main_2020_edit.js 2.5 MB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685768676877688768976907691769276937694769576967697769876997700770177027703770477057706770777087709771077117712771377147715771677177718771977207721772277237724772577267727772877297730773177327733773477357736773777387739774077417742774377447745774677477748774977507751775277537754775577567757775877597760776177627763776477657766776777687769777077717772777377747775777677777778777977807781778277837784778577867787778877897790779177927793779477957796779777987799780078017802780378047805780678077808780978107811781278137814781578167817781878197820782178227823782478257826782778287829783078317832783378347835783678377838783978407841784278437844784578467847784878497850785178527853785478557856785778587859786078617862786378647865786678677868786978707871787278737874787578767877787878797880788178827883788478857886788778887889789078917892789378947895789678977898789979007901790279037904790579067907790879097910791179127913791479157916791779187919792079217922792379247925792679277928792979307931793279337934793579367937793879397940794179427943794479457946794779487949795079517952795379547955795679577958795979607961796279637964796579667967796879697970797179727973797479757976797779787979798079817982798379847985798679877988798979907991799279937994799579967997799879998000800180028003800480058006800780088009801080118012801380148015801680178018801980208021802280238024802580268027802880298030803180328033803480358036803780388039804080418042804380448045804680478048804980508051805280538054805580568057805880598060806180628063806480658066806780688069807080718072807380748075807680778078807980808081808280838084808580868087808880898090809180928093809480958096809780988099810081018102810381048105810681078108810981108111811281138114811581168117811881198120812181228123812481258126812781288129813081318132813381348135813681378138813981408141814281438144814581468147814881498150815181528153815481558156815781588159816081618162816381648165816681678168816981708171817281738174817581768177817881798180818181828183818481858186818781888189819081918192819381948195819681978198819982008201820282038204820582068207820882098210821182128213821482158216821782188219822082218222822382248225822682278228822982308231823282338234823582368237823882398240824182428243824482458246824782488249825082518252825382548255825682578258825982608261826282638264826582668267826882698270827182728273827482758276827782788279828082818282828382848285828682878288828982908291829282938294829582968297829882998300830183028303830483058306830783088309831083118312831383148315831683178318831983208321832283238324832583268327832883298330833183328333833483358336833783388339834083418342834383448345834683478348834983508351835283538354835583568357835883598360836183628363836483658366836783688369837083718372837383748375837683778378837983808381838283838384838583868387838883898390839183928393839483958396839783988399840084018402840384048405840684078408840984108411841284138414841584168417841884198420842184228423842484258426842784288429843084318432843384348435843684378438843984408441844284438444844584468447844884498450845184528453845484558456845784588459846084618462846384648465846684678468846984708471847284738474847584768477847884798480848184828483848484858486848784888489849084918492849384948495849684978498849985008501850285038504850585068507850885098510851185128513851485158516851785188519852085218522852385248525852685278528852985308531853285338534853585368537853885398540854185428543854485458546854785488549855085518552855385548555855685578558855985608561856285638564856585668567856885698570857185728573857485758576857785788579858085818582858385848585858685878588858985908591859285938594859585968597859885998600860186028603860486058606860786088609861086118612861386148615861686178618861986208621862286238624862586268627862886298630863186328633863486358636863786388639864086418642864386448645864686478648864986508651865286538654865586568657865886598660866186628663866486658666866786688669867086718672867386748675867686778678867986808681868286838684868586868687868886898690869186928693869486958696869786988699870087018702870387048705870687078708870987108711871287138714871587168717871887198720872187228723872487258726872787288729873087318732873387348735873687378738873987408741874287438744874587468747874887498750875187528753875487558756875787588759876087618762876387648765876687678768876987708771877287738774877587768777877887798780878187828783878487858786878787888789879087918792879387948795879687978798879988008801880288038804880588068807880888098810881188128813881488158816881788188819882088218822882388248825882688278828882988308831883288338834883588368837883888398840884188428843884488458846884788488849885088518852885388548855885688578858885988608861886288638864886588668867886888698870887188728873887488758876887788788879888088818882888388848885888688878888888988908891889288938894889588968897889888998900890189028903890489058906890789088909891089118912891389148915891689178918891989208921892289238924892589268927892889298930893189328933893489358936893789388939894089418942894389448945894689478948894989508951895289538954895589568957895889598960896189628963896489658966896789688969897089718972897389748975897689778978897989808981898289838984898589868987898889898990899189928993899489958996899789988999900090019002900390049005900690079008900990109011901290139014901590169017901890199020902190229023902490259026902790289029903090319032903390349035903690379038903990409041904290439044904590469047904890499050905190529053905490559056905790589059906090619062906390649065906690679068906990709071907290739074907590769077907890799080908190829083908490859086908790889089909090919092909390949095909690979098909991009101910291039104910591069107910891099110911191129113911491159116911791189119912091219122912391249125912691279128912991309131913291339134913591369137913891399140914191429143914491459146914791489149915091519152915391549155915691579158915991609161916291639164916591669167916891699170917191729173917491759176917791789179918091819182918391849185918691879188918991909191919291939194919591969197919891999200920192029203920492059206920792089209921092119212921392149215921692179218921992209221922292239224922592269227922892299230923192329233923492359236923792389239924092419242924392449245924692479248924992509251925292539254925592569257925892599260926192629263926492659266926792689269927092719272927392749275927692779278927992809281928292839284928592869287928892899290929192929293929492959296929792989299930093019302930393049305930693079308930993109311931293139314931593169317931893199320932193229323932493259326932793289329933093319332933393349335933693379338933993409341934293439344934593469347934893499350935193529353935493559356935793589359936093619362936393649365936693679368936993709371937293739374937593769377937893799380938193829383938493859386938793889389939093919392939393949395939693979398939994009401940294039404940594069407940894099410941194129413941494159416941794189419942094219422942394249425942694279428942994309431943294339434943594369437943894399440944194429443944494459446944794489449945094519452945394549455945694579458945994609461946294639464946594669467946894699470947194729473947494759476947794789479948094819482948394849485948694879488948994909491949294939494949594969497949894999500950195029503950495059506950795089509951095119512951395149515951695179518951995209521952295239524952595269527952895299530953195329533953495359536953795389539954095419542954395449545954695479548954995509551955295539554955595569557955895599560956195629563956495659566956795689569957095719572957395749575957695779578957995809581958295839584958595869587958895899590959195929593959495959596959795989599960096019602960396049605960696079608960996109611961296139614961596169617961896199620962196229623962496259626962796289629963096319632963396349635963696379638963996409641964296439644964596469647964896499650965196529653965496559656965796589659966096619662966396649665966696679668966996709671967296739674967596769677967896799680968196829683968496859686968796889689969096919692969396949695969696979698969997009701970297039704970597069707970897099710971197129713971497159716971797189719972097219722972397249725972697279728972997309731973297339734973597369737973897399740974197429743974497459746974797489749975097519752975397549755975697579758975997609761976297639764976597669767976897699770977197729773977497759776977797789779978097819782978397849785978697879788978997909791979297939794979597969797979897999800980198029803980498059806980798089809981098119812981398149815981698179818981998209821982298239824982598269827982898299830983198329833983498359836983798389839984098419842984398449845984698479848984998509851985298539854985598569857985898599860986198629863986498659866986798689869987098719872987398749875987698779878987998809881988298839884988598869887988898899890989198929893989498959896989798989899990099019902990399049905990699079908990999109911991299139914991599169917991899199920992199229923992499259926992799289929993099319932993399349935993699379938993999409941994299439944994599469947994899499950995199529953995499559956995799589959996099619962996399649965996699679968996999709971997299739974997599769977997899799980998199829983998499859986998799889989999099919992999399949995999699979998999910000100011000210003100041000510006100071000810009100101001110012100131001410015100161001710018100191002010021100221002310024100251002610027100281002910030100311003210033100341003510036100371003810039100401004110042100431004410045100461004710048100491005010051100521005310054100551005610057100581005910060100611006210063100641006510066100671006810069100701007110072100731007410075100761007710078100791008010081100821008310084100851008610087100881008910090100911009210093100941009510096100971009810099101001010110102101031010410105101061010710108101091011010111101121011310114101151011610117101181011910120101211012210123101241012510126101271012810129101301013110132101331013410135101361013710138101391014010141101421014310144101451014610147101481014910150101511015210153101541015510156101571015810159101601016110162101631016410165101661016710168101691017010171101721017310174101751017610177101781017910180101811018210183101841018510186101871018810189101901019110192101931019410195101961019710198101991020010201102021020310204102051020610207102081020910210102111021210213102141021510216102171021810219102201022110222102231022410225102261022710228102291023010231102321023310234102351023610237102381023910240102411024210243102441024510246102471024810249102501025110252102531025410255102561025710258102591026010261102621026310264102651026610267102681026910270102711027210273102741027510276102771027810279102801028110282102831028410285102861028710288102891029010291102921029310294102951029610297102981029910300103011030210303103041030510306103071030810309103101031110312103131031410315103161031710318103191032010321103221032310324103251032610327103281032910330103311033210333103341033510336103371033810339103401034110342103431034410345103461034710348103491035010351103521035310354103551035610357103581035910360103611036210363103641036510366103671036810369103701037110372103731037410375103761037710378103791038010381103821038310384103851038610387103881038910390103911039210393103941039510396103971039810399104001040110402104031040410405104061040710408104091041010411104121041310414104151041610417104181041910420104211042210423104241042510426104271042810429104301043110432104331043410435104361043710438104391044010441104421044310444104451044610447104481044910450104511045210453104541045510456104571045810459104601046110462104631046410465104661046710468104691047010471104721047310474104751047610477104781047910480104811048210483104841048510486104871048810489104901049110492104931049410495104961049710498104991050010501105021050310504105051050610507105081050910510105111051210513105141051510516105171051810519105201052110522105231052410525105261052710528105291053010531105321053310534105351053610537105381053910540105411054210543105441054510546105471054810549105501055110552105531055410555105561055710558105591056010561105621056310564105651056610567105681056910570105711057210573105741057510576105771057810579105801058110582105831058410585105861058710588105891059010591105921059310594105951059610597105981059910600106011060210603106041060510606106071060810609106101061110612106131061410615106161061710618106191062010621106221062310624106251062610627106281062910630106311063210633106341063510636106371063810639106401064110642106431064410645106461064710648106491065010651106521065310654106551065610657106581065910660106611066210663106641066510666106671066810669106701067110672106731067410675106761067710678106791068010681106821068310684106851068610687106881068910690106911069210693106941069510696106971069810699107001070110702107031070410705107061070710708107091071010711107121071310714107151071610717107181071910720107211072210723107241072510726107271072810729107301073110732107331073410735107361073710738107391074010741107421074310744107451074610747107481074910750107511075210753107541075510756107571075810759107601076110762107631076410765107661076710768107691077010771107721077310774107751077610777107781077910780107811078210783107841078510786107871078810789107901079110792107931079410795107961079710798107991080010801108021080310804108051080610807108081080910810108111081210813108141081510816108171081810819108201082110822108231082410825108261082710828108291083010831108321083310834108351083610837108381083910840108411084210843108441084510846108471084810849108501085110852108531085410855108561085710858108591086010861108621086310864108651086610867108681086910870108711087210873108741087510876108771087810879108801088110882108831088410885108861088710888108891089010891108921089310894108951089610897108981089910900109011090210903109041090510906109071090810909109101091110912109131091410915109161091710918109191092010921109221092310924109251092610927109281092910930109311093210933109341093510936109371093810939109401094110942109431094410945109461094710948109491095010951109521095310954109551095610957109581095910960109611096210963109641096510966109671096810969109701097110972109731097410975109761097710978109791098010981109821098310984109851098610987109881098910990109911099210993109941099510996109971099810999110001100111002110031100411005110061100711008110091101011011110121101311014110151101611017110181101911020110211102211023110241102511026110271102811029110301103111032110331103411035110361103711038110391104011041110421104311044110451104611047110481104911050110511105211053110541105511056110571105811059110601106111062110631106411065110661106711068110691107011071110721107311074110751107611077110781107911080110811108211083110841108511086110871108811089110901109111092110931109411095110961109711098110991110011101111021110311104111051110611107111081110911110111111111211113111141111511116111171111811119111201112111122111231112411125111261112711128111291113011131111321113311134111351113611137111381113911140111411114211143111441114511146111471114811149111501115111152111531115411155111561115711158111591116011161111621116311164111651116611167111681116911170111711117211173111741117511176111771117811179111801118111182111831118411185111861118711188111891119011191111921119311194111951119611197111981119911200112011120211203112041120511206112071120811209112101121111212112131121411215112161121711218112191122011221112221122311224112251122611227112281122911230112311123211233112341123511236112371123811239112401124111242112431124411245112461124711248112491125011251112521125311254112551125611257112581125911260112611126211263112641126511266112671126811269112701127111272112731127411275112761127711278112791128011281112821128311284112851128611287112881128911290112911129211293112941129511296112971129811299113001130111302113031130411305113061130711308113091131011311113121131311314113151131611317113181131911320113211132211323113241132511326113271132811329113301133111332113331133411335113361133711338113391134011341113421134311344113451134611347113481134911350113511135211353113541135511356113571135811359113601136111362113631136411365113661136711368113691137011371113721137311374113751137611377113781137911380113811138211383113841138511386113871138811389113901139111392113931139411395113961139711398113991140011401114021140311404114051140611407114081140911410114111141211413114141141511416114171141811419114201142111422114231142411425114261142711428114291143011431114321143311434114351143611437114381143911440114411144211443114441144511446114471144811449114501145111452114531145411455114561145711458114591146011461114621146311464114651146611467114681146911470114711147211473114741147511476114771147811479114801148111482114831148411485114861148711488114891149011491114921149311494114951149611497114981149911500115011150211503115041150511506115071150811509115101151111512115131151411515115161151711518115191152011521115221152311524115251152611527115281152911530115311153211533115341153511536115371153811539115401154111542115431154411545115461154711548115491155011551115521155311554115551155611557115581155911560115611156211563115641156511566115671156811569115701157111572115731157411575115761157711578115791158011581115821158311584115851158611587115881158911590115911159211593115941159511596115971159811599116001160111602116031160411605116061160711608116091161011611116121161311614116151161611617116181161911620116211162211623116241162511626116271162811629116301163111632116331163411635116361163711638116391164011641116421164311644116451164611647116481164911650116511165211653116541165511656116571165811659116601166111662116631166411665116661166711668116691167011671116721167311674116751167611677116781167911680116811168211683116841168511686116871168811689116901169111692116931169411695116961169711698116991170011701117021170311704117051170611707117081170911710117111171211713117141171511716117171171811719117201172111722117231172411725117261172711728117291173011731117321173311734117351173611737117381173911740117411174211743117441174511746117471174811749117501175111752117531175411755117561175711758117591176011761117621176311764117651176611767117681176911770117711177211773117741177511776117771177811779117801178111782117831178411785117861178711788117891179011791117921179311794117951179611797117981179911800118011180211803118041180511806118071180811809118101181111812118131181411815118161181711818118191182011821118221182311824118251182611827118281182911830118311183211833118341183511836118371183811839118401184111842118431184411845118461184711848118491185011851118521185311854118551185611857118581185911860118611186211863118641186511866118671186811869118701187111872118731187411875118761187711878118791188011881118821188311884118851188611887118881188911890118911189211893118941189511896118971189811899119001190111902119031190411905119061190711908119091191011911119121191311914119151191611917119181191911920119211192211923119241192511926119271192811929119301193111932119331193411935119361193711938119391194011941119421194311944119451194611947119481194911950119511195211953119541195511956119571195811959119601196111962119631196411965119661196711968119691197011971119721197311974119751197611977119781197911980119811198211983119841198511986119871198811989119901199111992119931199411995119961199711998119991200012001120021200312004120051200612007120081200912010120111201212013120141201512016120171201812019120201202112022120231202412025120261202712028120291203012031120321203312034120351203612037120381203912040120411204212043120441204512046120471204812049120501205112052120531205412055120561205712058120591206012061120621206312064120651206612067120681206912070120711207212073120741207512076120771207812079120801208112082120831208412085120861208712088120891209012091120921209312094120951209612097120981209912100121011210212103121041210512106121071210812109121101211112112121131211412115121161211712118121191212012121121221212312124121251212612127121281212912130121311213212133121341213512136121371213812139121401214112142121431214412145121461214712148121491215012151121521215312154121551215612157121581215912160121611216212163121641216512166121671216812169121701217112172121731217412175121761217712178121791218012181121821218312184121851218612187121881218912190121911219212193121941219512196121971219812199122001220112202122031220412205122061220712208122091221012211122121221312214122151221612217122181221912220122211222212223122241222512226122271222812229122301223112232122331223412235122361223712238122391224012241122421224312244122451224612247122481224912250122511225212253122541225512256122571225812259122601226112262122631226412265122661226712268122691227012271122721227312274122751227612277122781227912280122811228212283122841228512286122871228812289122901229112292122931229412295122961229712298122991230012301123021230312304123051230612307123081230912310123111231212313123141231512316123171231812319123201232112322123231232412325123261232712328123291233012331123321233312334123351233612337123381233912340123411234212343123441234512346123471234812349123501235112352123531235412355123561235712358123591236012361123621236312364123651236612367123681236912370123711237212373123741237512376123771237812379123801238112382123831238412385123861238712388123891239012391123921239312394123951239612397123981239912400124011240212403124041240512406124071240812409124101241112412124131241412415124161241712418124191242012421124221242312424124251242612427124281242912430124311243212433124341243512436124371243812439124401244112442124431244412445124461244712448124491245012451124521245312454124551245612457124581245912460124611246212463124641246512466124671246812469124701247112472124731247412475124761247712478124791248012481124821248312484124851248612487124881248912490124911249212493124941249512496124971249812499125001250112502125031250412505125061250712508125091251012511125121251312514125151251612517125181251912520125211252212523125241252512526125271252812529125301253112532125331253412535125361253712538125391254012541125421254312544125451254612547125481254912550125511255212553125541255512556125571255812559125601256112562125631256412565125661256712568125691257012571125721257312574125751257612577125781257912580125811258212583125841258512586125871258812589125901259112592125931259412595125961259712598125991260012601126021260312604126051260612607126081260912610126111261212613126141261512616126171261812619126201262112622126231262412625126261262712628126291263012631126321263312634126351263612637126381263912640126411264212643126441264512646126471264812649126501265112652126531265412655126561265712658126591266012661126621266312664126651266612667126681266912670126711267212673126741267512676126771267812679126801268112682126831268412685126861268712688126891269012691126921269312694126951269612697126981269912700127011270212703127041270512706127071270812709127101271112712127131271412715127161271712718127191272012721127221272312724127251272612727127281272912730127311273212733127341273512736127371273812739127401274112742127431274412745127461274712748127491275012751127521275312754127551275612757127581275912760127611276212763127641276512766127671276812769127701277112772127731277412775127761277712778127791278012781127821278312784127851278612787127881278912790127911279212793127941279512796127971279812799128001280112802128031280412805128061280712808128091281012811128121281312814128151281612817128181281912820128211282212823128241282512826128271282812829128301283112832128331283412835128361283712838128391284012841128421284312844128451284612847128481284912850128511285212853128541285512856128571285812859128601286112862128631286412865128661286712868128691287012871128721287312874128751287612877128781287912880128811288212883128841288512886128871288812889128901289112892128931289412895128961289712898128991290012901129021290312904129051290612907129081290912910129111291212913129141291512916129171291812919129201292112922129231292412925129261292712928129291293012931129321293312934129351293612937129381293912940129411294212943129441294512946129471294812949129501295112952129531295412955129561295712958129591296012961129621296312964129651296612967129681296912970129711297212973129741297512976129771297812979129801298112982129831298412985129861298712988129891299012991129921299312994129951299612997129981299913000130011300213003130041300513006130071300813009130101301113012130131301413015130161301713018130191302013021130221302313024130251302613027130281302913030130311303213033130341303513036130371303813039130401304113042130431304413045130461304713048130491305013051130521305313054130551305613057130581305913060130611306213063130641306513066130671306813069130701307113072130731307413075130761307713078130791308013081130821308313084130851308613087130881308913090130911309213093130941309513096130971309813099131001310113102131031310413105131061310713108131091311013111131121311313114131151311613117131181311913120131211312213123131241312513126131271312813129131301313113132131331313413135131361313713138131391314013141131421314313144131451314613147131481314913150131511315213153131541315513156131571315813159131601316113162131631316413165131661316713168131691317013171131721317313174131751317613177131781317913180131811318213183131841318513186131871318813189131901319113192131931319413195131961319713198131991320013201132021320313204132051320613207132081320913210132111321213213132141321513216132171321813219132201322113222132231322413225132261322713228132291323013231132321323313234132351323613237132381323913240132411324213243132441324513246132471324813249132501325113252132531325413255132561325713258132591326013261132621326313264132651326613267132681326913270132711327213273132741327513276132771327813279132801328113282132831328413285132861328713288132891329013291132921329313294132951329613297132981329913300133011330213303133041330513306133071330813309133101331113312133131331413315133161331713318133191332013321133221332313324133251332613327133281332913330133311333213333133341333513336133371333813339133401334113342133431334413345133461334713348133491335013351133521335313354133551335613357133581335913360133611336213363133641336513366133671336813369133701337113372133731337413375133761337713378133791338013381133821338313384133851338613387133881338913390133911339213393133941339513396133971339813399134001340113402134031340413405134061340713408134091341013411134121341313414134151341613417134181341913420134211342213423134241342513426134271342813429134301343113432134331343413435134361343713438134391344013441134421344313444134451344613447134481344913450134511345213453134541345513456134571345813459134601346113462134631346413465134661346713468134691347013471134721347313474134751347613477134781347913480134811348213483134841348513486134871348813489134901349113492134931349413495134961349713498134991350013501135021350313504135051350613507135081350913510135111351213513135141351513516135171351813519135201352113522135231352413525135261352713528135291353013531135321353313534135351353613537135381353913540135411354213543135441354513546135471354813549135501355113552135531355413555135561355713558135591356013561135621356313564135651356613567135681356913570135711357213573135741357513576135771357813579135801358113582135831358413585135861358713588135891359013591135921359313594135951359613597135981359913600136011360213603136041360513606136071360813609136101361113612136131361413615136161361713618136191362013621136221362313624136251362613627136281362913630136311363213633136341363513636136371363813639136401364113642136431364413645136461364713648136491365013651136521365313654136551365613657136581365913660136611366213663136641366513666136671366813669136701367113672136731367413675136761367713678136791368013681136821368313684136851368613687136881368913690136911369213693136941369513696136971369813699137001370113702137031370413705137061370713708137091371013711137121371313714137151371613717137181371913720137211372213723137241372513726137271372813729137301373113732137331373413735137361373713738137391374013741137421374313744137451374613747137481374913750137511375213753137541375513756137571375813759137601376113762137631376413765137661376713768137691377013771137721377313774137751377613777137781377913780137811378213783137841378513786137871378813789137901379113792137931379413795137961379713798137991380013801138021380313804138051380613807138081380913810138111381213813138141381513816138171381813819138201382113822138231382413825138261382713828138291383013831138321383313834138351383613837138381383913840138411384213843138441384513846138471384813849138501385113852138531385413855138561385713858138591386013861138621386313864138651386613867138681386913870138711387213873138741387513876138771387813879138801388113882138831388413885138861388713888138891389013891138921389313894138951389613897138981389913900139011390213903139041390513906139071390813909139101391113912139131391413915139161391713918139191392013921139221392313924139251392613927139281392913930139311393213933139341393513936139371393813939139401394113942139431394413945139461394713948139491395013951139521395313954139551395613957139581395913960139611396213963139641396513966139671396813969139701397113972139731397413975139761397713978139791398013981139821398313984139851398613987139881398913990139911399213993139941399513996139971399813999140001400114002140031400414005140061400714008140091401014011140121401314014140151401614017140181401914020140211402214023140241402514026140271402814029140301403114032140331403414035140361403714038140391404014041140421404314044140451404614047140481404914050140511405214053140541405514056140571405814059140601406114062140631406414065140661406714068140691407014071140721407314074140751407614077140781407914080140811408214083140841408514086140871408814089140901409114092140931409414095140961409714098140991410014101141021410314104141051410614107141081410914110141111411214113141141411514116141171411814119141201412114122141231412414125141261412714128141291413014131141321413314134141351413614137141381413914140141411414214143141441414514146141471414814149141501415114152141531415414155141561415714158141591416014161141621416314164141651416614167141681416914170141711417214173141741417514176141771417814179141801418114182141831418414185141861418714188141891419014191141921419314194141951419614197141981419914200142011420214203142041420514206142071420814209142101421114212142131421414215142161421714218142191422014221142221422314224142251422614227142281422914230142311423214233142341423514236142371423814239142401424114242142431424414245142461424714248142491425014251142521425314254142551425614257142581425914260142611426214263142641426514266142671426814269142701427114272142731427414275142761427714278142791428014281142821428314284142851428614287142881428914290142911429214293142941429514296142971429814299143001430114302143031430414305143061430714308143091431014311143121431314314143151431614317143181431914320143211432214323143241432514326143271432814329143301433114332143331433414335143361433714338143391434014341143421434314344143451434614347143481434914350143511435214353143541435514356143571435814359143601436114362143631436414365143661436714368143691437014371143721437314374143751437614377143781437914380143811438214383143841438514386143871438814389143901439114392143931439414395143961439714398143991440014401144021440314404144051440614407144081440914410144111441214413144141441514416144171441814419144201442114422144231442414425144261442714428144291443014431144321443314434144351443614437144381443914440144411444214443144441444514446144471444814449144501445114452144531445414455144561445714458144591446014461144621446314464144651446614467144681446914470144711447214473144741447514476144771447814479144801448114482144831448414485144861448714488144891449014491144921449314494144951449614497144981449914500145011450214503145041450514506145071450814509145101451114512145131451414515145161451714518145191452014521145221452314524145251452614527145281452914530145311453214533145341453514536145371453814539145401454114542145431454414545145461454714548145491455014551145521455314554145551455614557145581455914560145611456214563145641456514566145671456814569145701457114572145731457414575145761457714578145791458014581145821458314584145851458614587145881458914590145911459214593145941459514596145971459814599146001460114602146031460414605146061460714608146091461014611146121461314614146151461614617146181461914620146211462214623146241462514626146271462814629146301463114632146331463414635146361463714638146391464014641146421464314644146451464614647146481464914650146511465214653146541465514656146571465814659146601466114662146631466414665146661466714668146691467014671146721467314674146751467614677146781467914680146811468214683146841468514686146871468814689146901469114692146931469414695146961469714698146991470014701147021470314704147051470614707147081470914710147111471214713147141471514716147171471814719147201472114722147231472414725147261472714728147291473014731147321473314734147351473614737147381473914740147411474214743147441474514746147471474814749147501475114752147531475414755147561475714758147591476014761147621476314764147651476614767147681476914770147711477214773147741477514776147771477814779147801478114782147831478414785147861478714788147891479014791147921479314794147951479614797147981479914800148011480214803148041480514806148071480814809148101481114812148131481414815148161481714818148191482014821148221482314824148251482614827148281482914830148311483214833148341483514836148371483814839148401484114842148431484414845148461484714848148491485014851148521485314854148551485614857148581485914860148611486214863148641486514866148671486814869148701487114872148731487414875148761487714878148791488014881148821488314884148851488614887148881488914890148911489214893148941489514896148971489814899149001490114902149031490414905149061490714908149091491014911149121491314914149151491614917149181491914920149211492214923149241492514926149271492814929149301493114932149331493414935149361493714938149391494014941149421494314944149451494614947149481494914950149511495214953149541495514956149571495814959149601496114962149631496414965149661496714968149691497014971149721497314974149751497614977149781497914980149811498214983149841498514986149871498814989149901499114992149931499414995149961499714998149991500015001150021500315004150051500615007150081500915010150111501215013150141501515016150171501815019150201502115022150231502415025150261502715028150291503015031150321503315034150351503615037150381503915040150411504215043150441504515046150471504815049150501505115052150531505415055150561505715058150591506015061150621506315064150651506615067150681506915070150711507215073150741507515076150771507815079150801508115082150831508415085150861508715088150891509015091150921509315094150951509615097150981509915100151011510215103151041510515106151071510815109151101511115112151131511415115151161511715118151191512015121151221512315124151251512615127151281512915130151311513215133151341513515136151371513815139151401514115142151431514415145151461514715148151491515015151151521515315154151551515615157151581515915160151611516215163151641516515166151671516815169151701517115172151731517415175151761517715178151791518015181151821518315184151851518615187151881518915190151911519215193151941519515196151971519815199152001520115202152031520415205152061520715208152091521015211152121521315214152151521615217152181521915220152211522215223152241522515226152271522815229152301523115232152331523415235152361523715238152391524015241152421524315244152451524615247152481524915250152511525215253152541525515256152571525815259152601526115262152631526415265152661526715268152691527015271152721527315274152751527615277152781527915280152811528215283152841528515286152871528815289152901529115292152931529415295152961529715298152991530015301153021530315304153051530615307153081530915310153111531215313153141531515316153171531815319153201532115322153231532415325153261532715328153291533015331153321533315334153351533615337153381533915340153411534215343153441534515346153471534815349153501535115352153531535415355153561535715358153591536015361153621536315364153651536615367153681536915370153711537215373153741537515376153771537815379153801538115382153831538415385153861538715388153891539015391153921539315394153951539615397153981539915400154011540215403154041540515406154071540815409154101541115412154131541415415154161541715418154191542015421154221542315424154251542615427154281542915430154311543215433154341543515436154371543815439154401544115442154431544415445154461544715448154491545015451154521545315454154551545615457154581545915460154611546215463154641546515466154671546815469154701547115472154731547415475154761547715478154791548015481154821548315484154851548615487154881548915490154911549215493154941549515496154971549815499155001550115502155031550415505155061550715508155091551015511155121551315514155151551615517155181551915520155211552215523155241552515526155271552815529155301553115532155331553415535155361553715538155391554015541155421554315544155451554615547155481554915550155511555215553155541555515556155571555815559155601556115562155631556415565155661556715568155691557015571155721557315574155751557615577155781557915580155811558215583155841558515586155871558815589155901559115592155931559415595155961559715598155991560015601156021560315604156051560615607156081560915610156111561215613156141561515616156171561815619156201562115622156231562415625156261562715628156291563015631156321563315634156351563615637156381563915640156411564215643156441564515646156471564815649156501565115652156531565415655156561565715658156591566015661156621566315664156651566615667156681566915670156711567215673156741567515676156771567815679156801568115682156831568415685156861568715688156891569015691156921569315694156951569615697156981569915700157011570215703157041570515706157071570815709157101571115712157131571415715157161571715718157191572015721157221572315724157251572615727157281572915730157311573215733157341573515736157371573815739157401574115742157431574415745157461574715748157491575015751157521575315754157551575615757157581575915760157611576215763157641576515766157671576815769157701577115772157731577415775157761577715778157791578015781157821578315784157851578615787157881578915790157911579215793157941579515796157971579815799158001580115802158031580415805158061580715808158091581015811158121581315814158151581615817158181581915820158211582215823158241582515826158271582815829158301583115832158331583415835158361583715838158391584015841158421584315844158451584615847158481584915850158511585215853158541585515856158571585815859158601586115862158631586415865158661586715868158691587015871158721587315874158751587615877158781587915880158811588215883158841588515886158871588815889158901589115892158931589415895158961589715898158991590015901159021590315904159051590615907159081590915910159111591215913159141591515916159171591815919159201592115922159231592415925159261592715928159291593015931159321593315934159351593615937159381593915940159411594215943159441594515946159471594815949159501595115952159531595415955159561595715958159591596015961159621596315964159651596615967159681596915970159711597215973159741597515976159771597815979159801598115982159831598415985159861598715988159891599015991159921599315994159951599615997159981599916000160011600216003160041600516006160071600816009160101601116012160131601416015160161601716018160191602016021160221602316024160251602616027160281602916030160311603216033160341603516036160371603816039160401604116042160431604416045160461604716048160491605016051160521605316054160551605616057160581605916060160611606216063160641606516066160671606816069160701607116072160731607416075160761607716078160791608016081160821608316084160851608616087160881608916090160911609216093160941609516096160971609816099161001610116102161031610416105161061610716108161091611016111161121611316114161151611616117161181611916120161211612216123161241612516126161271612816129161301613116132161331613416135161361613716138161391614016141161421614316144161451614616147161481614916150161511615216153161541615516156161571615816159161601616116162161631616416165161661616716168161691617016171161721617316174161751617616177161781617916180161811618216183161841618516186161871618816189161901619116192161931619416195161961619716198161991620016201162021620316204162051620616207162081620916210162111621216213162141621516216162171621816219162201622116222162231622416225162261622716228162291623016231162321623316234162351623616237162381623916240162411624216243162441624516246162471624816249162501625116252162531625416255162561625716258162591626016261162621626316264162651626616267162681626916270162711627216273162741627516276162771627816279162801628116282162831628416285162861628716288162891629016291162921629316294162951629616297162981629916300163011630216303163041630516306163071630816309163101631116312163131631416315163161631716318163191632016321163221632316324163251632616327163281632916330163311633216333163341633516336163371633816339163401634116342163431634416345163461634716348163491635016351163521635316354163551635616357163581635916360163611636216363163641636516366163671636816369163701637116372163731637416375163761637716378163791638016381163821638316384163851638616387163881638916390163911639216393163941639516396163971639816399164001640116402164031640416405164061640716408164091641016411164121641316414164151641616417164181641916420164211642216423164241642516426164271642816429164301643116432164331643416435164361643716438164391644016441164421644316444164451644616447164481644916450164511645216453164541645516456164571645816459164601646116462164631646416465164661646716468164691647016471164721647316474164751647616477164781647916480164811648216483164841648516486164871648816489164901649116492164931649416495164961649716498164991650016501165021650316504165051650616507165081650916510165111651216513165141651516516165171651816519165201652116522165231652416525165261652716528165291653016531165321653316534165351653616537165381653916540165411654216543165441654516546165471654816549165501655116552165531655416555165561655716558165591656016561165621656316564165651656616567165681656916570165711657216573165741657516576165771657816579165801658116582165831658416585165861658716588165891659016591165921659316594165951659616597165981659916600166011660216603166041660516606166071660816609166101661116612166131661416615166161661716618166191662016621166221662316624166251662616627166281662916630166311663216633166341663516636166371663816639166401664116642166431664416645166461664716648166491665016651166521665316654166551665616657166581665916660166611666216663166641666516666166671666816669166701667116672166731667416675166761667716678166791668016681166821668316684166851668616687166881668916690166911669216693166941669516696166971669816699167001670116702167031670416705167061670716708167091671016711167121671316714167151671616717167181671916720167211672216723167241672516726167271672816729167301673116732167331673416735167361673716738167391674016741167421674316744167451674616747167481674916750167511675216753167541675516756167571675816759167601676116762167631676416765167661676716768167691677016771167721677316774167751677616777167781677916780167811678216783167841678516786167871678816789167901679116792167931679416795167961679716798167991680016801168021680316804168051680616807168081680916810168111681216813168141681516816168171681816819168201682116822168231682416825168261682716828168291683016831168321683316834168351683616837168381683916840168411684216843168441684516846168471684816849168501685116852168531685416855168561685716858168591686016861168621686316864168651686616867168681686916870168711687216873168741687516876168771687816879168801688116882168831688416885168861688716888168891689016891168921689316894168951689616897168981689916900169011690216903169041690516906169071690816909169101691116912169131691416915169161691716918169191692016921169221692316924169251692616927169281692916930169311693216933169341693516936169371693816939169401694116942169431694416945169461694716948169491695016951169521695316954169551695616957169581695916960169611696216963169641696516966169671696816969169701697116972169731697416975169761697716978169791698016981169821698316984169851698616987169881698916990169911699216993169941699516996169971699816999170001700117002170031700417005170061700717008170091701017011170121701317014170151701617017170181701917020170211702217023170241702517026170271702817029170301703117032170331703417035170361703717038170391704017041170421704317044170451704617047170481704917050170511705217053170541705517056170571705817059170601706117062170631706417065170661706717068170691707017071170721707317074170751707617077170781707917080170811708217083170841708517086170871708817089170901709117092170931709417095170961709717098170991710017101171021710317104171051710617107171081710917110171111711217113171141711517116171171711817119171201712117122171231712417125171261712717128171291713017131171321713317134171351713617137171381713917140171411714217143171441714517146171471714817149171501715117152171531715417155171561715717158171591716017161171621716317164171651716617167171681716917170171711717217173171741717517176171771717817179171801718117182171831718417185171861718717188171891719017191171921719317194171951719617197171981719917200172011720217203172041720517206172071720817209172101721117212172131721417215172161721717218172191722017221172221722317224172251722617227172281722917230172311723217233172341723517236172371723817239172401724117242172431724417245172461724717248172491725017251172521725317254172551725617257172581725917260172611726217263172641726517266172671726817269172701727117272172731727417275172761727717278172791728017281172821728317284172851728617287172881728917290172911729217293172941729517296172971729817299173001730117302173031730417305173061730717308173091731017311173121731317314173151731617317173181731917320173211732217323173241732517326173271732817329173301733117332173331733417335173361733717338173391734017341173421734317344173451734617347173481734917350173511735217353173541735517356173571735817359173601736117362173631736417365173661736717368173691737017371173721737317374173751737617377173781737917380173811738217383173841738517386173871738817389173901739117392173931739417395173961739717398173991740017401174021740317404174051740617407174081740917410174111741217413174141741517416174171741817419174201742117422174231742417425174261742717428174291743017431174321743317434174351743617437174381743917440174411744217443174441744517446174471744817449174501745117452174531745417455174561745717458174591746017461174621746317464174651746617467174681746917470174711747217473174741747517476174771747817479174801748117482174831748417485174861748717488174891749017491174921749317494174951749617497174981749917500175011750217503175041750517506175071750817509175101751117512175131751417515175161751717518175191752017521175221752317524175251752617527175281752917530175311753217533175341753517536175371753817539175401754117542175431754417545175461754717548175491755017551175521755317554175551755617557175581755917560175611756217563175641756517566175671756817569175701757117572175731757417575175761757717578175791758017581175821758317584175851758617587175881758917590175911759217593175941759517596175971759817599176001760117602176031760417605176061760717608176091761017611176121761317614176151761617617176181761917620176211762217623176241762517626176271762817629176301763117632176331763417635176361763717638176391764017641176421764317644176451764617647176481764917650176511765217653176541765517656176571765817659176601766117662176631766417665176661766717668176691767017671176721767317674176751767617677176781767917680176811768217683176841768517686176871768817689176901769117692176931769417695176961769717698176991770017701177021770317704177051770617707177081770917710177111771217713177141771517716177171771817719177201772117722177231772417725177261772717728177291773017731177321773317734177351773617737177381773917740177411774217743177441774517746177471774817749177501775117752177531775417755177561775717758177591776017761177621776317764177651776617767177681776917770177711777217773177741777517776177771777817779177801778117782177831778417785177861778717788177891779017791177921779317794177951779617797177981779917800178011780217803178041780517806178071780817809178101781117812178131781417815178161781717818178191782017821178221782317824178251782617827178281782917830178311783217833178341783517836178371783817839178401784117842178431784417845178461784717848178491785017851178521785317854178551785617857178581785917860178611786217863178641786517866178671786817869178701787117872178731787417875178761787717878178791788017881178821788317884178851788617887178881788917890178911789217893178941789517896178971789817899179001790117902179031790417905179061790717908179091791017911179121791317914179151791617917179181791917920179211792217923179241792517926179271792817929179301793117932179331793417935179361793717938179391794017941179421794317944179451794617947179481794917950179511795217953179541795517956179571795817959179601796117962179631796417965179661796717968179691797017971179721797317974179751797617977179781797917980179811798217983179841798517986179871798817989179901799117992179931799417995179961799717998179991800018001180021800318004180051800618007180081800918010180111801218013180141801518016180171801818019180201802118022180231802418025180261802718028180291803018031180321803318034180351803618037180381803918040180411804218043180441804518046180471804818049180501805118052180531805418055180561805718058180591806018061180621806318064180651806618067180681806918070180711807218073180741807518076180771807818079180801808118082180831808418085180861808718088180891809018091180921809318094180951809618097180981809918100181011810218103181041810518106181071810818109181101811118112181131811418115181161811718118181191812018121181221812318124181251812618127181281812918130181311813218133181341813518136181371813818139181401814118142181431814418145181461814718148181491815018151181521815318154181551815618157181581815918160181611816218163181641816518166181671816818169181701817118172181731817418175181761817718178181791818018181181821818318184181851818618187181881818918190181911819218193181941819518196181971819818199182001820118202182031820418205182061820718208182091821018211182121821318214182151821618217182181821918220182211822218223182241822518226182271822818229182301823118232182331823418235182361823718238182391824018241182421824318244182451824618247182481824918250182511825218253182541825518256182571825818259182601826118262182631826418265182661826718268182691827018271182721827318274182751827618277182781827918280182811828218283182841828518286182871828818289182901829118292182931829418295182961829718298182991830018301183021830318304183051830618307183081830918310183111831218313183141831518316183171831818319183201832118322183231832418325183261832718328183291833018331183321833318334183351833618337183381833918340183411834218343183441834518346183471834818349183501835118352183531835418355183561835718358183591836018361183621836318364183651836618367183681836918370183711837218373183741837518376183771837818379183801838118382183831838418385183861838718388183891839018391183921839318394183951839618397183981839918400184011840218403184041840518406184071840818409184101841118412184131841418415184161841718418184191842018421184221842318424184251842618427184281842918430184311843218433184341843518436184371843818439184401844118442184431844418445184461844718448184491845018451184521845318454184551845618457184581845918460184611846218463184641846518466184671846818469184701847118472184731847418475184761847718478184791848018481184821848318484184851848618487184881848918490184911849218493184941849518496184971849818499185001850118502185031850418505185061850718508185091851018511185121851318514185151851618517185181851918520185211852218523185241852518526185271852818529185301853118532185331853418535185361853718538185391854018541185421854318544185451854618547185481854918550185511855218553185541855518556185571855818559185601856118562185631856418565185661856718568185691857018571185721857318574185751857618577185781857918580185811858218583185841858518586185871858818589185901859118592185931859418595185961859718598185991860018601186021860318604186051860618607186081860918610186111861218613186141861518616186171861818619186201862118622186231862418625186261862718628186291863018631186321863318634186351863618637186381863918640186411864218643186441864518646186471864818649186501865118652186531865418655186561865718658186591866018661186621866318664186651866618667186681866918670186711867218673186741867518676186771867818679186801868118682186831868418685186861868718688186891869018691186921869318694186951869618697186981869918700187011870218703187041870518706187071870818709187101871118712187131871418715187161871718718187191872018721187221872318724187251872618727187281872918730187311873218733187341873518736187371873818739187401874118742187431874418745187461874718748187491875018751187521875318754187551875618757187581875918760187611876218763187641876518766187671876818769187701877118772187731877418775187761877718778187791878018781187821878318784187851878618787187881878918790187911879218793187941879518796187971879818799188001880118802188031880418805188061880718808188091881018811188121881318814188151881618817188181881918820188211882218823188241882518826188271882818829188301883118832188331883418835188361883718838188391884018841188421884318844188451884618847188481884918850188511885218853188541885518856188571885818859188601886118862188631886418865188661886718868188691887018871188721887318874188751887618877188781887918880188811888218883188841888518886188871888818889188901889118892188931889418895188961889718898188991890018901189021890318904189051890618907189081890918910189111891218913189141891518916189171891818919189201892118922189231892418925189261892718928189291893018931189321893318934189351893618937189381893918940189411894218943189441894518946189471894818949189501895118952189531895418955189561895718958189591896018961189621896318964189651896618967189681896918970189711897218973189741897518976189771897818979189801898118982189831898418985189861898718988189891899018991189921899318994189951899618997189981899919000190011900219003190041900519006190071900819009190101901119012190131901419015190161901719018190191902019021190221902319024190251902619027190281902919030190311903219033190341903519036190371903819039190401904119042190431904419045190461904719048190491905019051190521905319054190551905619057190581905919060190611906219063190641906519066190671906819069190701907119072190731907419075190761907719078190791908019081190821908319084190851908619087190881908919090190911909219093190941909519096190971909819099191001910119102191031910419105191061910719108191091911019111191121911319114191151911619117191181911919120191211912219123191241912519126191271912819129191301913119132191331913419135191361913719138191391914019141191421914319144191451914619147191481914919150191511915219153191541915519156191571915819159191601916119162191631916419165191661916719168191691917019171191721917319174191751917619177191781917919180191811918219183191841918519186191871918819189191901919119192191931919419195191961919719198191991920019201192021920319204192051920619207192081920919210192111921219213192141921519216192171921819219192201922119222192231922419225192261922719228192291923019231192321923319234192351923619237192381923919240192411924219243192441924519246192471924819249192501925119252192531925419255192561925719258192591926019261192621926319264192651926619267192681926919270192711927219273192741927519276192771927819279192801928119282192831928419285192861928719288192891929019291192921929319294192951929619297192981929919300193011930219303193041930519306193071930819309193101931119312193131931419315193161931719318193191932019321193221932319324193251932619327193281932919330193311933219333193341933519336193371933819339193401934119342193431934419345193461934719348193491935019351193521935319354193551935619357193581935919360193611936219363193641936519366193671936819369193701937119372193731937419375193761937719378193791938019381193821938319384193851938619387193881938919390193911939219393193941939519396193971939819399194001940119402194031940419405194061940719408194091941019411194121941319414194151941619417194181941919420194211942219423194241942519426194271942819429194301943119432194331943419435194361943719438194391944019441194421944319444194451944619447194481944919450194511945219453194541945519456194571945819459194601946119462194631946419465194661946719468194691947019471194721947319474194751947619477194781947919480194811948219483194841948519486194871948819489194901949119492194931949419495194961949719498194991950019501195021950319504195051950619507195081950919510195111951219513195141951519516195171951819519195201952119522195231952419525195261952719528195291953019531195321953319534195351953619537195381953919540195411954219543195441954519546195471954819549195501955119552195531955419555195561955719558195591956019561195621956319564195651956619567195681956919570195711957219573195741957519576195771957819579195801958119582195831958419585195861958719588195891959019591195921959319594195951959619597195981959919600196011960219603196041960519606196071960819609196101961119612196131961419615196161961719618196191962019621196221962319624196251962619627196281962919630196311963219633196341963519636196371963819639196401964119642196431964419645196461964719648196491965019651196521965319654196551965619657196581965919660196611966219663196641966519666196671966819669196701967119672196731967419675196761967719678196791968019681196821968319684196851968619687196881968919690196911969219693196941969519696196971969819699197001970119702197031970419705197061970719708197091971019711197121971319714197151971619717197181971919720197211972219723197241972519726197271972819729197301973119732197331973419735197361973719738197391974019741197421974319744197451974619747197481974919750197511975219753197541975519756197571975819759197601976119762197631976419765197661976719768197691977019771197721977319774197751977619777197781977919780197811978219783197841978519786197871978819789197901979119792197931979419795197961979719798197991980019801198021980319804198051980619807198081980919810198111981219813198141981519816198171981819819198201982119822198231982419825198261982719828198291983019831198321983319834198351983619837198381983919840198411984219843198441984519846198471984819849198501985119852198531985419855198561985719858198591986019861198621986319864198651986619867198681986919870198711987219873198741987519876198771987819879198801988119882198831988419885198861988719888198891989019891198921989319894198951989619897198981989919900199011990219903199041990519906199071990819909199101991119912199131991419915199161991719918199191992019921199221992319924199251992619927199281992919930199311993219933199341993519936199371993819939199401994119942199431994419945199461994719948199491995019951199521995319954199551995619957199581995919960199611996219963199641996519966199671996819969199701997119972199731997419975199761997719978199791998019981199821998319984199851998619987199881998919990199911999219993199941999519996199971999819999200002000120002200032000420005200062000720008200092001020011200122001320014200152001620017200182001920020200212002220023200242002520026200272002820029200302003120032200332003420035200362003720038200392004020041200422004320044200452004620047200482004920050200512005220053200542005520056200572005820059200602006120062200632006420065200662006720068200692007020071200722007320074200752007620077200782007920080200812008220083200842008520086200872008820089200902009120092200932009420095200962009720098200992010020101201022010320104201052010620107201082010920110201112011220113201142011520116201172011820119201202012120122201232012420125201262012720128201292013020131201322013320134201352013620137201382013920140201412014220143201442014520146201472014820149201502015120152201532015420155201562015720158201592016020161201622016320164201652016620167201682016920170201712017220173201742017520176201772017820179201802018120182201832018420185201862018720188201892019020191201922019320194201952019620197201982019920200202012020220203202042020520206202072020820209202102021120212202132021420215202162021720218202192022020221202222022320224202252022620227202282022920230202312023220233202342023520236202372023820239202402024120242202432024420245202462024720248202492025020251202522025320254202552025620257202582025920260202612026220263202642026520266202672026820269202702027120272202732027420275202762027720278202792028020281202822028320284202852028620287202882028920290202912029220293202942029520296202972029820299203002030120302203032030420305203062030720308203092031020311203122031320314203152031620317203182031920320203212032220323203242032520326203272032820329203302033120332203332033420335203362033720338203392034020341203422034320344203452034620347203482034920350203512035220353203542035520356203572035820359203602036120362203632036420365203662036720368203692037020371203722037320374203752037620377203782037920380203812038220383203842038520386203872038820389203902039120392203932039420395203962039720398203992040020401204022040320404204052040620407204082040920410204112041220413204142041520416204172041820419204202042120422204232042420425204262042720428204292043020431204322043320434204352043620437204382043920440204412044220443204442044520446204472044820449204502045120452204532045420455204562045720458204592046020461204622046320464204652046620467204682046920470204712047220473204742047520476204772047820479204802048120482204832048420485204862048720488204892049020491204922049320494204952049620497204982049920500205012050220503205042050520506205072050820509205102051120512205132051420515205162051720518205192052020521205222052320524205252052620527205282052920530205312053220533205342053520536205372053820539205402054120542205432054420545205462054720548205492055020551205522055320554205552055620557205582055920560205612056220563205642056520566205672056820569205702057120572205732057420575205762057720578205792058020581205822058320584205852058620587205882058920590205912059220593205942059520596205972059820599206002060120602206032060420605206062060720608206092061020611206122061320614206152061620617206182061920620206212062220623206242062520626206272062820629206302063120632206332063420635206362063720638206392064020641206422064320644206452064620647206482064920650206512065220653206542065520656206572065820659206602066120662206632066420665206662066720668206692067020671206722067320674206752067620677206782067920680206812068220683206842068520686206872068820689206902069120692206932069420695206962069720698206992070020701207022070320704207052070620707207082070920710207112071220713207142071520716207172071820719207202072120722207232072420725207262072720728207292073020731207322073320734207352073620737207382073920740207412074220743207442074520746207472074820749207502075120752207532075420755207562075720758207592076020761207622076320764207652076620767207682076920770207712077220773207742077520776207772077820779207802078120782207832078420785207862078720788207892079020791207922079320794207952079620797207982079920800208012080220803208042080520806208072080820809208102081120812208132081420815208162081720818208192082020821208222082320824208252082620827208282082920830208312083220833208342083520836208372083820839208402084120842208432084420845208462084720848208492085020851208522085320854208552085620857208582085920860208612086220863208642086520866208672086820869208702087120872208732087420875208762087720878208792088020881208822088320884208852088620887208882088920890208912089220893208942089520896208972089820899209002090120902209032090420905209062090720908209092091020911209122091320914209152091620917209182091920920209212092220923209242092520926209272092820929209302093120932209332093420935209362093720938209392094020941209422094320944209452094620947209482094920950209512095220953209542095520956209572095820959209602096120962209632096420965209662096720968209692097020971209722097320974209752097620977209782097920980209812098220983209842098520986209872098820989209902099120992209932099420995209962099720998209992100021001210022100321004210052100621007210082100921010210112101221013210142101521016210172101821019210202102121022210232102421025210262102721028210292103021031210322103321034210352103621037210382103921040210412104221043210442104521046210472104821049210502105121052210532105421055210562105721058210592106021061210622106321064210652106621067210682106921070210712107221073210742107521076210772107821079210802108121082210832108421085210862108721088210892109021091210922109321094210952109621097210982109921100211012110221103211042110521106211072110821109211102111121112211132111421115211162111721118211192112021121211222112321124211252112621127211282112921130211312113221133211342113521136211372113821139211402114121142211432114421145211462114721148211492115021151211522115321154211552115621157211582115921160211612116221163211642116521166211672116821169211702117121172211732117421175211762117721178211792118021181211822118321184211852118621187211882118921190211912119221193211942119521196211972119821199212002120121202212032120421205212062120721208212092121021211212122121321214212152121621217212182121921220212212122221223212242122521226212272122821229212302123121232212332123421235212362123721238212392124021241212422124321244212452124621247212482124921250212512125221253212542125521256212572125821259212602126121262212632126421265212662126721268212692127021271212722127321274212752127621277212782127921280212812128221283212842128521286212872128821289212902129121292212932129421295212962129721298212992130021301213022130321304213052130621307213082130921310213112131221313213142131521316213172131821319213202132121322213232132421325213262132721328213292133021331213322133321334213352133621337213382133921340213412134221343213442134521346213472134821349213502135121352213532135421355213562135721358213592136021361213622136321364213652136621367213682136921370213712137221373213742137521376213772137821379213802138121382213832138421385213862138721388213892139021391213922139321394213952139621397213982139921400214012140221403214042140521406214072140821409214102141121412214132141421415214162141721418214192142021421214222142321424214252142621427214282142921430214312143221433214342143521436214372143821439214402144121442214432144421445214462144721448214492145021451214522145321454214552145621457214582145921460214612146221463214642146521466214672146821469214702147121472214732147421475214762147721478214792148021481214822148321484214852148621487214882148921490214912149221493214942149521496214972149821499215002150121502215032150421505215062150721508215092151021511215122151321514215152151621517215182151921520215212152221523215242152521526215272152821529215302153121532215332153421535215362153721538215392154021541215422154321544215452154621547215482154921550215512155221553215542155521556215572155821559215602156121562215632156421565215662156721568215692157021571215722157321574215752157621577215782157921580215812158221583215842158521586215872158821589215902159121592215932159421595215962159721598215992160021601216022160321604216052160621607216082160921610216112161221613216142161521616216172161821619216202162121622216232162421625216262162721628216292163021631216322163321634216352163621637216382163921640216412164221643216442164521646216472164821649216502165121652216532165421655216562165721658216592166021661216622166321664216652166621667216682166921670216712167221673216742167521676216772167821679216802168121682216832168421685216862168721688216892169021691216922169321694216952169621697216982169921700217012170221703217042170521706217072170821709217102171121712217132171421715217162171721718217192172021721217222172321724217252172621727217282172921730217312173221733217342173521736217372173821739217402174121742217432174421745217462174721748217492175021751217522175321754217552175621757217582175921760217612176221763217642176521766217672176821769217702177121772217732177421775217762177721778217792178021781217822178321784217852178621787217882178921790217912179221793217942179521796217972179821799218002180121802218032180421805218062180721808218092181021811218122181321814218152181621817218182181921820218212182221823218242182521826218272182821829218302183121832218332183421835218362183721838218392184021841218422184321844218452184621847218482184921850218512185221853218542185521856218572185821859218602186121862218632186421865218662186721868218692187021871218722187321874218752187621877218782187921880218812188221883218842188521886218872188821889218902189121892218932189421895218962189721898218992190021901219022190321904219052190621907219082190921910219112191221913219142191521916219172191821919219202192121922219232192421925219262192721928219292193021931219322193321934219352193621937219382193921940219412194221943219442194521946219472194821949219502195121952219532195421955219562195721958219592196021961219622196321964219652196621967219682196921970219712197221973219742197521976219772197821979219802198121982219832198421985219862198721988219892199021991219922199321994219952199621997219982199922000220012200222003220042200522006220072200822009220102201122012220132201422015220162201722018220192202022021220222202322024220252202622027220282202922030220312203222033220342203522036220372203822039220402204122042220432204422045220462204722048220492205022051220522205322054220552205622057220582205922060220612206222063220642206522066220672206822069220702207122072220732207422075220762207722078220792208022081220822208322084220852208622087220882208922090220912209222093220942209522096220972209822099221002210122102221032210422105221062210722108221092211022111221122211322114221152211622117221182211922120221212212222123221242212522126221272212822129221302213122132221332213422135221362213722138221392214022141221422214322144221452214622147221482214922150221512215222153221542215522156221572215822159221602216122162221632216422165221662216722168221692217022171221722217322174221752217622177221782217922180221812218222183221842218522186221872218822189221902219122192221932219422195221962219722198221992220022201222022220322204222052220622207222082220922210222112221222213222142221522216222172221822219222202222122222222232222422225222262222722228222292223022231222322223322234222352223622237222382223922240222412224222243222442224522246222472224822249222502225122252222532225422255222562225722258222592226022261222622226322264222652226622267222682226922270222712227222273222742227522276222772227822279222802228122282222832228422285222862228722288222892229022291222922229322294222952229622297222982229922300223012230222303223042230522306223072230822309223102231122312223132231422315223162231722318223192232022321223222232322324223252232622327223282232922330223312233222333223342233522336223372233822339223402234122342223432234422345223462234722348223492235022351223522235322354223552235622357223582235922360223612236222363223642236522366223672236822369223702237122372223732237422375223762237722378223792238022381223822238322384223852238622387223882238922390223912239222393223942239522396223972239822399224002240122402224032240422405224062240722408224092241022411224122241322414224152241622417224182241922420224212242222423224242242522426224272242822429224302243122432224332243422435224362243722438224392244022441224422244322444224452244622447224482244922450224512245222453224542245522456224572245822459224602246122462224632246422465224662246722468224692247022471224722247322474224752247622477224782247922480224812248222483224842248522486224872248822489224902249122492224932249422495224962249722498224992250022501225022250322504225052250622507225082250922510225112251222513225142251522516225172251822519225202252122522225232252422525225262252722528225292253022531225322253322534225352253622537225382253922540225412254222543225442254522546225472254822549225502255122552225532255422555225562255722558225592256022561225622256322564225652256622567225682256922570225712257222573225742257522576225772257822579225802258122582225832258422585225862258722588225892259022591225922259322594225952259622597225982259922600226012260222603226042260522606226072260822609226102261122612226132261422615226162261722618226192262022621226222262322624226252262622627226282262922630226312263222633226342263522636226372263822639226402264122642226432264422645226462264722648226492265022651226522265322654226552265622657226582265922660226612266222663226642266522666226672266822669226702267122672226732267422675226762267722678226792268022681226822268322684226852268622687226882268922690226912269222693226942269522696226972269822699227002270122702227032270422705227062270722708227092271022711227122271322714227152271622717227182271922720227212272222723227242272522726227272272822729227302273122732227332273422735227362273722738227392274022741227422274322744227452274622747227482274922750227512275222753227542275522756227572275822759227602276122762227632276422765227662276722768227692277022771227722277322774227752277622777227782277922780227812278222783227842278522786227872278822789227902279122792227932279422795227962279722798227992280022801228022280322804228052280622807228082280922810228112281222813228142281522816228172281822819228202282122822228232282422825228262282722828228292283022831228322283322834228352283622837228382283922840228412284222843228442284522846228472284822849228502285122852228532285422855228562285722858228592286022861228622286322864228652286622867228682286922870228712287222873228742287522876228772287822879228802288122882228832288422885228862288722888228892289022891228922289322894228952289622897228982289922900229012290222903229042290522906229072290822909229102291122912229132291422915229162291722918229192292022921229222292322924229252292622927229282292922930229312293222933229342293522936229372293822939229402294122942229432294422945229462294722948229492295022951229522295322954229552295622957229582295922960229612296222963229642296522966229672296822969229702297122972229732297422975229762297722978229792298022981229822298322984229852298622987229882298922990229912299222993229942299522996229972299822999230002300123002230032300423005230062300723008230092301023011230122301323014230152301623017230182301923020230212302223023230242302523026230272302823029230302303123032230332303423035230362303723038230392304023041230422304323044230452304623047230482304923050230512305223053230542305523056230572305823059230602306123062230632306423065230662306723068230692307023071230722307323074230752307623077230782307923080230812308223083230842308523086230872308823089230902309123092230932309423095230962309723098230992310023101231022310323104231052310623107231082310923110231112311223113231142311523116231172311823119231202312123122231232312423125231262312723128231292313023131231322313323134231352313623137231382313923140231412314223143231442314523146231472314823149231502315123152231532315423155231562315723158231592316023161231622316323164231652316623167231682316923170231712317223173231742317523176231772317823179231802318123182231832318423185231862318723188231892319023191231922319323194231952319623197231982319923200232012320223203232042320523206232072320823209232102321123212232132321423215232162321723218232192322023221232222322323224232252322623227232282322923230232312323223233232342323523236232372323823239232402324123242232432324423245232462324723248232492325023251232522325323254232552325623257232582325923260232612326223263232642326523266232672326823269232702327123272232732327423275232762327723278232792328023281232822328323284232852328623287232882328923290232912329223293232942329523296232972329823299233002330123302233032330423305233062330723308233092331023311233122331323314233152331623317233182331923320233212332223323233242332523326233272332823329233302333123332233332333423335233362333723338233392334023341233422334323344233452334623347233482334923350233512335223353233542335523356233572335823359233602336123362233632336423365233662336723368233692337023371233722337323374233752337623377233782337923380233812338223383233842338523386233872338823389233902339123392233932339423395233962339723398233992340023401234022340323404234052340623407234082340923410234112341223413234142341523416234172341823419234202342123422234232342423425234262342723428234292343023431234322343323434234352343623437234382343923440234412344223443234442344523446234472344823449234502345123452234532345423455234562345723458234592346023461234622346323464234652346623467234682346923470234712347223473234742347523476234772347823479234802348123482234832348423485234862348723488234892349023491234922349323494234952349623497234982349923500235012350223503235042350523506235072350823509235102351123512235132351423515235162351723518235192352023521235222352323524235252352623527235282352923530235312353223533235342353523536235372353823539235402354123542235432354423545235462354723548235492355023551235522355323554235552355623557235582355923560235612356223563235642356523566235672356823569235702357123572235732357423575235762357723578235792358023581235822358323584235852358623587235882358923590235912359223593235942359523596235972359823599236002360123602236032360423605236062360723608236092361023611236122361323614236152361623617236182361923620236212362223623236242362523626236272362823629236302363123632236332363423635236362363723638236392364023641236422364323644236452364623647236482364923650236512365223653236542365523656236572365823659236602366123662236632366423665236662366723668236692367023671236722367323674236752367623677236782367923680236812368223683236842368523686236872368823689236902369123692236932369423695236962369723698236992370023701237022370323704237052370623707237082370923710237112371223713237142371523716237172371823719237202372123722237232372423725237262372723728237292373023731237322373323734237352373623737237382373923740237412374223743237442374523746237472374823749237502375123752237532375423755237562375723758237592376023761237622376323764237652376623767237682376923770237712377223773237742377523776237772377823779237802378123782237832378423785237862378723788237892379023791237922379323794237952379623797237982379923800238012380223803238042380523806238072380823809238102381123812238132381423815238162381723818238192382023821238222382323824238252382623827238282382923830238312383223833238342383523836238372383823839238402384123842238432384423845238462384723848238492385023851238522385323854238552385623857238582385923860238612386223863238642386523866238672386823869238702387123872238732387423875238762387723878238792388023881238822388323884238852388623887238882388923890238912389223893238942389523896238972389823899239002390123902239032390423905239062390723908239092391023911239122391323914239152391623917239182391923920239212392223923239242392523926239272392823929239302393123932239332393423935239362393723938239392394023941239422394323944239452394623947239482394923950239512395223953239542395523956239572395823959239602396123962239632396423965239662396723968239692397023971239722397323974239752397623977239782397923980239812398223983239842398523986239872398823989239902399123992239932399423995239962399723998239992400024001240022400324004240052400624007240082400924010240112401224013240142401524016240172401824019240202402124022240232402424025240262402724028240292403024031240322403324034240352403624037240382403924040240412404224043240442404524046240472404824049240502405124052240532405424055240562405724058240592406024061240622406324064240652406624067240682406924070240712407224073240742407524076240772407824079240802408124082240832408424085240862408724088240892409024091240922409324094240952409624097240982409924100241012410224103241042410524106241072410824109241102411124112241132411424115241162411724118241192412024121241222412324124241252412624127241282412924130241312413224133241342413524136241372413824139241402414124142241432414424145241462414724148241492415024151241522415324154241552415624157241582415924160241612416224163241642416524166241672416824169241702417124172241732417424175241762417724178241792418024181241822418324184241852418624187241882418924190241912419224193241942419524196241972419824199242002420124202242032420424205242062420724208242092421024211242122421324214242152421624217242182421924220242212422224223242242422524226242272422824229242302423124232242332423424235242362423724238242392424024241242422424324244242452424624247242482424924250242512425224253242542425524256242572425824259242602426124262242632426424265242662426724268242692427024271242722427324274242752427624277242782427924280242812428224283242842428524286242872428824289242902429124292242932429424295242962429724298242992430024301243022430324304243052430624307243082430924310243112431224313243142431524316243172431824319243202432124322243232432424325243262432724328243292433024331243322433324334243352433624337243382433924340243412434224343243442434524346243472434824349243502435124352243532435424355243562435724358243592436024361243622436324364243652436624367243682436924370243712437224373243742437524376243772437824379243802438124382243832438424385243862438724388243892439024391243922439324394243952439624397243982439924400244012440224403244042440524406244072440824409244102441124412244132441424415244162441724418244192442024421244222442324424244252442624427244282442924430244312443224433244342443524436244372443824439244402444124442244432444424445244462444724448244492445024451244522445324454244552445624457244582445924460244612446224463244642446524466244672446824469244702447124472244732447424475244762447724478244792448024481244822448324484244852448624487244882448924490244912449224493244942449524496244972449824499245002450124502245032450424505245062450724508245092451024511245122451324514245152451624517245182451924520245212452224523245242452524526245272452824529245302453124532245332453424535245362453724538245392454024541245422454324544245452454624547245482454924550245512455224553245542455524556245572455824559245602456124562245632456424565245662456724568245692457024571245722457324574245752457624577245782457924580245812458224583245842458524586245872458824589245902459124592245932459424595245962459724598245992460024601246022460324604246052460624607246082460924610246112461224613246142461524616246172461824619246202462124622246232462424625246262462724628246292463024631246322463324634246352463624637246382463924640246412464224643246442464524646246472464824649246502465124652246532465424655246562465724658246592466024661246622466324664246652466624667246682466924670246712467224673246742467524676246772467824679246802468124682246832468424685246862468724688246892469024691246922469324694246952469624697246982469924700247012470224703247042470524706247072470824709247102471124712247132471424715247162471724718247192472024721247222472324724247252472624727247282472924730247312473224733247342473524736247372473824739247402474124742247432474424745247462474724748247492475024751247522475324754247552475624757247582475924760247612476224763247642476524766247672476824769247702477124772247732477424775247762477724778247792478024781247822478324784247852478624787247882478924790247912479224793247942479524796247972479824799248002480124802248032480424805248062480724808248092481024811248122481324814248152481624817248182481924820248212482224823248242482524826248272482824829248302483124832248332483424835248362483724838248392484024841248422484324844248452484624847248482484924850248512485224853248542485524856248572485824859248602486124862248632486424865248662486724868248692487024871248722487324874248752487624877248782487924880248812488224883248842488524886248872488824889248902489124892248932489424895248962489724898248992490024901249022490324904249052490624907249082490924910249112491224913249142491524916249172491824919249202492124922249232492424925249262492724928249292493024931249322493324934249352493624937249382493924940249412494224943249442494524946249472494824949249502495124952249532495424955249562495724958249592496024961249622496324964249652496624967249682496924970249712497224973249742497524976249772497824979249802498124982249832498424985249862498724988249892499024991249922499324994249952499624997249982499925000250012500225003250042500525006250072500825009250102501125012250132501425015250162501725018250192502025021250222502325024250252502625027250282502925030250312503225033250342503525036250372503825039250402504125042250432504425045250462504725048250492505025051250522505325054250552505625057250582505925060250612506225063250642506525066250672506825069250702507125072250732507425075250762507725078250792508025081250822508325084250852508625087250882508925090250912509225093250942509525096250972509825099251002510125102251032510425105251062510725108251092511025111251122511325114251152511625117251182511925120251212512225123251242512525126251272512825129251302513125132251332513425135251362513725138251392514025141251422514325144251452514625147251482514925150251512515225153251542515525156251572515825159251602516125162251632516425165251662516725168251692517025171251722517325174251752517625177251782517925180251812518225183251842518525186251872518825189251902519125192251932519425195251962519725198251992520025201252022520325204252052520625207252082520925210252112521225213252142521525216252172521825219252202522125222252232522425225252262522725228252292523025231252322523325234252352523625237252382523925240252412524225243252442524525246252472524825249252502525125252252532525425255252562525725258252592526025261252622526325264252652526625267252682526925270252712527225273252742527525276252772527825279252802528125282252832528425285252862528725288252892529025291252922529325294252952529625297252982529925300253012530225303253042530525306253072530825309253102531125312253132531425315253162531725318253192532025321253222532325324253252532625327253282532925330253312533225333253342533525336253372533825339253402534125342253432534425345253462534725348253492535025351253522535325354253552535625357253582535925360253612536225363253642536525366253672536825369253702537125372253732537425375253762537725378253792538025381253822538325384253852538625387253882538925390253912539225393253942539525396253972539825399254002540125402254032540425405254062540725408254092541025411254122541325414254152541625417254182541925420254212542225423254242542525426254272542825429254302543125432254332543425435254362543725438254392544025441254422544325444254452544625447254482544925450254512545225453254542545525456254572545825459254602546125462254632546425465254662546725468254692547025471254722547325474254752547625477254782547925480254812548225483254842548525486254872548825489254902549125492254932549425495254962549725498254992550025501255022550325504255052550625507255082550925510255112551225513255142551525516255172551825519255202552125522255232552425525255262552725528255292553025531255322553325534255352553625537255382553925540255412554225543255442554525546255472554825549255502555125552255532555425555255562555725558255592556025561255622556325564255652556625567255682556925570255712557225573255742557525576255772557825579255802558125582255832558425585255862558725588255892559025591255922559325594255952559625597255982559925600256012560225603256042560525606256072560825609256102561125612256132561425615256162561725618256192562025621256222562325624256252562625627256282562925630256312563225633256342563525636256372563825639256402564125642256432564425645256462564725648256492565025651256522565325654256552565625657256582565925660256612566225663256642566525666256672566825669256702567125672256732567425675256762567725678256792568025681256822568325684256852568625687256882568925690256912569225693256942569525696256972569825699257002570125702257032570425705257062570725708257092571025711257122571325714257152571625717257182571925720257212572225723257242572525726257272572825729257302573125732257332573425735257362573725738257392574025741257422574325744257452574625747257482574925750257512575225753257542575525756257572575825759257602576125762257632576425765257662576725768257692577025771257722577325774257752577625777257782577925780257812578225783257842578525786257872578825789257902579125792257932579425795257962579725798257992580025801258022580325804258052580625807258082580925810258112581225813258142581525816258172581825819258202582125822258232582425825258262582725828258292583025831258322583325834258352583625837258382583925840258412584225843258442584525846258472584825849258502585125852258532585425855258562585725858258592586025861258622586325864258652586625867258682586925870258712587225873258742587525876258772587825879258802588125882258832588425885258862588725888258892589025891258922589325894258952589625897258982589925900259012590225903259042590525906259072590825909259102591125912259132591425915259162591725918259192592025921259222592325924259252592625927259282592925930259312593225933259342593525936259372593825939259402594125942259432594425945259462594725948259492595025951259522595325954259552595625957259582595925960259612596225963259642596525966259672596825969259702597125972259732597425975259762597725978259792598025981259822598325984259852598625987259882598925990259912599225993259942599525996259972599825999260002600126002260032600426005260062600726008260092601026011260122601326014260152601626017260182601926020260212602226023260242602526026260272602826029260302603126032260332603426035260362603726038260392604026041260422604326044260452604626047260482604926050260512605226053260542605526056260572605826059260602606126062260632606426065260662606726068260692607026071260722607326074260752607626077260782607926080260812608226083260842608526086260872608826089260902609126092260932609426095260962609726098260992610026101261022610326104261052610626107261082610926110261112611226113261142611526116261172611826119261202612126122261232612426125261262612726128261292613026131261322613326134261352613626137261382613926140261412614226143261442614526146261472614826149261502615126152261532615426155261562615726158261592616026161261622616326164261652616626167261682616926170261712617226173261742617526176261772617826179261802618126182261832618426185261862618726188261892619026191261922619326194261952619626197261982619926200262012620226203262042620526206262072620826209262102621126212262132621426215262162621726218262192622026221262222622326224262252622626227262282622926230262312623226233262342623526236262372623826239262402624126242262432624426245262462624726248262492625026251262522625326254262552625626257262582625926260262612626226263262642626526266262672626826269262702627126272262732627426275262762627726278262792628026281262822628326284262852628626287262882628926290262912629226293262942629526296262972629826299263002630126302263032630426305263062630726308263092631026311263122631326314263152631626317263182631926320263212632226323263242632526326263272632826329263302633126332263332633426335263362633726338263392634026341263422634326344263452634626347263482634926350263512635226353263542635526356263572635826359263602636126362263632636426365263662636726368263692637026371263722637326374263752637626377263782637926380263812638226383263842638526386263872638826389263902639126392263932639426395263962639726398263992640026401264022640326404264052640626407264082640926410264112641226413264142641526416264172641826419264202642126422264232642426425264262642726428264292643026431264322643326434264352643626437264382643926440264412644226443264442644526446264472644826449264502645126452264532645426455264562645726458264592646026461264622646326464264652646626467264682646926470264712647226473264742647526476264772647826479264802648126482264832648426485264862648726488264892649026491264922649326494264952649626497264982649926500265012650226503265042650526506265072650826509265102651126512265132651426515265162651726518265192652026521265222652326524265252652626527265282652926530265312653226533265342653526536265372653826539265402654126542265432654426545265462654726548265492655026551265522655326554265552655626557265582655926560265612656226563265642656526566265672656826569265702657126572265732657426575265762657726578265792658026581265822658326584265852658626587265882658926590265912659226593265942659526596265972659826599266002660126602266032660426605266062660726608266092661026611266122661326614266152661626617266182661926620266212662226623266242662526626266272662826629266302663126632266332663426635266362663726638266392664026641266422664326644266452664626647266482664926650266512665226653266542665526656266572665826659266602666126662266632666426665266662666726668266692667026671266722667326674266752667626677266782667926680266812668226683266842668526686266872668826689266902669126692266932669426695266962669726698266992670026701267022670326704267052670626707267082670926710267112671226713267142671526716267172671826719267202672126722267232672426725267262672726728267292673026731267322673326734267352673626737267382673926740267412674226743267442674526746267472674826749267502675126752267532675426755267562675726758267592676026761267622676326764267652676626767267682676926770267712677226773267742677526776267772677826779267802678126782267832678426785267862678726788267892679026791267922679326794267952679626797267982679926800268012680226803268042680526806268072680826809268102681126812268132681426815268162681726818268192682026821268222682326824268252682626827268282682926830268312683226833268342683526836268372683826839268402684126842268432684426845268462684726848268492685026851268522685326854268552685626857268582685926860268612686226863268642686526866268672686826869268702687126872268732687426875268762687726878268792688026881268822688326884268852688626887268882688926890268912689226893268942689526896268972689826899269002690126902269032690426905269062690726908269092691026911269122691326914269152691626917269182691926920269212692226923269242692526926269272692826929269302693126932269332693426935269362693726938269392694026941269422694326944269452694626947269482694926950269512695226953269542695526956269572695826959269602696126962269632696426965269662696726968269692697026971269722697326974269752697626977269782697926980269812698226983269842698526986269872698826989269902699126992269932699426995269962699726998269992700027001270022700327004270052700627007270082700927010270112701227013270142701527016270172701827019270202702127022270232702427025270262702727028270292703027031270322703327034270352703627037270382703927040270412704227043270442704527046270472704827049270502705127052270532705427055270562705727058270592706027061270622706327064270652706627067270682706927070270712707227073270742707527076270772707827079270802708127082270832708427085270862708727088270892709027091270922709327094270952709627097270982709927100271012710227103271042710527106271072710827109271102711127112271132711427115271162711727118271192712027121271222712327124271252712627127271282712927130271312713227133271342713527136271372713827139271402714127142271432714427145271462714727148271492715027151271522715327154271552715627157271582715927160271612716227163271642716527166271672716827169271702717127172271732717427175271762717727178271792718027181271822718327184271852718627187271882718927190271912719227193271942719527196271972719827199272002720127202272032720427205272062720727208272092721027211272122721327214272152721627217272182721927220272212722227223272242722527226272272722827229272302723127232272332723427235272362723727238272392724027241272422724327244272452724627247272482724927250272512725227253272542725527256272572725827259272602726127262272632726427265272662726727268272692727027271272722727327274272752727627277272782727927280272812728227283272842728527286272872728827289272902729127292272932729427295272962729727298272992730027301273022730327304273052730627307273082730927310273112731227313273142731527316273172731827319273202732127322273232732427325273262732727328273292733027331273322733327334273352733627337273382733927340273412734227343273442734527346273472734827349273502735127352273532735427355273562735727358273592736027361273622736327364273652736627367273682736927370273712737227373273742737527376273772737827379273802738127382273832738427385273862738727388273892739027391273922739327394273952739627397273982739927400274012740227403274042740527406274072740827409274102741127412274132741427415274162741727418274192742027421274222742327424274252742627427274282742927430274312743227433274342743527436274372743827439274402744127442274432744427445274462744727448274492745027451274522745327454274552745627457274582745927460274612746227463274642746527466274672746827469274702747127472274732747427475274762747727478274792748027481274822748327484274852748627487274882748927490274912749227493274942749527496274972749827499275002750127502275032750427505275062750727508275092751027511275122751327514275152751627517275182751927520275212752227523275242752527526275272752827529275302753127532275332753427535275362753727538275392754027541275422754327544275452754627547275482754927550275512755227553275542755527556275572755827559275602756127562275632756427565275662756727568275692757027571275722757327574275752757627577275782757927580275812758227583275842758527586275872758827589275902759127592275932759427595275962759727598275992760027601276022760327604276052760627607276082760927610276112761227613276142761527616276172761827619276202762127622276232762427625276262762727628276292763027631276322763327634276352763627637276382763927640276412764227643276442764527646276472764827649276502765127652276532765427655276562765727658276592766027661276622766327664276652766627667276682766927670276712767227673276742767527676276772767827679276802768127682276832768427685276862768727688276892769027691276922769327694276952769627697276982769927700277012770227703277042770527706277072770827709277102771127712277132771427715277162771727718277192772027721277222772327724277252772627727277282772927730277312773227733277342773527736277372773827739277402774127742277432774427745277462774727748277492775027751277522775327754277552775627757277582775927760277612776227763277642776527766277672776827769277702777127772277732777427775277762777727778277792778027781277822778327784277852778627787277882778927790277912779227793277942779527796277972779827799278002780127802278032780427805278062780727808278092781027811278122781327814278152781627817278182781927820278212782227823278242782527826278272782827829278302783127832278332783427835278362783727838278392784027841278422784327844278452784627847278482784927850278512785227853278542785527856278572785827859278602786127862278632786427865278662786727868278692787027871278722787327874278752787627877278782787927880278812788227883278842788527886278872788827889278902789127892278932789427895278962789727898278992790027901279022790327904279052790627907279082790927910279112791227913279142791527916279172791827919279202792127922279232792427925279262792727928279292793027931279322793327934279352793627937279382793927940279412794227943279442794527946279472794827949279502795127952279532795427955279562795727958279592796027961279622796327964279652796627967279682796927970279712797227973279742797527976279772797827979279802798127982279832798427985279862798727988279892799027991279922799327994279952799627997279982799928000280012800228003280042800528006280072800828009280102801128012280132801428015280162801728018280192802028021280222802328024280252802628027280282802928030280312803228033280342803528036280372803828039280402804128042280432804428045280462804728048280492805028051280522805328054280552805628057280582805928060280612806228063280642806528066280672806828069280702807128072280732807428075280762807728078280792808028081280822808328084280852808628087280882808928090280912809228093280942809528096280972809828099281002810128102281032810428105281062810728108281092811028111281122811328114281152811628117281182811928120281212812228123281242812528126281272812828129281302813128132281332813428135281362813728138281392814028141281422814328144281452814628147281482814928150281512815228153281542815528156281572815828159281602816128162281632816428165281662816728168281692817028171281722817328174281752817628177281782817928180281812818228183281842818528186281872818828189281902819128192281932819428195281962819728198281992820028201282022820328204282052820628207282082820928210282112821228213282142821528216282172821828219282202822128222282232822428225282262822728228282292823028231282322823328234282352823628237282382823928240282412824228243282442824528246282472824828249282502825128252282532825428255282562825728258282592826028261282622826328264282652826628267282682826928270282712827228273282742827528276282772827828279282802828128282282832828428285282862828728288282892829028291282922829328294282952829628297282982829928300283012830228303283042830528306283072830828309283102831128312283132831428315283162831728318283192832028321283222832328324283252832628327283282832928330283312833228333283342833528336283372833828339283402834128342283432834428345283462834728348283492835028351283522835328354283552835628357283582835928360283612836228363283642836528366283672836828369283702837128372283732837428375283762837728378283792838028381283822838328384283852838628387283882838928390283912839228393283942839528396283972839828399284002840128402284032840428405284062840728408284092841028411284122841328414284152841628417284182841928420284212842228423284242842528426284272842828429284302843128432284332843428435284362843728438284392844028441284422844328444284452844628447284482844928450284512845228453284542845528456284572845828459284602846128462284632846428465284662846728468284692847028471284722847328474284752847628477284782847928480284812848228483284842848528486284872848828489284902849128492284932849428495284962849728498284992850028501285022850328504285052850628507285082850928510285112851228513285142851528516285172851828519285202852128522285232852428525285262852728528285292853028531285322853328534285352853628537285382853928540285412854228543285442854528546285472854828549285502855128552285532855428555285562855728558285592856028561285622856328564285652856628567285682856928570285712857228573285742857528576285772857828579285802858128582285832858428585285862858728588285892859028591285922859328594285952859628597285982859928600286012860228603286042860528606286072860828609286102861128612286132861428615286162861728618286192862028621286222862328624286252862628627286282862928630286312863228633286342863528636286372863828639286402864128642286432864428645286462864728648286492865028651286522865328654286552865628657286582865928660286612866228663286642866528666286672866828669286702867128672286732867428675286762867728678286792868028681286822868328684286852868628687286882868928690286912869228693286942869528696286972869828699287002870128702287032870428705287062870728708287092871028711287122871328714287152871628717287182871928720287212872228723287242872528726287272872828729287302873128732287332873428735287362873728738287392874028741287422874328744287452874628747287482874928750287512875228753287542875528756287572875828759287602876128762287632876428765287662876728768287692877028771287722877328774287752877628777287782877928780287812878228783287842878528786287872878828789287902879128792287932879428795287962879728798287992880028801288022880328804288052880628807288082880928810288112881228813288142881528816288172881828819288202882128822288232882428825288262882728828288292883028831288322883328834288352883628837288382883928840288412884228843288442884528846288472884828849288502885128852288532885428855288562885728858288592886028861288622886328864288652886628867288682886928870288712887228873288742887528876288772887828879288802888128882288832888428885288862888728888288892889028891288922889328894288952889628897288982889928900289012890228903289042890528906289072890828909289102891128912289132891428915289162891728918289192892028921289222892328924289252892628927289282892928930289312893228933289342893528936289372893828939289402894128942289432894428945289462894728948289492895028951289522895328954289552895628957289582895928960289612896228963289642896528966289672896828969289702897128972289732897428975289762897728978289792898028981289822898328984289852898628987289882898928990289912899228993289942899528996289972899828999290002900129002290032900429005290062900729008290092901029011290122901329014290152901629017290182901929020290212902229023290242902529026290272902829029290302903129032290332903429035290362903729038290392904029041290422904329044290452904629047290482904929050290512905229053290542905529056290572905829059290602906129062290632906429065290662906729068290692907029071290722907329074290752907629077290782907929080290812908229083290842908529086290872908829089290902909129092290932909429095290962909729098290992910029101291022910329104291052910629107291082910929110291112911229113291142911529116291172911829119291202912129122291232912429125291262912729128291292913029131291322913329134291352913629137291382913929140291412914229143291442914529146291472914829149291502915129152291532915429155291562915729158291592916029161291622916329164291652916629167291682916929170291712917229173291742917529176291772917829179291802918129182291832918429185291862918729188291892919029191291922919329194291952919629197291982919929200292012920229203292042920529206292072920829209292102921129212292132921429215292162921729218292192922029221292222922329224292252922629227292282922929230292312923229233292342923529236292372923829239292402924129242292432924429245292462924729248292492925029251292522925329254292552925629257292582925929260292612926229263292642926529266292672926829269292702927129272292732927429275292762927729278292792928029281292822928329284292852928629287292882928929290292912929229293292942929529296292972929829299293002930129302293032930429305293062930729308293092931029311293122931329314293152931629317293182931929320293212932229323293242932529326293272932829329293302933129332293332933429335293362933729338293392934029341293422934329344293452934629347293482934929350293512935229353293542935529356293572935829359293602936129362293632936429365293662936729368293692937029371293722937329374293752937629377293782937929380293812938229383293842938529386293872938829389293902939129392293932939429395293962939729398293992940029401294022940329404294052940629407294082940929410294112941229413294142941529416294172941829419294202942129422294232942429425294262942729428294292943029431294322943329434294352943629437294382943929440294412944229443294442944529446294472944829449294502945129452294532945429455294562945729458294592946029461294622946329464294652946629467294682946929470294712947229473294742947529476294772947829479294802948129482294832948429485294862948729488294892949029491294922949329494294952949629497294982949929500295012950229503295042950529506295072950829509295102951129512295132951429515295162951729518295192952029521295222952329524295252952629527295282952929530295312953229533295342953529536295372953829539295402954129542295432954429545295462954729548295492955029551295522955329554295552955629557295582955929560295612956229563295642956529566295672956829569295702957129572295732957429575295762957729578295792958029581295822958329584295852958629587295882958929590295912959229593295942959529596295972959829599296002960129602296032960429605296062960729608296092961029611296122961329614296152961629617296182961929620296212962229623296242962529626296272962829629296302963129632296332963429635296362963729638296392964029641296422964329644296452964629647296482964929650296512965229653296542965529656296572965829659296602966129662296632966429665296662966729668296692967029671296722967329674296752967629677296782967929680296812968229683296842968529686296872968829689296902969129692296932969429695296962969729698296992970029701297022970329704297052970629707297082970929710297112971229713297142971529716297172971829719297202972129722297232972429725297262972729728297292973029731297322973329734297352973629737297382973929740297412974229743297442974529746297472974829749297502975129752297532975429755297562975729758297592976029761297622976329764297652976629767297682976929770297712977229773297742977529776297772977829779297802978129782297832978429785297862978729788297892979029791297922979329794297952979629797297982979929800298012980229803298042980529806298072980829809298102981129812298132981429815298162981729818298192982029821298222982329824298252982629827298282982929830298312983229833298342983529836298372983829839298402984129842298432984429845298462984729848298492985029851298522985329854298552985629857298582985929860298612986229863298642986529866298672986829869298702987129872298732987429875298762987729878298792988029881298822988329884298852988629887298882988929890298912989229893298942989529896298972989829899299002990129902299032990429905299062990729908299092991029911299122991329914299152991629917299182991929920299212992229923299242992529926299272992829929299302993129932299332993429935299362993729938299392994029941299422994329944299452994629947299482994929950299512995229953299542995529956299572995829959299602996129962299632996429965299662996729968299692997029971299722997329974299752997629977299782997929980299812998229983299842998529986299872998829989299902999129992299932999429995299962999729998299993000030001300023000330004300053000630007300083000930010300113001230013300143001530016300173001830019300203002130022300233002430025300263002730028300293003030031300323003330034300353003630037300383003930040300413004230043300443004530046300473004830049300503005130052300533005430055300563005730058300593006030061300623006330064300653006630067300683006930070300713007230073300743007530076300773007830079300803008130082300833008430085300863008730088300893009030091300923009330094300953009630097300983009930100301013010230103301043010530106301073010830109301103011130112301133011430115301163011730118301193012030121301223012330124301253012630127301283012930130301313013230133301343013530136301373013830139301403014130142301433014430145301463014730148301493015030151301523015330154301553015630157301583015930160301613016230163301643016530166301673016830169301703017130172301733017430175301763017730178301793018030181301823018330184301853018630187301883018930190301913019230193301943019530196301973019830199302003020130202302033020430205302063020730208302093021030211302123021330214302153021630217302183021930220302213022230223302243022530226302273022830229302303023130232302333023430235302363023730238302393024030241302423024330244302453024630247302483024930250302513025230253302543025530256302573025830259302603026130262302633026430265302663026730268302693027030271302723027330274302753027630277302783027930280302813028230283302843028530286302873028830289302903029130292302933029430295302963029730298302993030030301303023030330304303053030630307303083030930310303113031230313303143031530316303173031830319303203032130322303233032430325303263032730328303293033030331303323033330334303353033630337303383033930340303413034230343303443034530346303473034830349303503035130352303533035430355303563035730358303593036030361303623036330364303653036630367303683036930370303713037230373303743037530376303773037830379303803038130382303833038430385303863038730388303893039030391303923039330394303953039630397303983039930400304013040230403304043040530406304073040830409304103041130412304133041430415304163041730418304193042030421304223042330424304253042630427304283042930430304313043230433304343043530436304373043830439304403044130442304433044430445304463044730448304493045030451304523045330454304553045630457304583045930460304613046230463304643046530466304673046830469304703047130472304733047430475304763047730478304793048030481304823048330484304853048630487304883048930490304913049230493304943049530496304973049830499305003050130502305033050430505305063050730508305093051030511305123051330514305153051630517305183051930520305213052230523305243052530526305273052830529305303053130532305333053430535305363053730538305393054030541305423054330544305453054630547305483054930550305513055230553305543055530556305573055830559305603056130562305633056430565305663056730568305693057030571305723057330574305753057630577305783057930580305813058230583305843058530586305873058830589305903059130592305933059430595305963059730598305993060030601306023060330604306053060630607306083060930610306113061230613306143061530616306173061830619306203062130622306233062430625306263062730628306293063030631306323063330634306353063630637306383063930640306413064230643306443064530646306473064830649306503065130652306533065430655306563065730658306593066030661306623066330664306653066630667306683066930670306713067230673306743067530676306773067830679306803068130682306833068430685306863068730688306893069030691306923069330694306953069630697306983069930700307013070230703307043070530706307073070830709307103071130712307133071430715307163071730718307193072030721307223072330724307253072630727307283072930730307313073230733307343073530736307373073830739307403074130742307433074430745307463074730748307493075030751307523075330754307553075630757307583075930760307613076230763307643076530766307673076830769307703077130772307733077430775307763077730778307793078030781307823078330784307853078630787307883078930790307913079230793307943079530796307973079830799308003080130802308033080430805308063080730808308093081030811308123081330814308153081630817308183081930820308213082230823308243082530826308273082830829308303083130832308333083430835308363083730838308393084030841308423084330844308453084630847308483084930850308513085230853308543085530856308573085830859308603086130862308633086430865308663086730868308693087030871308723087330874308753087630877308783087930880308813088230883308843088530886308873088830889308903089130892308933089430895308963089730898308993090030901309023090330904309053090630907309083090930910309113091230913309143091530916309173091830919309203092130922309233092430925309263092730928309293093030931309323093330934309353093630937309383093930940309413094230943309443094530946309473094830949309503095130952309533095430955309563095730958309593096030961309623096330964309653096630967309683096930970309713097230973309743097530976309773097830979309803098130982309833098430985309863098730988309893099030991309923099330994309953099630997309983099931000310013100231003310043100531006310073100831009310103101131012310133101431015310163101731018310193102031021310223102331024310253102631027310283102931030310313103231033310343103531036310373103831039310403104131042310433104431045310463104731048310493105031051310523105331054310553105631057310583105931060310613106231063310643106531066310673106831069310703107131072310733107431075310763107731078310793108031081310823108331084310853108631087310883108931090310913109231093310943109531096310973109831099311003110131102311033110431105311063110731108311093111031111311123111331114311153111631117311183111931120311213112231123311243112531126311273112831129311303113131132311333113431135311363113731138311393114031141311423114331144311453114631147311483114931150311513115231153311543115531156311573115831159311603116131162311633116431165311663116731168311693117031171311723117331174311753117631177311783117931180311813118231183311843118531186311873118831189311903119131192311933119431195311963119731198311993120031201312023120331204312053120631207312083120931210312113121231213312143121531216312173121831219312203122131222312233122431225312263122731228312293123031231312323123331234312353123631237312383123931240312413124231243312443124531246312473124831249312503125131252312533125431255312563125731258312593126031261312623126331264312653126631267312683126931270312713127231273312743127531276312773127831279312803128131282312833128431285312863128731288312893129031291312923129331294312953129631297312983129931300313013130231303313043130531306313073130831309313103131131312313133131431315313163131731318313193132031321313223132331324313253132631327313283132931330313313133231333313343133531336313373133831339313403134131342313433134431345313463134731348313493135031351313523135331354313553135631357313583135931360313613136231363313643136531366313673136831369313703137131372313733137431375313763137731378313793138031381313823138331384313853138631387313883138931390313913139231393313943139531396313973139831399314003140131402314033140431405314063140731408314093141031411314123141331414314153141631417314183141931420314213142231423314243142531426314273142831429314303143131432314333143431435314363143731438314393144031441314423144331444314453144631447314483144931450314513145231453314543145531456314573145831459314603146131462314633146431465314663146731468314693147031471314723147331474314753147631477314783147931480314813148231483314843148531486314873148831489314903149131492314933149431495314963149731498314993150031501315023150331504315053150631507315083150931510315113151231513315143151531516315173151831519315203152131522315233152431525315263152731528315293153031531315323153331534315353153631537315383153931540315413154231543315443154531546315473154831549315503155131552315533155431555315563155731558315593156031561315623156331564315653156631567315683156931570315713157231573315743157531576315773157831579315803158131582315833158431585315863158731588315893159031591315923159331594315953159631597315983159931600316013160231603316043160531606316073160831609316103161131612316133161431615316163161731618316193162031621316223162331624316253162631627316283162931630316313163231633316343163531636316373163831639316403164131642316433164431645316463164731648316493165031651316523165331654316553165631657316583165931660316613166231663316643166531666316673166831669316703167131672316733167431675316763167731678316793168031681316823168331684316853168631687316883168931690316913169231693316943169531696316973169831699317003170131702317033170431705317063170731708317093171031711317123171331714317153171631717317183171931720317213172231723317243172531726317273172831729317303173131732317333173431735317363173731738317393174031741317423174331744317453174631747317483174931750317513175231753317543175531756317573175831759317603176131762317633176431765317663176731768317693177031771317723177331774317753177631777317783177931780317813178231783317843178531786317873178831789317903179131792317933179431795317963179731798317993180031801318023180331804318053180631807318083180931810318113181231813318143181531816318173181831819318203182131822318233182431825318263182731828318293183031831318323183331834318353183631837318383183931840318413184231843318443184531846318473184831849318503185131852318533185431855318563185731858318593186031861318623186331864318653186631867318683186931870318713187231873318743187531876318773187831879318803188131882318833188431885318863188731888318893189031891318923189331894318953189631897318983189931900319013190231903319043190531906319073190831909319103191131912319133191431915319163191731918319193192031921319223192331924319253192631927319283192931930319313193231933319343193531936319373193831939319403194131942319433194431945319463194731948319493195031951319523195331954319553195631957319583195931960319613196231963319643196531966319673196831969319703197131972319733197431975319763197731978319793198031981319823198331984319853198631987319883198931990319913199231993319943199531996319973199831999320003200132002320033200432005320063200732008320093201032011320123201332014320153201632017320183201932020320213202232023320243202532026320273202832029320303203132032320333203432035320363203732038320393204032041320423204332044320453204632047320483204932050320513205232053320543205532056320573205832059320603206132062320633206432065320663206732068320693207032071320723207332074320753207632077320783207932080320813208232083320843208532086320873208832089320903209132092320933209432095320963209732098320993210032101321023210332104321053210632107321083210932110321113211232113321143211532116321173211832119321203212132122321233212432125321263212732128321293213032131321323213332134321353213632137321383213932140321413214232143321443214532146321473214832149321503215132152321533215432155321563215732158321593216032161321623216332164321653216632167321683216932170321713217232173321743217532176321773217832179321803218132182321833218432185321863218732188321893219032191321923219332194321953219632197321983219932200322013220232203322043220532206322073220832209322103221132212322133221432215322163221732218322193222032221322223222332224322253222632227322283222932230322313223232233322343223532236322373223832239322403224132242322433224432245322463224732248322493225032251322523225332254322553225632257322583225932260322613226232263322643226532266322673226832269322703227132272322733227432275322763227732278322793228032281322823228332284322853228632287322883228932290322913229232293322943229532296322973229832299323003230132302323033230432305323063230732308323093231032311323123231332314323153231632317323183231932320323213232232323323243232532326323273232832329323303233132332323333233432335323363233732338323393234032341323423234332344323453234632347323483234932350323513235232353323543235532356323573235832359323603236132362323633236432365323663236732368323693237032371323723237332374323753237632377323783237932380323813238232383323843238532386323873238832389323903239132392323933239432395323963239732398323993240032401324023240332404324053240632407324083240932410324113241232413324143241532416324173241832419324203242132422324233242432425324263242732428324293243032431324323243332434324353243632437324383243932440324413244232443324443244532446324473244832449324503245132452324533245432455324563245732458324593246032461324623246332464324653246632467324683246932470324713247232473324743247532476324773247832479324803248132482324833248432485324863248732488324893249032491324923249332494324953249632497324983249932500325013250232503325043250532506325073250832509325103251132512325133251432515325163251732518325193252032521325223252332524325253252632527325283252932530325313253232533325343253532536325373253832539325403254132542325433254432545325463254732548325493255032551325523255332554325553255632557325583255932560325613256232563325643256532566325673256832569325703257132572325733257432575325763257732578325793258032581325823258332584325853258632587325883258932590325913259232593325943259532596325973259832599326003260132602326033260432605326063260732608326093261032611326123261332614326153261632617326183261932620326213262232623326243262532626326273262832629326303263132632326333263432635326363263732638326393264032641326423264332644326453264632647326483264932650326513265232653326543265532656326573265832659326603266132662326633266432665326663266732668326693267032671326723267332674326753267632677326783267932680326813268232683326843268532686326873268832689326903269132692326933269432695326963269732698326993270032701327023270332704327053270632707327083270932710327113271232713327143271532716327173271832719327203272132722327233272432725327263272732728327293273032731327323273332734327353273632737327383273932740327413274232743327443274532746327473274832749327503275132752327533275432755327563275732758327593276032761327623276332764327653276632767327683276932770327713277232773327743277532776327773277832779327803278132782327833278432785327863278732788327893279032791327923279332794327953279632797327983279932800328013280232803328043280532806328073280832809328103281132812328133281432815328163281732818328193282032821328223282332824328253282632827328283282932830328313283232833328343283532836328373283832839328403284132842328433284432845328463284732848328493285032851328523285332854328553285632857328583285932860328613286232863328643286532866328673286832869328703287132872328733287432875328763287732878328793288032881328823288332884328853288632887328883288932890328913289232893328943289532896328973289832899329003290132902329033290432905329063290732908329093291032911329123291332914329153291632917329183291932920329213292232923329243292532926329273292832929329303293132932329333293432935329363293732938329393294032941329423294332944329453294632947329483294932950329513295232953329543295532956329573295832959329603296132962329633296432965329663296732968329693297032971329723297332974329753297632977329783297932980329813298232983329843298532986329873298832989329903299132992329933299432995329963299732998329993300033001330023300333004330053300633007330083300933010330113301233013330143301533016330173301833019330203302133022330233302433025330263302733028330293303033031330323303333034330353303633037330383303933040330413304233043330443304533046330473304833049330503305133052330533305433055330563305733058330593306033061330623306333064330653306633067330683306933070330713307233073330743307533076330773307833079330803308133082330833308433085330863308733088330893309033091330923309333094330953309633097330983309933100331013310233103331043310533106331073310833109331103311133112331133311433115331163311733118331193312033121331223312333124331253312633127331283312933130331313313233133331343313533136331373313833139331403314133142331433314433145331463314733148331493315033151331523315333154331553315633157331583315933160331613316233163331643316533166331673316833169331703317133172331733317433175331763317733178331793318033181331823318333184331853318633187331883318933190331913319233193331943319533196331973319833199332003320133202332033320433205332063320733208332093321033211332123321333214332153321633217332183321933220332213322233223332243322533226332273322833229332303323133232332333323433235332363323733238332393324033241332423324333244332453324633247332483324933250332513325233253332543325533256332573325833259332603326133262332633326433265332663326733268332693327033271332723327333274332753327633277332783327933280332813328233283332843328533286332873328833289332903329133292332933329433295332963329733298332993330033301333023330333304333053330633307333083330933310333113331233313333143331533316333173331833319333203332133322333233332433325333263332733328333293333033331333323333333334333353333633337333383333933340333413334233343333443334533346333473334833349333503335133352333533335433355333563335733358333593336033361333623336333364333653336633367333683336933370333713337233373333743337533376333773337833379333803338133382333833338433385333863338733388333893339033391333923339333394333953339633397333983339933400334013340233403334043340533406334073340833409334103341133412334133341433415334163341733418334193342033421334223342333424334253342633427334283342933430334313343233433334343343533436334373343833439334403344133442334433344433445334463344733448334493345033451334523345333454334553345633457334583345933460334613346233463334643346533466334673346833469334703347133472334733347433475334763347733478334793348033481334823348333484334853348633487334883348933490334913349233493334943349533496334973349833499335003350133502335033350433505335063350733508335093351033511335123351333514335153351633517335183351933520335213352233523335243352533526335273352833529335303353133532335333353433535335363353733538335393354033541335423354333544335453354633547335483354933550335513355233553335543355533556335573355833559335603356133562335633356433565335663356733568335693357033571335723357333574335753357633577335783357933580335813358233583335843358533586335873358833589335903359133592335933359433595335963359733598335993360033601336023360333604336053360633607336083360933610336113361233613336143361533616336173361833619336203362133622336233362433625336263362733628336293363033631336323363333634336353363633637336383363933640336413364233643336443364533646336473364833649336503365133652336533365433655336563365733658336593366033661336623366333664336653366633667336683366933670336713367233673336743367533676336773367833679336803368133682336833368433685336863368733688336893369033691336923369333694336953369633697336983369933700337013370233703337043370533706337073370833709337103371133712337133371433715337163371733718337193372033721337223372333724337253372633727337283372933730337313373233733337343373533736337373373833739337403374133742337433374433745337463374733748337493375033751337523375333754337553375633757337583375933760337613376233763337643376533766337673376833769337703377133772337733377433775337763377733778337793378033781337823378333784337853378633787337883378933790337913379233793337943379533796337973379833799338003380133802338033380433805338063380733808338093381033811338123381333814338153381633817338183381933820338213382233823338243382533826338273382833829338303383133832338333383433835338363383733838338393384033841338423384333844338453384633847338483384933850338513385233853338543385533856338573385833859338603386133862338633386433865338663386733868338693387033871338723387333874338753387633877338783387933880338813388233883338843388533886338873388833889338903389133892338933389433895338963389733898338993390033901339023390333904339053390633907339083390933910339113391233913339143391533916339173391833919339203392133922339233392433925339263392733928339293393033931339323393333934339353393633937339383393933940339413394233943339443394533946339473394833949339503395133952339533395433955339563395733958339593396033961339623396333964339653396633967339683396933970339713397233973339743397533976339773397833979339803398133982339833398433985339863398733988339893399033991339923399333994339953399633997339983399934000340013400234003340043400534006340073400834009340103401134012340133401434015340163401734018340193402034021340223402334024340253402634027340283402934030340313403234033340343403534036340373403834039340403404134042340433404434045340463404734048340493405034051340523405334054340553405634057340583405934060340613406234063340643406534066340673406834069340703407134072340733407434075340763407734078340793408034081340823408334084340853408634087340883408934090340913409234093340943409534096340973409834099341003410134102341033410434105341063410734108341093411034111341123411334114341153411634117341183411934120341213412234123341243412534126341273412834129341303413134132341333413434135341363413734138341393414034141341423414334144341453414634147341483414934150341513415234153341543415534156341573415834159341603416134162341633416434165341663416734168341693417034171341723417334174341753417634177341783417934180341813418234183341843418534186341873418834189341903419134192341933419434195341963419734198341993420034201342023420334204342053420634207342083420934210342113421234213342143421534216342173421834219342203422134222342233422434225342263422734228342293423034231342323423334234342353423634237342383423934240342413424234243342443424534246342473424834249342503425134252342533425434255342563425734258342593426034261342623426334264342653426634267342683426934270342713427234273342743427534276342773427834279342803428134282342833428434285342863428734288342893429034291342923429334294342953429634297342983429934300343013430234303343043430534306343073430834309343103431134312343133431434315343163431734318343193432034321343223432334324343253432634327343283432934330343313433234333343343433534336343373433834339343403434134342343433434434345343463434734348343493435034351343523435334354343553435634357343583435934360343613436234363343643436534366343673436834369343703437134372343733437434375343763437734378343793438034381343823438334384343853438634387343883438934390343913439234393343943439534396343973439834399344003440134402344033440434405344063440734408344093441034411344123441334414344153441634417344183441934420344213442234423344243442534426344273442834429344303443134432344333443434435344363443734438344393444034441344423444334444344453444634447344483444934450344513445234453344543445534456344573445834459344603446134462344633446434465344663446734468344693447034471344723447334474344753447634477344783447934480344813448234483344843448534486344873448834489344903449134492344933449434495344963449734498344993450034501345023450334504345053450634507345083450934510345113451234513345143451534516345173451834519345203452134522345233452434525345263452734528345293453034531345323453334534345353453634537345383453934540345413454234543345443454534546345473454834549345503455134552345533455434555345563455734558345593456034561345623456334564345653456634567345683456934570345713457234573345743457534576345773457834579345803458134582345833458434585345863458734588345893459034591345923459334594345953459634597345983459934600346013460234603346043460534606346073460834609346103461134612346133461434615346163461734618346193462034621346223462334624346253462634627346283462934630346313463234633346343463534636346373463834639346403464134642346433464434645346463464734648346493465034651346523465334654346553465634657346583465934660346613466234663346643466534666346673466834669346703467134672346733467434675346763467734678346793468034681346823468334684346853468634687346883468934690346913469234693346943469534696346973469834699347003470134702347033470434705347063470734708347093471034711347123471334714347153471634717347183471934720347213472234723347243472534726347273472834729347303473134732347333473434735347363473734738347393474034741347423474334744347453474634747347483474934750347513475234753347543475534756347573475834759347603476134762347633476434765347663476734768347693477034771347723477334774347753477634777347783477934780347813478234783347843478534786347873478834789347903479134792347933479434795347963479734798347993480034801348023480334804348053480634807348083480934810348113481234813348143481534816348173481834819348203482134822348233482434825348263482734828348293483034831348323483334834348353483634837348383483934840348413484234843348443484534846348473484834849348503485134852348533485434855348563485734858348593486034861348623486334864348653486634867348683486934870348713487234873348743487534876348773487834879348803488134882348833488434885348863488734888348893489034891348923489334894348953489634897348983489934900349013490234903349043490534906349073490834909349103491134912349133491434915349163491734918349193492034921349223492334924349253492634927349283492934930349313493234933349343493534936349373493834939349403494134942349433494434945349463494734948349493495034951349523495334954349553495634957349583495934960349613496234963349643496534966349673496834969349703497134972349733497434975349763497734978349793498034981349823498334984349853498634987349883498934990349913499234993349943499534996349973499834999350003500135002350033500435005350063500735008350093501035011350123501335014350153501635017350183501935020350213502235023350243502535026350273502835029350303503135032350333503435035350363503735038350393504035041350423504335044350453504635047350483504935050350513505235053350543505535056350573505835059350603506135062350633506435065350663506735068350693507035071350723507335074350753507635077350783507935080350813508235083350843508535086350873508835089350903509135092350933509435095350963509735098350993510035101351023510335104351053510635107351083510935110351113511235113351143511535116351173511835119351203512135122351233512435125351263512735128351293513035131351323513335134351353513635137351383513935140351413514235143351443514535146351473514835149351503515135152351533515435155351563515735158351593516035161351623516335164351653516635167351683516935170351713517235173351743517535176351773517835179351803518135182351833518435185351863518735188351893519035191351923519335194351953519635197351983519935200352013520235203352043520535206352073520835209352103521135212352133521435215352163521735218352193522035221352223522335224352253522635227352283522935230352313523235233352343523535236352373523835239352403524135242352433524435245352463524735248352493525035251352523525335254352553525635257352583525935260352613526235263352643526535266352673526835269352703527135272352733527435275352763527735278352793528035281352823528335284352853528635287352883528935290352913529235293352943529535296352973529835299353003530135302353033530435305353063530735308353093531035311353123531335314353153531635317353183531935320353213532235323353243532535326353273532835329353303533135332353333533435335353363533735338353393534035341353423534335344353453534635347353483534935350353513535235353353543535535356353573535835359353603536135362353633536435365353663536735368353693537035371353723537335374353753537635377353783537935380353813538235383353843538535386353873538835389353903539135392353933539435395353963539735398353993540035401354023540335404354053540635407354083540935410354113541235413354143541535416354173541835419354203542135422354233542435425354263542735428354293543035431354323543335434354353543635437354383543935440354413544235443354443544535446354473544835449354503545135452354533545435455354563545735458354593546035461354623546335464354653546635467354683546935470354713547235473354743547535476354773547835479354803548135482354833548435485354863548735488354893549035491354923549335494354953549635497354983549935500355013550235503355043550535506355073550835509355103551135512355133551435515355163551735518355193552035521355223552335524355253552635527355283552935530355313553235533355343553535536355373553835539355403554135542355433554435545355463554735548355493555035551355523555335554355553555635557355583555935560355613556235563355643556535566355673556835569355703557135572355733557435575355763557735578355793558035581355823558335584355853558635587355883558935590355913559235593355943559535596355973559835599356003560135602356033560435605356063560735608356093561035611356123561335614356153561635617356183561935620356213562235623356243562535626356273562835629356303563135632356333563435635356363563735638356393564035641356423564335644356453564635647356483564935650356513565235653356543565535656356573565835659356603566135662356633566435665356663566735668356693567035671356723567335674356753567635677356783567935680356813568235683356843568535686356873568835689356903569135692356933569435695356963569735698356993570035701357023570335704357053570635707357083570935710357113571235713357143571535716357173571835719357203572135722357233572435725357263572735728357293573035731357323573335734357353573635737357383573935740357413574235743357443574535746357473574835749357503575135752357533575435755357563575735758357593576035761357623576335764357653576635767357683576935770357713577235773357743577535776357773577835779357803578135782357833578435785357863578735788357893579035791357923579335794357953579635797357983579935800358013580235803358043580535806358073580835809358103581135812358133581435815358163581735818358193582035821358223582335824358253582635827358283582935830358313583235833358343583535836358373583835839358403584135842358433584435845358463584735848358493585035851358523585335854358553585635857358583585935860358613586235863358643586535866358673586835869358703587135872358733587435875358763587735878358793588035881358823588335884358853588635887358883588935890358913589235893358943589535896358973589835899359003590135902359033590435905359063590735908359093591035911359123591335914359153591635917359183591935920359213592235923359243592535926359273592835929359303593135932359333593435935359363593735938359393594035941359423594335944359453594635947359483594935950359513595235953359543595535956359573595835959359603596135962359633596435965359663596735968359693597035971359723597335974359753597635977359783597935980359813598235983359843598535986359873598835989359903599135992359933599435995359963599735998359993600036001360023600336004360053600636007360083600936010360113601236013360143601536016360173601836019360203602136022360233602436025360263602736028360293603036031360323603336034360353603636037360383603936040360413604236043360443604536046360473604836049360503605136052360533605436055360563605736058360593606036061360623606336064360653606636067360683606936070360713607236073360743607536076360773607836079360803608136082360833608436085360863608736088360893609036091360923609336094360953609636097360983609936100361013610236103361043610536106361073610836109361103611136112361133611436115361163611736118361193612036121361223612336124361253612636127361283612936130361313613236133361343613536136361373613836139361403614136142361433614436145361463614736148361493615036151361523615336154361553615636157361583615936160361613616236163361643616536166361673616836169361703617136172361733617436175361763617736178361793618036181361823618336184361853618636187361883618936190361913619236193361943619536196361973619836199362003620136202362033620436205362063620736208362093621036211362123621336214362153621636217362183621936220362213622236223362243622536226362273622836229362303623136232362333623436235362363623736238362393624036241362423624336244362453624636247362483624936250362513625236253362543625536256362573625836259362603626136262362633626436265362663626736268362693627036271362723627336274362753627636277362783627936280362813628236283362843628536286362873628836289362903629136292362933629436295362963629736298362993630036301363023630336304363053630636307363083630936310363113631236313363143631536316363173631836319363203632136322363233632436325363263632736328363293633036331363323633336334363353633636337363383633936340363413634236343363443634536346363473634836349363503635136352363533635436355363563635736358363593636036361363623636336364363653636636367363683636936370363713637236373363743637536376363773637836379363803638136382363833638436385363863638736388363893639036391363923639336394363953639636397363983639936400364013640236403364043640536406364073640836409364103641136412364133641436415364163641736418364193642036421364223642336424364253642636427364283642936430364313643236433364343643536436364373643836439364403644136442364433644436445364463644736448364493645036451364523645336454364553645636457364583645936460364613646236463364643646536466364673646836469364703647136472364733647436475364763647736478364793648036481364823648336484364853648636487364883648936490364913649236493364943649536496364973649836499365003650136502365033650436505365063650736508365093651036511365123651336514365153651636517365183651936520365213652236523365243652536526365273652836529365303653136532365333653436535365363653736538365393654036541365423654336544365453654636547365483654936550365513655236553365543655536556365573655836559365603656136562365633656436565365663656736568365693657036571365723657336574365753657636577365783657936580365813658236583365843658536586365873658836589365903659136592365933659436595365963659736598365993660036601366023660336604366053660636607366083660936610366113661236613366143661536616366173661836619366203662136622366233662436625366263662736628366293663036631366323663336634366353663636637366383663936640366413664236643366443664536646366473664836649366503665136652366533665436655366563665736658366593666036661366623666336664366653666636667366683666936670366713667236673366743667536676366773667836679366803668136682366833668436685366863668736688366893669036691366923669336694366953669636697366983669936700367013670236703367043670536706367073670836709367103671136712367133671436715367163671736718367193672036721367223672336724367253672636727367283672936730367313673236733367343673536736367373673836739367403674136742367433674436745367463674736748367493675036751367523675336754367553675636757367583675936760367613676236763367643676536766367673676836769367703677136772367733677436775367763677736778367793678036781367823678336784367853678636787367883678936790367913679236793367943679536796367973679836799368003680136802368033680436805368063680736808368093681036811368123681336814368153681636817368183681936820368213682236823368243682536826368273682836829368303683136832368333683436835368363683736838368393684036841368423684336844368453684636847368483684936850368513685236853368543685536856368573685836859368603686136862368633686436865368663686736868368693687036871368723687336874368753687636877368783687936880368813688236883368843688536886368873688836889368903689136892368933689436895368963689736898368993690036901369023690336904369053690636907369083690936910369113691236913369143691536916369173691836919369203692136922369233692436925369263692736928369293693036931369323693336934369353693636937369383693936940369413694236943369443694536946369473694836949369503695136952369533695436955369563695736958369593696036961369623696336964369653696636967369683696936970369713697236973369743697536976369773697836979369803698136982369833698436985369863698736988369893699036991369923699336994369953699636997369983699937000370013700237003370043700537006370073700837009370103701137012370133701437015370163701737018370193702037021370223702337024370253702637027370283702937030370313703237033370343703537036370373703837039370403704137042370433704437045370463704737048370493705037051370523705337054370553705637057370583705937060370613706237063370643706537066370673706837069370703707137072370733707437075370763707737078370793708037081370823708337084370853708637087370883708937090370913709237093370943709537096370973709837099371003710137102371033710437105371063710737108371093711037111371123711337114371153711637117371183711937120371213712237123371243712537126371273712837129371303713137132371333713437135371363713737138371393714037141371423714337144371453714637147371483714937150371513715237153371543715537156371573715837159371603716137162371633716437165371663716737168371693717037171371723717337174371753717637177371783717937180371813718237183371843718537186371873718837189371903719137192371933719437195371963719737198371993720037201372023720337204372053720637207372083720937210372113721237213372143721537216372173721837219372203722137222372233722437225372263722737228372293723037231372323723337234372353723637237372383723937240372413724237243372443724537246372473724837249372503725137252372533725437255372563725737258372593726037261372623726337264372653726637267372683726937270372713727237273372743727537276372773727837279372803728137282372833728437285372863728737288372893729037291372923729337294372953729637297372983729937300373013730237303373043730537306373073730837309373103731137312373133731437315373163731737318373193732037321373223732337324373253732637327373283732937330373313733237333373343733537336373373733837339373403734137342373433734437345373463734737348373493735037351373523735337354373553735637357373583735937360373613736237363373643736537366373673736837369373703737137372373733737437375373763737737378373793738037381373823738337384373853738637387373883738937390373913739237393373943739537396373973739837399374003740137402374033740437405374063740737408374093741037411374123741337414374153741637417374183741937420374213742237423374243742537426374273742837429374303743137432374333743437435374363743737438374393744037441374423744337444374453744637447374483744937450374513745237453374543745537456374573745837459374603746137462374633746437465374663746737468374693747037471374723747337474374753747637477374783747937480374813748237483374843748537486374873748837489374903749137492374933749437495374963749737498374993750037501375023750337504375053750637507375083750937510375113751237513375143751537516375173751837519375203752137522375233752437525375263752737528375293753037531375323753337534375353753637537375383753937540375413754237543375443754537546375473754837549375503755137552375533755437555375563755737558375593756037561375623756337564375653756637567375683756937570375713757237573375743757537576375773757837579375803758137582375833758437585375863758737588375893759037591375923759337594375953759637597375983759937600376013760237603376043760537606376073760837609376103761137612376133761437615376163761737618376193762037621376223762337624376253762637627376283762937630376313763237633376343763537636376373763837639376403764137642376433764437645376463764737648376493765037651376523765337654376553765637657376583765937660376613766237663376643766537666376673766837669376703767137672376733767437675376763767737678376793768037681376823768337684376853768637687376883768937690376913769237693376943769537696376973769837699377003770137702377033770437705377063770737708377093771037711377123771337714377153771637717377183771937720377213772237723377243772537726377273772837729377303773137732377333773437735377363773737738377393774037741377423774337744377453774637747377483774937750377513775237753377543775537756377573775837759377603776137762377633776437765377663776737768377693777037771377723777337774377753777637777377783777937780377813778237783377843778537786377873778837789377903779137792377933779437795377963779737798377993780037801378023780337804378053780637807378083780937810378113781237813378143781537816378173781837819378203782137822378233782437825378263782737828378293783037831378323783337834378353783637837378383783937840378413784237843378443784537846378473784837849378503785137852378533785437855378563785737858378593786037861378623786337864378653786637867378683786937870378713787237873378743787537876378773787837879378803788137882378833788437885378863788737888378893789037891378923789337894378953789637897378983789937900379013790237903379043790537906379073790837909379103791137912379133791437915379163791737918379193792037921379223792337924379253792637927379283792937930379313793237933379343793537936379373793837939379403794137942379433794437945379463794737948379493795037951379523795337954379553795637957379583795937960379613796237963379643796537966379673796837969379703797137972379733797437975379763797737978379793798037981379823798337984379853798637987379883798937990379913799237993379943799537996379973799837999380003800138002380033800438005380063800738008380093801038011380123801338014380153801638017380183801938020380213802238023380243802538026380273802838029380303803138032380333803438035380363803738038380393804038041380423804338044380453804638047380483804938050380513805238053380543805538056380573805838059380603806138062380633806438065380663806738068380693807038071380723807338074380753807638077380783807938080380813808238083380843808538086380873808838089380903809138092380933809438095380963809738098380993810038101381023810338104381053810638107381083810938110381113811238113381143811538116381173811838119381203812138122381233812438125381263812738128381293813038131381323813338134381353813638137381383813938140381413814238143381443814538146381473814838149381503815138152381533815438155381563815738158381593816038161381623816338164381653816638167381683816938170381713817238173381743817538176381773817838179381803818138182381833818438185381863818738188381893819038191381923819338194381953819638197381983819938200382013820238203382043820538206382073820838209382103821138212382133821438215382163821738218382193822038221382223822338224382253822638227382283822938230382313823238233382343823538236382373823838239382403824138242382433824438245382463824738248382493825038251382523825338254382553825638257382583825938260382613826238263382643826538266382673826838269382703827138272382733827438275382763827738278382793828038281382823828338284382853828638287382883828938290382913829238293382943829538296382973829838299383003830138302383033830438305383063830738308383093831038311383123831338314383153831638317383183831938320383213832238323383243832538326383273832838329383303833138332383333833438335383363833738338383393834038341383423834338344383453834638347383483834938350383513835238353383543835538356383573835838359383603836138362383633836438365383663836738368383693837038371383723837338374383753837638377383783837938380383813838238383383843838538386383873838838389383903839138392383933839438395383963839738398383993840038401384023840338404384053840638407384083840938410384113841238413384143841538416384173841838419384203842138422384233842438425384263842738428384293843038431384323843338434384353843638437384383843938440384413844238443384443844538446384473844838449384503845138452384533845438455384563845738458384593846038461384623846338464384653846638467384683846938470384713847238473384743847538476384773847838479384803848138482384833848438485384863848738488384893849038491384923849338494384953849638497384983849938500385013850238503385043850538506385073850838509385103851138512385133851438515385163851738518385193852038521385223852338524385253852638527385283852938530385313853238533385343853538536385373853838539385403854138542385433854438545385463854738548385493855038551385523855338554385553855638557385583855938560385613856238563385643856538566385673856838569385703857138572385733857438575385763857738578385793858038581385823858338584385853858638587385883858938590385913859238593385943859538596385973859838599386003860138602386033860438605386063860738608386093861038611386123861338614386153861638617386183861938620386213862238623386243862538626386273862838629386303863138632386333863438635386363863738638386393864038641386423864338644386453864638647386483864938650386513865238653386543865538656386573865838659386603866138662386633866438665386663866738668386693867038671386723867338674386753867638677386783867938680386813868238683386843868538686386873868838689386903869138692386933869438695386963869738698386993870038701387023870338704387053870638707387083870938710387113871238713387143871538716387173871838719387203872138722387233872438725387263872738728387293873038731387323873338734387353873638737387383873938740387413874238743387443874538746387473874838749387503875138752387533875438755387563875738758387593876038761387623876338764387653876638767387683876938770387713877238773387743877538776387773877838779387803878138782387833878438785387863878738788387893879038791387923879338794387953879638797387983879938800388013880238803388043880538806388073880838809388103881138812388133881438815388163881738818388193882038821388223882338824388253882638827388283882938830388313883238833388343883538836388373883838839388403884138842388433884438845388463884738848388493885038851388523885338854388553885638857388583885938860388613886238863388643886538866388673886838869388703887138872388733887438875388763887738878388793888038881388823888338884388853888638887388883888938890388913889238893388943889538896388973889838899389003890138902389033890438905389063890738908389093891038911389123891338914389153891638917389183891938920389213892238923389243892538926389273892838929389303893138932389333893438935389363893738938389393894038941389423894338944389453894638947389483894938950389513895238953389543895538956389573895838959389603896138962389633896438965389663896738968389693897038971389723897338974389753897638977389783897938980389813898238983389843898538986389873898838989389903899138992389933899438995389963899738998389993900039001390023900339004390053900639007390083900939010390113901239013390143901539016390173901839019390203902139022390233902439025390263902739028390293903039031390323903339034390353903639037390383903939040390413904239043390443904539046390473904839049390503905139052390533905439055390563905739058390593906039061390623906339064390653906639067390683906939070390713907239073390743907539076390773907839079390803908139082390833908439085390863908739088390893909039091390923909339094390953909639097390983909939100391013910239103391043910539106391073910839109391103911139112391133911439115391163911739118391193912039121391223912339124391253912639127391283912939130391313913239133391343913539136391373913839139391403914139142391433914439145391463914739148391493915039151391523915339154391553915639157391583915939160391613916239163391643916539166391673916839169391703917139172391733917439175391763917739178391793918039181391823918339184391853918639187391883918939190391913919239193391943919539196391973919839199392003920139202392033920439205392063920739208392093921039211392123921339214392153921639217392183921939220392213922239223392243922539226392273922839229392303923139232392333923439235392363923739238392393924039241392423924339244392453924639247392483924939250392513925239253392543925539256392573925839259392603926139262392633926439265392663926739268392693927039271392723927339274392753927639277392783927939280392813928239283392843928539286392873928839289392903929139292392933929439295392963929739298392993930039301393023930339304393053930639307393083930939310393113931239313393143931539316393173931839319393203932139322393233932439325393263932739328393293933039331393323933339334393353933639337393383933939340393413934239343393443934539346393473934839349393503935139352393533935439355393563935739358393593936039361393623936339364393653936639367393683936939370393713937239373393743937539376393773937839379393803938139382393833938439385393863938739388393893939039391393923939339394393953939639397393983939939400394013940239403394043940539406394073940839409394103941139412394133941439415394163941739418394193942039421394223942339424394253942639427394283942939430394313943239433394343943539436394373943839439394403944139442394433944439445394463944739448394493945039451394523945339454394553945639457394583945939460394613946239463394643946539466394673946839469394703947139472394733947439475394763947739478394793948039481394823948339484394853948639487394883948939490394913949239493394943949539496394973949839499395003950139502395033950439505395063950739508395093951039511395123951339514395153951639517395183951939520395213952239523395243952539526395273952839529395303953139532395333953439535395363953739538395393954039541395423954339544395453954639547395483954939550395513955239553395543955539556395573955839559395603956139562395633956439565395663956739568395693957039571395723957339574395753957639577395783957939580395813958239583395843958539586395873958839589395903959139592395933959439595395963959739598395993960039601396023960339604396053960639607396083960939610396113961239613396143961539616396173961839619396203962139622396233962439625396263962739628396293963039631396323963339634396353963639637396383963939640396413964239643396443964539646396473964839649396503965139652396533965439655396563965739658396593966039661396623966339664396653966639667396683966939670396713967239673396743967539676396773967839679396803968139682396833968439685396863968739688396893969039691396923969339694396953969639697396983969939700397013970239703397043970539706397073970839709397103971139712397133971439715397163971739718397193972039721397223972339724397253972639727397283972939730397313973239733397343973539736397373973839739397403974139742397433974439745397463974739748397493975039751397523975339754397553975639757397583975939760397613976239763397643976539766397673976839769397703977139772397733977439775397763977739778397793978039781397823978339784397853978639787397883978939790397913979239793397943979539796397973979839799398003980139802398033980439805398063980739808398093981039811398123981339814398153981639817398183981939820398213982239823398243982539826398273982839829398303983139832398333983439835398363983739838398393984039841398423984339844398453984639847398483984939850398513985239853398543985539856398573985839859398603986139862398633986439865398663986739868398693987039871398723987339874398753987639877398783987939880398813988239883398843988539886398873988839889398903989139892398933989439895398963989739898398993990039901399023990339904399053990639907399083990939910399113991239913399143991539916399173991839919399203992139922399233992439925399263992739928399293993039931399323993339934399353993639937399383993939940399413994239943399443994539946399473994839949399503995139952399533995439955399563995739958399593996039961399623996339964399653996639967399683996939970399713997239973399743997539976399773997839979399803998139982399833998439985399863998739988399893999039991399923999339994399953999639997399983999940000400014000240003400044000540006400074000840009400104001140012400134001440015400164001740018400194002040021400224002340024400254002640027400284002940030400314003240033400344003540036400374003840039400404004140042400434004440045400464004740048400494005040051400524005340054400554005640057400584005940060400614006240063400644006540066400674006840069400704007140072400734007440075400764007740078400794008040081400824008340084400854008640087400884008940090400914009240093400944009540096400974009840099401004010140102401034010440105401064010740108401094011040111401124011340114401154011640117401184011940120401214012240123401244012540126401274012840129401304013140132401334013440135401364013740138401394014040141401424014340144401454014640147401484014940150401514015240153401544015540156401574015840159401604016140162401634016440165401664016740168401694017040171401724017340174401754017640177401784017940180401814018240183401844018540186401874018840189401904019140192401934019440195401964019740198401994020040201402024020340204402054020640207402084020940210402114021240213402144021540216402174021840219402204022140222402234022440225402264022740228402294023040231402324023340234402354023640237402384023940240402414024240243402444024540246402474024840249402504025140252402534025440255402564025740258402594026040261402624026340264402654026640267402684026940270402714027240273402744027540276402774027840279402804028140282402834028440285402864028740288402894029040291402924029340294402954029640297402984029940300403014030240303403044030540306403074030840309403104031140312403134031440315403164031740318403194032040321403224032340324403254032640327403284032940330403314033240333403344033540336403374033840339403404034140342403434034440345403464034740348403494035040351403524035340354403554035640357403584035940360403614036240363403644036540366403674036840369403704037140372403734037440375403764037740378403794038040381403824038340384403854038640387403884038940390403914039240393403944039540396403974039840399404004040140402404034040440405404064040740408404094041040411404124041340414404154041640417404184041940420404214042240423404244042540426404274042840429404304043140432404334043440435404364043740438404394044040441404424044340444404454044640447404484044940450404514045240453404544045540456404574045840459404604046140462404634046440465404664046740468404694047040471404724047340474404754047640477404784047940480404814048240483404844048540486404874048840489404904049140492404934049440495404964049740498404994050040501405024050340504405054050640507405084050940510405114051240513405144051540516405174051840519405204052140522405234052440525405264052740528405294053040531405324053340534405354053640537405384053940540405414054240543405444054540546405474054840549405504055140552405534055440555405564055740558405594056040561405624056340564405654056640567405684056940570405714057240573405744057540576405774057840579405804058140582405834058440585405864058740588405894059040591405924059340594405954059640597405984059940600406014060240603406044060540606406074060840609406104061140612406134061440615406164061740618406194062040621406224062340624406254062640627406284062940630406314063240633406344063540636406374063840639406404064140642406434064440645406464064740648406494065040651406524065340654406554065640657406584065940660406614066240663406644066540666406674066840669406704067140672406734067440675406764067740678406794068040681406824068340684406854068640687406884068940690406914069240693406944069540696406974069840699407004070140702407034070440705407064070740708407094071040711407124071340714407154071640717407184071940720407214072240723407244072540726407274072840729407304073140732407334073440735407364073740738407394074040741407424074340744407454074640747407484074940750407514075240753407544075540756407574075840759407604076140762407634076440765407664076740768407694077040771407724077340774407754077640777407784077940780407814078240783407844078540786407874078840789407904079140792407934079440795407964079740798407994080040801408024080340804408054080640807408084080940810408114081240813408144081540816408174081840819408204082140822408234082440825408264082740828408294083040831408324083340834408354083640837408384083940840408414084240843408444084540846408474084840849408504085140852408534085440855408564085740858408594086040861408624086340864408654086640867408684086940870408714087240873408744087540876408774087840879408804088140882408834088440885408864088740888408894089040891408924089340894408954089640897408984089940900409014090240903409044090540906409074090840909409104091140912409134091440915409164091740918409194092040921409224092340924409254092640927409284092940930409314093240933409344093540936409374093840939409404094140942409434094440945409464094740948409494095040951409524095340954409554095640957409584095940960409614096240963409644096540966409674096840969409704097140972409734097440975409764097740978409794098040981409824098340984409854098640987409884098940990409914099240993409944099540996409974099840999410004100141002410034100441005410064100741008410094101041011410124101341014410154101641017410184101941020410214102241023410244102541026410274102841029410304103141032410334103441035410364103741038410394104041041410424104341044410454104641047410484104941050410514105241053410544105541056410574105841059410604106141062410634106441065410664106741068410694107041071410724107341074410754107641077410784107941080410814108241083410844108541086410874108841089410904109141092410934109441095410964109741098410994110041101411024110341104411054110641107411084110941110411114111241113411144111541116411174111841119411204112141122411234112441125411264112741128411294113041131411324113341134411354113641137411384113941140411414114241143411444114541146411474114841149411504115141152411534115441155411564115741158411594116041161411624116341164411654116641167411684116941170411714117241173411744117541176411774117841179411804118141182411834118441185411864118741188411894119041191411924119341194411954119641197411984119941200412014120241203412044120541206412074120841209412104121141212412134121441215412164121741218412194122041221412224122341224412254122641227412284122941230412314123241233412344123541236412374123841239412404124141242412434124441245412464124741248412494125041251412524125341254412554125641257412584125941260412614126241263412644126541266412674126841269412704127141272412734127441275412764127741278412794128041281412824128341284412854128641287412884128941290412914129241293412944129541296412974129841299413004130141302413034130441305413064130741308413094131041311413124131341314413154131641317413184131941320413214132241323413244132541326413274132841329413304133141332413334133441335413364133741338413394134041341413424134341344413454134641347413484134941350413514135241353413544135541356413574135841359413604136141362413634136441365413664136741368413694137041371413724137341374413754137641377413784137941380413814138241383413844138541386413874138841389413904139141392413934139441395413964139741398413994140041401414024140341404414054140641407414084140941410414114141241413414144141541416414174141841419414204142141422414234142441425414264142741428414294143041431414324143341434414354143641437414384143941440414414144241443414444144541446414474144841449414504145141452414534145441455414564145741458414594146041461414624146341464414654146641467414684146941470414714147241473414744147541476414774147841479414804148141482414834148441485414864148741488414894149041491414924149341494414954149641497414984149941500415014150241503415044150541506415074150841509415104151141512415134151441515415164151741518415194152041521415224152341524415254152641527415284152941530415314153241533415344153541536415374153841539415404154141542415434154441545415464154741548415494155041551415524155341554415554155641557415584155941560415614156241563415644156541566415674156841569415704157141572415734157441575415764157741578415794158041581415824158341584415854158641587415884158941590415914159241593415944159541596415974159841599416004160141602416034160441605416064160741608416094161041611416124161341614416154161641617416184161941620416214162241623416244162541626416274162841629416304163141632416334163441635416364163741638416394164041641416424164341644416454164641647416484164941650416514165241653416544165541656416574165841659416604166141662416634166441665416664166741668416694167041671416724167341674416754167641677416784167941680416814168241683416844168541686416874168841689416904169141692416934169441695416964169741698416994170041701417024170341704417054170641707417084170941710417114171241713417144171541716417174171841719417204172141722417234172441725417264172741728417294173041731417324173341734417354173641737417384173941740417414174241743417444174541746417474174841749417504175141752417534175441755417564175741758417594176041761417624176341764417654176641767417684176941770417714177241773417744177541776417774177841779417804178141782417834178441785417864178741788417894179041791417924179341794417954179641797417984179941800418014180241803418044180541806418074180841809418104181141812418134181441815418164181741818418194182041821418224182341824418254182641827418284182941830418314183241833418344183541836418374183841839418404184141842418434184441845418464184741848418494185041851418524185341854418554185641857418584185941860418614186241863418644186541866418674186841869418704187141872418734187441875418764187741878418794188041881418824188341884418854188641887418884188941890418914189241893418944189541896418974189841899419004190141902419034190441905419064190741908419094191041911419124191341914419154191641917419184191941920419214192241923419244192541926419274192841929419304193141932419334193441935419364193741938419394194041941419424194341944419454194641947419484194941950419514195241953419544195541956419574195841959419604196141962419634196441965419664196741968419694197041971419724197341974419754197641977419784197941980419814198241983419844198541986419874198841989419904199141992419934199441995419964199741998419994200042001420024200342004420054200642007420084200942010420114201242013420144201542016420174201842019420204202142022420234202442025420264202742028420294203042031420324203342034420354203642037420384203942040420414204242043420444204542046420474204842049420504205142052420534205442055420564205742058420594206042061420624206342064420654206642067420684206942070420714207242073420744207542076420774207842079420804208142082420834208442085420864208742088420894209042091420924209342094420954209642097420984209942100421014210242103421044210542106421074210842109421104211142112421134211442115421164211742118421194212042121421224212342124421254212642127421284212942130421314213242133421344213542136421374213842139421404214142142421434214442145421464214742148421494215042151421524215342154421554215642157421584215942160421614216242163421644216542166421674216842169421704217142172421734217442175421764217742178421794218042181421824218342184421854218642187421884218942190421914219242193421944219542196421974219842199422004220142202422034220442205422064220742208422094221042211422124221342214422154221642217422184221942220422214222242223422244222542226422274222842229422304223142232422334223442235422364223742238422394224042241422424224342244422454224642247422484224942250422514225242253422544225542256422574225842259422604226142262422634226442265422664226742268422694227042271422724227342274422754227642277422784227942280422814228242283422844228542286422874228842289422904229142292422934229442295422964229742298422994230042301423024230342304423054230642307423084230942310423114231242313423144231542316423174231842319423204232142322423234232442325423264232742328423294233042331423324233342334423354233642337423384233942340423414234242343423444234542346423474234842349423504235142352423534235442355423564235742358423594236042361423624236342364423654236642367423684236942370423714237242373423744237542376423774237842379423804238142382423834238442385423864238742388423894239042391423924239342394423954239642397423984239942400424014240242403424044240542406424074240842409424104241142412424134241442415424164241742418424194242042421424224242342424424254242642427424284242942430424314243242433424344243542436424374243842439424404244142442424434244442445424464244742448424494245042451424524245342454424554245642457424584245942460424614246242463424644246542466424674246842469424704247142472424734247442475424764247742478424794248042481424824248342484424854248642487424884248942490424914249242493424944249542496424974249842499425004250142502425034250442505425064250742508425094251042511425124251342514425154251642517425184251942520425214252242523425244252542526425274252842529425304253142532425334253442535425364253742538425394254042541425424254342544425454254642547425484254942550425514255242553425544255542556425574255842559425604256142562425634256442565425664256742568425694257042571425724257342574425754257642577425784257942580425814258242583425844258542586425874258842589425904259142592425934259442595425964259742598425994260042601426024260342604426054260642607426084260942610426114261242613426144261542616426174261842619426204262142622426234262442625426264262742628426294263042631426324263342634426354263642637426384263942640426414264242643426444264542646426474264842649426504265142652426534265442655426564265742658426594266042661426624266342664426654266642667426684266942670426714267242673426744267542676426774267842679426804268142682426834268442685426864268742688426894269042691426924269342694426954269642697426984269942700427014270242703427044270542706427074270842709427104271142712427134271442715427164271742718427194272042721427224272342724427254272642727427284272942730427314273242733427344273542736427374273842739427404274142742427434274442745427464274742748427494275042751427524275342754427554275642757427584275942760427614276242763427644276542766427674276842769427704277142772427734277442775427764277742778427794278042781427824278342784427854278642787427884278942790427914279242793427944279542796427974279842799428004280142802428034280442805428064280742808428094281042811428124281342814428154281642817428184281942820428214282242823428244282542826428274282842829428304283142832428334283442835428364283742838428394284042841428424284342844428454284642847428484284942850428514285242853428544285542856428574285842859428604286142862428634286442865428664286742868428694287042871428724287342874428754287642877428784287942880428814288242883428844288542886428874288842889428904289142892428934289442895428964289742898428994290042901429024290342904429054290642907429084290942910429114291242913429144291542916429174291842919429204292142922429234292442925429264292742928429294293042931429324293342934429354293642937429384293942940429414294242943429444294542946429474294842949429504295142952429534295442955429564295742958429594296042961429624296342964429654296642967429684296942970429714297242973429744297542976429774297842979429804298142982429834298442985429864298742988429894299042991429924299342994429954299642997429984299943000430014300243003430044300543006430074300843009430104301143012430134301443015430164301743018430194302043021430224302343024430254302643027430284302943030430314303243033430344303543036430374303843039430404304143042430434304443045430464304743048430494305043051430524305343054430554305643057430584305943060430614306243063430644306543066430674306843069430704307143072430734307443075430764307743078430794308043081430824308343084430854308643087430884308943090430914309243093430944309543096430974309843099431004310143102431034310443105431064310743108431094311043111431124311343114431154311643117431184311943120431214312243123431244312543126431274312843129431304313143132431334313443135431364313743138431394314043141431424314343144431454314643147431484314943150431514315243153431544315543156431574315843159431604316143162431634316443165431664316743168431694317043171431724317343174431754317643177431784317943180431814318243183431844318543186431874318843189431904319143192431934319443195431964319743198431994320043201432024320343204432054320643207432084320943210432114321243213432144321543216432174321843219432204322143222432234322443225432264322743228432294323043231432324323343234432354323643237432384323943240432414324243243432444324543246432474324843249432504325143252432534325443255432564325743258432594326043261432624326343264432654326643267432684326943270432714327243273432744327543276432774327843279432804328143282432834328443285432864328743288432894329043291432924329343294432954329643297432984329943300433014330243303433044330543306433074330843309433104331143312433134331443315433164331743318433194332043321433224332343324433254332643327433284332943330433314333243333433344333543336433374333843339433404334143342433434334443345433464334743348433494335043351433524335343354433554335643357433584335943360433614336243363433644336543366433674336843369433704337143372433734337443375433764337743378433794338043381433824338343384433854338643387433884338943390433914339243393433944339543396433974339843399434004340143402434034340443405434064340743408434094341043411434124341343414434154341643417434184341943420434214342243423434244342543426434274342843429434304343143432434334343443435434364343743438434394344043441434424344343444434454344643447434484344943450434514345243453434544345543456434574345843459434604346143462434634346443465434664346743468434694347043471434724347343474434754347643477434784347943480434814348243483434844348543486434874348843489434904349143492434934349443495434964349743498434994350043501435024350343504435054350643507435084350943510435114351243513435144351543516435174351843519435204352143522435234352443525435264352743528435294353043531435324353343534435354353643537435384353943540435414354243543435444354543546435474354843549435504355143552435534355443555435564355743558435594356043561435624356343564435654356643567435684356943570435714357243573435744357543576435774357843579435804358143582435834358443585435864358743588435894359043591435924359343594435954359643597435984359943600436014360243603436044360543606436074360843609436104361143612436134361443615436164361743618436194362043621436224362343624436254362643627436284362943630436314363243633436344363543636436374363843639436404364143642436434364443645436464364743648436494365043651436524365343654436554365643657436584365943660436614366243663436644366543666436674366843669436704367143672436734367443675436764367743678436794368043681436824368343684436854368643687436884368943690436914369243693436944369543696436974369843699437004370143702437034370443705437064370743708437094371043711437124371343714437154371643717437184371943720437214372243723437244372543726437274372843729437304373143732437334373443735437364373743738437394374043741437424374343744437454374643747437484374943750437514375243753437544375543756437574375843759437604376143762437634376443765437664376743768437694377043771437724377343774437754377643777437784377943780437814378243783437844378543786437874378843789437904379143792437934379443795437964379743798437994380043801438024380343804438054380643807438084380943810438114381243813438144381543816438174381843819438204382143822438234382443825438264382743828438294383043831438324383343834438354383643837438384383943840438414384243843438444384543846438474384843849438504385143852438534385443855438564385743858438594386043861438624386343864438654386643867438684386943870438714387243873438744387543876438774387843879438804388143882438834388443885438864388743888438894389043891438924389343894438954389643897438984389943900439014390243903439044390543906439074390843909439104391143912439134391443915439164391743918439194392043921439224392343924439254392643927439284392943930439314393243933439344393543936439374393843939439404394143942439434394443945439464394743948439494395043951439524395343954439554395643957439584395943960439614396243963439644396543966439674396843969439704397143972439734397443975439764397743978439794398043981439824398343984439854398643987439884398943990439914399243993439944399543996439974399843999440004400144002440034400444005440064400744008440094401044011440124401344014440154401644017440184401944020440214402244023440244402544026440274402844029440304403144032440334403444035440364403744038440394404044041440424404344044440454404644047440484404944050440514405244053440544405544056440574405844059440604406144062440634406444065440664406744068440694407044071440724407344074440754407644077440784407944080440814408244083440844408544086440874408844089440904409144092440934409444095440964409744098440994410044101441024410344104441054410644107441084410944110441114411244113441144411544116441174411844119441204412144122441234412444125441264412744128441294413044131441324413344134441354413644137441384413944140441414414244143441444414544146441474414844149441504415144152441534415444155441564415744158441594416044161441624416344164441654416644167441684416944170441714417244173441744417544176441774417844179441804418144182441834418444185441864418744188441894419044191441924419344194441954419644197441984419944200442014420244203442044420544206442074420844209442104421144212442134421444215442164421744218442194422044221442224422344224442254422644227442284422944230442314423244233442344423544236442374423844239442404424144242442434424444245442464424744248442494425044251442524425344254442554425644257442584425944260442614426244263442644426544266442674426844269442704427144272442734427444275442764427744278442794428044281442824428344284442854428644287442884428944290442914429244293442944429544296442974429844299443004430144302443034430444305443064430744308443094431044311443124431344314443154431644317443184431944320443214432244323443244432544326443274432844329443304433144332443334433444335443364433744338443394434044341443424434344344443454434644347443484434944350443514435244353443544435544356443574435844359443604436144362443634436444365443664436744368443694437044371443724437344374443754437644377443784437944380443814438244383443844438544386443874438844389443904439144392443934439444395443964439744398443994440044401444024440344404444054440644407444084440944410444114441244413444144441544416444174441844419444204442144422444234442444425444264442744428444294443044431444324443344434444354443644437444384443944440444414444244443444444444544446444474444844449444504445144452444534445444455444564445744458444594446044461444624446344464444654446644467444684446944470444714447244473444744447544476444774447844479444804448144482444834448444485444864448744488444894449044491444924449344494444954449644497444984449944500445014450244503445044450544506445074450844509445104451144512445134451444515445164451744518445194452044521445224452344524445254452644527445284452944530445314453244533445344453544536445374453844539445404454144542445434454444545445464454744548445494455044551445524455344554445554455644557445584455944560445614456244563445644456544566445674456844569445704457144572445734457444575445764457744578445794458044581445824458344584445854458644587445884458944590445914459244593445944459544596445974459844599446004460144602446034460444605446064460744608446094461044611446124461344614446154461644617446184461944620446214462244623446244462544626446274462844629446304463144632446334463444635446364463744638446394464044641446424464344644446454464644647446484464944650446514465244653446544465544656446574465844659446604466144662446634466444665446664466744668446694467044671446724467344674446754467644677446784467944680446814468244683446844468544686446874468844689446904469144692446934469444695446964469744698446994470044701447024470344704447054470644707447084470944710447114471244713447144471544716447174471844719447204472144722447234472444725447264472744728447294473044731447324473344734447354473644737447384473944740447414474244743447444474544746447474474844749447504475144752447534475444755447564475744758447594476044761447624476344764447654476644767447684476944770447714477244773447744477544776447774477844779447804478144782447834478444785447864478744788447894479044791447924479344794447954479644797447984479944800448014480244803448044480544806448074480844809448104481144812448134481444815448164481744818448194482044821448224482344824448254482644827448284482944830448314483244833448344483544836448374483844839448404484144842448434484444845448464484744848448494485044851448524485344854448554485644857448584485944860448614486244863448644486544866448674486844869448704487144872448734487444875448764487744878448794488044881448824488344884448854488644887448884488944890448914489244893448944489544896448974489844899449004490144902449034490444905449064490744908449094491044911449124491344914449154491644917449184491944920449214492244923449244492544926449274492844929449304493144932449334493444935449364493744938449394494044941449424494344944449454494644947449484494944950449514495244953449544495544956449574495844959449604496144962449634496444965449664496744968449694497044971449724497344974449754497644977449784497944980449814498244983449844498544986449874498844989449904499144992449934499444995449964499744998449994500045001450024500345004450054500645007450084500945010450114501245013450144501545016450174501845019450204502145022450234502445025450264502745028450294503045031450324503345034450354503645037450384503945040450414504245043450444504545046450474504845049450504505145052450534505445055450564505745058450594506045061450624506345064450654506645067450684506945070450714507245073450744507545076450774507845079450804508145082450834508445085450864508745088450894509045091450924509345094450954509645097450984509945100451014510245103451044510545106451074510845109451104511145112451134511445115451164511745118451194512045121451224512345124451254512645127451284512945130451314513245133451344513545136451374513845139451404514145142451434514445145451464514745148451494515045151451524515345154451554515645157451584515945160451614516245163451644516545166451674516845169451704517145172451734517445175451764517745178451794518045181451824518345184451854518645187451884518945190451914519245193451944519545196451974519845199452004520145202452034520445205452064520745208452094521045211452124521345214452154521645217452184521945220452214522245223452244522545226452274522845229452304523145232452334523445235452364523745238452394524045241452424524345244452454524645247452484524945250452514525245253452544525545256452574525845259452604526145262452634526445265452664526745268452694527045271452724527345274452754527645277452784527945280452814528245283452844528545286452874528845289452904529145292452934529445295452964529745298452994530045301453024530345304453054530645307453084530945310453114531245313453144531545316453174531845319453204532145322453234532445325453264532745328453294533045331453324533345334453354533645337453384533945340453414534245343453444534545346453474534845349453504535145352453534535445355453564535745358453594536045361453624536345364453654536645367453684536945370453714537245373453744537545376453774537845379453804538145382453834538445385453864538745388453894539045391453924539345394453954539645397453984539945400454014540245403454044540545406454074540845409454104541145412454134541445415454164541745418454194542045421454224542345424454254542645427454284542945430454314543245433454344543545436454374543845439454404544145442454434544445445454464544745448454494545045451454524545345454454554545645457454584545945460454614546245463454644546545466454674546845469454704547145472454734547445475454764547745478454794548045481454824548345484454854548645487454884548945490454914549245493454944549545496454974549845499455004550145502455034550445505455064550745508455094551045511455124551345514455154551645517455184551945520455214552245523455244552545526455274552845529455304553145532455334553445535455364553745538455394554045541455424554345544455454554645547455484554945550455514555245553455544555545556455574555845559455604556145562455634556445565455664556745568455694557045571455724557345574455754557645577455784557945580455814558245583455844558545586455874558845589455904559145592455934559445595455964559745598455994560045601456024560345604456054560645607456084560945610456114561245613456144561545616456174561845619456204562145622456234562445625456264562745628456294563045631456324563345634456354563645637456384563945640456414564245643456444564545646456474564845649456504565145652456534565445655456564565745658456594566045661456624566345664456654566645667456684566945670456714567245673456744567545676456774567845679456804568145682456834568445685456864568745688456894569045691456924569345694456954569645697456984569945700457014570245703457044570545706457074570845709457104571145712457134571445715457164571745718457194572045721457224572345724457254572645727457284572945730457314573245733457344573545736457374573845739457404574145742457434574445745457464574745748457494575045751457524575345754457554575645757457584575945760457614576245763457644576545766457674576845769457704577145772457734577445775457764577745778457794578045781457824578345784457854578645787457884578945790457914579245793457944579545796457974579845799458004580145802458034580445805458064580745808458094581045811458124581345814458154581645817458184581945820458214582245823458244582545826458274582845829458304583145832458334583445835458364583745838458394584045841458424584345844458454584645847458484584945850458514585245853458544585545856458574585845859458604586145862458634586445865458664586745868458694587045871458724587345874458754587645877458784587945880458814588245883458844588545886458874588845889458904589145892458934589445895458964589745898458994590045901459024590345904459054590645907459084590945910459114591245913459144591545916459174591845919459204592145922459234592445925459264592745928459294593045931459324593345934459354593645937459384593945940459414594245943459444594545946459474594845949459504595145952459534595445955459564595745958459594596045961459624596345964459654596645967459684596945970459714597245973459744597545976459774597845979459804598145982459834598445985459864598745988459894599045991459924599345994459954599645997459984599946000460014600246003460044600546006460074600846009460104601146012460134601446015460164601746018460194602046021460224602346024460254602646027460284602946030460314603246033460344603546036460374603846039460404604146042460434604446045460464604746048460494605046051460524605346054460554605646057460584605946060460614606246063460644606546066460674606846069460704607146072460734607446075460764607746078460794608046081460824608346084460854608646087460884608946090460914609246093460944609546096460974609846099461004610146102461034610446105461064610746108461094611046111461124611346114461154611646117461184611946120461214612246123461244612546126461274612846129461304613146132461334613446135461364613746138461394614046141461424614346144461454614646147461484614946150461514615246153461544615546156461574615846159461604616146162461634616446165461664616746168461694617046171461724617346174461754617646177461784617946180461814618246183461844618546186461874618846189461904619146192461934619446195461964619746198461994620046201462024620346204462054620646207462084620946210462114621246213462144621546216462174621846219462204622146222462234622446225462264622746228462294623046231462324623346234462354623646237462384623946240462414624246243462444624546246462474624846249462504625146252462534625446255462564625746258462594626046261462624626346264462654626646267462684626946270462714627246273462744627546276462774627846279462804628146282462834628446285462864628746288462894629046291462924629346294462954629646297462984629946300463014630246303463044630546306463074630846309463104631146312463134631446315463164631746318463194632046321463224632346324463254632646327463284632946330463314633246333463344633546336463374633846339463404634146342463434634446345463464634746348463494635046351463524635346354463554635646357463584635946360463614636246363463644636546366463674636846369463704637146372463734637446375463764637746378463794638046381463824638346384463854638646387463884638946390463914639246393463944639546396463974639846399464004640146402464034640446405464064640746408464094641046411464124641346414464154641646417464184641946420464214642246423464244642546426464274642846429464304643146432464334643446435464364643746438464394644046441464424644346444464454644646447464484644946450464514645246453464544645546456464574645846459464604646146462464634646446465464664646746468464694647046471464724647346474464754647646477464784647946480464814648246483464844648546486464874648846489464904649146492464934649446495464964649746498464994650046501465024650346504465054650646507465084650946510465114651246513465144651546516465174651846519465204652146522465234652446525465264652746528465294653046531465324653346534465354653646537465384653946540465414654246543465444654546546465474654846549465504655146552465534655446555465564655746558465594656046561465624656346564465654656646567465684656946570465714657246573465744657546576465774657846579465804658146582465834658446585465864658746588465894659046591465924659346594465954659646597465984659946600466014660246603466044660546606466074660846609466104661146612466134661446615466164661746618466194662046621466224662346624466254662646627466284662946630466314663246633466344663546636466374663846639466404664146642466434664446645466464664746648466494665046651466524665346654466554665646657466584665946660466614666246663466644666546666466674666846669466704667146672466734667446675466764667746678466794668046681466824668346684466854668646687466884668946690466914669246693466944669546696466974669846699467004670146702467034670446705467064670746708467094671046711467124671346714467154671646717467184671946720467214672246723467244672546726467274672846729467304673146732467334673446735467364673746738467394674046741467424674346744467454674646747467484674946750467514675246753467544675546756467574675846759467604676146762467634676446765467664676746768467694677046771467724677346774467754677646777467784677946780467814678246783467844678546786467874678846789467904679146792467934679446795467964679746798467994680046801468024680346804468054680646807468084680946810468114681246813468144681546816468174681846819468204682146822468234682446825468264682746828468294683046831468324683346834468354683646837468384683946840468414684246843468444684546846468474684846849468504685146852468534685446855468564685746858468594686046861468624686346864468654686646867468684686946870468714687246873468744687546876468774687846879468804688146882468834688446885468864688746888468894689046891468924689346894468954689646897468984689946900469014690246903469044690546906469074690846909469104691146912469134691446915469164691746918469194692046921469224692346924469254692646927469284692946930469314693246933469344693546936469374693846939469404694146942469434694446945469464694746948469494695046951469524695346954469554695646957469584695946960469614696246963469644696546966469674696846969469704697146972469734697446975469764697746978469794698046981469824698346984469854698646987469884698946990469914699246993469944699546996469974699846999470004700147002470034700447005470064700747008470094701047011470124701347014470154701647017470184701947020470214702247023470244702547026470274702847029470304703147032470334703447035470364703747038470394704047041470424704347044470454704647047470484704947050470514705247053470544705547056470574705847059470604706147062470634706447065470664706747068470694707047071470724707347074470754707647077470784707947080470814708247083470844708547086470874708847089470904709147092470934709447095470964709747098470994710047101471024710347104471054710647107471084710947110471114711247113471144711547116471174711847119471204712147122471234712447125471264712747128471294713047131471324713347134471354713647137471384713947140471414714247143471444714547146471474714847149471504715147152471534715447155471564715747158471594716047161471624716347164471654716647167471684716947170471714717247173471744717547176471774717847179471804718147182471834718447185471864718747188471894719047191471924719347194471954719647197471984719947200472014720247203472044720547206472074720847209472104721147212472134721447215472164721747218472194722047221472224722347224472254722647227472284722947230472314723247233472344723547236472374723847239472404724147242472434724447245472464724747248472494725047251472524725347254472554725647257472584725947260472614726247263472644726547266472674726847269472704727147272472734727447275472764727747278472794728047281472824728347284472854728647287472884728947290472914729247293472944729547296472974729847299473004730147302473034730447305473064730747308473094731047311473124731347314473154731647317473184731947320473214732247323473244732547326473274732847329473304733147332473334733447335473364733747338473394734047341473424734347344473454734647347473484734947350473514735247353473544735547356473574735847359473604736147362473634736447365473664736747368473694737047371473724737347374473754737647377473784737947380473814738247383473844738547386473874738847389473904739147392473934739447395473964739747398473994740047401474024740347404474054740647407474084740947410474114741247413474144741547416474174741847419474204742147422474234742447425474264742747428474294743047431474324743347434474354743647437474384743947440474414744247443474444744547446474474744847449474504745147452474534745447455474564745747458474594746047461474624746347464474654746647467474684746947470474714747247473474744747547476474774747847479474804748147482474834748447485474864748747488474894749047491474924749347494474954749647497474984749947500475014750247503475044750547506475074750847509475104751147512475134751447515475164751747518475194752047521475224752347524475254752647527475284752947530475314753247533475344753547536475374753847539475404754147542475434754447545475464754747548475494755047551475524755347554475554755647557475584755947560475614756247563475644756547566475674756847569475704757147572475734757447575475764757747578475794758047581475824758347584475854758647587475884758947590475914759247593475944759547596475974759847599476004760147602476034760447605476064760747608476094761047611476124761347614476154761647617476184761947620476214762247623476244762547626476274762847629476304763147632476334763447635476364763747638476394764047641476424764347644476454764647647476484764947650476514765247653476544765547656476574765847659476604766147662476634766447665476664766747668476694767047671476724767347674476754767647677476784767947680476814768247683476844768547686476874768847689476904769147692476934769447695476964769747698476994770047701477024770347704477054770647707477084770947710477114771247713477144771547716477174771847719477204772147722477234772447725477264772747728477294773047731477324773347734477354773647737477384773947740477414774247743477444774547746477474774847749477504775147752477534775447755477564775747758477594776047761477624776347764477654776647767477684776947770477714777247773477744777547776477774777847779477804778147782477834778447785477864778747788477894779047791477924779347794477954779647797477984779947800478014780247803478044780547806478074780847809478104781147812478134781447815478164781747818478194782047821478224782347824478254782647827478284782947830478314783247833478344783547836478374783847839478404784147842478434784447845478464784747848478494785047851478524785347854478554785647857478584785947860478614786247863478644786547866478674786847869478704787147872478734787447875478764787747878478794788047881478824788347884478854788647887478884788947890478914789247893478944789547896478974789847899479004790147902479034790447905479064790747908479094791047911479124791347914479154791647917479184791947920479214792247923479244792547926479274792847929479304793147932479334793447935479364793747938479394794047941479424794347944479454794647947479484794947950479514795247953479544795547956479574795847959479604796147962479634796447965479664796747968479694797047971479724797347974479754797647977479784797947980479814798247983479844798547986479874798847989479904799147992479934799447995479964799747998479994800048001480024800348004480054800648007480084800948010480114801248013480144801548016480174801848019480204802148022480234802448025480264802748028480294803048031480324803348034480354803648037480384803948040480414804248043480444804548046480474804848049480504805148052480534805448055480564805748058480594806048061480624806348064480654806648067480684806948070480714807248073480744807548076480774807848079480804808148082480834808448085480864808748088480894809048091480924809348094480954809648097480984809948100481014810248103481044810548106481074810848109481104811148112481134811448115481164811748118481194812048121481224812348124481254812648127481284812948130481314813248133481344813548136481374813848139481404814148142481434814448145481464814748148481494815048151481524815348154481554815648157481584815948160481614816248163481644816548166481674816848169481704817148172481734817448175481764817748178481794818048181481824818348184481854818648187481884818948190481914819248193481944819548196481974819848199482004820148202482034820448205482064820748208482094821048211482124821348214482154821648217482184821948220482214822248223482244822548226482274822848229482304823148232482334823448235482364823748238482394824048241482424824348244482454824648247482484824948250482514825248253482544825548256482574825848259482604826148262482634826448265482664826748268482694827048271482724827348274482754827648277482784827948280482814828248283482844828548286482874828848289482904829148292482934829448295482964829748298482994830048301483024830348304483054830648307483084830948310483114831248313483144831548316483174831848319483204832148322483234832448325483264832748328483294833048331483324833348334483354833648337483384833948340483414834248343483444834548346483474834848349483504835148352483534835448355483564835748358483594836048361483624836348364483654836648367483684836948370483714837248373483744837548376483774837848379483804838148382483834838448385483864838748388483894839048391483924839348394483954839648397483984839948400484014840248403484044840548406484074840848409484104841148412484134841448415484164841748418484194842048421484224842348424484254842648427484284842948430484314843248433484344843548436484374843848439484404844148442484434844448445484464844748448484494845048451484524845348454484554845648457484584845948460484614846248463484644846548466484674846848469484704847148472484734847448475484764847748478484794848048481484824848348484484854848648487484884848948490484914849248493484944849548496484974849848499485004850148502485034850448505485064850748508485094851048511485124851348514485154851648517485184851948520485214852248523485244852548526485274852848529485304853148532485334853448535485364853748538485394854048541485424854348544485454854648547485484854948550485514855248553485544855548556485574855848559485604856148562485634856448565485664856748568485694857048571485724857348574485754857648577485784857948580485814858248583485844858548586485874858848589485904859148592485934859448595485964859748598485994860048601486024860348604486054860648607486084860948610486114861248613486144861548616486174861848619486204862148622486234862448625486264862748628486294863048631486324863348634486354863648637486384863948640486414864248643486444864548646486474864848649486504865148652486534865448655486564865748658486594866048661486624866348664486654866648667486684866948670486714867248673486744867548676486774867848679486804868148682486834868448685486864868748688486894869048691486924869348694486954869648697486984869948700487014870248703487044870548706487074870848709487104871148712487134871448715487164871748718487194872048721487224872348724487254872648727487284872948730487314873248733487344873548736487374873848739487404874148742487434874448745487464874748748487494875048751487524875348754487554875648757487584875948760487614876248763487644876548766487674876848769487704877148772487734877448775487764877748778487794878048781487824878348784487854878648787487884878948790487914879248793487944879548796487974879848799488004880148802488034880448805488064880748808488094881048811488124881348814488154881648817488184881948820488214882248823488244882548826488274882848829488304883148832488334883448835488364883748838488394884048841488424884348844488454884648847488484884948850488514885248853488544885548856488574885848859488604886148862488634886448865488664886748868488694887048871488724887348874488754887648877488784887948880488814888248883488844888548886488874888848889488904889148892488934889448895488964889748898488994890048901489024890348904489054890648907489084890948910489114891248913489144891548916489174891848919489204892148922489234892448925489264892748928489294893048931489324893348934489354893648937489384893948940489414894248943489444894548946489474894848949489504895148952489534895448955489564895748958489594896048961489624896348964489654896648967489684896948970489714897248973489744897548976489774897848979489804898148982489834898448985489864898748988489894899048991489924899348994489954899648997489984899949000490014900249003490044900549006490074900849009490104901149012490134901449015490164901749018490194902049021490224902349024490254902649027490284902949030490314903249033490344903549036490374903849039490404904149042490434904449045490464904749048490494905049051490524905349054490554905649057490584905949060490614906249063490644906549066490674906849069490704907149072490734907449075490764907749078490794908049081490824908349084490854908649087490884908949090490914909249093490944909549096490974909849099491004910149102491034910449105491064910749108491094911049111491124911349114491154911649117491184911949120491214912249123491244912549126491274912849129491304913149132491334913449135491364913749138491394914049141491424914349144491454914649147491484914949150491514915249153491544915549156491574915849159491604916149162491634916449165491664916749168491694917049171491724917349174491754917649177491784917949180491814918249183491844918549186491874918849189491904919149192491934919449195491964919749198491994920049201492024920349204492054920649207492084920949210492114921249213492144921549216492174921849219492204922149222492234922449225492264922749228492294923049231492324923349234492354923649237492384923949240492414924249243492444924549246492474924849249492504925149252492534925449255492564925749258492594926049261492624926349264492654926649267492684926949270492714927249273492744927549276492774927849279492804928149282492834928449285492864928749288492894929049291492924929349294492954929649297492984929949300493014930249303493044930549306493074930849309493104931149312493134931449315493164931749318493194932049321493224932349324493254932649327493284932949330493314933249333493344933549336493374933849339493404934149342493434934449345493464934749348493494935049351493524935349354493554935649357493584935949360493614936249363493644936549366493674936849369493704937149372493734937449375493764937749378493794938049381493824938349384493854938649387493884938949390493914939249393493944939549396493974939849399494004940149402494034940449405494064940749408494094941049411494124941349414494154941649417494184941949420494214942249423494244942549426494274942849429494304943149432494334943449435494364943749438494394944049441494424944349444494454944649447494484944949450494514945249453494544945549456494574945849459494604946149462494634946449465494664946749468494694947049471494724947349474494754947649477494784947949480494814948249483494844948549486494874948849489494904949149492494934949449495494964949749498494994950049501495024950349504495054950649507495084950949510495114951249513495144951549516495174951849519495204952149522495234952449525495264952749528495294953049531495324953349534495354953649537495384953949540495414954249543495444954549546495474954849549495504955149552495534955449555495564955749558495594956049561495624956349564495654956649567495684956949570495714957249573495744957549576495774957849579495804958149582495834958449585495864958749588495894959049591495924959349594495954959649597495984959949600496014960249603496044960549606496074960849609496104961149612496134961449615496164961749618496194962049621496224962349624496254962649627496284962949630496314963249633496344963549636496374963849639496404964149642496434964449645496464964749648496494965049651496524965349654496554965649657496584965949660496614966249663496644966549666496674966849669496704967149672496734967449675496764967749678496794968049681496824968349684496854968649687496884968949690496914969249693496944969549696496974969849699497004970149702497034970449705497064970749708497094971049711497124971349714497154971649717497184971949720497214972249723497244972549726497274972849729497304973149732497334973449735497364973749738497394974049741497424974349744497454974649747497484974949750497514975249753497544975549756497574975849759497604976149762497634976449765497664976749768497694977049771497724977349774497754977649777497784977949780497814978249783497844978549786497874978849789497904979149792497934979449795497964979749798497994980049801498024980349804498054980649807498084980949810498114981249813498144981549816498174981849819498204982149822498234982449825498264982749828498294983049831498324983349834498354983649837498384983949840498414984249843498444984549846498474984849849498504985149852498534985449855498564985749858498594986049861498624986349864498654986649867498684986949870498714987249873498744987549876498774987849879498804988149882498834988449885498864988749888498894989049891498924989349894498954989649897498984989949900499014990249903499044990549906499074990849909499104991149912499134991449915499164991749918499194992049921499224992349924499254992649927499284992949930499314993249933499344993549936499374993849939499404994149942499434994449945499464994749948499494995049951499524995349954499554995649957499584995949960499614996249963499644996549966499674996849969499704997149972499734997449975499764997749978499794998049981499824998349984499854998649987499884998949990499914999249993499944999549996499974999849999500005000150002500035000450005500065000750008500095001050011500125001350014500155001650017500185001950020500215002250023500245002550026500275002850029500305003150032500335003450035500365003750038500395004050041500425004350044500455004650047500485004950050500515005250053500545005550056500575005850059500605006150062500635006450065500665006750068500695007050071500725007350074500755007650077500785007950080500815008250083500845008550086500875008850089500905009150092500935009450095500965009750098500995010050101501025010350104501055010650107501085010950110501115011250113501145011550116501175011850119501205012150122501235012450125501265012750128501295013050131501325013350134501355013650137501385013950140501415014250143501445014550146501475014850149501505015150152501535015450155501565015750158501595016050161501625016350164501655016650167501685016950170501715017250173501745017550176501775017850179501805018150182501835018450185501865018750188501895019050191501925019350194501955019650197501985019950200502015020250203502045020550206502075020850209502105021150212502135021450215502165021750218502195022050221502225022350224502255022650227502285022950230502315023250233502345023550236502375023850239502405024150242502435024450245502465024750248502495025050251502525025350254502555025650257502585025950260502615026250263502645026550266502675026850269502705027150272502735027450275502765027750278502795028050281502825028350284502855028650287502885028950290502915029250293502945029550296502975029850299503005030150302503035030450305503065030750308503095031050311503125031350314503155031650317503185031950320503215032250323503245032550326503275032850329503305033150332503335033450335503365033750338503395034050341503425034350344503455034650347503485034950350503515035250353503545035550356503575035850359503605036150362503635036450365503665036750368503695037050371503725037350374503755037650377503785037950380503815038250383503845038550386503875038850389503905039150392503935039450395503965039750398503995040050401504025040350404504055040650407504085040950410504115041250413504145041550416504175041850419504205042150422504235042450425504265042750428504295043050431504325043350434504355043650437504385043950440504415044250443504445044550446504475044850449504505045150452504535045450455504565045750458504595046050461504625046350464504655046650467504685046950470504715047250473504745047550476504775047850479504805048150482504835048450485504865048750488504895049050491504925049350494504955049650497504985049950500505015050250503505045050550506505075050850509505105051150512505135051450515505165051750518505195052050521505225052350524505255052650527505285052950530505315053250533505345053550536505375053850539505405054150542505435054450545505465054750548505495055050551505525055350554505555055650557505585055950560505615056250563505645056550566505675056850569505705057150572505735057450575505765057750578505795058050581505825058350584505855058650587505885058950590505915059250593505945059550596505975059850599506005060150602506035060450605506065060750608506095061050611506125061350614506155061650617506185061950620506215062250623506245062550626506275062850629506305063150632506335063450635506365063750638506395064050641506425064350644506455064650647506485064950650506515065250653506545065550656506575065850659506605066150662506635066450665506665066750668506695067050671506725067350674506755067650677506785067950680506815068250683506845068550686506875068850689506905069150692506935069450695506965069750698506995070050701507025070350704507055070650707507085070950710507115071250713507145071550716507175071850719507205072150722507235072450725507265072750728507295073050731507325073350734507355073650737507385073950740507415074250743507445074550746507475074850749507505075150752507535075450755507565075750758507595076050761507625076350764507655076650767507685076950770507715077250773507745077550776507775077850779507805078150782507835078450785507865078750788507895079050791507925079350794507955079650797507985079950800508015080250803508045080550806508075080850809508105081150812508135081450815508165081750818508195082050821508225082350824508255082650827508285082950830508315083250833508345083550836508375083850839508405084150842508435084450845508465084750848508495085050851508525085350854508555085650857508585085950860508615086250863508645086550866508675086850869508705087150872508735087450875508765087750878508795088050881508825088350884508855088650887508885088950890508915089250893508945089550896508975089850899509005090150902509035090450905509065090750908509095091050911509125091350914509155091650917509185091950920509215092250923509245092550926509275092850929509305093150932509335093450935509365093750938509395094050941509425094350944509455094650947509485094950950509515095250953509545095550956509575095850959509605096150962509635096450965509665096750968509695097050971509725097350974509755097650977509785097950980509815098250983509845098550986509875098850989509905099150992509935099450995509965099750998509995100051001510025100351004510055100651007510085100951010510115101251013510145101551016510175101851019510205102151022510235102451025510265102751028510295103051031510325103351034510355103651037510385103951040510415104251043510445104551046510475104851049510505105151052510535105451055510565105751058510595106051061510625106351064510655106651067510685106951070510715107251073510745107551076510775107851079510805108151082510835108451085510865108751088510895109051091510925109351094510955109651097510985109951100511015110251103511045110551106511075110851109511105111151112511135111451115511165111751118511195112051121511225112351124511255112651127511285112951130511315113251133511345113551136511375113851139511405114151142511435114451145511465114751148511495115051151511525115351154511555115651157511585115951160511615116251163511645116551166511675116851169511705117151172511735117451175511765117751178511795118051181511825118351184511855118651187511885118951190511915119251193511945119551196511975119851199512005120151202512035120451205512065120751208512095121051211512125121351214512155121651217512185121951220512215122251223512245122551226512275122851229512305123151232512335123451235512365123751238512395124051241512425124351244512455124651247512485124951250512515125251253512545125551256512575125851259512605126151262512635126451265512665126751268512695127051271512725127351274512755127651277512785127951280512815128251283512845128551286512875128851289512905129151292512935129451295512965129751298512995130051301513025130351304513055130651307513085130951310513115131251313513145131551316513175131851319513205132151322513235132451325513265132751328513295133051331513325133351334513355133651337513385133951340513415134251343513445134551346513475134851349513505135151352513535135451355513565135751358513595136051361513625136351364513655136651367513685136951370513715137251373513745137551376513775137851379513805138151382513835138451385513865138751388513895139051391513925139351394513955139651397513985139951400514015140251403514045140551406514075140851409514105141151412514135141451415514165141751418514195142051421514225142351424514255142651427514285142951430514315143251433514345143551436514375143851439514405144151442514435144451445514465144751448514495145051451514525145351454514555145651457514585145951460514615146251463514645146551466514675146851469514705147151472514735147451475514765147751478514795148051481514825148351484514855148651487514885148951490514915149251493514945149551496514975149851499515005150151502515035150451505515065150751508515095151051511515125151351514515155151651517515185151951520515215152251523515245152551526515275152851529515305153151532515335153451535515365153751538515395154051541515425154351544515455154651547515485154951550515515155251553515545155551556515575155851559515605156151562515635156451565515665156751568515695157051571515725157351574515755157651577515785157951580515815158251583515845158551586515875158851589515905159151592515935159451595515965159751598515995160051601516025160351604516055160651607516085160951610516115161251613516145161551616516175161851619516205162151622516235162451625516265162751628516295163051631516325163351634516355163651637516385163951640516415164251643516445164551646516475164851649516505165151652516535165451655516565165751658516595166051661516625166351664516655166651667516685166951670516715167251673516745167551676516775167851679516805168151682516835168451685516865168751688516895169051691516925169351694516955169651697516985169951700517015170251703517045170551706517075170851709517105171151712517135171451715517165171751718517195172051721517225172351724517255172651727517285172951730517315173251733517345173551736517375173851739517405174151742517435174451745517465174751748517495175051751517525175351754517555175651757517585175951760517615176251763517645176551766517675176851769517705177151772517735177451775517765177751778517795178051781517825178351784517855178651787517885178951790517915179251793517945179551796517975179851799518005180151802518035180451805518065180751808518095181051811518125181351814518155181651817518185181951820518215182251823518245182551826518275182851829518305183151832518335183451835518365183751838518395184051841518425184351844518455184651847518485184951850518515185251853518545185551856518575185851859518605186151862518635186451865518665186751868518695187051871518725187351874518755187651877518785187951880518815188251883518845188551886518875188851889518905189151892518935189451895518965189751898518995190051901519025190351904519055190651907519085190951910519115191251913519145191551916519175191851919519205192151922519235192451925519265192751928519295193051931519325193351934519355193651937519385193951940519415194251943519445194551946519475194851949519505195151952519535195451955519565195751958519595196051961519625196351964519655196651967519685196951970519715197251973519745197551976519775197851979519805198151982519835198451985519865198751988519895199051991519925199351994519955199651997519985199952000520015200252003520045200552006520075200852009520105201152012520135201452015520165201752018520195202052021520225202352024520255202652027520285202952030520315203252033520345203552036520375203852039520405204152042520435204452045520465204752048520495205052051520525205352054520555205652057520585205952060520615206252063520645206552066520675206852069520705207152072520735207452075520765207752078520795208052081520825208352084520855208652087520885208952090520915209252093520945209552096520975209852099521005210152102521035210452105521065210752108521095211052111521125211352114521155211652117521185211952120521215212252123521245212552126521275212852129521305213152132521335213452135521365213752138521395214052141521425214352144521455214652147521485214952150521515215252153521545215552156521575215852159521605216152162521635216452165521665216752168521695217052171521725217352174521755217652177521785217952180521815218252183521845218552186521875218852189521905219152192521935219452195521965219752198521995220052201522025220352204522055220652207522085220952210522115221252213522145221552216522175221852219522205222152222522235222452225522265222752228522295223052231522325223352234522355223652237522385223952240522415224252243522445224552246522475224852249522505225152252522535225452255522565225752258522595226052261522625226352264522655226652267522685226952270522715227252273522745227552276522775227852279522805228152282522835228452285522865228752288522895229052291522925229352294522955229652297522985229952300523015230252303523045230552306523075230852309523105231152312523135231452315523165231752318523195232052321523225232352324523255232652327523285232952330523315233252333523345233552336523375233852339523405234152342523435234452345523465234752348523495235052351523525235352354523555235652357523585235952360523615236252363523645236552366523675236852369523705237152372523735237452375523765237752378523795238052381523825238352384523855238652387523885238952390523915239252393523945239552396523975239852399524005240152402524035240452405524065240752408524095241052411524125241352414524155241652417524185241952420524215242252423524245242552426524275242852429524305243152432524335243452435524365243752438524395244052441524425244352444524455244652447524485244952450524515245252453524545245552456524575245852459524605246152462524635246452465524665246752468524695247052471524725247352474524755247652477524785247952480524815248252483524845248552486524875248852489524905249152492524935249452495524965249752498524995250052501525025250352504525055250652507525085250952510525115251252513525145251552516525175251852519525205252152522525235252452525525265252752528525295253052531525325253352534525355253652537525385253952540525415254252543525445254552546525475254852549525505255152552525535255452555525565255752558525595256052561525625256352564525655256652567525685256952570525715257252573525745257552576525775257852579525805258152582525835258452585525865258752588525895259052591525925259352594525955259652597525985259952600526015260252603526045260552606526075260852609526105261152612526135261452615526165261752618526195262052621526225262352624526255262652627526285262952630526315263252633526345263552636526375263852639526405264152642526435264452645526465264752648526495265052651526525265352654526555265652657526585265952660526615266252663526645266552666526675266852669526705267152672526735267452675526765267752678526795268052681526825268352684526855268652687526885268952690526915269252693526945269552696526975269852699527005270152702527035270452705527065270752708527095271052711527125271352714527155271652717527185271952720527215272252723527245272552726527275272852729527305273152732527335273452735527365273752738527395274052741527425274352744527455274652747527485274952750527515275252753527545275552756527575275852759527605276152762527635276452765527665276752768527695277052771527725277352774527755277652777527785277952780527815278252783527845278552786527875278852789527905279152792527935279452795527965279752798527995280052801528025280352804528055280652807528085280952810528115281252813528145281552816528175281852819528205282152822528235282452825528265282752828528295283052831528325283352834528355283652837528385283952840528415284252843528445284552846528475284852849528505285152852528535285452855528565285752858528595286052861528625286352864528655286652867528685286952870528715287252873528745287552876528775287852879528805288152882528835288452885528865288752888528895289052891528925289352894528955289652897528985289952900529015290252903529045290552906529075290852909529105291152912529135291452915529165291752918529195292052921529225292352924529255292652927529285292952930529315293252933529345293552936529375293852939529405294152942529435294452945529465294752948529495295052951529525295352954529555295652957529585295952960529615296252963529645296552966529675296852969529705297152972529735297452975529765297752978529795298052981529825298352984529855298652987529885298952990529915299252993529945299552996529975299852999530005300153002530035300453005530065300753008530095301053011530125301353014530155301653017530185301953020530215302253023530245302553026530275302853029530305303153032530335303453035530365303753038530395304053041530425304353044530455304653047530485304953050530515305253053530545305553056530575305853059530605306153062530635306453065530665306753068530695307053071530725307353074530755307653077530785307953080530815308253083530845308553086530875308853089530905309153092530935309453095530965309753098530995310053101531025310353104531055310653107531085310953110531115311253113531145311553116531175311853119531205312153122531235312453125531265312753128531295313053131531325313353134531355313653137531385313953140531415314253143531445314553146531475314853149531505315153152531535315453155531565315753158531595316053161531625316353164531655316653167531685316953170531715317253173531745317553176531775317853179531805318153182531835318453185531865318753188531895319053191531925319353194531955319653197531985319953200532015320253203532045320553206532075320853209532105321153212532135321453215532165321753218532195322053221532225322353224532255322653227532285322953230532315323253233532345323553236532375323853239532405324153242532435324453245532465324753248532495325053251532525325353254532555325653257532585325953260532615326253263532645326553266532675326853269532705327153272532735327453275532765327753278532795328053281532825328353284532855328653287532885328953290532915329253293532945329553296532975329853299533005330153302533035330453305533065330753308533095331053311533125331353314533155331653317533185331953320533215332253323533245332553326533275332853329533305333153332533335333453335533365333753338533395334053341533425334353344533455334653347533485334953350533515335253353533545335553356533575335853359533605336153362533635336453365533665336753368533695337053371533725337353374533755337653377533785337953380533815338253383533845338553386533875338853389533905339153392533935339453395533965339753398533995340053401534025340353404534055340653407534085340953410534115341253413534145341553416534175341853419534205342153422534235342453425534265342753428534295343053431534325343353434534355343653437534385343953440534415344253443534445344553446534475344853449534505345153452534535345453455534565345753458534595346053461534625346353464534655346653467534685346953470534715347253473534745347553476534775347853479534805348153482534835348453485534865348753488534895349053491534925349353494534955349653497534985349953500535015350253503535045350553506535075350853509535105351153512535135351453515535165351753518535195352053521535225352353524535255352653527535285352953530535315353253533535345353553536535375353853539535405354153542535435354453545535465354753548535495355053551535525355353554535555355653557535585355953560535615356253563535645356553566535675356853569535705357153572535735357453575535765357753578535795358053581535825358353584535855358653587535885358953590535915359253593535945359553596535975359853599536005360153602536035360453605536065360753608536095361053611536125361353614536155361653617536185361953620536215362253623536245362553626536275362853629536305363153632536335363453635536365363753638536395364053641536425364353644536455364653647536485364953650536515365253653536545365553656536575365853659536605366153662536635366453665536665366753668536695367053671536725367353674536755367653677536785367953680536815368253683536845368553686536875368853689536905369153692536935369453695536965369753698536995370053701537025370353704537055370653707537085370953710537115371253713537145371553716537175371853719537205372153722537235372453725537265372753728537295373053731537325373353734537355373653737537385373953740537415374253743537445374553746537475374853749537505375153752537535375453755537565375753758537595376053761537625376353764537655376653767537685376953770537715377253773537745377553776537775377853779537805378153782537835378453785537865378753788537895379053791537925379353794537955379653797537985379953800538015380253803538045380553806538075380853809538105381153812538135381453815538165381753818538195382053821538225382353824538255382653827538285382953830538315383253833538345383553836538375383853839538405384153842538435384453845538465384753848538495385053851538525385353854538555385653857538585385953860538615386253863538645386553866538675386853869538705387153872538735387453875538765387753878538795388053881538825388353884538855388653887538885388953890538915389253893538945389553896538975389853899539005390153902539035390453905539065390753908539095391053911539125391353914539155391653917539185391953920539215392253923539245392553926539275392853929539305393153932539335393453935539365393753938539395394053941539425394353944539455394653947539485394953950539515395253953539545395553956539575395853959539605396153962539635396453965539665396753968539695397053971539725397353974539755397653977539785397953980539815398253983539845398553986539875398853989539905399153992539935399453995539965399753998539995400054001540025400354004540055400654007540085400954010540115401254013540145401554016540175401854019540205402154022540235402454025540265402754028540295403054031540325403354034540355403654037540385403954040540415404254043540445404554046540475404854049540505405154052540535405454055540565405754058540595406054061540625406354064540655406654067540685406954070540715407254073540745407554076540775407854079540805408154082540835408454085540865408754088540895409054091540925409354094540955409654097540985409954100541015410254103541045410554106541075410854109541105411154112541135411454115541165411754118541195412054121541225412354124541255412654127541285412954130541315413254133541345413554136541375413854139541405414154142541435414454145541465414754148541495415054151541525415354154541555415654157541585415954160541615416254163541645416554166541675416854169541705417154172541735417454175541765417754178541795418054181541825418354184541855418654187541885418954190541915419254193541945419554196541975419854199542005420154202542035420454205542065420754208542095421054211542125421354214542155421654217542185421954220542215422254223542245422554226542275422854229542305423154232542335423454235542365423754238542395424054241542425424354244542455424654247542485424954250542515425254253542545425554256542575425854259542605426154262542635426454265542665426754268542695427054271542725427354274542755427654277542785427954280542815428254283542845428554286542875428854289542905429154292542935429454295542965429754298542995430054301543025430354304543055430654307543085430954310543115431254313543145431554316543175431854319543205432154322543235432454325543265432754328543295433054331543325433354334543355433654337543385433954340543415434254343543445434554346543475434854349543505435154352543535435454355543565435754358543595436054361543625436354364543655436654367543685436954370543715437254373543745437554376543775437854379543805438154382543835438454385543865438754388543895439054391543925439354394543955439654397543985439954400544015440254403544045440554406544075440854409544105441154412544135441454415544165441754418544195442054421544225442354424544255442654427544285442954430544315443254433544345443554436544375443854439544405444154442544435444454445544465444754448544495445054451544525445354454544555445654457544585445954460544615446254463544645446554466544675446854469544705447154472544735447454475544765447754478544795448054481544825448354484544855448654487544885448954490544915449254493544945449554496544975449854499545005450154502545035450454505545065450754508545095451054511545125451354514545155451654517545185451954520545215452254523545245452554526545275452854529545305453154532545335453454535545365453754538545395454054541545425454354544545455454654547545485454954550545515455254553545545455554556545575455854559545605456154562545635456454565545665456754568545695457054571545725457354574545755457654577545785457954580545815458254583545845458554586545875458854589545905459154592545935459454595545965459754598545995460054601546025460354604546055460654607546085460954610546115461254613546145461554616546175461854619546205462154622546235462454625546265462754628546295463054631546325463354634546355463654637546385463954640546415464254643546445464554646546475464854649546505465154652546535465454655546565465754658546595466054661546625466354664546655466654667546685466954670546715467254673546745467554676546775467854679546805468154682546835468454685546865468754688546895469054691546925469354694546955469654697546985469954700547015470254703547045470554706547075470854709547105471154712547135471454715547165471754718547195472054721547225472354724547255472654727547285472954730547315473254733547345473554736547375473854739547405474154742547435474454745547465474754748547495475054751547525475354754547555475654757547585475954760547615476254763547645476554766547675476854769547705477154772547735477454775547765477754778547795478054781547825478354784547855478654787547885478954790547915479254793547945479554796547975479854799548005480154802548035480454805548065480754808548095481054811548125481354814548155481654817548185481954820548215482254823548245482554826548275482854829548305483154832548335483454835548365483754838548395484054841548425484354844548455484654847548485484954850548515485254853548545485554856548575485854859548605486154862548635486454865548665486754868548695487054871548725487354874548755487654877548785487954880548815488254883548845488554886548875488854889548905489154892548935489454895548965489754898548995490054901549025490354904549055490654907549085490954910549115491254913549145491554916549175491854919549205492154922549235492454925549265492754928549295493054931549325493354934549355493654937549385493954940549415494254943549445494554946549475494854949549505495154952549535495454955549565495754958549595496054961549625496354964549655496654967549685496954970549715497254973549745497554976549775497854979549805498154982549835498454985549865498754988549895499054991549925499354994549955499654997549985499955000550015500255003550045500555006550075500855009550105501155012550135501455015550165501755018550195502055021550225502355024550255502655027550285502955030550315503255033550345503555036550375503855039550405504155042550435504455045550465504755048550495505055051550525505355054550555505655057550585505955060550615506255063550645506555066550675506855069550705507155072550735507455075550765507755078550795508055081550825508355084550855508655087550885508955090550915509255093550945509555096550975509855099551005510155102551035510455105551065510755108551095511055111551125511355114551155511655117551185511955120551215512255123551245512555126551275512855129551305513155132551335513455135551365513755138551395514055141551425514355144551455514655147551485514955150551515515255153551545515555156551575515855159551605516155162551635516455165551665516755168551695517055171551725517355174551755517655177551785517955180551815518255183551845518555186551875518855189551905519155192551935519455195551965519755198551995520055201552025520355204552055520655207552085520955210552115521255213552145521555216552175521855219552205522155222552235522455225552265522755228552295523055231552325523355234552355523655237552385523955240552415524255243552445524555246552475524855249552505525155252552535525455255552565525755258552595526055261552625526355264552655526655267552685526955270552715527255273552745527555276552775527855279552805528155282552835528455285552865528755288552895529055291552925529355294552955529655297552985529955300553015530255303553045530555306553075530855309553105531155312553135531455315553165531755318553195532055321553225532355324553255532655327553285532955330553315533255333553345533555336553375533855339553405534155342553435534455345553465534755348553495535055351553525535355354553555535655357553585535955360553615536255363553645536555366553675536855369553705537155372553735537455375553765537755378553795538055381553825538355384553855538655387553885538955390553915539255393553945539555396553975539855399554005540155402554035540455405554065540755408554095541055411554125541355414554155541655417554185541955420554215542255423554245542555426554275542855429554305543155432554335543455435554365543755438554395544055441554425544355444554455544655447554485544955450554515545255453554545545555456554575545855459554605546155462554635546455465554665546755468554695547055471554725547355474554755547655477554785547955480554815548255483554845548555486554875548855489554905549155492554935549455495554965549755498554995550055501555025550355504555055550655507555085550955510555115551255513555145551555516555175551855519555205552155522555235552455525555265552755528555295553055531555325553355534555355553655537555385553955540555415554255543555445554555546555475554855549555505555155552555535555455555555565555755558555595556055561555625556355564555655556655567555685556955570555715557255573555745557555576555775557855579555805558155582555835558455585555865558755588555895559055591555925559355594555955559655597555985559955600556015560255603556045560555606556075560855609556105561155612556135561455615556165561755618556195562055621556225562355624556255562655627556285562955630556315563255633556345563555636556375563855639556405564155642556435564455645556465564755648556495565055651556525565355654556555565655657556585565955660556615566255663556645566555666556675566855669556705567155672556735567455675556765567755678556795568055681556825568355684556855568655687556885568955690556915569255693556945569555696556975569855699557005570155702557035570455705557065570755708557095571055711557125571355714557155571655717557185571955720557215572255723557245572555726557275572855729557305573155732557335573455735557365573755738557395574055741557425574355744557455574655747557485574955750557515575255753557545575555756557575575855759557605576155762557635576455765557665576755768557695577055771557725577355774557755577655777557785577955780557815578255783557845578555786557875578855789557905579155792557935579455795557965579755798557995580055801558025580355804558055580655807558085580955810558115581255813558145581555816558175581855819558205582155822558235582455825558265582755828558295583055831558325583355834558355583655837558385583955840558415584255843558445584555846558475584855849558505585155852558535585455855558565585755858558595586055861558625586355864558655586655867558685586955870558715587255873558745587555876558775587855879558805588155882558835588455885558865588755888558895589055891558925589355894558955589655897558985589955900559015590255903559045590555906559075590855909559105591155912559135591455915559165591755918559195592055921559225592355924559255592655927559285592955930559315593255933559345593555936559375593855939559405594155942559435594455945559465594755948559495595055951559525595355954559555595655957559585595955960559615596255963559645596555966559675596855969559705597155972559735597455975559765597755978559795598055981559825598355984559855598655987559885598955990559915599255993559945599555996559975599855999560005600156002560035600456005560065600756008560095601056011560125601356014560155601656017560185601956020560215602256023560245602556026560275602856029560305603156032560335603456035560365603756038560395604056041560425604356044560455604656047560485604956050560515605256053560545605556056560575605856059560605606156062560635606456065560665606756068560695607056071560725607356074
  1. window.common = null;
  2. window.MathLight = null;
  3. window.math = null
  4. g_playAudio = null
  5. g_tourAudio = new Audio
  6. g_tourAudio.loop = !1
  7. g_tourAudio.crossOrigin = "anonymous"
  8. g_tourAudio.addEventListener("ended", function() {
  9. var e = document.createEvent("MouseEvent");
  10. e.initEvent("tourAudioEnded", !0, !0),
  11. window.dispatchEvent(e)
  12. })
  13. g_tourAudio.oncanplaythrough = function() {
  14. g_tourAudio.play();
  15. /* if(g_bgAudio && !g_bgAudio.paused){
  16. manage.switchBgmState(false);
  17. g_bgAudio.pauseByTour = true
  18. } */
  19. g_playAudio = g_tourAudio;
  20. }
  21. var dealMap = (map)=>{//使不resize when image is not power of two
  22. map.wrapS = map.wrapT = THREE.ClampToEdgeWrapping;
  23. map.minFilter = THREE.LinearFilter;
  24. map.magFilter = THREE.LinearFilter;
  25. map.generateMipmaps = true;
  26. }
  27. var sortByScore = function(list, request, rank) {
  28. var i = common.filterAll(list, request);
  29. return 0 === i.length ? null : i = i.map(function(e) {
  30. return {
  31. item: e,
  32. score: rank.reduce(function(t, i) {
  33. return t + i(e);
  34. }, 0)
  35. };
  36. }).sort(function(e, t) {
  37. return t.score - e.score;
  38. });
  39. };
  40. var getTransformSid = function(){
  41. var name
  42. if(player.mode == 'panorama'){
  43. name = player.currentPano ? player.currentPano.id : 'outside'
  44. }else{
  45. name = 'outside'
  46. }
  47. return name
  48. }
  49. var convertTool = {
  50. getPos2d : function(point, camera, dom){//获取一个三维坐标对应屏幕中的二维坐标
  51. var camera = camera || player.camera;
  52. var dom = dom || player.domElement;
  53. 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);
  54. var x,y;
  55. x = (pos.x + 1) / 2 * dom.clientWidth;
  56. y = (1 - (pos.y + 1) / 2) * dom.clientHeight;
  57. var inSight = x <= dom.clientWidth && x >= 0 //是否在屏幕中
  58. && y <= dom.clientHeight && y >= 0
  59. return {
  60. pos: new THREE.Vector2(x,y), // 屏幕像素坐标
  61. vector: pos, //(范围 -1 ~ 1)
  62. trueSide : pos.z<1, //trueSide为false时,即使在屏幕范围内可见,也是反方向的另一个不可以被渲染的点 参见Tag.update
  63. inSight : inSight //在屏幕范围内可见
  64. };
  65. },
  66. ifShelter: function(pos3d){//检测某点在视线中是否被mesh遮挡
  67. var ori = player.position
  68. var dir = pos3d.clone().sub(ori).normalize()
  69. var ray = new THREE.Raycaster(ori, dir) //由外向里 因为模型从内侧是可见的所以从外侧
  70. /* if(config.isEdit && publicObjectSet.editor.mainDesign.editing){
  71. var o = ray.intersectObjects(publicObjectSet.editor.mainDesign.wallMeshes);
  72. }else{ */
  73. var o = ray.intersectObjects(player.model.colliders);
  74. //}
  75. var len = pos3d.distanceTo(ori);
  76. if (o && o.length) {
  77. for(var i=0;i<o.length;i++){
  78. if(o[i].distance < len){ return true; }//有遮挡
  79. }
  80. }
  81. },
  82. /*
  83. 拖拽时,获取鼠标在拖拽面上的位置(需要借助另一个intersectPlane面来计算,即和相机方向一样的面,可保证铺满屏幕)
  84. 但是不一定能获取到,比如鼠标射线不朝向拖拽面时,即使获取也会是一个意外的反方向的交点。
  85. */
  86. getPosAtPlane : function(pos, info/* , mouse, camera */){ //pos:与intersectPlane的交点 见笔记
  87. var A = pos;
  88. var player = player;
  89. var mouse = player.mouse;
  90. var O = new THREE.Vector3(mouse.x, mouse.y, -1).unproject(player.camera);
  91. if(info.y != void 0){//地面线的
  92. var y = info.y;
  93. if(player.mode == "floorplan"/* || Math.abs(O.x-pos.x)<0.0001 && Math.abs(O.z-pos.z)<0.0001) */){
  94. //intersectPlane和地面平行,无交点
  95. var x = pos.x, z = pos.z;
  96. }else{
  97. if(y<player.camera.position.y && O.y <= A.y /* || y>player.camera.position.y && O.y >= A.y */)return null; //鼠标射线向上。因为相机一定位于地面以上(地面不会抬高到相机上吧?),所以无交点。
  98. if(O.y == A.y){console.log('一样??');return;}
  99. if(A.y == y){console.log('一样2??');return;}
  100. var r = (O.y-y)/(A.y-y);
  101. var x = (r*A.x-O.x)/(r-1);
  102. var z = (r*A.z-O.z)/(r-1);
  103. }
  104. }else{//垂直的也有越过消失点以后反向变化的情况,但使用时影响不大
  105. var N = info.normalVec;
  106. var P = info.pullPos;
  107. if(N.y != 0 ){console.log('N.y != 0');return;} //仅仅支持垂直于地面的的墙壁,目前都是
  108. if(O.z==A.z){console.log('O.z==A.z?');return;}
  109. if(N.z!=0 && N.x != 0){//直接用这个通用的也可以,支持斜线的墙
  110. //console.log('N.z==0 && N.x == 0?');
  111. var c = ( N.x*(A.x-O.x) + N.y*(A.y-O.y) + N.z*(A.z-O.z));
  112. if(c == 0){console.log("分母为0?? return;");return;}
  113. var t = -((N.x*O.x + N.y*O.y + N.z*O.z) - (P.x*N.x + P.y*N.y + P.z*N.z) ) / c
  114. var x = t * (A.x - O.x) + O.x;
  115. var y = t * (A.y - O.y) + O.y;
  116. var z = t * (A.z - O.z) + O.z;
  117. /*原理: 已知空间直线L:(x-a)/m=(x-b)/n=(z-c)/p和空间平面π:Ax+By+Cz+D=0;
  118. 求直线L与平面π的交点的坐标。
  119. 把直线方程改写成参数形式:设(x-a)/m=(x-b)/n=(z-c)/p=t;
  120. 则x=mt+a;y=nt+b;z=pt+c;代入平面π的方程得:
  121. A(mt+a)+B(nt+b)+C(pt+c)+D=0
  122. 由此解得t=-(Aa+Bb+Cc+D)/(Am+Bn+Cp)
  123. 再代入参数方程即得交点的坐标(x,y,z). */
  124. }else if(N.x ==0 ){ //z与pullPos相等
  125. var z = P.z;
  126. if(O.y == A.y){console.log('一样??');return;}
  127. if(A.y == y){console.log('一样2??');return;}
  128. if(A.z == z){console.log('一样3??');return;}
  129. var r = (O.z-z)/(A.z-z);
  130. var x = (r*A.x-O.x)/(r-1);
  131. var y = (r*A.y-O.y)/(r-1);
  132. }else if(N.z == 0){//x与pullPos相等
  133. var x = P.x;
  134. if(O.y == A.y){console.log('一样??');return;}
  135. if(A.y == y){console.log('一样2??');return;}
  136. if(A.x == x){console.log('一样3??');return;}
  137. var r = (O.x-x)/(A.x-x);
  138. var y = (r*A.y-O.y)/(r-1);
  139. var z = (r*A.z-O.z)/(r-1);
  140. }
  141. }
  142. return new THREE.Vector3(x,y,z);
  143. },
  144. getMouseIntersect : function(camera, meshes, mouse){//获取鼠标和meshes交点
  145. var raycaster = new THREE.Raycaster;
  146. camera.updateMatrixWorld();
  147. var origin = new THREE.Vector3(mouse.x,mouse.y,-1).unproject(camera)
  148. , end = new THREE.Vector3(mouse.x,mouse.y,1).unproject(camera);
  149. var dir = end.sub(origin).normalize()
  150. raycaster.set(origin, dir);
  151. var n = raycaster.intersectObjects(meshes);
  152. if (0 === n.length)
  153. return null;
  154. return n[0];
  155. },
  156. ifIntersectChunks : function(A,B,options={}){//获取某个线段/射线和meshes的交点
  157. var dir = B.clone().sub(A).normalize();
  158. var len = options.InfinityLen ? Infinity : A.distanceTo(B) + (options.extLen||0);
  159. var ray = new THREE.Raycaster(A.clone(), dir, 0, len);
  160. var o = ray.intersectObjects(options.model || player.model.colliders);
  161. if (o && o.length)return o;
  162. if(options.throughWidth){ //允许最小宽度,防止穿过极小的缝隙导致撞墙感
  163. var normal = math.getNormal({points:[{x:A.x, y:A.z},{x:B.x, y:B.z}]});//线段法线
  164. normal.multiplyScalar(options.throughWidth)
  165. var normalVec3 = new THREE.Vector3(normal.x, 0, normal.y);
  166. var A2 = A.clone().add(normalVec3)
  167. ray.set(A2, dir);
  168. var o2 = ray.intersectObjects(options.model || player.model.colliders);
  169. ray.set(A.clone().add(normalVec3.negate()), dir);
  170. if (o2 && o2.length)return o2;
  171. var o3 = ray.intersectObjects(options.model || player.model.colliders);
  172. if (o3 && o3.length)return o3;
  173. }
  174. return null;
  175. },
  176. getPosAtSphere : function(pos3d, toPanoPos){
  177. var dir = pos3d.clone().sub(toPanoPos);
  178. dir.normalize();//然后计算在球中
  179. dir.multiplyScalar(Constants.skyRadius);
  180. dir.add(toPanoPos);
  181. return dir;
  182. }
  183. }
  184. var dom = {
  185. getOffset: function(e, t, i) {
  186. for (left = "left" == e ? t.offsetLeft : t.offsetTop,
  187. i = i || $("body")[0]; (t = t.offsetParent) && t != i; )
  188. left += "left" == e ? t.offsetLeft : t.offsetTop;
  189. return left
  190. }
  191. };
  192. if (function() {
  193. "use strict";
  194. function o(e, t) {
  195. return typeof e === t
  196. }
  197. function a(e, t) {
  198. return e instanceof t
  199. }
  200. function s(e) {
  201. return e && e.nodeType
  202. }
  203. function l(e) {
  204. return s(e) ? e : a(e, y) ? e[0] : void 0
  205. }
  206. function e(e, i, n) {
  207. return y.each(e, function(e, t) {
  208. n = i.call(t, n, e, t)
  209. }),
  210. n
  211. }
  212. function t(e, t, i) {
  213. var n, r, o;
  214. if (e === t)
  215. return !0;
  216. if (!e || !t || e.constructor !== t.constructor)
  217. return !1;
  218. for (n = 0,
  219. r = i.length; n < r; n += 1) {
  220. if (e[o = i[n]] && E(e[o].equals) && !e[o].equals(t[o]))
  221. return !1;
  222. if (e[o] !== t[o])
  223. return !1
  224. }
  225. return !0
  226. }
  227. function c(e, t, i, n) {
  228. this.left = w(e),
  229. this.top = w(t),
  230. this.width = w(i),
  231. this.height = w(n),
  232. this.right = this.left + this.width,
  233. this.bottom = this.top + this.height
  234. }
  235. function h(e, t, i, n) {
  236. this.visible = e || 0,
  237. this.viewport = t || 0,
  238. this.possible = i || 0,
  239. this.rects = n && I({}, n) || null
  240. }
  241. function r(e, t) {
  242. this.els = e,
  243. this.viewport = t
  244. }
  245. function n(e, t) {
  246. return e.val - t.val
  247. }
  248. function u(e, t) {
  249. return t.val - e.val
  250. }
  251. function d(e) {
  252. var t = c.ofContent(e, !0)
  253. , i = c.ofViewport(e, !0)
  254. , n = t.width - i.width
  255. , r = t.height - i.height;
  256. this.content = t,
  257. this.viewport = i,
  258. this.width = n <= 0 ? null : i.left / n,
  259. this.height = r <= 0 ? null : i.top / r,
  260. this.left = i.left,
  261. this.top = i.top,
  262. this.right = t.right - i.right,
  263. this.bottom = t.bottom - i.bottom
  264. }
  265. function p(e) {
  266. this.el = e || window
  267. }
  268. function f(e, t) {
  269. this.context = e,
  270. this.viewport = t,
  271. this.init()
  272. }
  273. function g(e, t, i, n) {
  274. this.context = new r(e,t),
  275. this.property = i,
  276. this.descending = n,
  277. this.init()
  278. }
  279. function m(e) {
  280. e && e !== window && e !== document ? (this.context = e,
  281. this.$autoTarget = y(e)) : this.context = window,
  282. this.init()
  283. }
  284. 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 = {},
  285. v = 1,
  286. function(e) {
  287. return e ? (i[e] || (i[e] = v,
  288. v += 1),
  289. i[e]) : 0
  290. }
  291. );
  292. I(c.prototype, {
  293. equals: function(e) {
  294. return t(this, e, ["left", "top", "width", "height"])
  295. },
  296. area: function() {
  297. return this.width * this.height
  298. },
  299. relativeTo: function(e) {
  300. return new c(this.left - e.left,this.top - e.top,this.width,this.height)
  301. },
  302. intersection: function(e) {
  303. if (!a(e, c))
  304. return null;
  305. var t = _(this.left, e.left)
  306. , i = b(this.right, e.right)
  307. , n = _(this.top, e.top)
  308. , r = i - t
  309. , o = b(this.bottom, e.bottom) - n;
  310. return 0 <= r && 0 <= o ? new c(t,n,r,o) : null
  311. },
  312. envelope: function(e) {
  313. if (!a(e, c))
  314. return this;
  315. var t = b(this.left, e.left)
  316. , i = _(this.right, e.right)
  317. , n = b(this.top, e.top);
  318. return new c(t,n,i - t,_(this.bottom, e.bottom) - n)
  319. }
  320. }),
  321. I(c, {
  322. ofContent: function(e, t) {
  323. 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())
  324. },
  325. ofViewport: function(e, t) {
  326. 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())
  327. },
  328. ofElement: function(e) {
  329. var t = y(e);
  330. if (!t.is(":visible"))
  331. return null;
  332. var i = t.offset();
  333. return new c(i.left,i.top,t.outerWidth(),t.outerHeight())
  334. }
  335. }),
  336. I(h.prototype, {
  337. equals: function(e) {
  338. return this.fracsEqual(e) && this.rectsEqual(e)
  339. },
  340. fracsEqual: function(e) {
  341. return t(this, e, ["visible", "viewport", "possible"])
  342. },
  343. rectsEqual: function(e) {
  344. return t(this.rects, e.rects, ["document", "element", "viewport"])
  345. }
  346. }),
  347. I(h, {
  348. of: function(e, t) {
  349. var i, n, r;
  350. return e = s(e) && c.ofElement(e) || e,
  351. t = s(t) && c.ofViewport(t) || t || c.ofViewport(),
  352. e instanceof c && (i = e.intersection(t)) ? (n = i.area(),
  353. r = b(e.width, t.width) * b(e.height, t.height),
  354. new h(n / e.area(),n / t.area(),n / r,{
  355. document: i,
  356. element: i.relativeTo(e),
  357. viewport: i.relativeTo(t)
  358. })) : new h
  359. }
  360. });
  361. var x = ["width", "height", "left", "right", "top", "bottom"]
  362. , S = ["possible", "visible", "viewport"];
  363. I(r.prototype, {
  364. sorted: function(t, e) {
  365. var i = this.viewport;
  366. return y.map(this.els, function(e) {
  367. return {
  368. el: e,
  369. val: function(e, t, i) {
  370. var n;
  371. return 0 <= y.inArray(i, x) ? n = c.ofElement(e) : 0 <= y.inArray(i, S) && (n = h.of(e, t)),
  372. n ? n[i] : 0
  373. }(e, i, t)
  374. }
  375. }).sort(e ? u : n)
  376. },
  377. best: function(e, t) {
  378. return this.els.length ? this.sorted(e, t)[0] : null
  379. }
  380. }),
  381. I(d.prototype, {
  382. equals: function(e) {
  383. return t(this, e, ["width", "height", "left", "top", "right", "bottom", "content", "viewport"])
  384. }
  385. }),
  386. I(p.prototype, {
  387. equals: function(e) {
  388. return t(this, e, ["el"])
  389. },
  390. scrollState: function() {
  391. return new d(this.el)
  392. },
  393. scrollTo: function(e, t, i) {
  394. var n = y(this.el === window ? "html,body" : this.el);
  395. e = e || 0,
  396. t = t || 0,
  397. i = isNaN(i) ? 1e3 : i,
  398. n.stop(!0).animate({
  399. scrollLeft: e,
  400. scrollTop: t
  401. }, i)
  402. },
  403. scroll: function(e, t, i) {
  404. var n = this.el === window ? A : y(this.el);
  405. e = e || 0,
  406. t = t || 0,
  407. this.scrollTo(n.scrollLeft() + e, n.scrollTop() + t, i)
  408. },
  409. scrollToRect: function(e, t, i, n) {
  410. t = t || 0,
  411. i = i || 0,
  412. this.scrollTo(e.left - t, e.top - i, n)
  413. },
  414. scrollToElement: function(e, t, i, n) {
  415. var r = c.ofElement(e).relativeTo(c.ofContent(this.el));
  416. this.scrollToRect(r, t, i, n)
  417. }
  418. });
  419. var M = {
  420. init: function() {
  421. this.callbacks = y.Callbacks("memory unique"),
  422. this.currVal = null,
  423. this.prevVal = null,
  424. this.checkProxy = y.proxy(this.check, this),
  425. this.autoCheck()
  426. },
  427. bind: function(e) {
  428. this.callbacks.add(e)
  429. },
  430. unbind: function(e) {
  431. e ? this.callbacks.remove(e) : this.callbacks.empty()
  432. },
  433. trigger: function() {
  434. this.callbacks.fireWith(this.context, [this.currVal, this.prevVal])
  435. },
  436. check: function(e) {
  437. var t = this.updatedValue(e);
  438. return void 0 !== t && (this.prevVal = this.currVal,
  439. this.currVal = t,
  440. this.trigger(),
  441. !0)
  442. },
  443. $autoTarget: A,
  444. autoEvents: "load resize scroll",
  445. autoCheck: function(e) {
  446. this.$autoTarget[!1 === e ? "off" : "on"](this.autoEvents, this.checkProxy)
  447. }
  448. };
  449. I(f.prototype, M, {
  450. updatedValue: function() {
  451. var e = h.of(this.context, this.viewport);
  452. return this.currVal && this.currVal.equals(e) ? void 0 : e
  453. }
  454. }),
  455. I(g.prototype, M, {
  456. updatedValue: function() {
  457. var e = this.context.best(this.property, this.descending);
  458. return e && (e = 0 < e.val ? e.el : null,
  459. this.currVal !== e) ? e : void 0
  460. }
  461. }),
  462. I(m.prototype, M, {
  463. updatedValue: function() {
  464. var e = new d(this.context);
  465. return this.currVal && this.currVal.equals(e) ? void 0 : e
  466. }
  467. });
  468. var R, P, O, L, D, N, F, B, V, k, U = "fracs";
  469. function H(e, t, i, n) {
  470. return i = N(i) ? i.apply(e, t) : i,
  471. N(n[i]) ? n[i].apply(e, t) : void L.error('Method "' + i + '" does not exist on jQuery.' + R)
  472. }
  473. R = U,
  474. P = {
  475. statics: {
  476. version: "0.15.0",
  477. Rect: c,
  478. Fractions: h,
  479. Group: r,
  480. ScrollState: d,
  481. Viewport: p,
  482. FracsCallbacks: f,
  483. GroupCallbacks: g,
  484. ScrollStateCallbacks: m,
  485. fracs: function(e, t) {
  486. return h.of(e, t)
  487. }
  488. },
  489. methods: {
  490. content: function(e) {
  491. return this.length ? c.ofContent(this[0], e) : null
  492. },
  493. envelope: function() {
  494. return e(this, function(e) {
  495. var t = c.ofElement(this);
  496. return e ? e.envelope(t) : t
  497. })
  498. },
  499. fracs: function(e, i, n) {
  500. o(e, "string") || (n = i,
  501. i = e,
  502. e = null),
  503. E(i) || (n = i,
  504. i = null),
  505. n = l(n);
  506. var r = U + ".fracs." + T(n);
  507. return "unbind" === e ? this.each(function() {
  508. var e = y(this).data(r);
  509. e && e.unbind(i)
  510. }) : "check" === e ? this.each(function() {
  511. var e = y(this).data(r);
  512. e && e.check()
  513. }) : E(i) ? this.each(function() {
  514. var e = y(this)
  515. , t = e.data(r);
  516. t || (t = new f(this,n),
  517. e.data(r, t)),
  518. t.bind(i)
  519. }) : this.length ? h.of(this[0], n) : null
  520. },
  521. intersection: function() {
  522. return e(this, function(e) {
  523. var t = c.ofElement(this);
  524. return e ? e.intersection(t) : t
  525. })
  526. },
  527. max: function(e, t, i) {
  528. return E(t) || (i = t,
  529. t = null),
  530. i = l(i),
  531. t ? (new g(this,i,e,!0).bind(t),
  532. this) : this.pushStack(new r(this,i).best(e, !0).el)
  533. },
  534. min: function(e, t, i) {
  535. return E(t) || (i = t,
  536. t = null),
  537. i = l(i),
  538. t ? (new g(this,i,e).bind(t),
  539. this) : this.pushStack(new r(this,i).best(e).el)
  540. },
  541. rect: function() {
  542. return this.length ? c.ofElement(this[0]) : null
  543. },
  544. scrollState: function(e, i) {
  545. var n = U + ".scrollState";
  546. return o(e, "string") || (i = e,
  547. e = null),
  548. "unbind" === e ? this.each(function() {
  549. var e = y(this).data(n);
  550. e && e.unbind(i)
  551. }) : "check" === e ? this.each(function() {
  552. var e = y(this).data(n);
  553. e && e.check()
  554. }) : E(i) ? this.each(function() {
  555. var e = y(this)
  556. , t = e.data(n);
  557. t || (t = new m(this),
  558. e.data(n, t)),
  559. t.bind(i)
  560. }) : this.length ? new d(this[0]) : null
  561. },
  562. scroll: function(e, t, i) {
  563. return this.each(function() {
  564. new p(this).scroll(e, t, i)
  565. })
  566. },
  567. scrollTo: function(e, t, i, n) {
  568. return y.isNumeric(e) && (n = i,
  569. i = t,
  570. t = e,
  571. e = null),
  572. e = l(e),
  573. this.each(function() {
  574. e ? new p(this).scrollToElement(e, t, i, n) : new p(this).scrollTo(t, i, n)
  575. })
  576. },
  577. scrollToThis: function(e, t, i, n) {
  578. return (n = new p(l(n))).scrollToElement(this[0], e, t, i),
  579. this
  580. },
  581. softLink: function(t, i, n, r) {
  582. return r = new p(l(r)),
  583. this.filter("a[href^=#]").each(function() {
  584. var e = y(this);
  585. e.on("click", function() {
  586. r.scrollToElement(y(e.attr("href"))[0], t, i, n)
  587. })
  588. })
  589. },
  590. sort: function(e, t, i) {
  591. return o(t, "boolean") || (i = t,
  592. t = null),
  593. i = l(i),
  594. this.pushStack(y.map(new r(this,i).sorted(e, !t), function(e) {
  595. return e.el
  596. }))
  597. },
  598. viewport: function(e) {
  599. return this.length ? c.ofViewport(this[0], e) : null
  600. }
  601. },
  602. defaultStatic: "fracs",
  603. defaultMethod: "fracs"
  604. },
  605. O = [].slice,
  606. L = jQuery,
  607. D = L.extend,
  608. N = L.isFunction,
  609. F = D({}, P),
  610. B = function() {
  611. return H(this, O.call(arguments), F.defaultStatic, B)
  612. }
  613. ,
  614. V = function(e) {
  615. return N(V[e]) ? V[e].apply(this, O.call(arguments, 1)) : H(this, O.call(arguments), F.defaultMethod, V)
  616. }
  617. ,
  618. (k = function(e) {
  619. e && (D(B, e.statics),
  620. D(V, e.methods)),
  621. B.modplug = k
  622. }
  623. ).prev = {
  624. statics: L[R],
  625. methods: L.fn[R]
  626. },
  627. k(P),
  628. L[R] = B,
  629. L.fn[R] = V
  630. }(),
  631. "undefined" == typeof jQuery)
  632. throw new Error("Bootstrap's JavaScript requires jQuery");
  633. !function(m) {
  634. "use strict";
  635. function r(e, t) {
  636. this.type = this.options = this.enabled = this.timeout = this.hoverState = this.$element = null,
  637. this.init("tooltip", e, t)
  638. }
  639. r.VERSION = "3.2.0",
  640. r.DEFAULTS = {
  641. animation: !0,
  642. placement: "top",
  643. selector: !1,
  644. template: '<div class="tooltip" role="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>',
  645. trigger: "hover focus",
  646. title: "",
  647. delay: 0,
  648. html: !1,
  649. container: !1,
  650. viewport: {
  651. selector: "body",
  652. padding: 0
  653. }
  654. },
  655. r.prototype.init = function(e, t, i) {
  656. this.enabled = !0,
  657. this.type = e,
  658. this.$element = m(t),
  659. this.options = this.getOptions(i),
  660. this.$viewport = this.options.viewport && m(this.options.viewport.selector || this.options.viewport);
  661. for (var n = this.options.trigger.split(" "), r = n.length; r--; ) {
  662. var o = n[r];
  663. if ("click" == o)
  664. this.$element.on("click." + this.type, this.options.selector, m.proxy(this.toggle, this));
  665. else if ("manual" != o) {
  666. var a = "hover" == o ? "mouseenter" : "focusin"
  667. , s = "hover" == o ? "mouseleave" : "focusout";
  668. this.$element.on(a + "." + this.type, this.options.selector, m.proxy(this.enter, this)),
  669. this.$element.on(s + "." + this.type, this.options.selector, m.proxy(this.leave, this))
  670. }
  671. }
  672. this.options.selector ? this._options = m.extend({}, this.options, {
  673. trigger: "manual",
  674. selector: ""
  675. }) : this.fixTitle()
  676. }
  677. ,
  678. r.prototype.getDefaults = function() {
  679. return r.DEFAULTS
  680. }
  681. ,
  682. r.prototype.getOptions = function(e) {
  683. return (e = m.extend({}, this.getDefaults(), this.$element.data(), e)).delay && "number" == typeof e.delay && (e.delay = {
  684. show: e.delay,
  685. hide: e.delay
  686. }),
  687. e
  688. }
  689. ,
  690. r.prototype.getDelegateOptions = function() {
  691. var i = {}
  692. , n = this.getDefaults();
  693. return this._options && m.each(this._options, function(e, t) {
  694. n[e] != t && (i[e] = t)
  695. }),
  696. i
  697. }
  698. ,
  699. r.prototype.enter = function(e) {
  700. var t = e instanceof this.constructor ? e : m(e.currentTarget).data("bs." + this.type);
  701. return t || (t = new this.constructor(e.currentTarget,this.getDelegateOptions()),
  702. m(e.currentTarget).data("bs." + this.type, t)),
  703. clearTimeout(t.timeout),
  704. t.hoverState = "in",
  705. t.options.delay && t.options.delay.show ? void (t.timeout = setTimeout(function() {}, t.options.delay.show)) : t.show()
  706. }
  707. ,
  708. r.prototype.leave = function(e) {
  709. var t = e instanceof this.constructor ? e : m(e.currentTarget).data("bs." + this.type);
  710. return t || (t = new this.constructor(e.currentTarget,this.getDelegateOptions()),
  711. m(e.currentTarget).data("bs." + this.type, t)),
  712. clearTimeout(t.timeout),
  713. t.hoverState = "out",
  714. t.options.delay && t.options.delay.hide ? void (t.timeout = setTimeout(function() {
  715. "out" == t.hoverState && t.hide()
  716. }, t.options.delay.hide)) : t.hide()
  717. }
  718. ,
  719. r.prototype.show = function() {
  720. var e = m.Event("show.bs." + this.type);
  721. if (this.hasContent() && this.enabled) {
  722. this.$element.trigger(e);
  723. var t = m.contains(document.documentElement, this.$element[0]);
  724. if (e.isDefaultPrevented() || !t)
  725. return;
  726. var i = this
  727. , n = this.tip()
  728. , r = this.getUID(this.type);
  729. this.setContent(),
  730. n.attr("id", r),
  731. this.$element.attr("aria-describedby", r),
  732. this.options.animation && n.addClass("fade");
  733. var o = "function" == typeof this.options.placement ? this.options.placement.call(this, n[0], this.$element[0]) : this.options.placement
  734. , a = /\s?auto?\s?/i
  735. , s = a.test(o);
  736. s && (o = o.replace(a, "") || "top"),
  737. n.detach().css({
  738. top: 0,
  739. left: 0,
  740. display: "block"
  741. }).addClass(o).data("bs." + this.type, this),
  742. this.options.container ? n.appendTo(this.options.container) : n.insertAfter(this.$element);
  743. var l = this.getPosition()
  744. , c = n[0].offsetWidth
  745. , h = n[0].offsetHeight;
  746. if (s) {
  747. var u = o
  748. , d = this.$element.parent()
  749. , p = this.getPosition(d);
  750. 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,
  751. n.removeClass(u).addClass(o)
  752. }
  753. var f = this.getCalculatedOffset(o, l, c, h);
  754. this.applyPlacement(f, o);
  755. var g = function() {
  756. i.$element.trigger("shown.bs." + i.type),
  757. i.hoverState = null
  758. };
  759. m.support.transition && this.$tip.hasClass("fade") ? n.one("bsTransitionEnd", g).emulateTransitionEnd(150) : g()
  760. }
  761. }
  762. ,
  763. r.prototype.applyPlacement = function(e, t) {
  764. var i = this.tip()
  765. , n = i[0].offsetWidth
  766. , r = i[0].offsetHeight
  767. , o = parseInt(i.css("margin-top"), 10)
  768. , a = parseInt(i.css("margin-left"), 10);
  769. isNaN(o) && (o = 0),
  770. isNaN(a) && (a = 0),
  771. e.top = e.top + o,
  772. e.left = e.left + a,
  773. m.offset.setOffset(i[0], m.extend({
  774. using: function(e) {
  775. i.css({
  776. top: Math.round(e.top),
  777. left: Math.round(e.left)
  778. })
  779. }
  780. }, e), 0),
  781. i.addClass("in");
  782. var s = i[0].offsetWidth
  783. , l = i[0].offsetHeight;
  784. "top" == t && l != r && (e.top = e.top + r - l);
  785. var c = this.getViewportAdjustedDelta(t, e, s, l);
  786. c.left ? e.left += c.left : e.top += c.top;
  787. var h = c.left ? 2 * c.left - n + s : 2 * c.top - r + l
  788. , u = c.left ? "left" : "top"
  789. , d = c.left ? "offsetWidth" : "offsetHeight";
  790. i.offset(e),
  791. this.replaceArrow(h, i[0][d], u)
  792. }
  793. ,
  794. r.prototype.replaceArrow = function(e, t, i) {
  795. this.arrow().css(i, e ? 50 * (1 - e / t) + "%" : "")
  796. }
  797. ,
  798. r.prototype.setContent = function() {
  799. var e = this.tip()
  800. , t = this.getTitle();
  801. e.find(".tooltip-inner")[this.options.html ? "html" : "text"](t),
  802. e.removeClass("fade in top bottom left right")
  803. }
  804. ,
  805. r.prototype.hide = function() {
  806. function e() {
  807. "in" != t.hoverState && i.detach(),
  808. t.$element.trigger("hidden.bs." + t.type)
  809. }
  810. var t = this
  811. , i = this.tip()
  812. , n = m.Event("hide.bs." + this.type);
  813. if (this.$element.removeAttr("aria-describedby"),
  814. this.$element.trigger(n),
  815. !n.isDefaultPrevented())
  816. return i.removeClass("in"),
  817. m.support.transition && this.$tip.hasClass("fade") ? i.one("bsTransitionEnd", e).emulateTransitionEnd(150) : e(),
  818. this.hoverState = null,
  819. this
  820. }
  821. ,
  822. r.prototype.fixTitle = function() {
  823. var e = this.$element;
  824. !e.attr("title") && "string" == typeof e.attr("data-original-title") || e.attr("data-original-title", e.attr("title") || "").attr("title", "")
  825. }
  826. ,
  827. r.prototype.hasContent = function() {
  828. return this.getTitle()
  829. }
  830. ,
  831. r.prototype.getPosition = function(e) {
  832. var t = (e = e || this.$element)[0]
  833. , i = "BODY" == t.tagName;
  834. return m.extend({}, "function" == typeof t.getBoundingClientRect ? t.getBoundingClientRect() : null, {
  835. scroll: i ? document.documentElement.scrollTop || document.body.scrollTop : e.scrollTop(),
  836. width: i ? m(window).width() : e.outerWidth(),
  837. height: i ? m(window).height() : e.outerHeight()
  838. }, i ? {
  839. top: 0,
  840. left: 0
  841. } : e.offset())
  842. }
  843. ,
  844. r.prototype.getCalculatedOffset = function(e, t, i, n) {
  845. return "bottom" == e ? {
  846. top: t.top + t.height,
  847. left: t.left + t.width / 2 - i / 2
  848. } : "top" == e ? {
  849. top: t.top - n,
  850. left: t.left + t.width / 2 - i / 2
  851. } : "left" == e ? {
  852. top: t.top + t.height / 2 - n / 2,
  853. left: t.left - i
  854. } : {
  855. top: t.top + t.height / 2 - n / 2,
  856. left: t.left + t.width
  857. }
  858. }
  859. ,
  860. r.prototype.getViewportAdjustedDelta = function(e, t, i, n) {
  861. var r = {
  862. top: 0,
  863. left: 0
  864. };
  865. if (!this.$viewport)
  866. return r;
  867. var o = this.options.viewport && this.options.viewport.padding || 0
  868. , a = this.getPosition(this.$viewport);
  869. if (/right|left/.test(e)) {
  870. var s = t.top - o - a.scroll
  871. , l = t.top + o - a.scroll + n;
  872. s < a.top ? r.top = a.top - s : l > a.top + a.height && (r.top = a.top + a.height - l)
  873. } else {
  874. var c = t.left - o
  875. , h = t.left + o + i;
  876. c < a.left ? r.left = a.left - c : h > a.width && (r.left = a.left + a.width - h)
  877. }
  878. return r
  879. }
  880. ,
  881. r.prototype.getTitle = function() {
  882. var e = this.$element
  883. , t = this.options;
  884. return e.attr("data-original-title") || ("function" == typeof t.title ? t.title.call(e[0]) : t.title)
  885. }
  886. ,
  887. r.prototype.getUID = function(e) {
  888. for (; e += ~~(1e6 * Math.random()),
  889. document.getElementById(e); )
  890. ;
  891. return e
  892. }
  893. ,
  894. r.prototype.tip = function() {
  895. return this.$tip = this.$tip || m(this.options.template)
  896. }
  897. ,
  898. r.prototype.arrow = function() {
  899. return this.$arrow = this.$arrow || this.tip().find(".tooltip-arrow")
  900. }
  901. ,
  902. r.prototype.validate = function() {
  903. this.$element[0].parentNode || (this.hide(),
  904. this.$element = null,
  905. this.options = null)
  906. }
  907. ,
  908. r.prototype.enable = function() {
  909. this.enabled = !0
  910. }
  911. ,
  912. r.prototype.disable = function() {
  913. this.enabled = !1
  914. }
  915. ,
  916. r.prototype.toggleEnabled = function() {
  917. this.enabled = !this.enabled
  918. }
  919. ,
  920. r.prototype.toggle = function(e) {
  921. var t = this;
  922. e && ((t = m(e.currentTarget).data("bs." + this.type)) || (t = new this.constructor(e.currentTarget,this.getDelegateOptions()),
  923. m(e.currentTarget).data("bs." + this.type, t))),
  924. t.tip().hasClass("in") ? t.leave(t) : t.enter(t)
  925. }
  926. ,
  927. r.prototype.destroy = function() {
  928. clearTimeout(this.timeout),
  929. this.hide().$element.off("." + this.type).removeData("bs." + this.type)
  930. }
  931. ;
  932. var e = m.fn.tooltip;
  933. m.fn.tooltip = function(n) {
  934. return this.each(function() {
  935. var e = m(this)
  936. , t = e.data("bs.tooltip")
  937. , i = "object" == typeof n && n;
  938. !t && "destroy" == n || (t || e.data("bs.tooltip", t = new r(this,i)),
  939. "string" == typeof n && t[n]())
  940. })
  941. }
  942. ,
  943. m.fn.tooltip.Constructor = r,
  944. m.fn.tooltip.noConflict = function() {
  945. return m.fn.tooltip = e,
  946. this
  947. }
  948. }(jQuery),
  949. function(e, t, i) {
  950. "undefined" != typeof module && module.exports ? module.exports = i() : "function" == typeof define && define.amd ? define(i) : t.Keen = i()
  951. }(0, this, function() {
  952. "use strict";
  953. function Keen() {
  954. return _init.apply(this, arguments)
  955. }
  956. function _init(e) {
  957. if (_isUndefined(e))
  958. throw new Error("Check out our JavaScript SDK Usage Guide: https://keen.io/docs/clients/javascript/usage-guide/");
  959. if (_isUndefined(e.projectId) || "String" !== _type(e.projectId) || e.projectId.length < 1)
  960. throw new Error("Please provide a projectId");
  961. this.configure(e)
  962. }
  963. function _extend(e) {
  964. for (var t = 1; t < arguments.length; t++)
  965. for (var i in arguments[t])
  966. e[i] = arguments[t][i];
  967. return e
  968. }
  969. function _isUndefined(e) {
  970. return void 0 === e
  971. }
  972. function _type(e) {
  973. var t = e && e.constructor ? e.constructor.toString() : void 0;
  974. return t ? t.match(/function (.*)\(/)[1] : "Null"
  975. }
  976. function _each(e, t, i) {
  977. var n;
  978. if (!e)
  979. return 0;
  980. if (i = i || e,
  981. "array" === _type(e)) {
  982. for (n = 0; n < e.length; n++)
  983. if (!1 === t.call(i, e[n], n, e))
  984. return 0
  985. } else
  986. for (n in e)
  987. if (e.hasOwnProperty(n) && !1 === t.call(i, e[n], n, e))
  988. return 0;
  989. return 1
  990. }
  991. function _parse_params(e) {
  992. for (var t, i = {}, n = /\+/g, r = /([^&=]+)=?([^&]*)/g, o = function(e) {
  993. return decodeURIComponent(e.replace(n, " "))
  994. }, a = e.split("?")[1]; t = r.exec(a); )
  995. i[o(t[1])] = o(t[2]);
  996. return i
  997. }
  998. function _set_protocol(e) {
  999. switch (e) {
  1000. case "http":
  1001. return "http";
  1002. case "auto":
  1003. return location.protocol.replace(/:/g, "");
  1004. case "https":
  1005. case void 0:
  1006. default:
  1007. return "https"
  1008. }
  1009. }
  1010. function _set_request_type(e) {
  1011. var t = e || "jsonp"
  1012. , i = !1;
  1013. return ("Object" === _type(XMLHttpRequest) || "Function" === _type(XMLHttpRequest)) && "withCredentials"in new XMLHttpRequest && (i = !0),
  1014. null == t || "xhr" == t ? i ? "xhr" : "jsonp" : t
  1015. }
  1016. function _build_url(e) {
  1017. return this.client.endpoint + "/projects/" + this.client.projectId + e
  1018. }
  1019. function _uploadEvent(e, t, i, n, r) {
  1020. var o = _build_url.apply(this, ["/events/" + e])
  1021. , a = {};
  1022. for (var s in i = !1 !== i,
  1023. this.client.globalProperties && (a = this.client.globalProperties(e)),
  1024. t)
  1025. t.hasOwnProperty(s) && (a[s] = t[s]);
  1026. switch (this.client.requestType) {
  1027. case "xhr":
  1028. _request.xhr.apply(this, ["POST", o, null, a, this.client.writeKey, i, n, r]);
  1029. break;
  1030. case "jsonp":
  1031. var l = JSON.stringify(a)
  1032. , c = Keen.Base64.encode(l);
  1033. o = (o = (o = o + "?api_key=" + this.client.writeKey) + "&data=" + c) + "&modified=" + (new Date).getTime(),
  1034. _request.jsonp.apply(this, [o, this.client.writeKey, n, r]);
  1035. break;
  1036. case "beacon":
  1037. l = JSON.stringify(a),
  1038. c = Keen.Base64.encode(l);
  1039. o = (o = (o = o + "?api_key=" + encodeURIComponent(this.client.writeKey)) + "&data=" + encodeURIComponent(c)) + "&modified=" + encodeURIComponent((new Date).getTime()),
  1040. o += "&c=clv1",
  1041. _request.beacon.apply(this, [o, null, n, r])
  1042. }
  1043. }
  1044. Keen.prototype.configure = function(e) {
  1045. return e.host = _isUndefined(e.host) ? "api.keen.io/3.0" : e.host.replace(/.*?:\/\//g, ""),
  1046. e.protocol = _set_protocol(e.protocol),
  1047. e.requestType = _set_request_type(e.requestType),
  1048. this.client = {
  1049. projectId: e.projectId,
  1050. writeKey: e.writeKey,
  1051. readKey: e.readKey,
  1052. globalProperties: null,
  1053. endpoint: e.protocol + "://" + e.host,
  1054. requestType: e.requestType
  1055. },
  1056. Keen.trigger("client", this, e),
  1057. this.trigger("ready"),
  1058. this
  1059. }
  1060. ;
  1061. var _request = {
  1062. xhr: function(e, t, i, n, r, o, a, s) {
  1063. if (!r)
  1064. return Keen.log("Please provide a writeKey for https://keen.io/project/" + this.client.projectId);
  1065. var l = new XMLHttpRequest;
  1066. if (l.onreadystatechange = function() {
  1067. if (4 == l.readyState)
  1068. if (200 <= l.status && l.status < 300) {
  1069. var e;
  1070. try {
  1071. e = JSON.parse(l.responseText)
  1072. } catch (e) {
  1073. Keen.log("Could not JSON parse HTTP response: " + l.responseText),
  1074. s && s(l, e)
  1075. }
  1076. a && e && a(e)
  1077. } else
  1078. Keen.log("HTTP request failed."),
  1079. s && s(l, null)
  1080. }
  1081. ,
  1082. l.open(e, t, o),
  1083. r && l.setRequestHeader("Authorization", r),
  1084. n && l.setRequestHeader("Content-Type", "application/json"),
  1085. i)
  1086. for (var c in i)
  1087. i.hasOwnProperty(c) && l.setRequestHeader(c, i[c]);
  1088. var h = n ? JSON.stringify(n) : null;
  1089. l.send(h)
  1090. },
  1091. jsonp: function(e, t, i, n) {
  1092. if (!t)
  1093. return Keen.log("Please provide a writeKey for https://keen.io/project/" + this.client.projectId);
  1094. if (t && e.indexOf("api_key") < 0) {
  1095. var r = 0 < e.indexOf("?") ? "&" : "?";
  1096. e = e + r + "api_key=" + t
  1097. }
  1098. for (var o = "keenJSONPCallback" + (new Date).getTime(); o in window; )
  1099. o += "a";
  1100. var a = !1;
  1101. window[o] = function(e) {
  1102. a = !0,
  1103. i && e && i(e),
  1104. window[o] = void 0
  1105. }
  1106. ,
  1107. e = e + "&jsonp=" + o;
  1108. var s = document.createElement("script");
  1109. s.id = "keen-jsonp",
  1110. s.src = e,
  1111. document.getElementsByTagName("head")[0].appendChild(s),
  1112. s.onreadystatechange = function() {
  1113. !1 === a && "loaded" === this.readyState && (a = !0,
  1114. n && n())
  1115. }
  1116. ,
  1117. s.onerror = function() {
  1118. !1 === a && (a = !0,
  1119. n && n())
  1120. }
  1121. },
  1122. beacon: function(e, t, i, n) {
  1123. if (t && e.indexOf("api_key") < 0) {
  1124. var r = 0 < e.indexOf("?") ? "&" : "?";
  1125. e = e + r + "api_key=" + t
  1126. }
  1127. var o = document.createElement("img");
  1128. o.onload = function() {
  1129. if (!0,
  1130. "naturalHeight"in this) {
  1131. if (this.naturalHeight + this.naturalWidth === 0)
  1132. return void this.onerror()
  1133. } else if (this.width + this.height === 0)
  1134. return void this.onerror();
  1135. i && i({
  1136. created: !0
  1137. })
  1138. }
  1139. ,
  1140. o.onerror = function() {
  1141. !0,
  1142. n && n()
  1143. }
  1144. ,
  1145. o.src = e
  1146. }
  1147. }
  1148. , Events = Keen.Events = {
  1149. on: function(e, t) {
  1150. return this.listeners || (this.listeners = {}),
  1151. (this.listeners[e] || (this.listeners[e] = [])).push({
  1152. callback: t
  1153. }),
  1154. this
  1155. },
  1156. off: function(e, t) {
  1157. if (!e && !t)
  1158. return this.listeners = void 0,
  1159. delete this.listeners,
  1160. this;
  1161. for (var i = this.listeners[e] || [], n = i.length; n--; )
  1162. t && t == i[n].callback && this.listeners[e].splice(n, 1),
  1163. t && 0 != i.length || (this.listeners[e] = void 0,
  1164. delete this.listeners[e]);
  1165. return this
  1166. },
  1167. trigger: function(e) {
  1168. if (!this.listeners)
  1169. return this;
  1170. for (var t = Array.prototype.slice.call(arguments, 1), i = this.listeners[e] || [], n = 0; n < i.length; n++)
  1171. i[n].callback.apply(this, t);
  1172. return this
  1173. }
  1174. };
  1175. _extend(Keen.prototype, Events),
  1176. _extend(Keen, Events),
  1177. Keen.loaded = !0,
  1178. Keen.utils = {
  1179. each: _each,
  1180. extend: _extend,
  1181. parseParams: _parse_params
  1182. },
  1183. Keen.ready = function(e) {
  1184. Keen.loaded ? e() : Keen.on("ready", e)
  1185. }
  1186. ,
  1187. Keen.log = function(e) {
  1188. "object" == typeof console && console.log("[Keen IO]", e)
  1189. }
  1190. ;
  1191. var Plugins = Keen.Plugins = {}, Hh, Ih;
  1192. Keen.prototype.addEvent = function() {
  1193. _uploadEvent.apply(this, arguments)
  1194. }
  1195. ,
  1196. Keen.prototype.addEventSync = function(e, t, i, n) {
  1197. _uploadEvent.apply(this, [e, t, !1, i, n])
  1198. }
  1199. ,
  1200. Keen.prototype.trackExternalLink = function(e, t, i, n, r) {
  1201. var o = e
  1202. , a = o.metaKey
  1203. , s = o.target
  1204. , l = !1
  1205. , c = function() {};
  1206. return void 0 === n && (n = 500),
  1207. "A" === s.nodeName ? c = function() {
  1208. a || l || (l = !0,
  1209. window.location = s.href)
  1210. }
  1211. : "FORM" === s.nodeName && (c = function() {
  1212. l || (l = !0,
  1213. s.submit())
  1214. }
  1215. ),
  1216. r && (c = function() {
  1217. l || (l = !0,
  1218. r())
  1219. }
  1220. ),
  1221. _uploadEvent.call(this, t, i, c, c),
  1222. setTimeout(function() {
  1223. c()
  1224. }, n),
  1225. !!a && void 0
  1226. }
  1227. ,
  1228. Keen.prototype.setGlobalProperties = function(e) {
  1229. if (!this.client)
  1230. return Keen.log("Check out our JavaScript SDK Usage Guide: https://keen.io/docs/clients/javascript/usage-guide/");
  1231. if (!e || "function" != typeof e)
  1232. throw new Error("Invalid value for global properties: " + e);
  1233. this.client.globalProperties = e
  1234. }
  1235. ,
  1236. Keen.Base64 = {
  1237. map: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",
  1238. encode: function(e) {
  1239. var t, i, n, r, o, a, s, l = "", c = 0, h = this.map;
  1240. for (e = this.utf8.encode(e); c < e.length; )
  1241. t = e.charCodeAt(c++),
  1242. i = e.charCodeAt(c++),
  1243. n = e.charCodeAt(c++),
  1244. r = t >> 2,
  1245. o = (3 & t) << 4 | i >> 4,
  1246. a = isNaN(i) ? 64 : (15 & i) << 2 | n >> 6,
  1247. s = isNaN(i) || isNaN(n) ? 64 : 63 & n,
  1248. l = l + h.charAt(r) + h.charAt(o) + h.charAt(a) + h.charAt(s);
  1249. return l
  1250. },
  1251. decode: function(e) {
  1252. var t, i, n, r, o, a, s = "", l = 0, c = this.map, h = String.fromCharCode;
  1253. for (e = e.replace(/[^A-Za-z0-9\+\/\=]/g, ""); l < e.length; )
  1254. t = c.indexOf(e.charAt(l++)),
  1255. o = (15 & (i = c.indexOf(e.charAt(l++)))) << 4 | (n = c.indexOf(e.charAt(l++))) >> 2,
  1256. a = (3 & n) << 6 | (r = c.indexOf(e.charAt(l++))),
  1257. s = s + (h(t << 2 | i >> 4) + (64 != n ? h(o) : "")) + (64 != r ? h(a) : "");
  1258. return this.utf8.decode(s)
  1259. },
  1260. utf8: {
  1261. encode: function(e) {
  1262. for (var t, i = "", n = 0, r = String.fromCharCode; n < e.length; )
  1263. 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);
  1264. return i
  1265. },
  1266. decode: function(e) {
  1267. for (var t, i = "", n = 0, r = String.fromCharCode; n < e.length; )
  1268. 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];
  1269. return i
  1270. }
  1271. }
  1272. },
  1273. "object" != typeof JSON && (JSON = {}),
  1274. function() {
  1275. function f(e) {
  1276. return e < 10 ? "0" + e : e
  1277. }
  1278. function quote(e) {
  1279. return escapable.lastIndex = 0,
  1280. escapable.test(e) ? '"' + e.replace(escapable, function(e) {
  1281. var t = meta[e];
  1282. return "string" == typeof t ? t : "\\u" + ("0000" + e.charCodeAt(0).toString(16)).slice(-4)
  1283. }) + '"' : '"' + e + '"'
  1284. }
  1285. function str(e, t) {
  1286. var i, n, r, o, a, s = gap, l = t[e];
  1287. switch (l && "object" == typeof l && "function" == typeof l.toJSON && (l = l.toJSON(e)),
  1288. "function" == typeof rep && (l = rep.call(t, e, l)),
  1289. typeof l) {
  1290. case "string":
  1291. return quote(l);
  1292. case "number":
  1293. return isFinite(l) ? String(l) : "null";
  1294. case "boolean":
  1295. case "null":
  1296. return String(l);
  1297. case "object":
  1298. if (!l)
  1299. return "null";
  1300. if (gap += indent,
  1301. a = [],
  1302. "[object Array]" === Object.prototype.toString.apply(l)) {
  1303. for (o = l.length,
  1304. i = 0; i < o; i += 1)
  1305. a[i] = str(i, l) || "null";
  1306. return r = 0 === a.length ? "[]" : gap ? "[\n" + gap + a.join(",\n" + gap) + "\n" + s + "]" : "[" + a.join(",") + "]",
  1307. gap = s,
  1308. r
  1309. }
  1310. if (rep && "object" == typeof rep)
  1311. for (o = rep.length,
  1312. i = 0; i < o; i += 1)
  1313. "string" == typeof rep[i] && ((r = str(n = rep[i], l)) && a.push(quote(n) + (gap ? ": " : ":") + r));
  1314. else
  1315. for (n in l)
  1316. Object.prototype.hasOwnProperty.call(l, n) && ((r = str(n, l)) && a.push(quote(n) + (gap ? ": " : ":") + r));
  1317. return r = 0 === a.length ? "{}" : gap ? "{\n" + gap + a.join(",\n" + gap) + "\n" + s + "}" : "{" + a.join(",") + "}",
  1318. gap = s,
  1319. r
  1320. }
  1321. }
  1322. "function" != typeof Date.prototype.toJSON && (Date.prototype.toJSON = function() {
  1323. 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
  1324. }
  1325. ,
  1326. String.prototype.toJSON = Number.prototype.toJSON = Boolean.prototype.toJSON = function() {
  1327. return this.valueOf()
  1328. }
  1329. );
  1330. 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 = {
  1331. "\b": "\\b",
  1332. "\t": "\\t",
  1333. "\n": "\\n",
  1334. "\f": "\\f",
  1335. "\r": "\\r",
  1336. '"': '\\"',
  1337. "\\": "\\\\"
  1338. }, rep;
  1339. "function" != typeof JSON.stringify && (JSON.stringify = function(e, t, i) {
  1340. var n;
  1341. if (indent = gap = "",
  1342. "number" == typeof i)
  1343. for (n = 0; n < i; n += 1)
  1344. indent += " ";
  1345. else
  1346. "string" == typeof i && (indent = i);
  1347. if ((rep = t) && "function" != typeof t && ("object" != typeof t || "number" != typeof t.length))
  1348. throw new Error("JSON.stringify");
  1349. return str("", {
  1350. "": e
  1351. })
  1352. }
  1353. ),
  1354. "function" != typeof JSON.parse && (JSON.parse = function(text, reviver) {
  1355. function walk(e, t) {
  1356. var i, n, r = e[t];
  1357. if (r && "object" == typeof r)
  1358. for (i in r)
  1359. Object.prototype.hasOwnProperty.call(r, i) && (void 0 !== (n = walk(r, i)) ? r[i] = n : delete r[i]);
  1360. return reviver.call(e, t, r)
  1361. }
  1362. var j;
  1363. if (text = String(text),
  1364. cx.lastIndex = 0,
  1365. cx.test(text) && (text = text.replace(cx, function(e) {
  1366. return "\\u" + ("0000" + e.charCodeAt(0).toString(16)).slice(-4)
  1367. })),
  1368. /^[\],:{}\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, "")))
  1369. return j = eval("(" + text + ")"),
  1370. "function" == typeof reviver ? walk({
  1371. "": j
  1372. }, "") : j;
  1373. throw new SyntaxError("JSON.parse")
  1374. }
  1375. )
  1376. }(),
  1377. Hh = Keen.utils,
  1378. Ih = function(i) {
  1379. function e(e) {
  1380. for (u = 1; e = n.shift(); )
  1381. e()
  1382. }
  1383. 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]);
  1384. return r[l] && r[l](s, t = function() {
  1385. r.removeEventListener(s, t, !1),
  1386. e()
  1387. }
  1388. , !1),
  1389. a && r.attachEvent(c, t = function() {
  1390. /^c/.test(r[h]) && (r.detachEvent(c, t),
  1391. e())
  1392. }
  1393. ),
  1394. i = a ? function(t) {
  1395. self != top ? u ? t() : n.push(t) : function() {
  1396. try {
  1397. o.doScroll("left")
  1398. } catch (e) {
  1399. return setTimeout(function() {
  1400. i(t)
  1401. }, 50)
  1402. }
  1403. t()
  1404. }()
  1405. }
  1406. : function(e) {
  1407. u ? e() : n.push(e)
  1408. }
  1409. }
  1410. ,
  1411. "undefined" != typeof module && module.exports ? module.exports = Ih() : "function" == typeof define && define.amd ? define(Ih) : Hh.domready = Ih();
  1412. var loaded = window.Keen, cached = window._Keen || {}, clients, ready;
  1413. if (loaded && cached) {
  1414. for (var instance in clients = cached.clients || {},
  1415. ready = cached.ready || [],
  1416. clients)
  1417. if (clients.hasOwnProperty(instance)) {
  1418. var client = clients[instance];
  1419. for (var method in Keen.prototype)
  1420. Keen.prototype.hasOwnProperty(method) && (loaded.prototype[method] = Keen.prototype[method]);
  1421. if (loaded.Query = Keen.Query ? Keen.Query : function() {}
  1422. ,
  1423. loaded.Visualization = Keen.Visualization ? Keen.Visualization : function() {}
  1424. ,
  1425. client._config && (client.configure.call(client, client._config),
  1426. delete client._config),
  1427. client._setGlobalProperties) {
  1428. for (var globals = client._setGlobalProperties, i = 0; i < globals.length; i++)
  1429. client.setGlobalProperties.apply(client, globals[i]);
  1430. delete client._setGlobalProperties
  1431. }
  1432. if (client._addEvent) {
  1433. for (var queue = client._addEvent || [], i = 0; i < queue.length; i++)
  1434. client.addEvent.apply(client, queue[i]);
  1435. delete client._addEvent
  1436. }
  1437. var callback = client._on || [];
  1438. if (client._on) {
  1439. for (var i = 0; i < callback.length; i++)
  1440. client.on.apply(client, callback[i]);
  1441. client.trigger("ready"),
  1442. delete client._on
  1443. }
  1444. }
  1445. for (var i = 0; i < ready.length; i++) {
  1446. var callback = ready[i];
  1447. Keen.on("ready", function() {
  1448. callback()
  1449. })
  1450. }
  1451. }
  1452. return Keen.loaded && setTimeout(function() {
  1453. Keen.utils.domready(function() {
  1454. Keen.trigger("ready")
  1455. })
  1456. }, 0),
  1457. Keen
  1458. }),
  1459. function() {
  1460. var i = window.analytics = window.analytics || [];
  1461. if (!i.initialize) {
  1462. if (i.invoked)
  1463. return window.console && console.error && console.error("Segment snippet included twice.");
  1464. i.invoked = !0,
  1465. i.methods = ["trackSubmit", "trackClick", "trackLink", "trackForm", "pageview", "identify", "reset", "group", "track", "ready", "alias", "debug", "page", "once", "off", "on"],
  1466. i.factory = function(t) {
  1467. return function() {
  1468. var e = Array.prototype.slice.call(arguments);
  1469. return e.unshift(t),
  1470. i.push(e),
  1471. i
  1472. }
  1473. }
  1474. ;
  1475. for (var e = 0; e < i.methods.length; e++) {
  1476. var t = i.methods[e];
  1477. i[t] = i.factory(t)
  1478. }
  1479. i.load = function(e) {
  1480. var t = document.createElement("script");
  1481. t.type = "text/javascript",
  1482. t.async = !0,
  1483. t.src = ("https:" === document.location.protocol ? "https://" : "http://") + "cdn.segment.com/analytics.js/v1/" + e + "/analytics.min.js";
  1484. var i = document.getElementsByTagName("script")[0];
  1485. i.parentNode.insertBefore(t, i)
  1486. }
  1487. ,
  1488. i.SNIPPET_VERSION = "4.0.0"
  1489. }
  1490. }(),
  1491. function(i, u) {
  1492. "use strict";
  1493. var d = "function"
  1494. , p = "undefined"
  1495. , f = "object"
  1496. , e = "major"
  1497. , t = "model"
  1498. , n = "name"
  1499. , r = "type"
  1500. , o = "vendor"
  1501. , a = "version"
  1502. , s = "architecture"
  1503. , l = "console"
  1504. , c = "mobile"
  1505. , h = "tablet"
  1506. , g = {
  1507. has: function(e, t) {
  1508. return -1 !== t.toLowerCase().indexOf(e.toLowerCase())
  1509. },
  1510. lowerize: function(e) {
  1511. return e.toLowerCase()
  1512. }
  1513. }
  1514. , m = {
  1515. rgx: function() {
  1516. for (var e, t, i, n, r, o, a, s = 0, l = arguments; s < l.length; s += 2) {
  1517. var c = l[s]
  1518. , h = l[s + 1];
  1519. if (typeof e == p)
  1520. for (n in e = {},
  1521. h)
  1522. typeof (r = h[n]) == f ? e[r[0]] = u : e[r] = u;
  1523. for (t = i = 0; t < c.length; t++)
  1524. if (o = c[t].exec(this.getUA())) {
  1525. for (n = 0; n < h.length; n++)
  1526. a = o[++i],
  1527. 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;
  1528. break
  1529. }
  1530. if (o)
  1531. break
  1532. }
  1533. return e
  1534. },
  1535. str: function(e, t) {
  1536. for (var i in t)
  1537. if (typeof t[i] == f && 0 < t[i].length) {
  1538. for (var n = 0; n < t[i].length; n++)
  1539. if (g.has(t[i][n], e))
  1540. return "?" === i ? u : i
  1541. } else if (g.has(t[i], e))
  1542. return "?" === i ? u : i;
  1543. return e
  1544. }
  1545. }
  1546. , v = {
  1547. browser: {
  1548. oldsafari: {
  1549. major: {
  1550. 1: ["/8", "/1", "/3"],
  1551. 2: "/4",
  1552. "?": "/"
  1553. },
  1554. version: {
  1555. "1.0": "/8",
  1556. 1.2: "/1",
  1557. 1.3: "/3",
  1558. "2.0": "/412",
  1559. "2.0.2": "/416",
  1560. "2.0.3": "/417",
  1561. "2.0.4": "/419",
  1562. "?": "/"
  1563. }
  1564. }
  1565. },
  1566. device: {
  1567. sprint: {
  1568. model: {
  1569. "Evo Shift 4G": "7373KT"
  1570. },
  1571. vendor: {
  1572. HTC: "APA",
  1573. Sprint: "Sprint"
  1574. }
  1575. }
  1576. },
  1577. os: {
  1578. windows: {
  1579. version: {
  1580. ME: "4.90",
  1581. "NT 3.11": "NT3.51",
  1582. "NT 4.0": "NT4.0",
  1583. 2e3: "NT 5.0",
  1584. XP: ["NT 5.1", "NT 5.2"],
  1585. Vista: "NT 6.0",
  1586. 7: "NT 6.1",
  1587. 8: "NT 6.2",
  1588. 8.1: "NT 6.3",
  1589. RT: "ARM"
  1590. }
  1591. }
  1592. }
  1593. }
  1594. , y = {
  1595. 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]],
  1596. 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]],
  1597. 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]],
  1598. 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]],
  1599. 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]]
  1600. }
  1601. , A = function(e) {
  1602. var t = e || (i && i.navigator && i.navigator.userAgent ? i.navigator.userAgent : "");
  1603. return this instanceof A ? (this.getBrowser = function() {
  1604. return m.rgx.apply(this, y.browser)
  1605. }
  1606. ,
  1607. this.getCPU = function() {
  1608. return m.rgx.apply(this, y.cpu)
  1609. }
  1610. ,
  1611. this.getDevice = function() {
  1612. return m.rgx.apply(this, y.device)
  1613. }
  1614. ,
  1615. this.getEngine = function() {
  1616. return m.rgx.apply(this, y.engine)
  1617. }
  1618. ,
  1619. this.getOS = function() {
  1620. return m.rgx.apply(this, y.os)
  1621. }
  1622. ,
  1623. this.getResult = function() {
  1624. return {
  1625. ua: this.getUA(),
  1626. browser: this.getBrowser(),
  1627. engine: this.getEngine(),
  1628. os: this.getOS(),
  1629. device: this.getDevice(),
  1630. cpu: this.getCPU()
  1631. }
  1632. }
  1633. ,
  1634. this.getUA = function() {
  1635. return t
  1636. }
  1637. ,
  1638. this.setUA = function(e) {
  1639. return t = e,
  1640. this
  1641. }
  1642. ,
  1643. void this.setUA(t)) : new A(e).getResult()
  1644. };
  1645. if (typeof exports != p)
  1646. typeof module != p && module.exports && (exports = module.exports = A),
  1647. exports.UAParser = A;
  1648. else if (i.UAParser = A,
  1649. typeof define == d && define.amd && define(function() {
  1650. return A
  1651. }),
  1652. typeof i.jQuery != p) {
  1653. var C = i.jQuery
  1654. , I = new A;
  1655. C.ua = I.getResult(),
  1656. C.ua.get = function() {
  1657. return I.getUA()
  1658. }
  1659. ,
  1660. C.ua.set = function(e) {
  1661. I.setUA(e);
  1662. var t = I.getResult();
  1663. for (var i in t)
  1664. C.ua[i] = t[i]
  1665. }
  1666. }
  1667. }(this),
  1668. window.Modernizr = function(e, t) {
  1669. function i(e, t) {
  1670. return typeof e === t
  1671. }
  1672. var n, r, o, a = {}, s = t.documentElement, l = t.createElement("modernizr"), c = l.style, h = {}, u = [], d = u.slice, p = {}.hasOwnProperty;
  1673. for (var f in r = i(p, "undefined") || i(p.call, "undefined") ? function(e, t) {
  1674. return t in e && i(e.constructor.prototype[t], "undefined")
  1675. }
  1676. : function(e, t) {
  1677. return p.call(e, t)
  1678. }
  1679. ,
  1680. Function.prototype.bind || (Function.prototype.bind = function(n) {
  1681. var r = this;
  1682. if ("function" != typeof r)
  1683. throw new TypeError;
  1684. var o = d.call(arguments, 1)
  1685. , a = function() {
  1686. if (this instanceof a) {
  1687. function e() {}
  1688. e.prototype = r.prototype;
  1689. var t = new e
  1690. , i = r.apply(t, o.concat(d.call(arguments)));
  1691. return Object(i) === i ? i : t
  1692. }
  1693. return r.apply(n, o.concat(d.call(arguments)))
  1694. };
  1695. return a
  1696. }
  1697. ),
  1698. h.webgl = function() {
  1699. return !!e.WebGLRenderingContext
  1700. }
  1701. ,
  1702. h)
  1703. r(h, f) && (n = f.toLowerCase(),
  1704. a[n] = h[f](),
  1705. u.push((a[n] ? "" : "no-") + n));
  1706. return a.addTest = function(e, t) {
  1707. if ("object" == typeof e)
  1708. for (var i in e)
  1709. r(e, i) && a.addTest(i, e[i]);
  1710. else {
  1711. if (e = e.toLowerCase(),
  1712. void 0 !== a[e])
  1713. return a;
  1714. t = "function" == typeof t ? t() : t,
  1715. "undefined" != typeof enableClasses && enableClasses && (s.className += " " + (t ? "" : "no-") + e),
  1716. a[e] = t
  1717. }
  1718. return a
  1719. }
  1720. ,
  1721. o = "",
  1722. c.cssText = o,
  1723. l = null,
  1724. a._version = "2.8.2",
  1725. a
  1726. }(this, this.document),
  1727. function(xe, e, Se) {
  1728. "use strict";
  1729. function Me(s, e, n) {
  1730. function a(e) {
  1731. var t = Q.length;
  1732. if (G.old = xe.extend({}, G),
  1733. H = V ? 0 : k[F.horizontal ? "width" : "height"](),
  1734. Y = W[F.horizontal ? "width" : "height"](),
  1735. z = V ? s : U[F.horizontal ? "outerWidth" : "outerHeight"](),
  1736. Q.length = 0,
  1737. G.start = 0,
  1738. G.end = nt(z - H, 0),
  1739. le) {
  1740. $.length,
  1741. J = U.children(F.itemSelector),
  1742. $.length = 0;
  1743. 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;
  1744. z = 0,
  1745. J.each(function(e, t) {
  1746. var i = xe(t)
  1747. , n = t.getBoundingClientRect()
  1748. , r = it(F.horizontal ? n.width || n.right - n.left : n.height || n.bottom - n.top)
  1749. , o = Ne(i, F.horizontal ? "marginLeft" : "marginTop")
  1750. , a = Ne(i, F.horizontal ? "marginRight" : "marginBottom")
  1751. , s = r + o + a
  1752. , l = !o || !a
  1753. , c = {};
  1754. c.el = t,
  1755. c.size = l ? r : s,
  1756. c.half = c.size / 2,
  1757. c.start = z + (l ? o : 0),
  1758. c.center = c.start - it(H / 2 - c.size / 2),
  1759. c.end = c.start - H + c.size,
  1760. e || (z += u),
  1761. z += s,
  1762. F.horizontal || p || a && o && 0 < e && (z -= rt(o, a)),
  1763. e === g && (c.end += d,
  1764. z += d,
  1765. f = l ? a : 0),
  1766. $.push(c),
  1767. h = c
  1768. }),
  1769. U[0].style[F.horizontal ? "width" : "height"] = (i ? z : z - u - d) + "px",
  1770. z -= f,
  1771. $.length ? (G.start = $[0][ae ? "center" : "start"],
  1772. G.end = ae ? h.center : H < z ? h.end : G.start) : G.start = G.end = 0
  1773. }
  1774. if (G.center = it(G.end / 2 + G.start / 2),
  1775. v(),
  1776. j.length && 0 < Y && (F.dynamicHandle ? (q = Fe(q = G.start === G.end ? Y : it(Y * H / z), F.minHandleSize, Y),
  1777. j[0].style[F.horizontal ? "width" : "height"] = q + "px") : q = j[F.horizontal ? "outerWidth" : "outerHeight"](),
  1778. X.end = Y - q,
  1779. _e || c()),
  1780. !V && 0 < H) {
  1781. var n = G.start
  1782. , r = "";
  1783. if (le)
  1784. xe.each($, function(e, t) {
  1785. ae ? Q.push(t.center) : t.start + t.size > n && n <= G.end && (n = t.start,
  1786. Q.push(n),
  1787. (n += H) > G.end && n < G.end + H && Q.push(G.end))
  1788. });
  1789. else
  1790. for (; n - H < G.end; )
  1791. Q.push(n),
  1792. n += H;
  1793. if (Z[0] && t !== Q.length) {
  1794. for (var o = 0; o < Q.length; o++)
  1795. r += F.pageBuilder.call(B, o);
  1796. (K = Z.html(r).children()).eq(ee.activePage).addClass(F.activeClass)
  1797. }
  1798. }
  1799. if (ee.slideeSize = z,
  1800. ee.frameSize = H,
  1801. ee.sbSize = Y,
  1802. ee.handleSize = q,
  1803. le) {
  1804. e && null != F.startAt && (m(F.startAt),
  1805. B[se ? "toCenter" : "toStart"](F.startAt));
  1806. var a = $[ee.activeItem];
  1807. l(se && a ? a.center : Fe(G.dest, G.start, G.end))
  1808. } else
  1809. e ? null != F.startAt && l(F.startAt, 1) : l(Fe(G.dest, G.start, G.end));
  1810. L("load")
  1811. }
  1812. function l(e, t, i) {
  1813. if (le && Ie.released && !i) {
  1814. var n = d(e)
  1815. , r = e > G.start && e < G.end;
  1816. se ? (r && (e = $[n.centerItem].center),
  1817. ae && F.activateMiddle && m(n.centerItem)) : r && (e = $[n.firstItem].start)
  1818. }
  1819. 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),
  1820. Ae.start = +new Date,
  1821. Ae.time = 0,
  1822. Ae.from = G.cur,
  1823. Ae.to = e,
  1824. Ae.delta = e - G.cur,
  1825. Ae.tweesing = Ie.tweese || Ie.init && !Ie.slidee,
  1826. Ae.immediate = !Ae.tweesing && (t || Ie.init && Ie.slidee || !F.speed),
  1827. Ie.tweese = 0,
  1828. e !== G.dest && (G.dest = e,
  1829. L("change"),
  1830. _e || o()),
  1831. g(),
  1832. v(),
  1833. p(),
  1834. K[0] && ye.page !== ee.activePage && (ye.page = ee.activePage,
  1835. K.removeClass(F.activeClass).eq(ee.activePage).addClass(F.activeClass),
  1836. L("activePage", ye.page))
  1837. }
  1838. function o() {
  1839. if (B.initialized) {
  1840. if (!_e)
  1841. return _e = Ge(o),
  1842. void (Ie.released && L("moveStart"));
  1843. Ae.immediate ? G.cur = Ae.to : Ae.tweesing ? (Ae.tweeseDelta = Ae.to - G.cur,
  1844. $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),
  1845. G.cur = Ae.from + Ae.delta * xe.easing[F.easing](Ae.time / F.speed, Ae.time, 0, 1, F.speed)),
  1846. Ae.to === G.cur ? (G.cur = Ae.to,
  1847. Ie.tweese = _e = 0) : _e = Ge(o),
  1848. L("move"),
  1849. 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"),
  1850. !_e && Ie.released && L("moveEnd"),
  1851. c()
  1852. }
  1853. }
  1854. function c() {
  1855. 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,
  1856. X.cur = Fe(it(X.cur), X.start, X.end),
  1857. ye.hPos !== X.cur && (ye.hPos = X.cur,
  1858. Ve ? j[0].style[Ve] = ke + (F.horizontal ? "translateX" : "translateY") + "(" + X.cur + "px)" : j[0].style[F.horizontal ? "left" : "top"] = X.cur + "px"))
  1859. }
  1860. function t() {
  1861. Ce.speed && G.cur !== (0 < Ce.speed ? G.end : G.start) || B.stop(),
  1862. Te = Ie.init ? Ge(t) : 0,
  1863. Ce.now = +new Date,
  1864. Ce.pos = G.cur + (Ce.now - Ce.lastTime) / 1e3 * Ce.speed,
  1865. l(Ie.init ? Ce.pos : it(Ce.pos)),
  1866. Ie.init || G.cur !== G.dest || L("moveEnd"),
  1867. Ce.lastTime = Ce.now
  1868. }
  1869. function i(e, t, i) {
  1870. if ("boolean" === Re(t) && (i = t,
  1871. t = Se),
  1872. t === Se)
  1873. l(G[e], i);
  1874. else {
  1875. if (se && "center" !== e)
  1876. return;
  1877. var n = B.getPos(t);
  1878. n && l(n[e], i, !se)
  1879. }
  1880. }
  1881. function h(e) {
  1882. return null != e ? De(e) ? 0 <= e && e < $.length ? e : -1 : J.index(e) : -1
  1883. }
  1884. function u(e) {
  1885. return h(De(e) && e < 0 ? e + $.length : e)
  1886. }
  1887. function m(e, t) {
  1888. var i = h(e);
  1889. return !(!le || i < 0) && (ye.active === i && !t || (J.eq(ee.activeItem).removeClass(F.activeClass),
  1890. J.eq(i).addClass(F.activeClass),
  1891. ye.active = ee.activeItem = i,
  1892. p(),
  1893. L("active", i)),
  1894. i)
  1895. }
  1896. function d(e) {
  1897. e = Fe(De(e) ? e : G.dest, G.start, G.end);
  1898. var t = {}
  1899. , i = ae ? 0 : H / 2;
  1900. if (!V)
  1901. for (var n = 0, r = Q.length; n < r; n++) {
  1902. if (e >= G.end || n === Q.length - 1) {
  1903. t.activePage = Q.length - 1;
  1904. break
  1905. }
  1906. if (e <= Q[n] + i) {
  1907. t.activePage = n;
  1908. break
  1909. }
  1910. }
  1911. if (le) {
  1912. for (var o = !1, a = !1, s = !1, l = 0, c = $.length; l < c; l++)
  1913. if (!1 === o && e <= $[l].start + $[l].half && (o = l),
  1914. !1 === s && e <= $[l].center + $[l].half && (s = l),
  1915. l === c - 1 || e <= $[l].end + $[l].half) {
  1916. a = l;
  1917. break
  1918. }
  1919. t.firstItem = De(o) ? o : 0,
  1920. t.centerItem = De(s) ? s : t.firstItem,
  1921. t.lastItem = De(a) ? a : t.centerItem
  1922. }
  1923. return t
  1924. }
  1925. function v(e) {
  1926. xe.extend(ee, d(e))
  1927. }
  1928. function p() {
  1929. var e = G.dest <= G.start
  1930. , t = G.dest >= G.end
  1931. , i = (e ? 1 : 0) | (t ? 2 : 0);
  1932. if (ye.slideePosState !== i && (ye.slideePosState = i,
  1933. ge.is("button,input") && ge.prop("disabled", e),
  1934. me.is("button,input") && me.prop("disabled", t),
  1935. ge.add(de)[e ? "addClass" : "removeClass"](F.disabledClass),
  1936. me.add(ue)[t ? "addClass" : "removeClass"](F.disabledClass)),
  1937. ye.fwdbwdState !== i && Ie.released && (ye.fwdbwdState = i,
  1938. de.is("button,input") && de.prop("disabled", e),
  1939. ue.is("button,input") && ue.prop("disabled", t)),
  1940. le && null != ee.activeItem) {
  1941. var n = 0 === ee.activeItem
  1942. , r = ee.activeItem >= $.length - 1
  1943. , o = (n ? 1 : 0) | (r ? 2 : 0);
  1944. ye.itemsButtonState !== o && (ye.itemsButtonState = o,
  1945. pe.is("button,input") && pe.prop("disabled", n),
  1946. fe.is("button,input") && fe.prop("disabled", r),
  1947. pe[n ? "addClass" : "removeClass"](F.disabledClass),
  1948. fe[r ? "addClass" : "removeClass"](F.disabledClass))
  1949. }
  1950. }
  1951. function r(e, t, i) {
  1952. if (e = u(e),
  1953. t = u(t),
  1954. -1 < e && -1 < t && e !== t && (!i || t !== e - 1) && (i || t !== e + 1)) {
  1955. J.eq(e)[i ? "insertAfter" : "insertBefore"]($[t].el);
  1956. var n = e < t ? e : i ? t : t - 1
  1957. , r = t < e ? e : i ? t + 1 : t
  1958. , o = t < e;
  1959. 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)),
  1960. a()
  1961. }
  1962. }
  1963. function f(e, t) {
  1964. for (var i = 0, n = ve[e].length; i < n; i++)
  1965. if (ve[e][i] === t)
  1966. return i;
  1967. return -1
  1968. }
  1969. function g() {
  1970. Ie.released && !B.isPaused && B.resume()
  1971. }
  1972. function y(e) {
  1973. return it(Fe(e, X.start, X.end) / X.end * (G.end - G.start)) + G.start
  1974. }
  1975. function A() {
  1976. Ie.history[0] = Ie.history[1],
  1977. Ie.history[1] = Ie.history[2],
  1978. Ie.history[2] = Ie.history[3],
  1979. Ie.history[3] = Ie.delta
  1980. }
  1981. function C(e) {
  1982. Ie.released = 0,
  1983. Ie.source = e,
  1984. Ie.slidee = "slidee" === e
  1985. }
  1986. function I(e) {
  1987. var t = "touchstart" === e.type
  1988. , i = e.data.source
  1989. , n = "slidee" === i;
  1990. 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),
  1991. C(i),
  1992. Ie.init = 0,
  1993. Ie.$source = xe(e.target),
  1994. Ie.touch = t,
  1995. Ie.pointer = t ? e.originalEvent.touches[0] : e,
  1996. Ie.initX = Ie.pointer.pageX,
  1997. Ie.initY = Ie.pointer.pageY,
  1998. Ie.initPos = n ? G.cur : X.cur,
  1999. Ie.start = +new Date,
  2000. Ie.time = 0,
  2001. Ie.path = 0,
  2002. Ie.delta = 0,
  2003. Ie.locked = 0,
  2004. Ie.history = [0, 0, 0, 0],
  2005. Ie.pathToLock = n ? t ? 30 : 10 : 0,
  2006. We.on(t ? qe : Ye, E),
  2007. B.pause(1),
  2008. (n ? U : j).addClass(F.draggedClass),
  2009. L("moveStart"),
  2010. n && (be = setInterval(A, 10)))
  2011. }
  2012. function E(e) {
  2013. if (Ie.released = "mouseup" === e.type || "touchend" === e.type,
  2014. Ie.pointer = Ie.touch ? e.originalEvent[Ie.released ? "changedTouches" : "touches"][0] : e,
  2015. Ie.pathX = Ie.pointer.pageX - Ie.initX,
  2016. Ie.pathY = Ie.pointer.pageY - Ie.initY,
  2017. Ie.path = et(tt(Ie.pathX, 2) + tt(Ie.pathY, 2)),
  2018. Ie.delta = F.horizontal ? Ie.pathX : Ie.pathY,
  2019. Ie.released || !(Ie.path < 1)) {
  2020. if (!Ie.init) {
  2021. if (!(F.horizontal ? $e(Ie.pathX) > $e(Ie.pathY) : $e(Ie.pathX) < $e(Ie.pathY)))
  2022. return _();
  2023. Ie.init = 1
  2024. }
  2025. Pe(e),
  2026. !Ie.locked && Ie.path > Ie.pathToLock && Ie.slidee && (Ie.locked = 1,
  2027. Ie.$source.on(Ze, Oe)),
  2028. Ie.released && (_(),
  2029. F.releaseSwing && Ie.slidee && (Ie.swing = (Ie.delta - Ie.history[0]) / 40 * 300,
  2030. Ie.delta += Ie.swing,
  2031. Ie.tweese = 10 < $e(Ie.swing))),
  2032. l(Ie.slidee ? it(Ie.initPos - Ie.delta) : y(Ie.initPos + Ie.delta))
  2033. }
  2034. }
  2035. function _() {
  2036. clearInterval(be),
  2037. Ie.released = !0,
  2038. We.off(Ie.touch ? qe : Ye, E),
  2039. (Ie.slidee ? U : j).removeClass(F.draggedClass),
  2040. setTimeout(function() {
  2041. Ie.$source.off(Ze, Oe)
  2042. }),
  2043. G.cur === G.dest && Ie.init && L("moveEnd"),
  2044. B.resume(1),
  2045. Ie.init = 0
  2046. }
  2047. function b(e) {
  2048. return ~xe.inArray(e.nodeName, Qe) || xe(e).is(F.interactive)
  2049. }
  2050. function w() {
  2051. B.stop(),
  2052. We.off("mouseup", w)
  2053. }
  2054. function T(e) {
  2055. switch (Pe(e),
  2056. this) {
  2057. case ue[0]:
  2058. case de[0]:
  2059. B.moveBy(ue.is(this) ? F.moveBy : -F.moveBy),
  2060. We.on("mouseup", w);
  2061. break;
  2062. case pe[0]:
  2063. B.prev();
  2064. break;
  2065. case fe[0]:
  2066. B.next();
  2067. break;
  2068. case ge[0]:
  2069. B.prevPage();
  2070. break;
  2071. case me[0]:
  2072. B.nextPage()
  2073. }
  2074. }
  2075. function x(e) {
  2076. e.originalEvent[He] = B;
  2077. var t = +new Date;
  2078. if (ot + F.scrollHijack > t && ce[0] !== document && ce[0] !== window)
  2079. ot = t;
  2080. else if (F.scrollBy && G.start !== G.end) {
  2081. var i = function(e) {
  2082. return Ee.curDelta = (F.horizontal ? e.deltaY || e.deltaX : e.deltaY) || -e.wheelDelta,
  2083. Ee.curDelta /= 1 === e.deltaMode ? 3 : 100,
  2084. le ? (Ue = +new Date,
  2085. Ee.last < Ue - Ee.resetTime && (Ee.delta = 0),
  2086. Ee.last = Ue,
  2087. Ee.delta += Ee.curDelta,
  2088. $e(Ee.delta) < 1 ? Ee.finalDelta = 0 : (Ee.finalDelta = it(Ee.delta / 1),
  2089. Ee.delta %= 1),
  2090. Ee.finalDelta) : Ee.curDelta
  2091. }(e.originalEvent);
  2092. (F.scrollTrap || 0 < i && G.dest < G.end || i < 0 && G.dest > G.start) && Pe(e, 1),
  2093. B.slideBy(F.scrollBy * i)
  2094. }
  2095. }
  2096. function S(e) {
  2097. F.clickBar && e.target === W[0] && (Pe(e),
  2098. l(y((F.horizontal ? e.pageX - W.offset().left : e.pageY - W.offset().top) - q / 2)))
  2099. }
  2100. function M(e) {
  2101. if (F.keyboardNavBy)
  2102. switch (e.which) {
  2103. case F.horizontal ? 37 : 38:
  2104. Pe(e),
  2105. B["pages" === F.keyboardNavBy ? "prevPage" : "prev"]();
  2106. break;
  2107. case F.horizontal ? 39 : 40:
  2108. Pe(e),
  2109. B["pages" === F.keyboardNavBy ? "nextPage" : "next"]()
  2110. }
  2111. }
  2112. function R(e) {
  2113. return b(this) ? void (e.originalEvent[He + "ignore"] = !0) : void (this.parentNode !== U[0] || e.originalEvent[He + "ignore"] || B.activate(this))
  2114. }
  2115. function P() {
  2116. this.parentNode === Z[0] && B.activatePage(K.index(this))
  2117. }
  2118. function O(e) {
  2119. F.pauseOnHover && B["mouseenter" === e.type ? "pause" : "resume"](2)
  2120. }
  2121. function L(e, t) {
  2122. if (ve[e]) {
  2123. for (N = ve[e].length,
  2124. Je.length = 0,
  2125. D = 0; D < N; D++)
  2126. Je.push(ve[e][D]);
  2127. for (D = 0; D < N; D++)
  2128. Je[D].call(B, e, t)
  2129. }
  2130. }
  2131. 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 = {
  2132. start: 0,
  2133. center: 0,
  2134. end: 0,
  2135. cur: 0,
  2136. dest: 0
  2137. }, W = xe(F.scrollBar).eq(0), j = W.children().eq(0), Y = 0, q = 0, X = {
  2138. start: 0,
  2139. end: 0,
  2140. cur: 0
  2141. }, Z = xe(F.pagesBar), K = 0, Q = [], J = 0, $ = [], ee = {
  2142. firstItem: 0,
  2143. lastItem: 0,
  2144. centerItem: 0,
  2145. activeItem: null,
  2146. activePage: 0
  2147. }, 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 = {
  2148. released: 1
  2149. }, Ee = {
  2150. last: 0,
  2151. delta: 0,
  2152. resetTime: 200
  2153. }, _e = 0, be = 0, we = 0, Te = 0;
  2154. V || (s = k[0]),
  2155. B.initialized = 0,
  2156. B.frame = s,
  2157. B.slidee = U[0],
  2158. B.pos = G,
  2159. B.rel = ee,
  2160. B.items = $,
  2161. B.pages = Q,
  2162. B.isPaused = 0,
  2163. B.options = F,
  2164. B.dragging = Ie,
  2165. B.reload = function() {
  2166. a()
  2167. }
  2168. ,
  2169. B.getPos = function(e) {
  2170. if (le) {
  2171. var t = h(e);
  2172. return -1 !== t && $[t]
  2173. }
  2174. var i = U.find(e).eq(0);
  2175. if (i[0]) {
  2176. var n = F.horizontal ? i.offset().left - U.offset().left : i.offset().top - U.offset().top
  2177. , r = i[F.horizontal ? "outerWidth" : "outerHeight"]();
  2178. return {
  2179. start: n,
  2180. center: n - H / 2 + r / 2,
  2181. end: n - H + r,
  2182. size: r
  2183. }
  2184. }
  2185. return !1
  2186. }
  2187. ,
  2188. B.moveBy = function(e) {
  2189. Ce.speed = e,
  2190. !Ie.init && Ce.speed && G.cur !== (0 < Ce.speed ? G.end : G.start) && (Ce.lastTime = +new Date,
  2191. Ce.startPos = G.cur,
  2192. C("button"),
  2193. Ie.init = 1,
  2194. L("moveStart"),
  2195. ze(Te),
  2196. t())
  2197. }
  2198. ,
  2199. B.stop = function() {
  2200. "button" === Ie.source && (Ie.init = 0,
  2201. Ie.released = 1)
  2202. }
  2203. ,
  2204. B.prev = function() {
  2205. B.activate(null == ee.activeItem ? 0 : ee.activeItem - 1)
  2206. }
  2207. ,
  2208. B.next = function() {
  2209. B.activate(null == ee.activeItem ? 0 : ee.activeItem + 1)
  2210. }
  2211. ,
  2212. B.prevPage = function() {
  2213. B.activatePage(ee.activePage - 1)
  2214. }
  2215. ,
  2216. B.nextPage = function() {
  2217. B.activatePage(ee.activePage + 1)
  2218. }
  2219. ,
  2220. B.slideBy = function(e, t) {
  2221. e && (le ? B[se ? "toCenter" : "toStart"](Fe((se ? ee.centerItem : ee.firstItem) + F.scrollBy * e, 0, $.length)) : l(G.dest + e, t))
  2222. }
  2223. ,
  2224. B.slideTo = function(e, t) {
  2225. l(e, t)
  2226. }
  2227. ,
  2228. B.toStart = function(e, t) {
  2229. i("start", e, t)
  2230. }
  2231. ,
  2232. B.toEnd = function(e, t) {
  2233. i("end", e, t)
  2234. }
  2235. ,
  2236. B.toCenter = function(e, t) {
  2237. i("center", e, t)
  2238. }
  2239. ,
  2240. B.getIndex = h,
  2241. B.activate = function(e, t) {
  2242. var i = m(e);
  2243. F.smart && !1 !== i && (se ? B.toCenter(i, t) : i >= ee.lastItem ? B.toStart(i, t) : i <= ee.firstItem ? B.toEnd(i, t) : g())
  2244. }
  2245. ,
  2246. B.activatePage = function(e, t) {
  2247. De(e) && l(Q[Fe(e, 0, Q.length - 1)], t)
  2248. }
  2249. ,
  2250. B.resume = function(e) {
  2251. F.cycleBy && F.cycleInterval && ("items" !== F.cycleBy || $[0] && null != ee.activeItem) && !(e < B.isPaused) && (B.isPaused = 0,
  2252. we ? we = clearTimeout(we) : L("resume"),
  2253. we = setTimeout(function() {
  2254. switch (L("cycle"),
  2255. F.cycleBy) {
  2256. case "items":
  2257. B.activate(ee.activeItem >= $.length - 1 ? 0 : ee.activeItem + 1);
  2258. break;
  2259. case "pages":
  2260. B.activatePage(ee.activePage >= Q.length - 1 ? 0 : ee.activePage + 1)
  2261. }
  2262. }, F.cycleInterval))
  2263. }
  2264. ,
  2265. B.pause = function(e) {
  2266. e < B.isPaused || (B.isPaused = e || 100,
  2267. we && (we = clearTimeout(we),
  2268. L("pause")))
  2269. }
  2270. ,
  2271. B.toggle = function() {
  2272. B[we ? "pause" : "resume"]()
  2273. }
  2274. ,
  2275. B.set = function(e, t) {
  2276. xe.isPlainObject(e) ? xe.extend(F, e) : F.hasOwnProperty(e) && (F[e] = t)
  2277. }
  2278. ,
  2279. B.add = function(e, t) {
  2280. var i = xe(e);
  2281. le ? (null == t || !$[0] || t >= $.length ? i.appendTo(U) : $.length && i.insertBefore($[t].el),
  2282. null != ee.activeItem && t <= ee.activeItem && (ye.active = ee.activeItem += i.length)) : U.append(i),
  2283. a()
  2284. }
  2285. ,
  2286. B.remove = function(e) {
  2287. if (le) {
  2288. var t = u(e);
  2289. if (-1 < t) {
  2290. J.eq(t).remove();
  2291. var i = t === ee.activeItem;
  2292. null != ee.activeItem && t < ee.activeItem && (ye.active = --ee.activeItem),
  2293. a(),
  2294. i && (ye.active = null,
  2295. B.activate(ee.activeItem))
  2296. }
  2297. } else
  2298. xe(e).remove(),
  2299. a()
  2300. }
  2301. ,
  2302. B.moveAfter = function(e, t) {
  2303. r(e, t, 1)
  2304. }
  2305. ,
  2306. B.moveBefore = function(e, t) {
  2307. r(e, t)
  2308. }
  2309. ,
  2310. B.on = function(e, t) {
  2311. if ("object" === Re(e))
  2312. for (var i in e)
  2313. e.hasOwnProperty(i) && B.on(i, e[i]);
  2314. else if ("function" === Re(t))
  2315. for (var n = e.split(" "), r = 0, o = n.length; r < o; r++)
  2316. ve[n[r]] = ve[n[r]] || [],
  2317. -1 === f(n[r], t) && ve[n[r]].push(t);
  2318. else if ("array" === Re(t))
  2319. for (var a = 0, s = t.length; a < s; a++)
  2320. B.on(e, t[a])
  2321. }
  2322. ,
  2323. B.one = function(t, i) {
  2324. B.on(t, function e() {
  2325. i.apply(B, arguments),
  2326. B.off(t, e)
  2327. })
  2328. }
  2329. ,
  2330. B.off = function(e, t) {
  2331. if (t instanceof Array)
  2332. for (var i = 0, n = t.length; i < n; i++)
  2333. B.off(e, t[i]);
  2334. else
  2335. for (var r = e.split(" "), o = 0, a = r.length; o < a; o++)
  2336. if (ve[r[o]] = ve[r[o]] || [],
  2337. null == t)
  2338. ve[r[o]].length = 0;
  2339. else {
  2340. var s = f(r[o], t);
  2341. -1 !== s && ve[r[o]].splice(s, 1)
  2342. }
  2343. }
  2344. ,
  2345. B.destroy = function() {
  2346. return ce.add(j).add(W).add(Z).add(ue).add(de).add(pe).add(fe).add(ge).add(me).off("." + He),
  2347. We.off("keydown", M),
  2348. pe.add(fe).add(ge).add(me).removeClass(F.disabledClass),
  2349. J && null != ee.activeItem && J.eq(ee.activeItem).removeClass(F.activeClass),
  2350. Z.empty(),
  2351. V || (k.off("." + He),
  2352. te.restore(),
  2353. ie.restore(),
  2354. ne.restore(),
  2355. re.restore(),
  2356. xe.removeData(s, He)),
  2357. $.length = Q.length = 0,
  2358. ye = {},
  2359. B.initialized = 0,
  2360. B
  2361. }
  2362. ,
  2363. B.init = function() {
  2364. if (!B.initialized) {
  2365. B.on(n);
  2366. var e = ["overflow", "position"]
  2367. , t = ["position", "webkitTransform", "msTransform", "transform", "left", "top", "width", "height"];
  2368. te.save.apply(te, e),
  2369. ne.save.apply(ne, e),
  2370. ie.save.apply(ie, t),
  2371. re.save.apply(re, t);
  2372. var i = j;
  2373. return V || (i = i.add(U),
  2374. k.css("overflow", "hidden"),
  2375. Ve || "static" !== k.css("position") || k.css("position", "relative")),
  2376. Ve ? ke && i.css(Ve, ke) : ("static" === W.css("position") && W.css("position", "relative"),
  2377. i.css({
  2378. position: "absolute"
  2379. })),
  2380. F.forward && ue.on(Ke, T),
  2381. F.backward && de.on(Ke, T),
  2382. F.prev && pe.on(Ze, T),
  2383. F.next && fe.on(Ze, T),
  2384. F.prevPage && ge.on(Ze, T),
  2385. F.nextPage && me.on(Ze, T),
  2386. ce.on(Xe, x),
  2387. W[0] && W.on(Ze, S),
  2388. le && F.activateOn && k.on(F.activateOn + "." + He, "*", R),
  2389. Z[0] && F.activatePageOn && Z.on(F.activatePageOn + "." + He, "*", P),
  2390. he.on(je, {
  2391. source: "slidee"
  2392. }, I),
  2393. j && j.on(je, {
  2394. source: "handle"
  2395. }, I),
  2396. We.on("keydown", M),
  2397. V || (k.on("mouseenter." + He + " mouseleave." + He, O),
  2398. k.on("scroll." + He, Le)),
  2399. B.initialized = 1,
  2400. a(!0),
  2401. F.cycleBy && !V && B[F.startPaused ? "pause" : "resume"](),
  2402. B
  2403. }
  2404. }
  2405. }
  2406. function Re(e) {
  2407. 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
  2408. }
  2409. function Pe(e, t) {
  2410. e.preventDefault(),
  2411. t && e.stopPropagation()
  2412. }
  2413. function Oe(e) {
  2414. Pe(e, 1),
  2415. xe(this).off(e.type, Oe)
  2416. }
  2417. function Le() {
  2418. this.scrollLeft = 0,
  2419. this.scrollTop = 0
  2420. }
  2421. function De(e) {
  2422. return !isNaN(parseFloat(e)) && isFinite(e)
  2423. }
  2424. function Ne(e, t) {
  2425. return 0 | it(String(e.css(t)).replace(/[^\-0-9.]/g, ""))
  2426. }
  2427. function Fe(e, t, i) {
  2428. return e < t ? t : i < e ? i : e
  2429. }
  2430. function Be(t) {
  2431. var i = {
  2432. style: {},
  2433. save: function() {
  2434. if (t && t.nodeType) {
  2435. for (var e = 0; e < arguments.length; e++)
  2436. i.style[arguments[e]] = t.style[arguments[e]];
  2437. return i
  2438. }
  2439. },
  2440. restore: function() {
  2441. if (t && t.nodeType) {
  2442. for (var e in i.style)
  2443. i.style.hasOwnProperty(e) && (t.style[e] = i.style[e]);
  2444. return i
  2445. }
  2446. }
  2447. };
  2448. return i
  2449. }
  2450. 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;
  2451. function t(e) {
  2452. for (var t = 0, i = r.length; t < i; t++) {
  2453. var n = r[t] ? r[t] + e.charAt(0).toUpperCase() + e.slice(1) : e;
  2454. if (null != o.style[n])
  2455. return n
  2456. }
  2457. }
  2458. We.on(Xe, function(e) {
  2459. var t = e.originalEvent[He]
  2460. , i = +new Date;
  2461. (!t || t.options.scrollHijack < i - ot) && (ot = i)
  2462. }),
  2463. function(t) {
  2464. Ge = t.requestAnimationFrame || t.webkitRequestAnimationFrame || function(e) {
  2465. var t = (new Date).getTime()
  2466. , i = Math.max(0, 16 - (t - r))
  2467. , n = setTimeout(e, i);
  2468. return r = t,
  2469. n
  2470. }
  2471. ;
  2472. var r = (new Date).getTime()
  2473. , i = t.cancelAnimationFrame || t.webkitCancelAnimationFrame || t.clearTimeout;
  2474. ze = function(e) {
  2475. i.call(t, e)
  2476. }
  2477. }(window),
  2478. r = ["", "webkit", "moz", "ms", "o"],
  2479. o = document.createElement("div"),
  2480. Ve = t("transform"),
  2481. ke = t("perspective") ? "translateZ(0) " : "",
  2482. e.Sly = Me,
  2483. xe.fn.sly = function(n, r) {
  2484. var o, a;
  2485. return xe.isPlainObject(n) || ("string" !== Re(n) && !1 !== n || (o = !1 === n ? "destroy" : n,
  2486. a = Array.prototype.slice.call(arguments, 1)),
  2487. n = {}),
  2488. this.each(function(e, t) {
  2489. var i = xe.data(t, He);
  2490. i || o ? i && o && i[o] && i[o].apply(i, a) : i = xe.data(t, He, new Me(t,n,r).init())
  2491. })
  2492. }
  2493. ,
  2494. Me.defaults = {
  2495. slidee: null,
  2496. horizontal: !1,
  2497. itemNav: null,
  2498. itemSelector: null,
  2499. smart: !1,
  2500. activateOn: null,
  2501. activateMiddle: !1,
  2502. scrollSource: null,
  2503. scrollBy: 0,
  2504. scrollHijack: 300,
  2505. scrollTrap: !1,
  2506. dragSource: null,
  2507. mouseDragging: !1,
  2508. touchDragging: !1,
  2509. releaseSwing: !1,
  2510. swingSpeed: .2,
  2511. elasticBounds: !1,
  2512. interactive: null,
  2513. scrollBar: null,
  2514. dragHandle: !1,
  2515. dynamicHandle: !1,
  2516. minHandleSize: 50,
  2517. clickBar: !1,
  2518. syncSpeed: .5,
  2519. pagesBar: null,
  2520. activatePageOn: null,
  2521. pageBuilder: function(e) {
  2522. return "<li>" + (e + 1) + "</li>"
  2523. },
  2524. forward: null,
  2525. backward: null,
  2526. prev: null,
  2527. next: null,
  2528. prevPage: null,
  2529. nextPage: null,
  2530. cycleBy: null,
  2531. cycleInterval: 5e3,
  2532. pauseOnHover: !1,
  2533. startPaused: !1,
  2534. moveBy: 300,
  2535. speed: 0,
  2536. easing: "swing",
  2537. startAt: null,
  2538. keyboardNavBy: null,
  2539. draggedClass: "dragged",
  2540. activeClass: "active",
  2541. disabledClass: "disabled"
  2542. }
  2543. }(jQuery, window),
  2544. function o(a, s, l) {
  2545. function c(i, e) {
  2546. if (!s[i]) {
  2547. if (!a[i]) {
  2548. var t = "function" == typeof require && require;
  2549. if (!e && t)
  2550. return t(i, !0);
  2551. if (h)
  2552. return h(i, !0);
  2553. var n = new Error("Cannot find module '" + i + "'");
  2554. throw n.code = "MODULE_NOT_FOUND",
  2555. n
  2556. }
  2557. var r = s[i] = {
  2558. exports: {}
  2559. };
  2560. a[i][0].call(r.exports, function(e) {
  2561. var t = a[i][1][e];
  2562. return c(t || e)
  2563. }, r, r.exports, o, a, s, l)
  2564. }
  2565. return s[i].exports
  2566. }
  2567. for (var h = "function" == typeof require && require, e = 0; e < l.length; e++)
  2568. c(l[e]);
  2569. return c
  2570. }({
  2571. 1: [function(p, f, e) {
  2572. (function(e) {
  2573. "use strict";
  2574. function t(e) {
  2575. this.player = null,
  2576. this.director = null,
  2577. this.modelManager = null,
  2578. this.container = null,
  2579. this.tagManager = null,
  2580. this.fadeInSpeed = e,
  2581. null !== this.fadeInSpeed && void 0 !== this.fadeInSpeed || (this.fadeInSpeed = 0)
  2582. }
  2583. var r = p("three")
  2584. , i = p("./util/logger")
  2585. , n = (p("./util/common"),
  2586. p("./enum/PlayerEvents"))
  2587. , o = p("./enum/DirectorEvents")
  2588. , a = p("./settings")
  2589. , s = p("./enum/Viewmode")
  2590. , l = (p("./enum/WarpStyle"),
  2591. p("./enum/BlackoutStyle"),
  2592. p("./enum/ModelManagerEvents"))
  2593. , c = p("./enum/tagEvents")
  2594. , h = p("./util/transitions")
  2595. , u = p("./util/lerp")
  2596. , d = new i(e);
  2597. t.prototype.init = function(e, t, i, n, r) {
  2598. (window.app = this).player = t,
  2599. this.director = e,
  2600. this.modelManager = i,
  2601. this.tagManager = n,
  2602. this.container = r,
  2603. this.updateModel(),
  2604. this.bindEvents()
  2605. }
  2606. ,
  2607. t.prototype.bindEvents = function() {
  2608. this.modelManager.on(l.ActiveModelChanged, this.updateModel.bind(this)),
  2609. this.player.on(n.ModeChanging, this.handlePlayerModeChanging.bind(this)),
  2610. this.player.on(n.ModeChanged, this.handlePlayerModeChanged.bind(this)),
  2611. this.player.on(n.ClosestPanoChanging, this.handleClosestPanoChanging.bind(this)),
  2612. this.player.on(n.StartInside, this.handleStartInside.bind(this)),
  2613. this.player.on(n.StartOutside, this.handleStartOutside.bind(this)),
  2614. this.player.on(n.WarpStarted, this.handleWarpStarted.bind(this)),
  2615. this.director.on(o.ActionInterrupted, this.handleActionInterruption.bind(this)),
  2616. this.tagManager.on(c.TagActivated, this.ontagActivated.bind(this)),
  2617. this.tagManager.on(c.TagNavigation, this.onNavigationTotag.bind(this))
  2618. }
  2619. ,
  2620. t.prototype.updateModel = function() {
  2621. this.model = this.modelManager.getActiveModel()
  2622. }
  2623. ,
  2624. t.prototype.handleWarpStarted = function() {
  2625. this.hidePlayerReticule()
  2626. }
  2627. ,
  2628. t.prototype.ontagActivated = function() {
  2629. this.hidePlayerReticule()
  2630. }
  2631. ,
  2632. t.prototype.onNavigationTotag = function() {
  2633. this.hidePlayerReticule()
  2634. }
  2635. ,
  2636. t.prototype.handlePlayerModeChanging = function(e, t, i) {
  2637. var n = this.modelManager.getActiveModel()
  2638. , r = this.player.is360View(t, i) || this.director.tourIsPlaying ? 0 : a[t].markerOpacity;
  2639. n.fadePanoMarkers(r),
  2640. n.setMode(t)
  2641. }
  2642. ,
  2643. t.prototype.handlePlayerModeChanged = function(e, t) {
  2644. var i = this.modelManager.getActiveModel()
  2645. , n = t === s.PANORAMA ? r.DoubleSide : r.FrontSide;
  2646. i.setSide(n),
  2647. i.setMode(t)
  2648. }
  2649. ,
  2650. t.prototype.handleClosestPanoChanging = function(e, t, i) {
  2651. i !== s.TRANSITIONING && (e && !this.director.tourIsPlaying && e.hoverOff(i),
  2652. t && !this.director.tourIsPlaying && t.hoverOn(i))
  2653. }
  2654. ,
  2655. t.prototype.handleActionInterruption = function() {}
  2656. ,
  2657. t.prototype.handleStartInside = function(e) {
  2658. var t = a[this.player.mode]
  2659. , i = e ? 0 : t.transitionTime * t.skyboxOpacityLength;
  2660. this.fadeIn(this.fadeInSpeed),
  2661. this.model.alpha = 0,
  2662. this.model.skybox.material.uniforms.opacity.value = 1,
  2663. this.model.fadePanoMarkers(e ? 0 : t.markerOpacity);
  2664. var n = this.player.reticule;
  2665. h.start(u.property(n.material, "opacity", 0), i, null, 0, null, "retReOpac")
  2666. }
  2667. ,
  2668. t.prototype.handleStartOutside = function(e) {
  2669. this.fadeIn(e)
  2670. }
  2671. ,
  2672. t.prototype.fadeIn = function(e) {
  2673. null != e || (e = 2e3,
  2674. d.warn("DisplayController.fadeIn -> no transition time specified, defaulting to 2000 ms.")),
  2675. $(this.container).fadeIn(e)
  2676. }
  2677. ,
  2678. t.prototype.hidePlayerReticule = function() {
  2679. this.player.reticule.hide()
  2680. }
  2681. ,
  2682. f.exports = t
  2683. }
  2684. ).call(this, "/js/DisplayController.js")
  2685. }
  2686. , {
  2687. "./enum/BlackoutStyle": 18,
  2688. "./enum/DirectorEvents": 23,
  2689. "./enum/tagEvents": 32,
  2690. "./enum/ModelManagerEvents": 33,
  2691. "./enum/PlayerEvents": 40,
  2692. "./enum/Viewmode": 51,
  2693. "./enum/WarpStyle": 52,
  2694. "./settings": 166,
  2695. "./util/common": 185,
  2696. "./util/lerp": 188,
  2697. "./util/logger": 189,
  2698. "./util/transitions": 195,
  2699. three: 217
  2700. }],
  2701. 2: [function(e, t, i) {
  2702. "use strict";
  2703. function n() {
  2704. this.baseStartTime = performance.timing.navigationStart,
  2705. this.loadingStartTime = null,
  2706. this.waitingStartTime = null,
  2707. this.appReadyTime = null
  2708. }
  2709. n.prototype.setBaseStartTime = function(e) {
  2710. this.baseStartTime = e || Date.now()
  2711. }
  2712. ,
  2713. n.prototype.setWaitingStartTime = function(e) {
  2714. this.waitingStartTime = e || Date.now()
  2715. }
  2716. ,
  2717. n.prototype.setLoadingStartTime = function(e) {
  2718. this.loadingStartTime = e || Date.now()
  2719. }
  2720. ,
  2721. n.prototype.setAppReadyTime = function(e) {
  2722. this.appReadyTime = e || Date.now()
  2723. }
  2724. ,
  2725. n.prototype.calcFullLoadingTime = function() {
  2726. var e = this.appReadyTime - this.baseStartTime;
  2727. return this.waitingStartTime && (e -= this.loadingStartTime - this.waitingStartTime),
  2728. e
  2729. }
  2730. ,
  2731. t.exports = n
  2732. }
  2733. , {}],
  2734. 3: [function(i, n, e) {
  2735. (function(e) {
  2736. "use strict";
  2737. function a() {
  2738. return 100 * Math.random()
  2739. }
  2740. var t = i("./util/logger")
  2741. , s = i("./util/browser")
  2742. , l = new t(e)
  2743. , c = window.MP_AB_TESTS = window.MP_AB_TESTS || {
  2744. initialized: !1,
  2745. init: function(e, t) {
  2746. if (t = t || {},
  2747. !this.initialized) {
  2748. for (var i in this.initialized = !0,
  2749. s.valueFromHash("tilegen") && (t.tilegen = 1 === s.valueFromHash("tilegen", 0)),
  2750. s.valueFromHash("imgopt") && (t.imgopt = 1 === s.valueFromHash("imgopt", 0)),
  2751. e) {
  2752. var n = i.match("^sc_tilegen_([0-9]+)$");
  2753. n && (c.tilegen = a() < parseInt(n[1]));
  2754. var r = i.match("^sc_imgopt_([0-9]+)$");
  2755. r && (c.imgopt = a() < parseInt(r[1]))
  2756. }
  2757. for (var o in t)
  2758. c[o] = t[o],
  2759. l.debug("A/B override:", o, c[o])
  2760. }
  2761. },
  2762. changeIfTileGenerating: function(e) {
  2763. return c.tilegen && (e += -1 === e.indexOf("?") ? "?" : "&",
  2764. e += ""),
  2765. e
  2766. },
  2767. changeIfImageOptimzing: function(e) {
  2768. if(e.includes("blob:http"))return e;//add
  2769. return c.imgopt && -1 === e.indexOf("imgopt=1") && (e += -1 === e.indexOf("?") ? "?" : "&",
  2770. e += ""),
  2771. e
  2772. },
  2773. tilegen: !1,
  2774. imgopt: !1
  2775. };
  2776. n.exports = c
  2777. }
  2778. ).call(this, "/js/ab.js")
  2779. }
  2780. , {
  2781. "./util/browser": 182,
  2782. "./util/logger": 189
  2783. }],
  2784. 4: [function(u, d, e) {
  2785. (function(e) {
  2786. "use strict";
  2787. function r(n, e, t, i) {
  2788. function r(e) {
  2789. a[e.sid] = !0;
  2790. var t = e.billboard.media && e.billboard.media.type
  2791. , i = {
  2792. tag_id: e.sid,
  2793. tags_visited: Object.keys(a).length,
  2794. tag_count: Object.keys(n.tags).length,
  2795. tag_view_count: ++d,
  2796. has_media: !!t
  2797. };
  2798. t && (i.media_type = t),
  2799. g("tag_opened", i)
  2800. }
  2801. var o, a = {}, s = Date.now() - P, l = null;
  2802. i && (l = Date.now() - window.navigationStart);
  2803. try {
  2804. o = /* n.data.player_options.highlight_reel && */ 0 < n.heroLocations.length
  2805. } catch (n) {
  2806. o = !1
  2807. }
  2808. var c, h = n.supportsVR;
  2809. h || (c = "VR disabled at the model/account level",
  2810. 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"))),
  2811. g("model_loaded", {
  2812. duration: s,
  2813. duration_from_navigation_start: l,
  2814. has_hlr: o,
  2815. has_vr: h,
  2816. vr_reason: c
  2817. });
  2818. var u = 0;
  2819. n.panos.forEach(function(e) {
  2820. e.on("enter", function() {
  2821. f("pano_viewed", {
  2822. pano_id: e.id,
  2823. pano_view_count: ++u,
  2824. alignment_type: e.alignmentType,
  2825. interaction_source: R,
  2826. navigation_source: v
  2827. })
  2828. })
  2829. });
  2830. var d = 0;
  2831. for (var p in n.tags)
  2832. n.tags[p].billboard.on(M.OPENED, r.bind(this, n.tags[p]));
  2833. e.on("tour_auto", function(e) {
  2834. v = "tour_" + e
  2835. }),
  2836. e.on("tour_manual", function(e) {
  2837. R = "gui-" + e,
  2838. v = "tour_manual"
  2839. }),
  2840. t.on(C.InteractionKey, function() {
  2841. e.mode === A.TRANSITIONING || e.flying || m(C.InteractionKey)
  2842. }),
  2843. t.on(C.InteractionDirect, function() {
  2844. e.mode === A.TRANSITIONING || e.flying || m(C.InteractionDirect)
  2845. }),
  2846. function(t) {
  2847. I.on(T.OPENED, function() {
  2848. f("showcase_share_intent", {
  2849. pano_id: t.currentPano && t.currentPano.id
  2850. })
  2851. }),
  2852. I.on(T.LINK_CLICKED, function(e) {
  2853. f("showcase_share_action", {
  2854. channel: e.channel,
  2855. pano_id: t.currentPano && t.currentPano.id
  2856. })
  2857. }),
  2858. E.on(x.ORIGIN_LINK_CLICKED, function() {
  2859. f("showcase_share_origin_link_clicked")
  2860. })
  2861. }(e),
  2862. function() {
  2863. _.on(S.OPENED, f.bind(this, "showcase_gui", {
  2864. gui_action: "click_vr_button"
  2865. })),
  2866. _.on(S.LAUNCH, function(e) {
  2867. f("showcase_gui", {
  2868. gui_action: "launch_vr",
  2869. vr_platform: e.vr_platform,
  2870. vr_app: e.vr_app
  2871. })
  2872. }),
  2873. _.on(S.PREV, f.bind(this, "showcase_gui", {
  2874. gui_action: "vr_modal_prev"
  2875. })),
  2876. _.on(S.NEXT, function(e) {
  2877. f("showcase_gui", {
  2878. gui_action: e.nextAction
  2879. })
  2880. }),
  2881. _.on(S.CLOSED, f.bind(this, "showcase_gui", {
  2882. gui_action: "vr_modal_close"
  2883. })),
  2884. _.on(S.falseICECHOSEN, function(e) {
  2885. f("showcase_gui", {
  2886. gui_action: e.name + " "
  2887. })
  2888. }),
  2889. _.on(S.STORE, function(e) {
  2890. f("showcase_gui", {
  2891. gui_action: "launch_store",
  2892. store: e
  2893. })
  2894. })
  2895. }()
  2896. }
  2897. function f(e, t) {
  2898. if (t = t || {},
  2899. i)
  2900. try {
  2901. window.analytics.track(e, s.extendObject(t, c), {
  2902. context: {
  2903. app: {
  2904. name: "showcase",
  2905. version: "2.25.6-0-gd87e5b1"
  2906. },
  2907. screen: {
  2908. width: window.screen.width,
  2909. height: window.screen.height,
  2910. density: window.devicePixelRatio
  2911. }
  2912. }
  2913. })
  2914. } catch (t) {
  2915. console.warn("Failed to send data to segment for " + e)
  2916. }
  2917. }
  2918. function g(e, t) {
  2919. f(e, t = t || {})
  2920. }
  2921. function m(e, t) {
  2922. R = e === C.InteractionGui ? "gui-" + t : e,
  2923. v = "self_guided"
  2924. }
  2925. var v, o, a = (u("three"),
  2926. u("./util/ajax"),
  2927. u("./ab")), y = u("./util/browser"), s = u("./util/common"), t = u("./settings"), A = (u("./localization/localize"),
  2928. 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"),
  2929. "direct"), i = null, n = !1, P = null, c = null, h = s.uuid4();
  2930. d.exports = {
  2931. report: function(e, t, i, n) {
  2932. !function(e, t) {
  2933. if (o)
  2934. try {
  2935. o.addEvent(e, s.extendObject({
  2936. host: window.location.host,
  2937. keen: {
  2938. addons: [{
  2939. name: "keen:ua_parser",
  2940. input: {
  2941. ua_string: "user_agent"
  2942. },
  2943. output: "parsed_user_agent"
  2944. }]
  2945. },
  2946. user_agent: "${keen.user_agent}",
  2947. referrer: {
  2948. url: s.normalizeUrl(document.referrer),
  2949. domain: s.domainFromUrl(document.referrer),
  2950. url_original: document.referrer
  2951. },
  2952. embedded: y.inIframe(),
  2953. is_mobile: y.isMobile(),
  2954. version: "2.25.6-0-gd87e5b1"
  2955. }, t))
  2956. } catch (e) {
  2957. l.warn("analytics.report -> client.addEvent() error (is there blocking software installed?). Error message: " + e)
  2958. }
  2959. }("Session starts", {
  2960. model: e,
  2961. status: t,
  2962. loadtime: Date.now() - (P || Date.now()),
  2963. loadtime_from_navigation_start: i ? Date.now() - window.navigationStart : null,
  2964. autoplay: i,
  2965. quickstart: n,
  2966. ab_tilegen: a.tilegen,
  2967. ab_imgopt: a.imgopt
  2968. })
  2969. },
  2970. impression: function(e) {
  2971. g("impression", {
  2972. visible: void 0 === (e = e || {}).isVisible || e.isVisible,
  2973. url_params: (void 0 !== e.immediate && e.immediate,
  2974. window.location.search.substr(1).split("&"))
  2975. })
  2976. },
  2977. initKeen: function(e) {
  2978. return e.token && e.appId ? void (o = new Keen({
  2979. projectId: e.appId,
  2980. writeKey: e.token,
  2981. readKey: "",
  2982. requestType: "xhr"
  2983. })) : void l.warn("no keen token/appId")
  2984. },
  2985. initSegment: function(e) {
  2986. return e.token ? (i = e.token,
  2987. window.analytics.load(e.token),
  2988. c = {
  2989. model_id: e.model,
  2990. start_source: e.startSource,
  2991. autoplay: e.autoplay,
  2992. quickstart: e.quickstart,
  2993. language_tag: t.languageTag,
  2994. is_mobile: y.isMobile(),
  2995. iframe: y.inIframe(),
  2996. aspect_ratio: y.aspectRatio(),
  2997. session_id: h,
  2998. window: {
  2999. width: $("#player").width(),
  3000. height: $("#player").height()
  3001. },
  3002. platform: {
  3003. browser: {
  3004. name: $.ua.browser.name,
  3005. major: $.ua.browser.major,
  3006. version: $.ua.browser.version
  3007. },
  3008. os: {
  3009. name: $.ua.os.name,
  3010. version: $.ua.os.version
  3011. },
  3012. device: {
  3013. vendor: $.ua.device.vendor,
  3014. model: $.ua.device.model,
  3015. type: $.ua.device.type
  3016. }
  3017. }
  3018. },
  3019. n = Math.random() < t.analytics.sessionTrackingRate,
  3020. l.debug("tracking sample rate = " + t.analytics.sessionTrackingRate),
  3021. void l.debug("tracking this session = " + n)) : void l.warn("no segment token")
  3022. },
  3023. sessionStart: function(e) {
  3024. l.debug("analytics user_session_start"),
  3025. f("session_started"),
  3026. P = Date.now(),
  3027. window.addEventListener("unload", function() {
  3028. !function(e, t) {
  3029. if (t = t || {},
  3030. navigator.sendBeacon && i)
  3031. try {
  3032. navigator.sendBeacon("https://api.segment.io/v1/t", JSON.stringify({
  3033. event: e,
  3034. anonymousId: window.analytics.user().anonymousId(),
  3035. properties: s.extendObject(t, c),
  3036. writeKey: i,
  3037. sentAt: Date.now(),
  3038. type: "track",
  3039. context: {
  3040. userAgent: y.userAgent(),
  3041. library: {
  3042. name: "showcase-beacon",
  3043. version: "2.25.6-0-gd87e5b1"
  3044. },
  3045. app: {
  3046. name: "showcase",
  3047. version: "2.25.6-0-gd87e5b1"
  3048. }
  3049. }
  3050. }))
  3051. } catch (e) {
  3052. console.warn("Failed to send async segment request")
  3053. }
  3054. }("session_ended", {
  3055. duration: Date.now() - P
  3056. })
  3057. })
  3058. },
  3059. modelLoaded: function(e, t, i, n) {
  3060. r(e, t, i, n)
  3061. },
  3062. loadComplete: function(e) {
  3063. f("load_times", {
  3064. time_to_app_start: e
  3065. })
  3066. },
  3067. track: function(e, t) {
  3068. n && (l.debug('analytics.track("' + e + '", ' + JSON.stringify(t) + " )"),
  3069. f(e, t))
  3070. },
  3071. trackAlways: function(e, t) {
  3072. l.debug('analytics.trackAlways("' + e + '", ' + JSON.stringify(t) + " )"),
  3073. f(e, t)
  3074. },
  3075. getSessionId: function() {
  3076. return h
  3077. },
  3078. updateInteraction: m
  3079. }
  3080. }
  3081. ).call(this, "/js/analytics.js")
  3082. }
  3083. , {
  3084. "./ab": 3,
  3085. "./enum/ControlEvents": 21,
  3086. "./enum/PlayerEvents": 40,
  3087. "./enum/VROption": 47,
  3088. "./enum/VRPlatforms": 49,
  3089. "./enum/Viewmode": 51,
  3090. "./gui/sharing/ShareEvents": 76,
  3091. "./gui/sharing/modal": 77,
  3092. "./gui/title/TitleEvents": 80,
  3093. "./gui/title/titleBar": 82,
  3094. "./gui/vr/vrEvent": 85,
  3095. "./gui/vr/vrModal": 87,
  3096. "./localization/localize": 108,
  3097. "./tag/Billboard/BillboardEvent": 120,
  3098. "./settings": 166,
  3099. "./util/ajax": 181,
  3100. "./util/browser": 182,
  3101. "./util/common": 185,
  3102. "./util/logger": 189,
  3103. three: 217
  3104. }],
  3105. 5: [function(e, t, i) {
  3106. "use strict";
  3107. function n() {
  3108. r.PerspectiveCamera.call(this, a.clampVFOV(o.dollhouseFOV), $("#player").width() / $("#player").height(), o.dollhouseNear, o.dollhouseFar),
  3109. this.controls = null
  3110. }
  3111. var r = e("three")
  3112. , o = e("../constants")
  3113. , a = e("../util/cameraLight");
  3114. (n.prototype = Object.create(r.PerspectiveCamera.prototype)).updateAspect = function(e) {
  3115. this.aspect = e,
  3116. this.updateProjectionMatrix()
  3117. }
  3118. ,
  3119. t.exports = n
  3120. }
  3121. , {
  3122. "../constants": 8,
  3123. "../util/cameraLight": 184,
  3124. three: 217
  3125. }],
  3126. 6: [function(e, t, i) {
  3127. "use strict";
  3128. function n() {
  3129. var e = $("#player").width() / $("#player").height();
  3130. r.OrthographicCamera.call(this, -o.orthoBase, o.orthoBase, o.orthoBase / e, -o.orthoBase / e, o.orthoNear, o.orthoFar),
  3131. this.controls = null,
  3132. this.updateAspect(e)
  3133. }
  3134. var r = e("three")
  3135. , o = e("../constants");
  3136. (n.prototype = Object.create(r.OrthographicCamera.prototype)).updateAspect = function(e) {
  3137. this.aspect = e,
  3138. this.top = o.orthoBase / e,
  3139. this.bottom = -o.orthoBase / e,
  3140. this.updateProjectionMatrix()
  3141. }
  3142. ,
  3143. t.exports = n
  3144. }
  3145. , {
  3146. "../constants": 8,
  3147. three: 217
  3148. }],
  3149. 7: [function(e, t, i) {
  3150. "use strict";
  3151. function n() {
  3152. r.PerspectiveCamera.call(this, a.clampVFOV(o.insideFOV), $("#player").width() / $("#player").height(), o.insideNear, o.insideFar),
  3153. this.controls = null
  3154. }
  3155. var r = e("three")
  3156. , o = e("../settings")
  3157. , a = e("../util/cameraLight");
  3158. (n.prototype = Object.create(r.PerspectiveCamera.prototype)).updateAspect = function(e) {
  3159. this.aspect = e,
  3160. this.updateProjectionMatrix()
  3161. }
  3162. ,
  3163. t.exports = n
  3164. }
  3165. , {
  3166. "../settings": 166,
  3167. "../util/cameraLight": 184,
  3168. three: 217
  3169. }],
  3170. 8: [function(e, t, i) {
  3171. "use strict";
  3172. t.exports = {
  3173. signedUrlDefaultExpireTime: 24e4,
  3174. signedUrlCheckInterval: 1e4,
  3175. signedUrlRefreshBuffer: 15e3,
  3176. dollhouseFOV: 70,
  3177. dollhouseNear: .1,//1,
  3178. dollhouseFar: 5e3,
  3179. insideFOV: 70,
  3180. insideFOVMax: 120,
  3181. insideNear: .1,
  3182. insideFar: 5e3,
  3183. insideLookSpeed: .12,
  3184. insideLookLimitUp: 40,
  3185. insideLookLimitDown: -40,
  3186. orthoNear: 1,
  3187. orthoFar: 5e3,
  3188. orthoBase: 10,
  3189. narrowLandscapeHeight: 290,
  3190. reallyNarrowLandscapeHeight: 250,
  3191. visionTilingStartDate: new Date("8/26/2016"),
  3192. visionTilingStartVersion: "1.1.407.13667",
  3193. windowHeightHighQualityThreshold: 900,
  3194. tourStepDelayDefault: 3500,
  3195. tourStepDelaySlideShow: 5e3,
  3196. workshopApsect: 9 / 16,
  3197. highQualityMaxZoom: 2,
  3198. ultraHighQualityMaxZoom: 3
  3199. }
  3200. }
  3201. , {}],
  3202. 9: [function(e, t, i) {
  3203. "use strict";
  3204. function n() {
  3205. this.activeControl = null,
  3206. this.controls = {},
  3207. this.cameras = {}
  3208. }
  3209. var a = e("./PanoramaControls")
  3210. , s = e("./DollhouseControls")
  3211. , l = e("./FloorplanControls")
  3212. , c = e("../cameras/PanoramaCamera")
  3213. , h = e("../cameras/DollhouseCamera")
  3214. , u = e("../cameras/FloorplanCamera")
  3215. , r = e("events").EventEmitter
  3216. , d = e("../enum/ControlEvents")
  3217. , o = e("../enum/ModelManagerEvents")
  3218. , p = e("../enum/Viewmode")
  3219. , f = e("../settings");
  3220. (n.prototype = Object.create(r.prototype)).init = function(e, t) {
  3221. this.setUpControls(),
  3222. this.bindEvents(e, t)
  3223. }
  3224. ,
  3225. n.prototype.activateControls = function(e) {
  3226. this.activeControl && (this.activeControl.reset(),
  3227. this.activeControl.enabled = !1),
  3228. this.controls[e] && (this.controls[e].enabled = !0),
  3229. this.activeControl = this.controls[e]
  3230. }
  3231. ,
  3232. n.prototype.setUpControls = function() {
  3233. var i = {}
  3234. , n = {}
  3235. , e = [p.PANORAMA, p.DOLLHOUSE, p.FLOORPLAN]
  3236. , r = [c, h, u]
  3237. , o = [a, s, l];
  3238. e.forEach(function(e, t) {
  3239. i[e] = new r[t],
  3240. n[e] = new o[t](i[e]),
  3241. n[e].on(d.Move, this.emit.bind(this, d.Move)),
  3242. n[e].on(d.InputStart, this.emit.bind(this, d.InputStart)),
  3243. n[e].on(d.InteractionDirect, this.emit.bind(this, d.InteractionDirect)),
  3244. n[e].on(d.InteractionKey, this.emit.bind(this, d.InteractionKey)),
  3245. n[e].on(d.Pinch, this.emit.bind(this, d.Pinch)),
  3246. n[e].on(d.Scroll, this.emit.bind(this, d.Scroll))
  3247. }
  3248. .bind(this)),
  3249. this.controls = n,
  3250. this.cameras = i
  3251. }
  3252. ,
  3253. n.prototype.bindEvents = function(e, t) {
  3254. e.addEventListener("mousemove", this.onMouseMove.bind(this)),
  3255. e.addEventListener("mousedown", this.onMouseDown.bind(this)),
  3256. e.addEventListener("mouseup", this.onMouseUp.bind(this)),
  3257. e.addEventListener("mouseover", this.onMouseOver.bind(this)),
  3258. f.useWheel && (e.addEventListener("mousewheel", this.onMouseWheel.bind(this), {
  3259. passive: !1
  3260. }),
  3261. e.addEventListener("DOMMouseScroll", this.onMouseWheel.bind(this))),
  3262. e.addEventListener("touchstart", this.onTouchStart.bind(this)),
  3263. e.addEventListener("touchmove", this.onTouchMove.bind(this)),
  3264. e.addEventListener("touchend", this.onTouchEnd.bind(this)),
  3265. e.addEventListener("contextmenu", function(e) {
  3266. e.preventDefault()
  3267. }),
  3268. e.addEventListener("pointerdown", this.onPointerDown.bind(this)),
  3269. e.addEventListener("pointermove", this.onPointerMove.bind(this)),
  3270. e.addEventListener("pointerup", this.onPointerUp.bind(this)),
  3271. e.addEventListener("pointerout", this.onPointerCancel.bind(this)),
  3272. e.addEventListener("pointercancel", this.onPointerCancel.bind(this)),
  3273. document.addEventListener("keydown", this.onKeyDown.bind(this)),
  3274. document.addEventListener("keyup", this.onKeyUp.bind(this)),
  3275. t.on(o.ActiveModelChanged, function(e) {
  3276. this.setModelForControls(e.model)
  3277. }
  3278. .bind(this))
  3279. }
  3280. ,
  3281. n.prototype.setModelForControls = function(e) {
  3282. this.controls[p.DOLLHOUSE].setZoomBounds(e.boundingBox);
  3283. var t = e.boundingBox.clone().expandByScalar(f.modelBoundsPadding);
  3284. [p.DOLLHOUSE, p.FLOORPLAN].forEach(function(e) {
  3285. this.controls[e].setBounds(t)
  3286. }
  3287. .bind(this))
  3288. }
  3289. ,
  3290. n.prototype.onMouseDown = function(e) {
  3291. e.preventDefault(),
  3292. this.activeControl && this.activeControl.onMouseDown(e)
  3293. }
  3294. ,
  3295. n.prototype.onMouseMove = function(e) {
  3296. e.preventDefault(),
  3297. this.activeControl && this.activeControl.onMouseMove(e)
  3298. }
  3299. ,
  3300. n.prototype.onMouseUp = function(e) {
  3301. e.preventDefault(),
  3302. this.activeControl && this.activeControl.onMouseUp(e)
  3303. }
  3304. ,
  3305. n.prototype.onMouseOver = function(e) {
  3306. e.preventDefault(),
  3307. this.activeControl && this.activeControl.onMouseOver(e)
  3308. }
  3309. ,
  3310. n.prototype.onMouseWheel = function(e) {
  3311. e.preventDefault(),
  3312. this.activeControl && this.activeControl.onMouseWheel(e)
  3313. }
  3314. ,
  3315. n.prototype.onTouchStart = function(e) {
  3316. e.preventDefault(),
  3317. this.activeControl && this.activeControl.onTouchStart(e),
  3318. $("#hotListWrap")[0].classList.remove("hotListActive"),
  3319. $("#hotListContent ul .active").removeClass("active"),
  3320. $("#hotList")[0].classList.remove("active")
  3321. }
  3322. ,
  3323. n.prototype.onTouchMove = function(e) {
  3324. e.preventDefault(),
  3325. this.activeControl && this.activeControl.onTouchMove(e)
  3326. }
  3327. ,
  3328. n.prototype.onTouchEnd = function(e) {
  3329. e.preventDefault(),
  3330. this.activeControl && this.activeControl.onTouchEnd(e)
  3331. }
  3332. ,
  3333. n.prototype.onPointerDown = function(e) {
  3334. if (e.preventDefault(),
  3335. this.activeControl)
  3336. switch (e.pointerType) {
  3337. case "mouse":
  3338. this.activeControl.onMouseDown(e);
  3339. break;
  3340. default:
  3341. this.activeControl.onPointerDown(e)
  3342. }
  3343. }
  3344. ,
  3345. n.prototype.onPointerMove = function(e) {
  3346. if (e.preventDefault(),
  3347. this.activeControl)
  3348. switch (e.pointerType) {
  3349. case "mouse":
  3350. this.activeControl.onMouseMove(e);
  3351. break;
  3352. default:
  3353. this.activeControl.onPointerMove(e)
  3354. }
  3355. }
  3356. ,
  3357. n.prototype.onPointerUp = function(e) {
  3358. if (e.preventDefault(),
  3359. this.activeControl)
  3360. switch (e.pointerType) {
  3361. case "mouse":
  3362. this.activeControl.onMouseUp(e);
  3363. break;
  3364. default:
  3365. this.activeControl.onPointerUp(e)
  3366. }
  3367. }
  3368. ,
  3369. n.prototype.onPointerCancel = function(e) {
  3370. e.preventDefault(),
  3371. this.activeControl && "mouse" !== e.pointerType && this.activeControl.onPointerUp(e)
  3372. }
  3373. ,
  3374. n.prototype.onKeyDown = function(e) {
  3375. e.metaKey || e.ctrlKey || (e.preventDefault(),
  3376. this.activeControl && this.activeControl.onKeyDown(e))
  3377. }
  3378. ,
  3379. n.prototype.onKeyUp = function(e) {
  3380. e.preventDefault(),
  3381. this.activeControl && this.activeControl.onKeyUp(e)
  3382. }
  3383. ,
  3384. t.exports = n
  3385. }
  3386. , {
  3387. "../cameras/DollhouseCamera": 5,
  3388. "../cameras/FloorplanCamera": 6,
  3389. "../cameras/PanoramaCamera": 7,
  3390. "../enum/ControlEvents": 21,
  3391. "../enum/ModelManagerEvents": 33,
  3392. "../enum/Viewmode": 51,
  3393. "../settings": 166,
  3394. "./DollhouseControls": 10,
  3395. "./FloorplanControls": 11,
  3396. "./PanoramaControls": 13,
  3397. events: 202
  3398. }],
  3399. 10: [function(e, t, i) {
  3400. "use strict";
  3401. function n(e) {
  3402. a.call(this, e),
  3403. this.minPolarAngle = o.dollhouseDefault.minPolarAngle,
  3404. this.maxPolarAngle = o.dollhouseDefault.maxPolarAngle,
  3405. this.minDistance = o.dollhouseDefault.minDistance,
  3406. this.maxDistance = o.dollhouseDefault.maxDistance,
  3407. this.adjustedMinDistance = this.minDistance,
  3408. this.adjustedMaxDistance = this.maxDistance
  3409. }
  3410. var r = e("three")
  3411. , o = e("../settings")
  3412. , a = e("./OutsideControls");
  3413. (n.prototype = Object.create(a.prototype)).pan = function(e, t) {
  3414. this.camera.updateMatrix();
  3415. var i = this.camera.position.clone().sub(this.target).length();
  3416. i *= Math.tan(this.camera.fov / 2 * Math.PI / 180),
  3417. this.panLeft(2 * e * i / $("#player").height()),
  3418. this.panUp(-2 * t * i / $("#player").height())
  3419. }
  3420. ,
  3421. n.prototype.updateZoom = function() {
  3422. return this.offset.length() * this.scale
  3423. }
  3424. ,
  3425. n.prototype.setZoomBounds = function(e) {
  3426. var t = e.min.distanceTo(e.max);
  3427. this.adjustedMinDistance = Math.max(Math.min(t / 2, o.dollhouseDefault.minDistance), 0),
  3428. this.adjustedMaxDistance = Math.min(Math.max(t, o.dollhouseDefault.maxDistance), o.skyboxRadius),
  3429. this.minDistance = this.adjustedMinDistance,
  3430. this.maxDistance = this.adjustedMaxDistance
  3431. }
  3432. ,
  3433. n.prototype.resetRanges = function(e, t) {
  3434. e ? (this.minDistance = Math.min(e, this.minDistance),
  3435. this.maxDistance = Math.max(e, this.maxDistance)) : (this.minDistance = this.adjustedMinDistance,
  3436. this.maxDistance = this.adjustedMaxDistance),
  3437. t ? (this.minPolarAngle = r.Math.degToRad(-15),
  3438. this.maxPolarAngle = r.Math.degToRad(89.9)) : (this.minPolarAngle = o.dollhouseDefault.minPolarAngle,
  3439. this.maxPolarAngle = o.dollhouseDefault.maxPolarAngle)
  3440. }
  3441. ,
  3442. n.prototype.toJSON = function() {
  3443. return a.prototype.toJSON.call(this)
  3444. }
  3445. ,
  3446. t.exports = n
  3447. }
  3448. , {
  3449. "../settings": 166,
  3450. "./OutsideControls": 12,
  3451. three: 217
  3452. }],
  3453. 11: [function(e, t, i) {
  3454. "use strict";
  3455. function n(e) {
  3456. c.call(this, e),
  3457. this.minDistance = 15,
  3458. this.maxDistance = 50,
  3459. this.noRotateUpDown = !0,
  3460. this.minPolarAngle = 0,
  3461. this.maxPolarAngle = 0,
  3462. this.mouseActions[u.LEFT] = h.PAN,
  3463. this.mouseActions[u.MIDDLE] = h.DOLLY,
  3464. this.mouseActions[u.RIGHT] = h.ROTATE,
  3465. this.touchActions[1] = h.PAN,
  3466. this.touchActions[2] = h.ROTATE_DOLLY,
  3467. this.absoluteScale = 1,
  3468. this.currentScale = 1
  3469. }
  3470. 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");
  3471. (n.prototype = Object.create(c.prototype)).zoomToContain = function(e) {
  3472. this.absoluteScale = this.getDefaultAbsoluteScale(e);
  3473. this.currentScale = this.absoluteScale
  3474. }
  3475. ,
  3476. n.prototype.getDefaultAbsoluteScale = function(modelSize) {
  3477. var t = Math.max(modelSize.x, modelSize.z)
  3478. , i = Math.min(modelSize.x, modelSize.z)
  3479. , n = Math.max(t, i * this.camera.aspect)
  3480. , r = Math.max(i, t * this.camera.aspect);
  3481. var absoluteScale = (p.aspectRatio() < 1 ? r : n) / 2 / l.orthoBase * 1.2
  3482. return absoluteScale
  3483. },
  3484. n.prototype.rotateToView = function(e, t) {
  3485. var i = 0;
  3486. p.aspectRatio() < 1 == e.x < e.z ? 0 < t.z && (i = Math.PI) : i = 0 < t.x ? Math.PI / 2 : -Math.PI / 2,
  3487. this.rotateLeft(i),
  3488. this.update(0)
  3489. }
  3490. ,
  3491. n.prototype.pan = function(e, t) {
  3492. this.camera.updateMatrix(),
  3493. this.panLeft(e * (this.camera.right - this.camera.left) / $("#player").width()),
  3494. this.panUp(-t * (this.camera.top - this.camera.bottom) / $("#player").height())
  3495. }
  3496. ,
  3497. n.prototype.updateZoom = function() {
  3498. return this.absoluteScale *= this.scale - .03 * this.keyboardZoomSpeed,
  3499. this.absoluteScale = Math.max(l.zoomNearLimit, Math.min(this.absoluteScale, l.zoomFarLimit)),
  3500. this.currentScale = .8 * this.currentScale + .2 * this.absoluteScale,
  3501. this.camera.left = -l.orthoBase * this.currentScale,
  3502. this.camera.right = l.orthoBase * this.currentScale,
  3503. this.camera.top = l.orthoBase * this.currentScale / this.camera.aspect,
  3504. this.camera.bottom = -l.orthoBase * this.currentScale / this.camera.aspect,
  3505. this.camera.updateProjectionMatrix(),
  3506. this.offset.length()
  3507. }
  3508. ,
  3509. n.prototype.toJSON = (r = new s.Quaternion,
  3510. o = (new s.Quaternion).setFromAxisAngle(new s.Vector3(0,1,0), s.Math.degToRad(90)),
  3511. a = new s.Quaternion,
  3512. function() {
  3513. var e = c.prototype.toJSON.call(this);
  3514. return r.copy(e.camera_quaternion),
  3515. a.copy(o),
  3516. a.multiply(r),
  3517. e.camera_quaternion.x = d.toPrecision(a.x, 4),
  3518. e.camera_quaternion.y = d.toPrecision(a.y, 4),
  3519. e.camera_quaternion.z = d.toPrecision(a.z, 4),
  3520. e.camera_quaternion.w = d.toPrecision(a.w, 4),
  3521. e.ortho_zoom = d.toPrecision(this.currentScale * this.camera.aspect, 4),
  3522. e
  3523. }
  3524. ),
  3525. t.exports = n
  3526. }
  3527. , {
  3528. "../enum/ControlActions": 20,
  3529. "../enum/MouseButton": 34,
  3530. "../settings": 166,
  3531. "../util/browser": 182,
  3532. "../util/math": 190,
  3533. "./OutsideControls": 12,
  3534. three: 217
  3535. }],
  3536. 12: [function(e, t, i) {
  3537. "use strict";
  3538. function n(e) {
  3539. this.camera = e,
  3540. (this.camera.controls = this).enabled = !1,
  3541. this.target = new a.Vector3,
  3542. this.targetBounds = new a.Box3,
  3543. this.zoomSpeed = 2,//编辑时缩放快一些
  3544. this.minDistance = 0,
  3545. this.maxDistance = 1 / 0,
  3546. this.noRotateUpDown = !1,
  3547. this.rotateSpeed = 1,
  3548. this.keyboardZoomSpeed = 0,
  3549. this.keyPanSpeed = 7,
  3550. this.autoRotate = !1,
  3551. this.autoRotateSpeed = 2,
  3552. this.autoPan = !1,
  3553. this.autoPanPosition = new a.Vector3,
  3554. this.minPolarAngle = a.Math.degToRad(25),
  3555. this.maxPolarAngle = a.Math.degToRad(65),
  3556. this.rotationAcceleration = new a.Vector2,
  3557. this.rotationSpeed = new a.Vector2,
  3558. this.panAcceleration = new a.Vector2,
  3559. this.panSpeed = new a.Vector2,
  3560. this.rotateStart = new a.Vector2,
  3561. this.rotateEnd = new a.Vector2,
  3562. this.rotateDelta = new a.Vector2,
  3563. this.panStart = new a.Vector2,
  3564. this.panEnd = new a.Vector2,
  3565. this.panDelta = new a.Vector2,
  3566. this.panOffset = new a.Vector3,
  3567. this.offset = new a.Vector3,
  3568. this.dollyStart = new a.Vector2,
  3569. this.dollyEnd = new a.Vector2,
  3570. this.dollyDelta = new a.Vector2,
  3571. this.phiDelta = 0,
  3572. this.thetaDelta = 0,
  3573. this.scale = 1,
  3574. this.panVector = new a.Vector3,
  3575. this.lastPosition = new a.Vector3,
  3576. this.state = u.NONE,
  3577. this.mouseActions = {},
  3578. this.mouseActions[d.LEFT] = u.ROTATE,
  3579. this.mouseActions[d.MIDDLE] = u.DOLLY,
  3580. this.mouseActions[d.RIGHT] = u.PAN,
  3581. this.touchActions = {},
  3582. this.touchActions[1] = u.ROTATE,
  3583. this.touchActions[2] = u.PAN_DOLLY,
  3584. this.lastMoveTime = 0,
  3585. this.pointersLimit = 2,
  3586. this.pointers = []
  3587. }
  3588. 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;
  3589. (n.prototype = Object.create(g.prototype)).setBounds = function(e) {
  3590. this.targetBounds = e
  3591. }
  3592. ,
  3593. n.prototype.isEngaged = function() {
  3594. return this.state !== u.NONE
  3595. }
  3596. ,
  3597. n.prototype.rotateLeft = function(e) {
  3598. void 0 === e && (e = this.getAutoRotationAngle()),
  3599. this.thetaDelta -= e
  3600. }
  3601. ,
  3602. n.prototype.rotateUp = function(e) {
  3603. this.noRotateUpDown || (void 0 === e && (e = this.getAutoRotationAngle()),
  3604. this.phiDelta -= e)
  3605. }
  3606. ,
  3607. n.prototype.panLeft = function(e) {
  3608. var t = this.camera.matrix.elements;
  3609. this.panOffset.set(t[0], 0, t[2]).normalize(),
  3610. this.panOffset.multiplyScalar(-e),
  3611. this.panVector.add(this.panOffset)
  3612. }
  3613. ,
  3614. n.prototype.panUp = function(e) {
  3615. var t = this.camera.matrix.elements;
  3616. this.panOffset.set(t[4], 0, t[6]).normalize(),
  3617. this.panOffset.multiplyScalar(-e),
  3618. this.panVector.add(this.panOffset)
  3619. }
  3620. ,
  3621. n.prototype.startRotating = function(e, t) {
  3622. e && this.navRotationAcc("x", e),
  3623. t && this.navRotationAcc("y", t)
  3624. }
  3625. ,
  3626. n.prototype.stopRotating = function(e) {
  3627. e && (this.rotationSpeed.x = this.rotationSpeed.y = 0),
  3628. this.navRotationAcc("x", 0),
  3629. this.navRotationAcc("y", 0)
  3630. }
  3631. ,
  3632. n.prototype.setAutoPanPosition = (r = new a.Vector3,
  3633. o = new a.Vector3,
  3634. function(e, t) {
  3635. r.copy(this.camera.position),
  3636. void 0 === e && null === e || r.setX(e),
  3637. void 0 === t && null === t || r.setZ(t);
  3638. var i = this.camera.position.distanceTo(this.target)
  3639. , n = l.FORWARD.clone().applyQuaternion(this.camera.quaternion);
  3640. this.targetClamped = !1,
  3641. o.copy(r).addScaledVector(n, i),
  3642. this.targetBounds.containsPoint(o) || (this.targetBounds.clampPoint(o, o),
  3643. r.copy(o).addScaledVector(n, -i),
  3644. this.targetClamped = !0),
  3645. this.autoPanPosition.x = r.x,
  3646. this.autoPanPosition.z = r.z,
  3647. this.autoPan && this.stopAutoPanning()
  3648. }
  3649. ),
  3650. n.prototype.stopAutoPanning = function() {
  3651. var e = this.autoPan;
  3652. this.autoPan = !1,
  3653. this.emit(this.targetClamped ? f.AutoPanClamped : e ? f.AutoPanInterrupt : f.AutoPanComplete)
  3654. }
  3655. ,
  3656. n.prototype.dollyIn = function(e) {
  3657. void 0 === e && (e = this.getZoomScale()),
  3658. this.scale /= e
  3659. }
  3660. ,
  3661. n.prototype.dollyOut = function(e) {
  3662. void 0 === e && (e = this.getZoomScale()),
  3663. this.scale *= e
  3664. }
  3665. ,
  3666. n.prototype.updatePan = function(e) {
  3667. if (this.panSpeed.multiplyScalar(1 - c.panFriction).addScaledVector(this.panAcceleration, c.panAccelerationOutside * e),
  3668. this.pan(-this.panSpeed.x, this.panSpeed.y),
  3669. this.autoPan) {
  3670. var t = (new a.Vector3).copy(this.autoPanPosition).sub(this.camera.position);
  3671. t.setY(0).clampLength(0, 50 * e),
  3672. this.target.add(t),
  3673. this.camera.position.add(t),
  3674. this.autoPanPosition.x === this.camera.position.x && this.autoPanPosition.z === this.camera.position.z && (this.autoPan = !1,
  3675. this.stopAutoPanning())
  3676. }
  3677. }
  3678. ,
  3679. n.prototype.update = function(e) {
  3680. e = e || 1 / 60,
  3681. this.rotationSpeed.multiplyScalar(1 - c.rotationFriction).addScaledVector(this.rotationAcceleration, c.rotationAccelerationOutside * e),
  3682. this.rotateLeft(-this.rotationSpeed.x),
  3683. this.noRotateUpDown || this.rotateUp(this.rotationSpeed.y),
  3684. this.updatePan(e);
  3685. var t = this.camera.position;
  3686. this.offset.copy(t).sub(this.target);
  3687. var i = Math.atan2(this.offset.x, this.offset.z)
  3688. , n = Math.atan2(Math.sqrt(this.offset.x * this.offset.x + this.offset.z * this.offset.z), this.offset.y);
  3689. this.autoRotate && this.rotateLeft(this.getAutoRotationAngle()),
  3690. i += this.thetaDelta,
  3691. n += this.phiDelta,
  3692. n = Math.max(this.minPolarAngle, Math.min(this.maxPolarAngle, n)),
  3693. n = Math.max(1e-6, Math.min(Math.PI - 1e-6, n));
  3694. var r = this.updateZoom();
  3695. r = Math.max(this.minDistance, Math.min(this.maxDistance, r)),
  3696. this.target.add(this.panVector),
  3697. this.targetBounds.clampPoint(this.target, this.target),
  3698. this.offset.x = r * Math.sin(n) * Math.sin(i),
  3699. this.offset.y = r * Math.cos(n),
  3700. this.offset.z = r * Math.sin(n) * Math.cos(i),
  3701. t.copy(this.target).add(this.offset),
  3702. this.camera.lookAt(this.target),
  3703. this.thetaDelta = 0,
  3704. this.phiDelta = 0,
  3705. this.scale = 1,
  3706. this.panVector.set(0, 0, 0),
  3707. 0 < this.lastPosition.distanceTo(this.camera.position) && this.lastPosition.copy(this.camera.position)
  3708. }
  3709. ,
  3710. n.prototype.getAutoRotationAngle = function() {
  3711. return 2 * Math.PI / 60 / 60 * this.autoRotateSpeed
  3712. }
  3713. ,
  3714. n.prototype.getZoomScale = function() {
  3715. return Math.pow(.95, this.zoomSpeed)
  3716. }
  3717. ,
  3718. n.prototype.onMouseDown = function(e) {
  3719. if (this.enabled) {
  3720. switch (e.preventDefault(),
  3721. this.stopAutoPanning(),
  3722. this.mouseDown = !0,
  3723. this.state = this.mouseActions[e.button],
  3724. this.state) {
  3725. case u.ROTATE:
  3726. this.rotateStart.set(e.clientX, this.noRotateUpDown ? 0 : e.clientY),
  3727. this.rotationSpeed.set(0, 0);
  3728. break;
  3729. case u.DOLLY:
  3730. this.dollyStart.set(e.clientX, e.clientY);
  3731. break;
  3732. case u.PAN:
  3733. this.panStart.set(e.clientX, e.clientY)
  3734. }
  3735. this.emit(f.InputStart, "mouse")
  3736. }
  3737. }
  3738. ,
  3739. n.prototype.onMouseMove = function(e) {
  3740. if (this.enabled && this.mouseDown && 0 !== e.buttons) {
  3741. switch (e.preventDefault(),
  3742. this.state) {
  3743. case u.ROTATE:
  3744. this.rotateEnd.set(e.clientX, this.noRotateUpDown ? 0 : e.clientY),
  3745. this.rotateDelta.subVectors(this.rotateEnd, this.rotateStart),
  3746. this.rotateLeft(2 * Math.PI * this.rotateDelta.x / $("#player").width() * this.rotateSpeed),
  3747. this.rotateUp(2 * Math.PI * this.rotateDelta.y / $("#player").height() * this.rotateSpeed),
  3748. this.rotateStart.copy(this.rotateEnd);
  3749. break;
  3750. case u.DOLLY:
  3751. this.dollyEnd.set(e.clientX, e.clientY),
  3752. this.dollyDelta.subVectors(this.dollyEnd, this.dollyStart),
  3753. (0 < this.dollyDelta.y ? this.dollyIn : this.dollyOut).call(this),
  3754. this.dollyStart.copy(this.dollyEnd);
  3755. break;
  3756. case u.PAN:
  3757. this.panEnd.set(e.clientX, e.clientY),
  3758. this.panDelta.subVectors(this.panEnd, this.panStart),
  3759. this.pan(this.panDelta.x, this.panDelta.y),
  3760. this.panStart.copy(this.panEnd)
  3761. }
  3762. this.emit(f.Move, "mouse"),
  3763. this.lastMoveTime = e.timeStamp,
  3764. this.update()
  3765. }
  3766. }
  3767. ,
  3768. n.prototype.onMouseUp = function(e) {
  3769. this.enabled && (this.mouseDown = !1,
  3770. this.state = u.NONE,
  3771. "mouseover" !== e.type && (e.timeStamp > this.lastMoveTime + 100 ? (this.rotationSpeed.set(0, 0),
  3772. this.rotationAcceleration.set(0, 0)) : this.rotationAcceleration.set(-this.rotateDelta.x, this.rotateDelta.y),
  3773. this.update(),
  3774. this.rotationAcceleration.set(0, 0),
  3775. this.rotateDelta.set(0, 0)))
  3776. }
  3777. ,
  3778. n.prototype.onMouseOver = function(e) {
  3779. 0 !== e.which && 0 !== e.buttons || this.onMouseUp(e)
  3780. }
  3781. ,
  3782. n.prototype.onMouseWheel = function(e) {
  3783. this.enabled && c.useWheel && (this.emit(f.Move, "wheel"),
  3784. (0 < (e.wheelDelta || -e.detail) ? this.dollyOut : this.dollyIn).call(this),
  3785. this.update())
  3786. }
  3787. ,
  3788. n.prototype.onKeyDown = function(e) {
  3789. this.enabled && (e.metaKey || e.ctrlKey || (e.preventDefault(),
  3790. this.handleKeyDown(e.which)))
  3791. }
  3792. ,
  3793. n.prototype.navRotationAcc = function(e, t) {
  3794. "y" === e ? this.noRotateUpDown ? this.keyboardZoomSpeed = t : this.rotationAcceleration.y = t : this.rotationAcceleration.x = t
  3795. }
  3796. ,
  3797. n.prototype.navPanAcc = function(e, t) {
  3798. this.stopAutoPanning(),
  3799. this.panAcceleration[e] = t
  3800. }
  3801. ,
  3802. n.prototype.handleKeyDown = function(e) {
  3803. var t = !0;
  3804. switch (e) {
  3805. case p.UPARROW:
  3806. case p.I:
  3807. this.navRotationAcc("y", 1);
  3808. break;
  3809. case p.DOWNARROW:
  3810. case p.K:
  3811. this.navRotationAcc("y", -1);
  3812. break;
  3813. case p.LEFTARROW:
  3814. case p.J:
  3815. this.navRotationAcc("x", -1);
  3816. break;
  3817. case p.RIGHTARROW:
  3818. case p.L:
  3819. this.navRotationAcc("x", 1);
  3820. break;
  3821. case p.W:
  3822. this.navPanAcc("y", 1);
  3823. break;
  3824. case p.S:
  3825. this.navPanAcc("y", -1);
  3826. break;
  3827. case p.A:
  3828. this.navPanAcc("x", -1);
  3829. break;
  3830. case p.D:
  3831. this.navPanAcc("x", 1);
  3832. break;
  3833. default:
  3834. t = !1
  3835. }
  3836. t && this.emit(f.Move, "key")
  3837. }
  3838. ,
  3839. n.prototype.onKeyUp = function(e) {
  3840. this.enabled && (e.preventDefault(),
  3841. e.stopPropagation(),
  3842. this.handleKeyUp(e.which))
  3843. }
  3844. ,
  3845. n.prototype.handleKeyUp = function(e) {
  3846. switch (e) {
  3847. case p.I:
  3848. case p.K:
  3849. case p.UPARROW:
  3850. case p.DOWNARROW:
  3851. this.keyboardZoomSpeed = 0,
  3852. this.rotationAcceleration.y = 0;
  3853. break;
  3854. case p.J:
  3855. case p.L:
  3856. case p.LEFTARROW:
  3857. case p.RIGHTARROW:
  3858. this.rotationAcceleration.x = 0;
  3859. break;
  3860. case p.S:
  3861. case p.W:
  3862. this.panAcceleration.y = 0;
  3863. break;
  3864. case p.A:
  3865. case p.D:
  3866. this.panAcceleration.x = 0
  3867. }
  3868. }
  3869. ,
  3870. n.prototype.onTouchStart = function(i) {
  3871. if (this.enabled || this.state === u.NONE) {
  3872. i.preventDefault(),
  3873. i.stopPropagation(),
  3874. this.stopAutoPanning();
  3875. var e = function() {
  3876. if (2 === i.touches.length) {
  3877. var e = i.touches[0].pageX - i.touches[1].pageX
  3878. , t = i.touches[0].pageY - i.touches[1].pageY;
  3879. this.dollyStart.set(e, t)
  3880. }
  3881. }
  3882. .bind(this)
  3883. , t = function() {
  3884. this.panStart.set(h.average(i.touches, "pageX"), h.average(i.touches, "pageY"))
  3885. }
  3886. .bind(this)
  3887. , n = function() {
  3888. this.rotateStart.set(h.average(i.touches, "pageX"), h.average(i.touches, "pageY"))
  3889. }
  3890. .bind(this);
  3891. switch (this.state = this.touchActions[i.touches.length],
  3892. this.state) {
  3893. case u.PAN_DOLLY:
  3894. e();
  3895. case u.PAN:
  3896. t();
  3897. break;
  3898. case u.ROTATE_DOLLY:
  3899. e();
  3900. case u.ROTATE:
  3901. n()
  3902. }
  3903. this.rotationSpeed.set(0, 0),
  3904. this.emit(f.InputStart, "touch")
  3905. }
  3906. }
  3907. ,
  3908. n.prototype.onTouchMove = function(a) {
  3909. if (this.enabled && this.state !== u.NONE) {
  3910. a.preventDefault(),
  3911. a.stopPropagation();
  3912. var s = function() {
  3913. var e = a.touches[0].pageX - a.touches[1].pageX
  3914. , t = a.touches[0].pageY - a.touches[1].pageY;
  3915. this.dollyEnd.set(e, t);
  3916. var i = this.dollyStart.length() - this.dollyEnd.length();
  3917. 0 < i ? this.dollyOut(1 + i / 500) : this.dollyIn(1 - i / 500),
  3918. this.dollyStart.copy(this.dollyEnd)
  3919. }
  3920. .bind(this)
  3921. , e = function() {
  3922. this.panEnd.set(h.average(a.touches, "pageX"), h.average(a.touches, "pageY")),
  3923. this.panDelta.subVectors(this.panEnd, this.panStart),
  3924. this.pan(this.panDelta.x, this.panDelta.y),
  3925. this.panStart.copy(this.panEnd),
  3926. this.rotateDelta.set(0, 0)
  3927. }
  3928. .bind(this)
  3929. , l = function() {
  3930. this.rotateEnd.set(h.average(a.touches, "pageX"), h.average(a.touches, "pageY")),
  3931. this.rotateDelta.subVectors(this.rotateEnd, this.rotateStart),
  3932. this.rotateLeft(2 * Math.PI * this.rotateDelta.x / $("#player").width() * this.rotateSpeed),
  3933. this.rotateUp(2 * Math.PI * this.rotateDelta.y / $("#player").height() * this.rotateSpeed),
  3934. this.rotateStart.copy(this.rotateEnd)
  3935. }
  3936. .bind(this)
  3937. , t = function() {
  3938. if (2 === a.touches.length) {
  3939. var e = window.devicePixelRatio || 1
  3940. , t = a.touches[1].pageX - a.touches[0].pageX
  3941. , i = a.touches[1].pageY - a.touches[0].pageY
  3942. , n = Math.sqrt(t * t + i * i);
  3943. if (Math.abs(this.dollyStart.length() - n) > c.input.touchMoveThreshold * e)
  3944. this.state = u.DOLLY,
  3945. s();
  3946. else {
  3947. var r = h.average(a.touches, "pageX")
  3948. , o = h.average(a.touches, "pageY");
  3949. this.rotateDelta.set(r, o).sub(this.rotateStart).length() > c.input.touchMoveThreshold && (this.state = u.ROTATE,
  3950. this.rotateStart.set(r, o),
  3951. l())
  3952. }
  3953. }
  3954. }
  3955. .bind(this);
  3956. switch (this.state) {
  3957. case u.PAN_DOLLY:
  3958. s();
  3959. case u.PAN:
  3960. e();
  3961. break;
  3962. case u.ROTATE_DOLLY:
  3963. t();
  3964. break;
  3965. case u.DOLLY:
  3966. s();
  3967. break;
  3968. case u.ROTATE:
  3969. l();
  3970. break;
  3971. default:
  3972. this.state = u.NONE
  3973. }
  3974. this.lastMoveTime = a.timeStamp,
  3975. this.emit(f.Move, "touch")
  3976. }
  3977. }
  3978. ,
  3979. n.prototype.onTouchEnd = function(e) {
  3980. this.enabled && (this.state === u.ROTATE && (e.timeStamp > this.lastMoveTime + 100 ? (this.rotationSpeed.set(0, 0),
  3981. this.rotationAcceleration.set(0, 0)) : this.rotationAcceleration.set(-this.rotateDelta.x, this.rotateDelta.y)),
  3982. this.state = u.NONE,
  3983. this.update(),
  3984. this.rotationAcceleration.set(0, 0),
  3985. this.rotateDelta.set(0, 0))
  3986. }
  3987. ,
  3988. n.prototype.onPointerDown = function(e) {
  3989. this.enabled && ("touch" === e.pointerType && (this.pointers.length < this.pointersLimit && this.pointers.push({
  3990. id: e.pointerId,
  3991. pageX: e.pageX,
  3992. pageY: e.pageY
  3993. }),
  3994. e.touches = this.pointers,
  3995. this.onTouchStart(e)),
  3996. this.emit(f.InputStart, "pointer"))
  3997. }
  3998. ,
  3999. n.prototype.onPointerMove = function(t) {
  4000. this.enabled && "touch" === t.pointerType && (this.pointers.forEach(function(e) {
  4001. t.pointerId === e.id && (e.pageX = t.pageX,
  4002. e.pageY = t.pageY)
  4003. }),
  4004. t.touches = this.pointers,
  4005. this.onTouchMove(t))
  4006. }
  4007. ,
  4008. n.prototype.onPointerUp = function(i) {
  4009. this.enabled && "touch" === i.pointerType && (this.pointers.forEach(function(e, t) {
  4010. i.pointerId === e.id && this.pointers.splice(t, 1)
  4011. }
  4012. .bind(this)),
  4013. i.touches = this.pointers,
  4014. this.onTouchEnd(i))
  4015. }
  4016. ,
  4017. n.prototype.reset = function() {
  4018. this.state = u.NONE,
  4019. this.stopAutoPanning(),
  4020. this.rotationSpeed.set(0, 0),
  4021. this.rotationAcceleration.set(0, 0),
  4022. this.panSpeed.set(0, 0),
  4023. this.panAcceleration.set(0, 0)
  4024. }
  4025. ,
  4026. n.prototype.toJSON = function() {
  4027. return {
  4028. camera_position: {
  4029. x: s.toPrecision(this.camera.position.x, 4),
  4030. y: s.toPrecision(this.camera.position.y, 4),
  4031. z: s.toPrecision(this.camera.position.z, 4)
  4032. },
  4033. camera_quaternion: {
  4034. x: s.toPrecision(this.camera.quaternion.x, 4),
  4035. y: s.toPrecision(this.camera.quaternion.y, 4),
  4036. z: s.toPrecision(this.camera.quaternion.z, 4),
  4037. w: s.toPrecision(this.camera.quaternion.w, 4)
  4038. }
  4039. }
  4040. }
  4041. ,
  4042. t.exports = n
  4043. }
  4044. , {
  4045. "../enum/ControlActions": 20,
  4046. "../enum/ControlEvents": 21,
  4047. "../enum/Keys": 30,
  4048. "../enum/MouseButton": 34,
  4049. "../enum/Vectors": 50,
  4050. "../settings": 166,
  4051. "../util/common": 185,
  4052. "../util/math": 190,
  4053. events: 202,
  4054. three: 217
  4055. }],
  4056. 13: [function(u, d, e) {
  4057. (function(e) {
  4058. "use strict";
  4059. function t(e) {
  4060. this.camera = e,
  4061. (this.camera.controls = this).target = new s.Vector3(0,0,0),
  4062. this.lookVector = new s.Vector3,
  4063. this.lookSpeed = .05,
  4064. this.rotationAcc = new s.Vector2,
  4065. this.rotationSpeed = new s.Vector2,
  4066. this.lat = 0,
  4067. this.lon = 0,
  4068. this.phi = 0,
  4069. this.theta = 0,
  4070. this.enabled = !1,
  4071. this.locked = !1,
  4072. this.pointer = new s.Vector2(0,0),
  4073. this.rotationHistory = [],
  4074. this.rotationDifference = new s.Vector2,
  4075. this.pointerDragOn = !1,
  4076. this.pointerDragStart = new s.Vector2(0,0),
  4077. this.pinchDistance = 0,
  4078. this.moveStart = new s.Vector2,
  4079. this.moveTolerance = .01,
  4080. this.pointersLimit = 2,
  4081. this.pointers = []
  4082. }
  4083. var s = u("three")
  4084. , i = u("../util/logger")
  4085. , n = u("../settings")
  4086. , r = u("../util/common")
  4087. , o = u("../util/math")
  4088. , a = (u("../enum/Vectors"),
  4089. u("../enum/MouseButton"))
  4090. , l = u("../enum/Keys")
  4091. , c = u("../enum/ControlEvents")
  4092. , h = u("events").EventEmitter;
  4093. new i(e),
  4094. (t.prototype = Object.create(h.prototype)).usable = function() {
  4095. return this.enabled && !this.locked
  4096. }
  4097. ,
  4098. /* t.prototype.lookAt = function(e) {
  4099. var t = this.camera.position.clone().sub(e)
  4100. , i = Math.atan(t.z / t.x);
  4101. i += t.x < 0 ? Math.PI : 0,
  4102. i += 0 < t.x && t.z < 0 ? 2 * Math.PI : 0,
  4103. this.lon = s.Math.radToDeg(i) + 180;
  4104. var n = Math.sqrt(t.x * t.x + t.z * t.z)
  4105. , r = Math.atan(t.y / n);
  4106. this.lat = -s.Math.radToDeg(r)
  4107. } */
  4108. t.prototype.lookAt = function(aim, dir) {
  4109. var t = dir || this.camera.position.clone().sub(aim); //aim所指点的笛卡尔坐标系
  4110. var i = Math.atan(t.z / t.x);
  4111. i += t.x < 0 ? Math.PI : 0;
  4112. i += t.x > 0 && t.z < 0 ? 2 * Math.PI : 0;
  4113. this.lon = s.Math.radToDeg(i) + 180;
  4114. var n = Math.sqrt(t.x * t.x + t.z * t.z),
  4115. o = Math.atan(t.y / n);
  4116. this.lat = -s.Math.radToDeg(o);
  4117. }
  4118. ,
  4119. t.prototype.startRotationFrom = function(e, t) {
  4120. o.convertScreenPositionToNDC(e, t, this.pointer),
  4121. this.pointerDragOn = !0,
  4122. this.pointerDragStart.copy(this.pointer),
  4123. this.moveStart.copy(this.pointer),
  4124. this.rotationHistory = [],
  4125. this.rotationSpeed.set(0, 0)
  4126. }
  4127. ,
  4128. t.prototype.onMouseOver = function(e) {
  4129. !this.pointerDragOn || 0 !== e.which && 0 !== e.buttons || this.onMouseUp(e)
  4130. }
  4131. ,
  4132. t.prototype.onTouchStart = function(e) {
  4133. if (this.usable()) {
  4134. switch (e.preventDefault(),
  4135. e.stopPropagation(),
  4136. e.touches.length) {
  4137. case 1:
  4138. this.startRotationFrom(e.touches[0].clientX, e.touches[0].clientY);
  4139. break;
  4140. case 2:
  4141. var t = (e.touches[0].clientX - e.touches[1].clientX) / $("#player").width()
  4142. , i = (e.touches[0].clientY - e.touches[1].clientY) / $("#player").height();
  4143. this.pinchDistance = Math.sqrt(t * t + i * i)
  4144. }
  4145. this.emit(c.InputStart, "touch")
  4146. }
  4147. }
  4148. ,
  4149. t.prototype.onPointerDown = function(e) {
  4150. this.usable() && "touch" === e.pointerType && (this.pointers.length < this.pointersLimit && this.pointers.push({
  4151. id: e.pointerId,
  4152. clientX: e.clientX,
  4153. clientY: e.clientY
  4154. }),
  4155. e.touches = this.pointers,
  4156. this.onTouchStart(e),
  4157. this.emit(c.InputStart, "pointer"))
  4158. }
  4159. ,
  4160. t.prototype.onMouseDown = function(e) {
  4161. if (this.usable()) {
  4162. switch (e.preventDefault(),
  4163. e.stopPropagation(),
  4164. e.button) {
  4165. case a.LEFT:
  4166. this.startRotationFrom(e.clientX, e.clientY)
  4167. }
  4168. this.emit(c.InputStart, "mouse")
  4169. }
  4170. }
  4171. ,
  4172. t.prototype.updateRotation = function() {
  4173. if (this.usable() && this.pointerDragOn) {
  4174. var e = new s.Vector3(this.pointerDragStart.x,this.pointerDragStart.y,-1).unproject(this.camera)
  4175. , t = new s.Vector3(this.pointer.x,this.pointer.y,-1).unproject(this.camera)
  4176. , i = Math.sqrt(e.x * e.x + e.z * e.z)
  4177. , n = Math.sqrt(t.x * t.x + t.z * t.z)
  4178. , r = Math.atan2(e.y, i)
  4179. , o = Math.atan2(t.y, n);
  4180. this.rotationDifference.y = s.Math.radToDeg(r - o),
  4181. e.y = 0,
  4182. t.y = 0;
  4183. var a = Math.acos(e.dot(t) / e.length() / t.length());
  4184. isNaN(a) || (this.rotationDifference.x = s.Math.radToDeg(a),
  4185. this.pointerDragStart.x < this.pointer.x && (this.rotationDifference.x *= -1)),
  4186. this.pointerDragStart.copy(this.pointer)
  4187. }
  4188. }
  4189. ,
  4190. t.prototype.onMouseMove = function(e) {
  4191. this.usable() && (o.convertScreenPositionToNDC(e.clientX, e.clientY, this.pointer),
  4192. 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"))
  4193. }
  4194. ,
  4195. t.prototype.onTouchMove = function(e) {
  4196. if (this.usable())
  4197. switch (this.emit(c.Move, "touch"),
  4198. e.touches.length) {
  4199. case 1:
  4200. o.convertScreenPositionToNDC(e.touches[0].clientX, e.touches[0].clientY, this.pointer);
  4201. break;
  4202. case 2:
  4203. var t = (e.touches[0].clientX - e.touches[1].clientX) / $("#player").width()
  4204. , i = (e.touches[0].clientY - e.touches[1].clientY) / $("#player").height()
  4205. , n = this.pinchDistance - Math.sqrt(t * t + i * i);
  4206. .01 < Math.abs(n) && (this.emit(c.InteractionDirect),
  4207. this.emit(c.Pinch, n),
  4208. this.pinchDistance -= n)
  4209. }
  4210. }
  4211. ,
  4212. t.prototype.onPointerMove = function(t) {
  4213. this.usable() && "touch" === t.pointerType && (this.pointers.forEach(function(e) {
  4214. t.pointerId === e.id && (e.clientX = t.clientX,
  4215. e.clientY = t.clientY)
  4216. }),
  4217. t.touches = this.pointers,
  4218. this.onTouchMove(t))
  4219. }
  4220. ,
  4221. t.prototype.endRotation = function() {
  4222. this.pointerDragOn = !1;
  4223. var e = r.averageVectors(this.rotationHistory);
  4224. this.rotationSpeed.set(e.x * n.rotationAfterMoveMultiplier, e.y * n.rotationAfterMoveMultiplier)
  4225. }
  4226. ,
  4227. t.prototype.onTouchEnd = function(e) {
  4228. this.usable() && (e.preventDefault(),
  4229. e.stopPropagation(),
  4230. this.endRotation())
  4231. }
  4232. ,
  4233. t.prototype.onMouseUp = function(e) {
  4234. this.usable() && (e.preventDefault(),
  4235. e.stopPropagation(),
  4236. this.endRotation())
  4237. }
  4238. ,
  4239. t.prototype.onPointerUp = function(i) {
  4240. this.usable() && "touch" === i.pointerType && (this.pointers.forEach(function(e, t) {
  4241. i.pointerId === e.id && this.pointers.splice(t, 1)
  4242. }
  4243. .bind(this)),
  4244. i.touches = this.pointers,
  4245. this.onTouchEnd(i))
  4246. }
  4247. ,
  4248. t.prototype.update = function(e) {
  4249. for (this.lon,
  4250. this.lat,
  4251. this.updateRotation(),
  4252. this.rotationHistory.push(this.rotationDifference.clone()); this.rotationHistory.length > n.rotationAfterMoveHistoryCount; )
  4253. this.rotationHistory.shift();
  4254. this.lon += this.rotationDifference.x,
  4255. this.lat += this.rotationDifference.y,
  4256. this.rotationDifference.set(0, 0),
  4257. this.rotationSpeed.x = this.rotationSpeed.x * (1 - n.rotationFriction) + this.rotationAcc.x * n.rotationAccelerationInside,
  4258. this.rotationSpeed.y = this.rotationSpeed.y * (1 - n.rotationFriction) + this.rotationAcc.y * n.rotationAccelerationInside,
  4259. this.lon += this.rotationSpeed.x * e,
  4260. this.lat += this.rotationSpeed.y * e
  4261. var insideLookLimitDown = n.insideLookLimitDown - n.insideFOV/2 + this.camera.fov / 2
  4262. var insideLookLimitUp = n.insideLookLimitUp + n.insideFOV/2 - this.camera.fov / 2
  4263. 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 );
  4264. //this.lat = Math.max(n.insideLookLimitDown, Math.min(n.insideLookLimitUp, this.lat)),
  4265. this.phi = s.Math.degToRad(90 - this.lat),
  4266. this.theta = s.Math.degToRad(this.lon),
  4267. this.lookVector.x = Math.sin(this.phi) * Math.cos(this.theta),
  4268. this.lookVector.y = Math.cos(this.phi),
  4269. this.lookVector.z = Math.sin(this.phi) * Math.sin(this.theta),
  4270. this.target.copy(this.lookVector).add(this.camera.position),
  4271. this.camera.lookAt(this.target)
  4272. }
  4273. ,
  4274. t.prototype.onMouseWheel = function(e) {
  4275. if (this.usable()) {
  4276. var t = e.wheelDelta || -e.detail;
  4277. this.emit(c.InteractionDirect),
  4278. this.emit(c.Scroll, t)
  4279. }
  4280. }
  4281. ,
  4282. t.prototype.onKeyDown = function(e) {
  4283. this.usable() && (e.metaKey || e.ctrlKey || (e.preventDefault(),
  4284. this.handleKeyDown(e.which)))
  4285. }
  4286. ,
  4287. t.prototype.handleKeyDown = function(e) {
  4288. var t = function(e, t) {
  4289. this.rotationAcc[e] = t
  4290. }
  4291. .bind(this);
  4292. this.emit(c.InteractionKey);
  4293. var i = !0;
  4294. switch (e) {
  4295. case l.LEFTARROW:
  4296. case l.J:
  4297. t("x", -1);
  4298. break;
  4299. case l.RIGHTARROW:
  4300. case l.L:
  4301. t("x", 1);
  4302. break;
  4303. case l.I:
  4304. t("y", 1);
  4305. break;
  4306. case l.K:
  4307. t("y", -1);
  4308. break;
  4309. default:
  4310. i = !1
  4311. }
  4312. i && this.emit(c.Move, "key")
  4313. }
  4314. ,
  4315. t.prototype.onKeyUp = function(e) {
  4316. this.usable() && (e.preventDefault(),
  4317. e.stopPropagation(),
  4318. this.handleKeyUp(e.which))
  4319. }
  4320. ,
  4321. t.prototype.handleKeyUp = function(e) {
  4322. switch (e) {
  4323. case l.LEFTARROW:
  4324. case l.J:
  4325. case l.RIGHTARROW:
  4326. case l.L:
  4327. this.rotationAcc.x = 0;
  4328. break;
  4329. case l.I:
  4330. case l.K:
  4331. this.rotationAcc.y = 0
  4332. }
  4333. }
  4334. ,
  4335. t.prototype.startRotating = function(e, t) {
  4336. e && (this.rotationAcc.x = e),
  4337. t && (this.rotationAcc.y = t)
  4338. }
  4339. ,
  4340. t.prototype.stopRotating = function(e) {
  4341. e && (this.rotationSpeed.x = this.rotationSpeed.y = 0),
  4342. this.rotationAcc.set(0, 0)
  4343. }
  4344. ,
  4345. t.prototype.reset = function() {
  4346. this.pointerDragOn = !1,
  4347. this.rotationAcc.set(0, 0),
  4348. this.rotationSpeed.set(0, 0),
  4349. this.pointers = []
  4350. }
  4351. ,
  4352. t.prototype.toJSON = function() {
  4353. return {
  4354. camera_position: {
  4355. x: o.toPrecision(this.camera.position.x, 4),
  4356. y: o.toPrecision(this.camera.position.y, 4),
  4357. z: o.toPrecision(this.camera.position.z, 4)
  4358. },
  4359. camera_quaternion: {
  4360. x: o.toPrecision(this.camera.quaternion.x, 4),
  4361. y: o.toPrecision(this.camera.quaternion.y, 4),
  4362. z: o.toPrecision(this.camera.quaternion.z, 4),
  4363. w: o.toPrecision(this.camera.quaternion.w, 4)
  4364. }
  4365. }
  4366. }
  4367. ,
  4368. t.prototype.setStateFromJSON = function(e) {
  4369. this.camera.position.copy(e.camera_position),
  4370. this.camera.quaternion.copy(e.camera_quaternion)
  4371. }
  4372. ,
  4373. d.exports = t
  4374. }
  4375. ).call(this, "/js/controls/PanoramaControls.js")
  4376. }
  4377. , {
  4378. "../enum/ControlEvents": 21,
  4379. "../enum/Keys": 30,
  4380. "../enum/MouseButton": 34,
  4381. "../enum/Vectors": 50,
  4382. "../settings": 166,
  4383. "../util/common": 185,
  4384. "../util/logger": 189,
  4385. "../util/math": 190,
  4386. events: 202,
  4387. three: 217
  4388. }],
  4389. 14: [function(t, i, e) {
  4390. (function(e) {
  4391. "use strict";
  4392. var c = t("three")
  4393. , h = t("../enum/Viewmode")
  4394. , u = new (t("../util/logger"))(e);
  4395. i.exports = {
  4396. serialize: function(e) {
  4397. return encodeURI(JSON.stringify(e))
  4398. },
  4399. deserialize: function(e) {
  4400. function t(e) {
  4401. return e.reduce(function(e, t) {
  4402. return e && "number" == typeof t && !isNaN(t)
  4403. }, !0)
  4404. }
  4405. try {
  4406. var i = JSON.parse(decodeURI(e))
  4407. , n = {
  4408. mode: h.fromInt(i.camera_mode),
  4409. panoId: i.scan_id,
  4410. position: (new c.Vector3).copy(i.camera_position),
  4411. quaternion: (new c.Quaternion).copy(i.camera_quaternion),
  4412. zoom: i.ortho_zoom,
  4413. floorVisibility: i.floor_visibility
  4414. }
  4415. , r = n.position;
  4416. t([r.x, r.y, r.z]) || n.position.set(0, 0, 0);
  4417. var o = n.quaternion;
  4418. return t([o.x, o.y, o.z, o.w]) || n.quaternion.set(0, 0, 0, 1),
  4419. n
  4420. } catch (i) {
  4421. u.debug("Not able to parse start location as JSON; falling back to old array style parsing");
  4422. try {
  4423. var a = e.split(",")
  4424. , s = {
  4425. x: parseFloat(a[2]),
  4426. y: parseFloat(a[3]),
  4427. z: parseFloat(a[4])
  4428. }
  4429. , l = {
  4430. x: parseFloat(a[5]),
  4431. y: parseFloat(a[6]),
  4432. z: parseFloat(a[7]),
  4433. w: parseFloat(a[8])
  4434. };
  4435. return t([s.x, s.y, s.z]) || (s.x = 0,
  4436. s.y = 0,
  4437. s.z = 0),
  4438. t([l.x, l.y, l.z, l.w]) || (l.x = 0,
  4439. l.y = 0,
  4440. l.z = 0,
  4441. l.w = 1),
  4442. {
  4443. mode: h.fromInt(a[0]),
  4444. panoId: a[1],
  4445. position: (new c.Vector3).copy(s),
  4446. quaternion: (new c.Quaternion).copy(l)
  4447. }
  4448. } catch (t) {
  4449. u.warn('Invalid start override, ignoring: "' + e + '"', t.message)
  4450. }
  4451. }
  4452. return null
  4453. }
  4454. }
  4455. }
  4456. ).call(this, "/js/controls/serializer.js")
  4457. }
  4458. , {
  4459. "../enum/Viewmode": 51,
  4460. "../util/logger": 189,
  4461. three: 217
  4462. }],
  4463. 15: [function(C, I, e) {
  4464. (function(e) {
  4465. "use strict";
  4466. function t() {
  4467. this.endlessLoop = r.warp.loop,
  4468. this.clock = new i.Clock(!0),
  4469. this.model = null,
  4470. this.player = null,
  4471. this.currentItem = null,
  4472. this.destinationItem = null,
  4473. this.tourIsPlaying = !1,
  4474. this.transitionStage = v.None,
  4475. this.nextFunc = null,
  4476. this.onTheBus = !1,
  4477. this.tourInProgress = !1,
  4478. this.reachSource = null,
  4479. this.interrupted = !1,
  4480. this.nItems = 0,
  4481. this.walkingSectionPaused = !1
  4482. }
  4483. var i = C("three")
  4484. , n = C("./util/logger")
  4485. , r = C("./settings")
  4486. , o = C("./util/transitions")
  4487. , a = C("events").EventEmitter
  4488. , s = C("./enum/Viewmode")
  4489. , l = C("./analytics")
  4490. , c = C("./enum/WarpStyle")
  4491. , h = (o = C("./util/transitions"),
  4492. C("./model/ModelManager"),
  4493. C("./enum/ModelManagerEvents"))
  4494. , u = C("./enum/DirectorEvents")
  4495. , d = C("./enum/PlayerEvents")
  4496. , p = (C("./enum/ControlEvents"),
  4497. C("./enum/BlackoutStyle"))
  4498. , f = C("./enum/PathDiscardMode")
  4499. , g = C("./enum/PathDisplayMode")
  4500. , m = (C("./player"),
  4501. new n(e))
  4502. , v = Object.freeze({
  4503. None: 0,
  4504. Moving: 1,
  4505. Aiming: 2,
  4506. Interlude: 3
  4507. })
  4508. , y = Object.freeze({
  4509. Forward: 1,
  4510. NoChange: 0,
  4511. Backwards: -1
  4512. })
  4513. , A = o.getUniqueId();
  4514. (t.prototype = Object.create(a.prototype)).init = function(e, t) {
  4515. this.player = e,
  4516. this.modelManager = t,
  4517. this.updateModel(),
  4518. this.resetAll(),
  4519. this.bindEvents()
  4520. }
  4521. ,
  4522. t.prototype.resetAll = function() {
  4523. if (this.currentItem = null,
  4524. this.destinationItem = null,
  4525. this.tourIsPlaying = !1,
  4526. this.bgmReplay(),
  4527. this.transitionStage = v.None,
  4528. this.nextFunc = null,
  4529. this.onTheBus = !1,
  4530. this.reachSource = null,
  4531. this.interrupted = !1,
  4532. this.model) {
  4533. var e = r.path.typ === c.WALK ? c.WALK : c.STD;
  4534. this.defaultWarpStyle = this.model.data.hasOwnProperty("player_options") && this.model.data.player_options && !1 === this.model.data.player_options.fast_transitions ? e : c.BLACK
  4535. } else
  4536. this.defaultWarpStyle = c.BLACK,
  4537. m.warn('No model yet, choosing "' + this.defaultWarpStyle + '" transitions');
  4538. this.resetSpecialTransition()
  4539. }
  4540. ,
  4541. t.prototype.updateModel = function() {
  4542. this.model = this.modelManager.getActiveModel(),
  4543. this.nItems = this.model.heroLocations.length
  4544. }
  4545. ,
  4546. t.prototype.bindEvents = function() {
  4547. this.modelManager.on(h.ActiveModelChanged, this.updateModel.bind(this)),
  4548. this.player.on(d.WarpInterruptedWithFlyTo, this.checkAndHandleWalkingtourInterruption.bind(this)),
  4549. this.player.on(d.Move, this.handlePlayerMove.bind(this)),
  4550. this.player.on(d.PanoChosen, this.handlePlayerPanoChosen.bind(this)),
  4551. this.player.on(d.ModeChanged, this.handlePlayerModeChanged.bind(this)),
  4552. this.player.on(d.InputStart, this.handlePlayerInputStart.bind(this)),
  4553. this.player.on(d.FlyingStarted, this.handlePlayerFlyingStarted.bind(this)),
  4554. this.player.once(d.Move, function() {
  4555. o.cancelById(A)
  4556. })
  4557. }
  4558. ,
  4559. t.prototype.checkAndHandleWalkingtourInterruption = function(e) {
  4560. return e === c.WALK && (this.interrupt(p.NONE),
  4561. this.pauseWalkingSection(),
  4562. this.player.fastForwardActivePanoFlight(),
  4563. !0)
  4564. }
  4565. ,
  4566. t.prototype.handlePlayerMove = function(e) {
  4567. this.transitionStage === v.Interlude && this.interrupt(p.NONE),
  4568. this.emit("update.controls")
  4569. }
  4570. ,
  4571. t.prototype.handlePlayerPanoChosen = function(e, t) {
  4572. this.intermediateState() || e.id === t.id || (this.onTheBus = !1,
  4573. this.emit("update.controls"))
  4574. }
  4575. ,
  4576. t.prototype.handlePlayerModeChanged = function(e, t) {
  4577. this.intermediateState() || e === t || (this.onTheBus = !1,
  4578. this.emit("update.controls"))
  4579. }
  4580. ,
  4581. t.prototype.handlePlayerInputStart = function(e) {
  4582. this.transitionStage === v.Interlude && this.interrupt(p.NONE)
  4583. }
  4584. ,
  4585. t.prototype.handlePlayerFlyingStarted = function() {
  4586. this.clearWalkingSectionPaused()
  4587. }
  4588. ,
  4589. t.prototype.describe = function() {
  4590. return {
  4591. nItems: this.nItems,
  4592. currentItem: this.currentItem,
  4593. destinationItem: this.destinationItem,
  4594. tourIsPlaying: this.tourIsPlaying,
  4595. onTheBus: this.onTheBus,
  4596. endlessLoop: this.endlessLoop,
  4597. viewMode: this.player.mode,
  4598. inTransition: this._inTransition(),
  4599. transitionStage: this.transitionStage,
  4600. tourInProgress: this.tourInProgress
  4601. }
  4602. }
  4603. ,
  4604. t.prototype._inTransition = function() {
  4605. return this.player.flying || this.player.isWarping() || this.player.isWaitingToWarp() || this.player.mode === s.TRANSITIONING || this.tourIsPlaying
  4606. }
  4607. ,
  4608. t.prototype.bounceable = function() {
  4609. var e = this.clock.getDelta();
  4610. return this.isInterrupted() || e < .9 && .01 < e || this.player.flying && !this.player.isWarping()
  4611. }
  4612. ,
  4613. t.prototype.itemCompare = function(item1, item2, type){//add
  4614. if(type == 'equal'){//==
  4615. return item1 && item2 && item1[0] == item2[0] && item1[1] == item2[1]
  4616. }else if(type == 'less'){//<
  4617. return item1 && item2 && (item1[0] < item2[0]) || (item1[0] == item2[0] && item1[1] < item2[1])
  4618. }
  4619. }
  4620. t.prototype.currentMoveDirection = function() {
  4621. //return null === this.currentItem || void 0 === this.currentItem ? y.Forward : this.destinationItem === this.currentItem ? y.NoChange : this.destinationItem > this.currentItem ? y.Forward : y.Backwards
  4622. 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
  4623. }
  4624. ,
  4625. t.prototype.clearPath = function() {
  4626. this._inTransition() || this.player.path.discardPathObject()
  4627. }
  4628. ,
  4629. t.prototype.allFloors = function() {
  4630. this.model.toggleAllFloors()
  4631. }
  4632. ,
  4633. t.prototype.actionComplete = function(e) {
  4634. if (this.interrupted = !1,
  4635. this.transitionStage = v.None,
  4636. this.resetSpecialTransition(),
  4637. null !== this.destinationItem && this.setCurrentItem(this.destinationItem),
  4638. this.tourIsPlaying || (this.player.disablePreRendering(),
  4639. this.player.mode === s.PANORAMA && this.player.currentPano.isAligned() && this.model.fadePanoMarkers()),
  4640. this.emit("update.controls"),
  4641. this.nextFunc) {
  4642. var t = this.nextFunc;
  4643. this.nextFunc = null,
  4644. t()
  4645. }
  4646. }
  4647. ,
  4648. t.prototype.awaitCompletion = function(e, t) {
  4649. this.nextFunc = t,
  4650. e()
  4651. }
  4652. ,
  4653. t.prototype.updateSuccessFunction = function(e) {
  4654. this.nextFunc = e
  4655. }
  4656. ,
  4657. t.prototype.interrupt = function(e, t) {
  4658. return !!this.wouldInterrupt() && (this.tourIsPlaying && (this.player.zoomEnabled = this.wasZoomEnabled),
  4659. this.tourIsPlaying = !1,
  4660. this.bgmReplay(),
  4661. this.interrupted = !0,
  4662. this.nextFunc = null,
  4663. this.emit(u.ActionInterrupted),
  4664. null != e || (e = p.BEGINNING),
  4665. this.player.interruptAndFastForward(e, t),
  4666. !0)
  4667. }
  4668. ,
  4669. t.prototype.wouldInterrupt = function() {
  4670. return this.transitionStage !== v.None
  4671. }
  4672. ,
  4673. t.prototype.intermediateState = function() {
  4674. return this.transitionStage !== v.None
  4675. }
  4676. ,
  4677. t.prototype.isInterrupted = function() {
  4678. return this.interrupted
  4679. }
  4680. ,
  4681. t.prototype.pauseWalkingSection = function() {
  4682. this.walkingSectionPaused = !0
  4683. }
  4684. ,
  4685. t.prototype.clearWalkingSectionPaused = function() {
  4686. this.walkingSectionPaused = !1
  4687. }
  4688. ,
  4689. t.prototype.autoTour = function() {
  4690. var i = Date.now();
  4691. this.model.auxDataPromise.then(function() {
  4692. i = Date.now() - i;
  4693. var e = r.warp.auto
  4694. , t = this.model.data && this.model.data.player_options/* && this.model.data.player_options.highlight_reel */;
  4695. 0 <= e && 1 < this.model.heroCount() && t && o.trigger({
  4696. duration: Math.max(1e3 * Math.min(300, e) - i, 0),
  4697. done: function() {
  4698. this.playTour()
  4699. }
  4700. .bind(this),
  4701. name: "_atr",
  4702. id: A
  4703. })
  4704. }
  4705. .bind(this))
  4706. }
  4707. ,
  4708. t.prototype.atDestinationPano = function() {
  4709. if (!this.player.currentPano || null === this.destinationItem)
  4710. return !1;
  4711. var e = this.player.currentPano.id;
  4712. if (void 0 === e)
  4713. return !1;
  4714. var t = this.model.heroLocations;
  4715. //return null !== this.destinationItem && void 0 !== t[this.destinationItem] && e === t[this.destinationItem].panoId
  4716. var destination = this.destinationItem && this.model.getHeroDescriptorByIndex(this.destinationItem)
  4717. return destination && destination.panoId == e
  4718. }
  4719. ,
  4720. t.prototype.redirectToItem = function(e, t) {
  4721. if (null != e)
  4722. if (this.wouldInterrupt())
  4723. if (this.player.mode !== s.TRANSITIONING) {
  4724. m.debug("Director.redirectToItem() -> Redirecting to " + e + " via " + t);
  4725. var i = function() {
  4726. o.setTimeout(function() {
  4727. this.setDestinationItem(e),
  4728. this.goToDestination(!0, p.BEGINNING, r.warp.warpInterruptionRedirectTime, !1)
  4729. }
  4730. .bind(this), 0)
  4731. }
  4732. .bind(this);
  4733. this.interrupt(p.END, 0),
  4734. this.updateSuccessFunction(i)
  4735. } else
  4736. m.debug("Director.redirectToItem() -> Cannot redirect while transitioning.");
  4737. else
  4738. m.warn("Director.redirectToItem() -> Director cannot redirect if there is nothing to interrupt.");
  4739. else
  4740. m.warn("Director.redirectToItem() -> Redirecting to null item.")
  4741. }
  4742. ,
  4743. t.prototype.useSpecialTransition = function(e) {
  4744. void 0 !== e && this.defaultWarpStyle !== c.BLACK && m.debug("useSpecialTransition(): " + e),
  4745. this.nextWarpStyle = c.BLACK
  4746. }
  4747. ,
  4748. t.prototype.resetSpecialTransition = function() {
  4749. this.nextWarpStyle = this.defaultWarpStyle
  4750. }
  4751. ,
  4752. t.prototype.arrivedAtDestination = function(e) {
  4753. if (this.player.flying || this.player.isWarping())
  4754. m.warn("Cannot advance to interlude or aiming while player is flying or warping.");
  4755. else {
  4756. this.transitionStage = v.Aiming;
  4757. var t = this.tourIsPlaying ? this.tourInterlude.bind(this, this.nextItem(this.currentItem)) : null;
  4758. this.player.model.fadePanoMarkers(0),
  4759. this.awaitCompletion(function() {
  4760. this.resetSpecialTransition(),
  4761. e ? this.player.aimTourCamera(this.destinationItem, g.Retain, g.Slow, this.actionComplete.bind(this)) : this.actionComplete()
  4762. }
  4763. .bind(this), t)
  4764. }
  4765. }
  4766. ,
  4767. t.prototype.goToDestination = function(e, t, i, n) {
  4768. //音频
  4769. var musicInfo = this.model.heroLocations[this.destinationItem[0]].musicInfo
  4770. if(musicInfo && musicInfo.music){
  4771. var o1 = musicInfo.music.includes(g_Prefix.slice(-10)) ? musicInfo.music : g_Prefix + musicInfo.music;
  4772. let audioSrc1 = g_tourAudio.src.split('/').pop();
  4773. let audioSrc2 = o1.split('/').pop();
  4774. if(audioSrc1 == audioSrc2){//应该是继续播放该folder
  4775. if(this.destinationItem[1] == 0){//从头开始播放 因为可能暂停后然后再点该缩略图播
  4776. g_tourAudio.currentTime = 0; g_tourAudio.play();
  4777. }else if(g_tourAudio.paused && g_tourAudio.currentTime < g_tourAudio.duration){//未播完
  4778. g_tourAudio.play()
  4779. }
  4780. }else{//很可能是该folder的起始
  4781. g_tourAudio.src = manage.dealURL(o1);
  4782. g_tourAudio.load()
  4783. }
  4784. if(g_bgAudio && !g_bgAudio.paused){
  4785. manage.switchBgmState(false);
  4786. g_bgAudio.pauseByTour = true
  4787. }
  4788. }
  4789. if (this.onTheBus = !0,
  4790. this.emit("update.controls"),
  4791. this.player.updateLastView(),
  4792. n || !this.atDestinationPano()){
  4793. if (this.player.flying || this.player.isWarping())
  4794. m.warn("Cannot go to new destination while player is flying or warping.");
  4795. else {
  4796. var a = this.model.getHeroDescriptorByIndex(this.destinationItem)
  4797. , s = null
  4798. , l = null;
  4799. if (a.isPano()) {
  4800. o1 = this.getMomentTour(this.destinationItem) //window.DATA.momentTour || "walk";
  4801. l = this.player.warpToPanoByHeroIndex.bind(this.player, this.destinationItem, g.Show, f.Slow, o1, !0, i, this.actionComplete.bind(this)),
  4802. s = this.arrivedAtDestination.bind(this, !0)
  4803. //add
  4804. if(o1=='black' && a.zoom && a.zoom != this.player.zoomLevel){
  4805. this.player.smoothZoomFovTo(null, a.zoom, r.warp.teleportTime) //瞬间过渡的时间
  4806. }
  4807. } else{
  4808. l = this.player.warpToNonPanoByHeroIndex.bind(this.player, this.destinationItem, this.actionComplete.bind(this)),
  4809. s = this.arrivedAtDestination.bind(this, !1);
  4810. }
  4811. this.transitionStage = v.Moving,
  4812. this.model.fadePanoMarkers(0),
  4813. this.awaitCompletion(function() {
  4814. l()
  4815. }
  4816. .bind(this), s),
  4817. this.emit("update.controls")
  4818. }
  4819. }else{
  4820. //add 原地旋转时, 写到_warpCameraAim里,因那有时间
  4821. /* var a = this.model.getHeroDescriptorByIndex(this.destinationItem)
  4822. if(a.zoom && a.zoom != this.player.zoomLevel){
  4823. this.player.smoothZoomFovTo(null, a.zoom, r.warp.teleportTime) //瞬间过渡的时间
  4824. } */
  4825. this.arrivedAtDestination(!0)
  4826. }
  4827. }
  4828. ,
  4829. t.prototype.tourInterlude = function() {
  4830. if (l.trackAlways("reach_highlight", {
  4831. reach_source: this.reachSource
  4832. }),
  4833. this.model.fadePanoMarkers(0),
  4834. this.emit("update.controls"),
  4835. this.tourIsPlaying)
  4836. return this.atEndOfTour() && !this.endlessLoop ? (this.tourInProgress = !1,
  4837. this.stopTour(),
  4838. this.emit(u.TourEnd),
  4839. void (this.player.mode === s.PANORAMA && this.model.fadePanoMarkers(r.panorama.markerOpacity))) : void this.awaitCompletion(function() {
  4840. this.transitionStage = v.Interlude,
  4841. this.player.tourInterlude(this.nextItem(this.currentItem), this.actionComplete.bind(this))
  4842. }
  4843. .bind(this), this.goNext.bind(this))
  4844. }
  4845. ,
  4846. t.prototype.playTour = function() {
  4847. if (!this.bounceable())
  4848. return this.tourIsPlaying ? void m.info("tour is already playing") : void (this.wouldInterrupt() || (this.player.emit("tour_auto", this.defaultWarpStyle),
  4849. this.tourInProgress = !0,
  4850. this.reachSource = "play",
  4851. this.tourIsPlaying = !0,
  4852. this.wasZoomEnabled = this.player.zoomEnabled,
  4853. this.player.zoomEnabled = !1,
  4854. this.resetSpecialTransition(),
  4855. this.emit("update.controls"),
  4856. this.emit(u.TourStart),
  4857. this.player.enablePreRendering(),
  4858. this.walkingSectionPaused ? (this.clearWalkingSectionPaused(),
  4859. this.goToDestination()) : this.goNext()))
  4860. }
  4861. ,
  4862. t.prototype.bgmReplay = function() {
  4863. if(g_bgAudio && g_bgAudio.paused && g_bgAudio.pauseByTour){
  4864. g_playAudio = g_bgAudio;
  4865. g_tourAudio && g_tourAudio.pause();
  4866. //window.tourAudio && window.tourAudio.pause();
  4867. manage.switchBgmState(true);
  4868. }
  4869. }
  4870. ,
  4871. t.prototype.stopTour = function(isAutoStop) {//停止导览 isAutoStop 希望仅在飞完结束自动停止时的stopTour不停止tourSound, 这样才能完整播放tourSound. 不过似乎会在倒数第二个片段点击按钮停止导览时也视作自动结束的(执行this.interrupt() )。
  4872. this.isInterrupted() || this.transitionStage === v.Moving && this.checkAndHandleWalkingtourInterruption(this.nextWarpStyle) || (this.tourIsPlaying && (this.player.zoomEnabled = this.wasZoomEnabled),
  4873. this.tourIsPlaying = !1,
  4874. (!isAutoStop || g_tourAudio && g_tourAudio.paused )&&this.bgmReplay(),//xzw
  4875. this.interrupt(),
  4876. this.clearWalkingSectionPaused(),
  4877. this.resetSpecialTransition(),
  4878. this.emit("update.controls"))
  4879. if(!isAutoStop && g_tourAudio && g_tourAudio.paused == false )
  4880. {
  4881. g_tourAudio.pause();
  4882. g_tourAudio.src = ""
  4883. }
  4884. }
  4885. ,
  4886. t.prototype.endTourProgress = function() {
  4887. this.tourInProgress = !1,
  4888. this.emit("update.controls"),
  4889. this.emit(u.TourEnd)
  4890. }
  4891. ,
  4892. t.prototype.goToHighlight = function(e) {
  4893. if (this.wouldInterrupt())
  4894. this.itemCompare(this.destinationItem,e,'equal') ? this.interrupt() : this.redirectToItem(e, "goToHighlight");
  4895. else {
  4896. if (m.debug("<tour.goto " + e + ">"),
  4897. this.isInterrupted())
  4898. return;
  4899. this.clearWalkingSectionPaused(),
  4900. this.setDestinationItem(e),
  4901. this.useSpecialTransition("Hilight"),
  4902. this.goToDestination(),
  4903. l.trackAlways("reach_highlight", {
  4904. reach_source: "thumb"
  4905. })
  4906. }
  4907. }
  4908. ,
  4909. t.prototype.prevHighlight = function() {
  4910. this.bounceable() || (this.player.emit("tour_manual", "prev"),
  4911. this.interrupt(p.BEGINNING) || this.isInterrupted() || (this.clearWalkingSectionPaused(),
  4912. this.reachSource = "prev",
  4913. this.goPrev()))
  4914. }
  4915. ,
  4916. t.prototype.nextHighlight = function() {
  4917. this.bounceable() || (this.player.emit("tour_manual", "next"),
  4918. this.interrupt(p.BEGINNING) || this.isInterrupted() || (this.clearWalkingSectionPaused(),
  4919. this.reachSource = "next",
  4920. this.goNext()))
  4921. }
  4922. ,
  4923. t.prototype.changeMode = function(e) {
  4924. var t = $.Deferred()
  4925. , i = t.resolve.bind(t)
  4926. , n = t.reject.bind(t);
  4927. if (this.emit(u.StartModeChange),
  4928. !function() {
  4929. return this.clearWalkingSectionPaused(),
  4930. !!this.wouldInterrupt() && (this.interrupt(),
  4931. !0)
  4932. }
  4933. .bind(this)()) {
  4934. switch (e) {
  4935. case s.PANORAMA:
  4936. 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);
  4937. break;
  4938. case s.DOLLHOUSE:
  4939. case s.FLOORPLAN:
  4940. this.player.flyToNewMode({
  4941. mode: e
  4942. }).done(i).fail(n);
  4943. break;
  4944. case s.OUTDOOR:
  4945. 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)
  4946. }
  4947. return t.promise()
  4948. }
  4949. }
  4950. ,
  4951. t.prototype.atEndOfTour = function(item) {
  4952. //return this.currentItem >= this.nItems - 1
  4953. var end = this.currentItem && this.currentItem[0] >= this.nItems - 1;
  4954. if(end){
  4955. var heroLocations = this.model.heroLocations[this.nItems-1].heroLocations
  4956. if(heroLocations){
  4957. end = this.currentItem[1] >= heroLocations.length - 1
  4958. }
  4959. }
  4960. return end;
  4961. }
  4962. ,
  4963. t.prototype.firstDestination = function() {
  4964. //return 0 < this.nItems ? 0 : null
  4965. return 0 < this.nItems ? [0,0]: null
  4966. }
  4967. ,
  4968. t.prototype.finalDestination = function() {
  4969. //return 0 < this.nItems ? this.nItems - 1 : null
  4970. return 0 < this.nItems ? [this.nItems - 1,0]: null
  4971. }
  4972. ,
  4973. t.prototype.goPrev = function() {
  4974. this.tourAdvance(-1)
  4975. }
  4976. ,
  4977. t.prototype.goNext = function() {
  4978. this.tourAdvance(1)
  4979. }
  4980. ,
  4981. t.prototype.setDestinationItem = function(e) {
  4982. this.destinationItem = e,
  4983. this.emit("update.controls")
  4984. }
  4985. ,
  4986. t.prototype.setCurrentItem = function(e) {
  4987. this.currentItem = e,
  4988. this.emit("update.controls")
  4989. }
  4990. ,
  4991. t.prototype.nextItem = function(currentItem) {
  4992. //return null === e ? this.firstDestination() : e >= this.nItems - 1 ? this.endlessLoop ? this.firstDestination() : null : e + 1
  4993. if(currentItem == void 0)return this.firstDestination()
  4994. var currentLocation = this.model.heroLocations[currentItem[0]];
  4995. var currentChildNum = currentLocation.heroLocations ? currentLocation.heroLocations.length : 1
  4996. var item;
  4997. if(this.currentItem[1] >= currentChildNum - 1){//子目录中最后一个
  4998. item = [currentItem[0] + 1, 0] //结果可能超出nItems
  4999. }else{
  5000. item = [currentItem[0] , currentItem[1]+1]
  5001. }
  5002. if(item[0] >= this.nItems ){
  5003. item = this.firstDestination()
  5004. }
  5005. return item;
  5006. //暂时不理会endlessLoop,默认为false
  5007. }
  5008. ,
  5009. t.prototype.prevItem = function(currentItem) {
  5010. //return null === e ? this.firstDestination() : e < 0 ? this.endlessLoop ? this.lastDestination() : null : e - 1
  5011. if(currentItem == void 0)return this.firstDestination()//finalDestination?
  5012. var item;
  5013. var lastLocation = this.model.heroLocations[currentItem[0]-1];
  5014. if(!lastLocation) return this.finalDestination()//[-1, 0]//this.setDestinationItem([-1, 0]) //结果小于0
  5015. else{
  5016. var lastChildNum = lastLocation.heroLocations ? lastLocation.heroLocations.length : 1
  5017. if(this.currentItem[1] == 0){//子目录中第一个
  5018. return [currentItem[0] - 1, lastChildNum-1]
  5019. }else{
  5020. return [currentItem[0], currentItem[1]-1]
  5021. }
  5022. }
  5023. }
  5024. ,
  5025. t.prototype.tourAdvance = function(e) {//e是1或-1
  5026. m.debug("tourAdvance(" + e + ")")
  5027. if(null === this.currentItem || void 0 === this.currentItem){
  5028. this.setDestinationItem(this.firstDestination())
  5029. }else{
  5030. var item
  5031. if(e == 1){
  5032. item = this.nextItem(this.currentItem)
  5033. /* var currentLocation = this.model.heroLocations[this.currentItem[0]];
  5034. var currentChildNum = currentLocation.heroLocations ? currentLocation.heroLocations.length : 1
  5035. if(this.currentItem[1] >= currentChildNum - 1){//子目录中最后一个
  5036. this.setDestinationItem([this.currentItem[0] + 1, 0]) //结果可能超出nItems
  5037. }else{
  5038. this.setDestinationItem([this.currentItem[0] , this.currentItem[1]+1])
  5039. } */
  5040. }else if(e == -1){
  5041. item = this.prevItem(this.currentItem)
  5042. /* var lastLocation = this.model.heroLocations[this.currentItem[0]-1];
  5043. if(!lastLocation) this.setDestinationItem([-1, 0]) //结果小于0
  5044. else{
  5045. var lastChildNum = lastLocation.heroLocations ? lastLocation.heroLocations.length : 1
  5046. if(this.currentItem[1] == 0){//子目录中第一个
  5047. this.setDestinationItem([this.currentItem[0] - 1, lastChildNum-1])
  5048. }else{
  5049. this.setDestinationItem([this.currentItem[0], this.currentItem[1]-1])
  5050. }
  5051. } */
  5052. }
  5053. //this.setDestinationItem(this.currentItem + e)
  5054. this.setDestinationItem(item)
  5055. }
  5056. if(this.itemCompare(this.destinationItem, this.finalDestination(), 'equal')[0] < 0 ){
  5057. this.useSpecialTransition("reverse-looping to end")
  5058. }else if(this.itemCompare(this.destinationItem, this.firstDestination(), 'equal')){
  5059. this.useSpecialTransition("looping back to start")
  5060. }
  5061. /* if(this.destinationItem[0] < 0 ){
  5062. this.setDestinationItem(this.finalDestination())
  5063. this.useSpecialTransition("reverse-looping to end")
  5064. }else{
  5065. this.destinationItem[0] >= this.nItems && (this.setDestinationItem(this.firstDestination()),
  5066. this.useSpecialTransition("looping back to start"))
  5067. } */
  5068. /* var momentTour = this.getMomentTour(this.destinationItem);
  5069. if ( "black" === momentTour) { // 方奕卓 瞬间过渡, 相机缩放至1
  5070. var i = this.player.zoomLevel;
  5071. this.player.zoomEnabled = !0;
  5072. var t = function(e, t) {
  5073. this.player.zoomTo((1 - e) * i, !0)
  5074. }
  5075. .bind(this);
  5076. o.start(t, 1500, function() {}, 0, h.easeOutQuad, "zoom")
  5077. } */
  5078. this.goToDestination()
  5079. }
  5080. ,
  5081. t.prototype.getMomentTour = function(destinationItem) {//add
  5082. var wholeMomentTour = window.DATA.momentTour || "walk"; //最外层
  5083. if(!destinationItem) return wholeMomentTour
  5084. else{
  5085. var currentLocation = this.model.getHeroDescriptorByIndex(destinationItem)//最内层。 如果有使用最内层
  5086. if(currentLocation.momentTour)return currentLocation.momentTour;
  5087. var currentLocation_ = this.model.heroLocations[destinationItem[0]];
  5088. return currentLocation_.momentTour || wholeMomentTour; //若中间层或最内层有就使用,否则使用最外层
  5089. }
  5090. }
  5091. ,
  5092. I.exports = t
  5093. }
  5094. ).call(this, "/js/director.js")
  5095. }
  5096. , {
  5097. "./analytics": 4,
  5098. "./enum/BlackoutStyle": 18,
  5099. "./enum/ControlEvents": 21,
  5100. "./enum/DirectorEvents": 23,
  5101. "./enum/ModelManagerEvents": 33,
  5102. "./enum/PathDiscardMode": 38,
  5103. "./enum/PathDisplayMode": 39,
  5104. "./enum/PlayerEvents": 40,
  5105. "./enum/Viewmode": 51,
  5106. "./enum/WarpStyle": 52,
  5107. "./model/ModelManager": 140,
  5108. "./player": 155,
  5109. "./settings": 166,
  5110. "./util/logger": 189,
  5111. "./util/transitions": 195,
  5112. events: 202,
  5113. three: 217
  5114. }],
  5115. 16: [function(e, t, i) {
  5116. "use strict";
  5117. var n = e("three")
  5118. , r = e("./enum/Viewmode")
  5119. , o = (e("./settings"),
  5120. e("./util/transitions"))
  5121. , a = e("./enum/PlayerEvents")
  5122. , s = new n.ShaderPass(n.HorizontalBlurShader)
  5123. , l = new n.ShaderPass(n.VerticalBlurShader);
  5124. l.renderToScreen = !0;
  5125. var c = $("#player").width() / $("#player").height();
  5126. isNaN(c) && (c = 1);
  5127. var h = {
  5128. currentBlur: 0,
  5129. aspect: c,
  5130. blurStrength: 1,
  5131. hblurPass: s,
  5132. vblurPass: l,
  5133. bindEvents: function(e) {
  5134. e.on(a.ModeChanged, function(e, t) {
  5135. e === r.PANORAMA && (o.cancel(h.blur),
  5136. o.cancel(h.addBlur),
  5137. o.start(h.removeBlur, 500, null, 0, null, "deblur"))
  5138. })
  5139. },
  5140. blur: function(e) {
  5141. var t = (h.currentBlur = e) * h.blurStrength;
  5142. l.uniforms.v.value = t / 512 * h.aspect,
  5143. s.uniforms.h.value = t / 512
  5144. },
  5145. addBlur: function(e) {
  5146. e = Math.max(e, h.currentBlur),
  5147. h.blur(e)
  5148. },
  5149. removeBlur: function(e) {
  5150. e = Math.min(1 - e, h.currentBlur),
  5151. h.blur(e)
  5152. }
  5153. };
  5154. h.blur(0),
  5155. t.exports = h
  5156. }
  5157. , {
  5158. "./enum/PlayerEvents": 40,
  5159. "./enum/Viewmode": 51,
  5160. "./settings": 166,
  5161. "./util/transitions": 195,
  5162. three: 217
  5163. }],
  5164. 17: [function(e, t, i) {
  5165. "use strict";
  5166. t.exports = {
  5167. UNKNOWN: 0,
  5168. ALIGNED: 1,
  5169. UNALIGNED: 2,
  5170. PLACED: 3
  5171. }
  5172. }
  5173. , {}],
  5174. 18: [function(e, t, i) {
  5175. "use strict";
  5176. t.exports = {
  5177. NONE: 0,
  5178. MIDDLE: 1,
  5179. END: 2,
  5180. BEGINNING: 3,
  5181. FADEIN: 4
  5182. }
  5183. }
  5184. , {}],
  5185. 19: [function(e, t, i) {
  5186. "use strict";
  5187. var r = e("three");
  5188. t.exports = {
  5189. newBlue: new r.Color(4967932),
  5190. altBlue: new r.Color(47355),
  5191. tagDefault: new r.Color(223357),
  5192. classicBlue: new r.Color(53759),
  5193. mpYellow: new r.Color(16502016),
  5194. mpOrange: new r.Color(16428055),
  5195. mpBlue: new r.Color(12096),
  5196. mpLtGrey: new r.Color(13751252),
  5197. mpDkGrey: new r.Color(10000019),
  5198. mpRed: new r.Color(12525854),
  5199. mpOrangeDesat: new r.Color(16764529),
  5200. mpBlueDesat: new r.Color(4034734),
  5201. mpRedDesat: new r.Color(14705505),
  5202. white: new r.Color(16777215),
  5203. black: new r.Color(0),
  5204. _desat: function(e, t) {
  5205. var i = t || .3
  5206. , n = (new r.Color).copy(e).getHSL();
  5207. return (new r.Color).setHSL(n.h, n.s * (1 - i), n.l)
  5208. },
  5209. _darken: function(e, t) {
  5210. var i = t || .2
  5211. , n = e.getHSL();
  5212. return (new r.Color).setHSL(n.h, n.s, n.l * (1 - i))
  5213. }
  5214. }
  5215. }
  5216. , {
  5217. three: 217
  5218. }],
  5219. 20: [function(e, t, i) {
  5220. "use strict";
  5221. t.exports = {
  5222. NONE: -1,
  5223. ROTATE: 0,
  5224. DOLLY: 1,
  5225. PAN: 2,
  5226. ROTATE_DOLLY: 3,
  5227. PAN_DOLLY: 4
  5228. }
  5229. }
  5230. , {}],
  5231. 21: [function(e, t, i) {
  5232. "use strict";
  5233. t.exports = {
  5234. Move: "move",
  5235. InteractionDirect: "interaction.direct",
  5236. InteractionKey: "interaction.key",
  5237. InteractionGui: "interaction.gui",
  5238. FlyInDirection: "fly.direction",
  5239. InputStart: "input.start",
  5240. Pinch: "input.pinch",
  5241. Scroll: "input.scroll",
  5242. AutoPanInterrupt: "autopan.interrupt",
  5243. AutoPanComplete: "autopan.complete",
  5244. AutoPanClamped: "autopan.clamped",
  5245. LongTap: "longtap"
  5246. }
  5247. }
  5248. , {}],
  5249. 22: [function(e, t, i) {
  5250. "use strict";
  5251. t.exports = Object.freeze({
  5252. FORWARD: "FORWARD",
  5253. LEFT: "LEFT",
  5254. RIGHT: "RIGHT",
  5255. BACK: "BACK",
  5256. UP: "UP",
  5257. DOWN: "DOWN"
  5258. })
  5259. }
  5260. , {}],
  5261. 23: [function(e, t, i) {
  5262. "use strict";
  5263. t.exports = {
  5264. ActionInterrupted: "action.interrupted",
  5265. TourStart: "tour.start",
  5266. TourEnd: "tour.end",
  5267. StartModeChange: "mode.startChange"
  5268. }
  5269. }
  5270. , {}],
  5271. 24: [function(e, t, i) {
  5272. "use strict";
  5273. t.exports = Object.freeze({
  5274. None: 0,
  5275. Queued: 1,
  5276. ForceQueued: 2,
  5277. Downloading: 3,
  5278. Downloaded: 4,
  5279. DownloadFailed: 5
  5280. })
  5281. }
  5282. , {}],
  5283. 25: [function(e, t, i) {
  5284. "use strict";
  5285. t.exports = {
  5286. GL_TEXTURE_CUBE_MAP_POSITIVE_X: 0,
  5287. GL_TEXTURE_CUBE_MAP_NEGATIVE_X: 1,
  5288. GL_TEXTURE_CUBE_MAP_POSITIVE_Y: 2,
  5289. GL_TEXTURE_CUBE_MAP_NEGATIVE_Y: 3,
  5290. GL_TEXTURE_CUBE_MAP_POSITIVE_Z: 4,
  5291. GL_TEXTURE_CUBE_MAP_NEGATIVE_Z: 5
  5292. }
  5293. }
  5294. , {}],
  5295. 26: [function(e, t, i) {
  5296. "use strict";
  5297. t.exports = {
  5298. Texture2D: 0,
  5299. TextureCube: 1
  5300. }
  5301. }
  5302. , {}],
  5303. 27: [function(e, t, i) {
  5304. "use strict";
  5305. t.exports = {
  5306. SMALL: "small",
  5307. LARGE: "large"
  5308. }
  5309. }
  5310. , {}],
  5311. 28: [function(e, t, i) {
  5312. "use strict";
  5313. var n = e("./Viewmode")
  5314. , r = {
  5315. LANDING: {},
  5316. NAVIGATION: "navigation",
  5317. MORE_HELP: "moreHelp",
  5318. TOUR_INTERACTION: {}
  5319. };
  5320. r.LANDING[n.PANORAMA] = "panorama.landing",
  5321. r.LANDING[n.OUTDOOR] = "outdoor.landing",
  5322. r.LANDING[n.DOLLHOUSE] = "dollhouse.landing",
  5323. r.LANDING[n.FLOORPLAN] = "floorplan.landing",
  5324. r.TOUR_INTERACTION.standard = "standard.tour",
  5325. r.TOUR_INTERACTION[n.OUTDOOR] = "outdoor.tour",
  5326. r.TOUR_INTERACTION[n.FLOORPLAN] = "floorplan.tour",
  5327. t.exports = r
  5328. }
  5329. , {
  5330. "./Viewmode": 51
  5331. }],
  5332. 29: [function(e, t, i) {
  5333. "use strict";
  5334. var n = {
  5335. UP: 1,
  5336. DOWN: -1,
  5337. LEFT: "L",
  5338. RIGHT: "R",
  5339. FORWARD: "F",
  5340. BACK: "B",
  5341. reverse: {},
  5342. opposite: function(e) {
  5343. return this.reverse[e.toString()]
  5344. }
  5345. };
  5346. n.reverse[n.UP] = n.DOWN,
  5347. n.reverse[n.DOWN] = n.UP,
  5348. n.reverse[n.LEFT] = n.RIGHT,
  5349. n.reverse[n.RIGHT] = n.LEFT,
  5350. n.reverse[n.FORWARD] = n.BACK,
  5351. n.reverse[n.BACK] = n.FORWARD,
  5352. t.exports = n
  5353. }
  5354. , {}],
  5355. 30: [function(e, t, i) {
  5356. "use strict";
  5357. var n = {
  5358. ZERO: 48,
  5359. ONE: 49,
  5360. TWO: 50,
  5361. THREE: 51,
  5362. FOUR: 52,
  5363. FIVE: 53,
  5364. SIX: 54,
  5365. SEVEN: 55,
  5366. EIGHT: 56,
  5367. NINE: 57,
  5368. LEFTARROW: 37,
  5369. UPARROW: 38,
  5370. RIGHTARROW: 39,
  5371. DOWNARROW: 40,
  5372. A: 65,
  5373. B: 66,
  5374. C: 67,
  5375. D: 68,
  5376. E: 69,
  5377. F: 70,
  5378. G: 71,
  5379. H: 72,
  5380. I: 73,
  5381. J: 74,
  5382. K: 75,
  5383. L: 76,
  5384. M: 77,
  5385. N: 78,
  5386. O: 79,
  5387. P: 80,
  5388. Q: 81,
  5389. R: 82,
  5390. S: 83,
  5391. T: 84,
  5392. U: 85,
  5393. V: 86,
  5394. W: 87,
  5395. X: 88,
  5396. Y: 89,
  5397. Z: 90,
  5398. SPACE: 32,
  5399. RETURN: 13,
  5400. SEMICOLON: 186,
  5401. PLUSEQUALS: 187,
  5402. DASHUNDERSCORE: 189,
  5403. OPENBRACKET: 219
  5404. };
  5405. e("../util/browser").detectFirefox() && (n.SEMICOLON = 59,
  5406. n.PLUSEQUALS = 61,
  5407. n.DASHUNDERSCORE = 173),
  5408. t.exports = n
  5409. }
  5410. , {
  5411. "../util/browser": 182
  5412. }],
  5413. 31: [function(e, t, i) {
  5414. "use strict";
  5415. t.exports = {
  5416. EN_US: "en-US",
  5417. ES_MX: "es-MX",
  5418. FR_FR: "fr-FR",
  5419. DE_DE: "de-DE",
  5420. RU_RU: "ru-RU",
  5421. CN_CN: "cn-CN",
  5422. JP_JP: "jp-JP"
  5423. }
  5424. }
  5425. , {}],
  5426. 32: [function(e, t, i) {
  5427. "use strict";
  5428. t.exports = {
  5429. TagActivated: "tag.activated",
  5430. TagDismissed: "tag.dismissed",
  5431. TagNavigation: "tag.navigation"
  5432. }
  5433. }
  5434. , {}],
  5435. 33: [function(e, t, i) {
  5436. "use strict";
  5437. t.exports = {
  5438. ModelAdded: "model-added",
  5439. ActiveModelChanged: "active-model-changed"
  5440. }
  5441. }
  5442. , {}],
  5443. 34: [function(e, t, i) {
  5444. "use strict";
  5445. t.exports = {
  5446. LEFT: 0,
  5447. MIDDLE: 1,
  5448. RIGHT: 2
  5449. }
  5450. }
  5451. , {}],
  5452. 35: [function(e, t, i) {
  5453. "use strict";
  5454. t.exports = {
  5455. PanoRenderComplete: "panorama.render.complete",
  5456. TileRenderFailure: "panorama.tile.render.failed",
  5457. TileRenderSuccess: "panorama.tile.render.success",
  5458. TileUploadAttempted: "panorama.tile.upload.attempted",
  5459. UploadAttemptedForAllTiles: "panorama.upload.attempted.all.tiles",
  5460. ZoomLevelRenderStarted: "panorama.zoom.render.started"
  5461. }
  5462. }
  5463. , {}],
  5464. 36: [function(e, t, i) {
  5465. "use strict";
  5466. t.exports = {
  5467. BASE: 1,
  5468. STANDARD: 2,
  5469. HIGH: 3,
  5470. ULTRAHIGH: 4
  5471. }
  5472. }
  5473. , {}],
  5474. 37: [function(e, t, i) {
  5475. "use strict";
  5476. t.exports = {
  5477. LoadComplete: "panorama.load.complete",
  5478. LoadFailed: "panorama.load.failed",
  5479. TileLoaded: "panorama.tile.loaded"
  5480. }
  5481. }
  5482. , {}],
  5483. 38: [function(e, t, i) {
  5484. "use strict";
  5485. t.exports = Object.freeze({
  5486. Standard: 0,
  5487. Slow: 1,
  5488. Retain: 2
  5489. })
  5490. }
  5491. , {}],
  5492. 39: [function(e, t, i) {
  5493. "use strict";
  5494. t.exports = Object.freeze({
  5495. Show: 0,
  5496. Hide: 1,
  5497. Retain: 2
  5498. })
  5499. }
  5500. , {}],
  5501. 40: [function(e, t, i) {
  5502. "use strict";
  5503. t.exports = {
  5504. Move: "move",
  5505. MoveComplete: "move.complete",
  5506. ModeChanged: "mode.changed",
  5507. ModeChanging: "mode.changing",
  5508. PanoChosen: "pano.chosen",
  5509. ClosestPanoChanging: "closest.pano.changing",
  5510. WarpStarted: "warp.started",
  5511. WarpInterrupted: "warp.interrupted",
  5512. WarpEnded: "warp.ended",
  5513. FlyinFinished: "flyin.finished",
  5514. FlyingStarted: "flying.started",
  5515. FlyingInterrupted: "flying.interrupted",
  5516. FlyingEnded: "flying.ended",
  5517. Ready: "ready",
  5518. StartInside: "start.inside",
  5519. StartOutside: "start.outside",
  5520. ViewChanged: "view.changed",
  5521. WarpInterruptedWithFlyTo: "warp.interrupted.flyto",
  5522. InputStart: "input.start"
  5523. }
  5524. }
  5525. , {}],
  5526. 41: [function(e, t, i) {
  5527. "use strict";
  5528. t.exports = Object.freeze({
  5529. DEFAULT: 0,
  5530. PANOMARKERS: 1,
  5531. RETICULE: 2,
  5532. TAG: 3
  5533. })
  5534. }
  5535. , {}],
  5536. 42: [function(e, t, i) {
  5537. "use strict";
  5538. t.exports = {
  5539. visibleFloor: 1,
  5540. ghostFloor: 3,
  5541. boundingSkybox: 1,
  5542. panoMarker: 2,
  5543. reticule: 3,
  5544. tagStem: 4,
  5545. tagDisc: 5,
  5546. ribbon: 100
  5547. }
  5548. }
  5549. , {}],
  5550. 43: [function(e, t, i) {
  5551. "use strict";
  5552. t.exports = {
  5553. ContextCreated: "scene-renderer-context-created",
  5554. AfterRender: "after-render",
  5555. MemoryUsageUpdated: "scene-renderer-memory-usage-updated"
  5556. }
  5557. }
  5558. , {}],
  5559. 44: [function(e, t, i) {
  5560. "use strict";
  5561. t.exports = {
  5562. IDLE: "idle",
  5563. BROWSE: "browse",
  5564. EXAMINE: "examine"
  5565. }
  5566. }
  5567. , {}],
  5568. 45: [function(e, t, i) {
  5569. "use strict";
  5570. t.exports = {
  5571. TileDownloadSuccess: "tiledownloader.download.success",
  5572. TileDownloadFailure: "tiledownloader.download.failure",
  5573. PanoDownloadComplete: "tiledownloader.pano.download.complete"
  5574. }
  5575. }
  5576. , {}],
  5577. 46: [function(e, t, i) {
  5578. "use strict";
  5579. t.exports = {
  5580. CardboardAndroid: "googlevr",
  5581. GearVR: "gearvr",
  5582. CardboardIOS: "googlevrios",
  5583. Cardboard: "googlevr"
  5584. }
  5585. }
  5586. , {}],
  5587. 47: [function(e, t, i) {
  5588. "use strict";
  5589. t.exports = {
  5590. NONE: 0,
  5591. CONTEXTUAL: 1,
  5592. ANDROID: 2
  5593. }
  5594. }
  5595. , {}],
  5596. 48: [function(e, t, i) {
  5597. "use strict";
  5598. var n = {
  5599. Title: 0,
  5600. Cardboard: 1
  5601. }
  5602. , r = {
  5603. Title: 0,
  5604. Cardboard: 1,
  5605. Gear: 2
  5606. };
  5607. [n, r].forEach(function(e) {
  5608. e.pageCount = Object.keys(e).length
  5609. }),
  5610. t.exports.ios = n,
  5611. t.exports.standard = r
  5612. }
  5613. , {}],
  5614. 49: [function(e, t, i) {
  5615. "use strict";
  5616. t.exports = {
  5617. Android: "android",
  5618. IOS: "ios",
  5619. Desktop: "desktop",
  5620. UnsupportedAndroid: "android-unsupported"
  5621. }
  5622. }
  5623. , {}],
  5624. 50: [function(e, t, i) {
  5625. "use strict";
  5626. var n = e("three");
  5627. t.exports = {
  5628. UP: new n.Vector3(0,1,0),
  5629. DOWN: new n.Vector3(0,-1,0),
  5630. LEFT: new n.Vector3(-1,0,0),
  5631. RIGHT: new n.Vector3(1,0,0),
  5632. FORWARD: new n.Vector3(0,0,-1),
  5633. BACK: new n.Vector3(0,0,1)
  5634. }
  5635. }
  5636. , {
  5637. three: 217
  5638. }],
  5639. 51: [function(e, t, i) {
  5640. "use strict";
  5641. var n = e("../exception/ViewmodeConvertException")
  5642. , r = e("./coreViewmodes")
  5643. , o = {
  5644. MESH: "mesh",
  5645. OUTDOOR: "outdoor",
  5646. TRANSITIONING: "transitioning",
  5647. toInt: function(e) {
  5648. switch (e) {
  5649. case this.PANORAMA:
  5650. return 1;
  5651. case this.DOLLHOUSE:
  5652. return 2;
  5653. case this.FLOORPLAN:
  5654. return 3;
  5655. case this.OUTDOOR:
  5656. return 4;
  5657. case this.TRANSITIONING:
  5658. return -1
  5659. }
  5660. throw new n("No known conversion for Viewmode to int for mode: " + e)
  5661. },
  5662. fromInt: function(e) {
  5663. switch (e) {
  5664. case "1":
  5665. case 1:
  5666. return this.PANORAMA;
  5667. case "2":
  5668. case 2:
  5669. return this.DOLLHOUSE;
  5670. case "3":
  5671. case 3:
  5672. return this.FLOORPLAN;
  5673. case "4":
  5674. case 4:
  5675. return this.OUTDOOR
  5676. }
  5677. throw new n("No known conversion for int to viewmode for int: " + e)
  5678. },
  5679. convertWorkshopModeInt: function(e) {
  5680. switch (e) {
  5681. case "0":
  5682. case 0:
  5683. case void 0:
  5684. return this.PANORAMA;
  5685. case "1":
  5686. case 1:
  5687. return this.FLOORPLAN;
  5688. case "2":
  5689. case 2:
  5690. return this.DOLLHOUSE;
  5691. case "3":
  5692. case 3:
  5693. return this.MESH
  5694. }
  5695. throw new n("No known conversion for Workshop int to viewmode for int: " + e)
  5696. }
  5697. };
  5698. e("../util/common").extendObject(o, r),
  5699. t.exports = o
  5700. }
  5701. , {
  5702. "../exception/ViewmodeConvertException": 58,
  5703. "../util/common": 185,
  5704. "./coreViewmodes": 54
  5705. }],
  5706. 52: [function(e, t, i) {
  5707. "use strict";
  5708. t.exports = {
  5709. BLACK: "black",
  5710. STD: "std",
  5711. WALK: "walk"
  5712. }
  5713. }
  5714. , {}],
  5715. 53: [function(e, t, i) {
  5716. "use strict";
  5717. t.exports = {
  5718. ZoomIn: "zoom.in",
  5719. ZoomOut: "zoom.out",
  5720. ZoomMax: "zoom.max",
  5721. ZoomMin: "zoom.min"
  5722. }
  5723. }
  5724. , {}],
  5725. 54: [function(e, t, i) {
  5726. "use strict";
  5727. t.exports = {
  5728. PANORAMA: "panorama",
  5729. DOLLHOUSE: "dollhouse",
  5730. FLOORPLAN: "floorplan"
  5731. }
  5732. }
  5733. , {}],
  5734. 55: [function(e, t, i) {
  5735. "use strict";
  5736. t.exports = function(e) {
  5737. this.message = e
  5738. }
  5739. }
  5740. , {}],
  5741. 56: [function(e, t, i) {
  5742. "use strict";
  5743. function n(e) {
  5744. r.call(this, e)
  5745. }
  5746. var r = e("./BasicException");
  5747. n.prototype = Object.create(r.prototype),
  5748. t.exports = n
  5749. }
  5750. , {
  5751. "./BasicException": 55
  5752. }],
  5753. 57: [function(e, t, i) {
  5754. "use strict";
  5755. function n(e) {
  5756. r.call(this, e)
  5757. }
  5758. var r = e("./BasicException");
  5759. n.prototype = Object.create(r.prototype),
  5760. t.exports = n
  5761. }
  5762. , {
  5763. "./BasicException": 55
  5764. }],
  5765. 58: [function(e, t, i) {
  5766. "use strict";
  5767. function n(e) {
  5768. r.call(this, e)
  5769. }
  5770. var r = e("./BasicException");
  5771. n.prototype = Object.create(r.prototype),
  5772. t.exports = n
  5773. }
  5774. , {
  5775. "./BasicException": 55
  5776. }],
  5777. 59: [function(a, s, e) {
  5778. (function(e) {
  5779. "use strict";
  5780. var i = a("./util/ajax")
  5781. , n = a("./util/showcase")
  5782. , t = a("./util/logger")
  5783. , r = new t(e)
  5784. , o = {};
  5785. s.exports = {
  5786. loadFeatureFlags: function(e) {
  5787. var t = $.Deferred();
  5788. return i.get(e.urlBase + "", {
  5789. responseType: "json",
  5790. prefetchFrom: "user",
  5791. auth: n.getAuthorizationHeader()
  5792. }).done(function(e) {
  5793. (o = function(e) {
  5794. var t = {};
  5795. if (e) {
  5796. var i = e.flags;
  5797. if (i)
  5798. for (var n in i)
  5799. i.hasOwnProperty(n) && (t[i[n]] = !0);
  5800. return t
  5801. }
  5802. return r.debug("Feature flags -> parseFeatureFlags: rawData is null."),
  5803. null
  5804. }(e)) ? t.resolve(o) : t.reject("loading-failed")
  5805. }).fail(function() {
  5806. r.debug("Retrieval of feature flags failed."),
  5807. t.reject("loading-failed")
  5808. }),
  5809. t.promise()
  5810. },
  5811. getFlags: function() {
  5812. return o
  5813. },
  5814. updateDependentSettings: function(e, t) {
  5815. (e = e || o).labels && (t.labels.enabled = !0),
  5816. e.zooming && !t.zoom.forceOff && (t.zoom.enabled = !0),
  5817. e.showcase_sdk && (t.sdkInit = !0),
  5818. e.mobile_highq_override && (t.tiling.mobileHighQualityOverride = !0),
  5819. e.showcase_webvr && (t.vr.allowWebVR = !0),
  5820. e.uhql && (t.tiling.allowUltraHighResolution = !0),
  5821. e.hide_sc_sharing && (t.share.enabled = !1)
  5822. }
  5823. }
  5824. }
  5825. ).call(this, "/js/featureflags.js")
  5826. }
  5827. , {
  5828. "./util/ajax": 181,
  5829. "./util/logger": 189,
  5830. "./util/showcase": 193
  5831. }],
  5832. 60: [function(e, t, i) {
  5833. "use strict";
  5834. var n = (e("../util/common"),
  5835. {
  5836. status: 0,
  5837. set: function(e) {
  5838. if (isNaN(e))
  5839. return !1;
  5840. var t = $(".progressbar");
  5841. e < 0 && (e = 0),
  5842. 100 < e && (e = 100);
  5843. var i = e * (parseInt(t.css("width").replace("px", "")) / 100)
  5844. , n = Math.round(e)
  5845. , r = parseInt(i) - 15;
  5846. t.find(".bar").css("width", i),
  5847. t.find(".label").css("left", r),
  5848. t.find(".perc").text(n + "%"),
  5849. this.status = e
  5850. },
  5851. done: function(e) {
  5852. return e || this.status ? (this.status = null,
  5853. this.set(100)) : this
  5854. }
  5855. });
  5856. t.exports.circleLoader = n
  5857. }
  5858. , {
  5859. "../util/common": 185
  5860. }],
  5861. 61: [function(e, t, i) {
  5862. "use strict";
  5863. t.exports = Object.freeze({
  5864. CLOSE: "modal.closer.close"
  5865. })
  5866. }
  5867. , {}],
  5868. 62: [function(e, t, i) {
  5869. "use strict";
  5870. function n(t, e) {
  5871. function i() {
  5872. var e = t.offsetHeight >= $("#player").height() && t.offsetWidth >= $("#player").width();
  5873. e !== p && ((p = e) ? (t.classList.add("closeByFooter"),
  5874. c.classList.add("closeByFooter")) : (t.classList.remove("closeByFooter"),
  5875. c.classList.remove("closeByFooter")))
  5876. }
  5877. e ? setTimeout(i, r.guiAnimationSpeed) : i()
  5878. }
  5879. var r = e("../../settings")
  5880. , o = (e("../../tag/Media/MediaEvent"),
  5881. e("../../util/browser"))
  5882. , a = e("../../util/common")
  5883. , s = e("./ModalCloserEvent")
  5884. , l = e("events").EventEmitter
  5885. , c = document.getElementsByClassName("footer")[0]
  5886. , h = c.querySelectorAll(".close")[0]
  5887. , u = null
  5888. , d = null
  5889. , p = null
  5890. , f = (o.isMobile(),
  5891. {
  5892. open: function(e) {
  5893. e && (n(e),
  5894. u && h.removeEventListener("click", u, !0),
  5895. u = function(e, t) {
  5896. t && (t.stopPropagation(),
  5897. t.preventDefault()),
  5898. e && this.emit(s.CLOSE, e),
  5899. f.reset()
  5900. }
  5901. .bind(this, e.id),
  5902. h.addEventListener("click", u, !0),
  5903. d && window.removeEventListener("resize", d, !0),
  5904. d = n.bind(this, e),
  5905. window.addEventListener("resize", d, !0))
  5906. },
  5907. reset: function() {
  5908. c.classList.remove("closeByFooter"),
  5909. h.removeEventListener("click", u, !0),
  5910. window.removeEventListener("resize", d, !0),
  5911. u = d = p = null
  5912. }
  5913. });
  5914. a.extendObject(f, l.prototype),
  5915. t.exports = f
  5916. }
  5917. , {
  5918. "../../tag/Media/MediaEvent": 131,
  5919. "../../settings": 166,
  5920. "../../util/browser": 182,
  5921. "../../util/common": 185,
  5922. "./ModalCloserEvent": 61,
  5923. events: 202
  5924. }],
  5925. 63: [function(e, t, i) {
  5926. "use strict";
  5927. var A = e("../lib/dat.gui")
  5928. , C = e("three")
  5929. , I = e("../util/easing")
  5930. , E = e("../enum/Viewmode")
  5931. , _ = e("../enum/Colors")
  5932. , b = e("../enum/WarpStyle")
  5933. , w = e("../settings");
  5934. e("../tag/tag"),
  5935. A.GUI.prototype.removeFolder = function(e) {
  5936. var t = this.__folders[e];
  5937. t && (t.close(),
  5938. this.__ul.removeChild(t.domElement.parentNode),
  5939. delete this.__folders[e],
  5940. this.onResize())
  5941. }
  5942. ,
  5943. t.exports.toggle = function(t, e, i) {
  5944. var n = new A.GUI({
  5945. width: 400
  5946. })
  5947. , r = n.addFolder("Flydown from Dollhouse");
  5948. r.add(w.flydown, "movementEasing", Object.keys(I)),
  5949. r.add(w.flydown, "movementDelay", 0, 1).step(.01),
  5950. r.add(w.flydown, "rotationEasing", Object.keys(I)),
  5951. r.add(w.flydown, "rotationDelay", 0, 1).step(.01),
  5952. r.add(w.flydown, "modelTextureDelay", 0, 1).step(.01),
  5953. r.add(w.flydown, "skyboxDelay", 0, 1).step(.01),
  5954. r.add(w.dollhouseDefault, "minPolarAngle", 0, C.Math.degToRad(50)),
  5955. r.add(w.dollhouseDefault, "maxPolarAngle", C.Math.degToRad(50), C.Math.degToRad(170));
  5956. var o = n.addFolder("Transition between panos");
  5957. o.add(w.transition, "blur", 0, 10).onFinishChange(function() {}),
  5958. o.add(w.transition, "flySpeed", 0, 10).step(.01).onFinishChange(function() {
  5959. w.transition.flyTime = 0,
  5960. o.__controllers.forEach(function(e) {
  5961. e.updateDisplay()
  5962. })
  5963. }),
  5964. o.add(w.transition, "flyTime", 0, 5e3).onFinishChange(function() {
  5965. w.transition.flySpeed = 0,
  5966. o.__controllers.forEach(function(e) {
  5967. e.updateDisplay()
  5968. })
  5969. }),
  5970. o.add(w.transition, "aimTime", 500, 2500).step(50),
  5971. o.add(w.transition, "aimSlowFactor", 1, 3).step(.1),
  5972. o.add(w.transition, "movementEasing", Object.keys(I));
  5973. var a = n.addFolder("Path Display");
  5974. a.add(w.path, "opacity", 0, 1).step(.01).onFinishChange(function() {}),
  5975. a.add(w.path, "height", 0, .2).step(.01).onFinishChange(function() {}),
  5976. a.add(w.path, "outsideHeight", 0, 2).step(.01).onFinishChange(function() {}),
  5977. a.add(w.path, "ribbonWidth", .01, .35).step(.01).onFinishChange(function() {}),
  5978. a.add(w.path, "waypointRadius", .01, 1.2).step(.01).onFinishChange(function() {}),
  5979. a.add(w.path, "waypointPulse", 0, 3600).step(20).onFinishChange(function() {}),
  5980. a.add(w.path, "waypointIndoorRadius", .01, 1.2).step(.01).onFinishChange(function() {}),
  5981. a.add(w.path, "fadeInTime", 0, 1200).step(10).onFinishChange(function() {}),
  5982. a.add(w.path, "fadeOutTime", 0, 1200).step(10).onFinishChange(function() {}),
  5983. a.add(w.path, "color", Object.keys(_)).onFinishChange(function() {
  5984. w.path.color = _[w.path.color],
  5985. w.path.colorUp = _._desat(w.path.color),
  5986. w.path.colorDown = _.darken(w.path.color)
  5987. }),
  5988. a.add(w, "reticuleColor", Object.keys(_)).onFinishChange(function() {
  5989. w.reticuleColor = _[w.reticuleColor]
  5990. });
  5991. var s = n.addFolder("Warping")
  5992. , l = s.addFolder("Warp/Teleport");
  5993. l.add(w.warp, "softPushDist", 0, 2).onFinishChange(function() {}),
  5994. l.add(w.warp, "softPushEnd", 0, 1).step(.01).onFinishChange(function() {}),
  5995. l.add(w.warp, "softBendAngle", 0, 45).onFinishChange(function() {}),
  5996. l.add(w.warp, "softBendTilt", 0, 45).onFinishChange(function() {}),
  5997. l.add(w.warp, "softBendEnd", 0, 1).step(.01).onFinishChange(function() {}),
  5998. l.add(w.warp, "burnsAngle", 0, 30).onFinishChange(function() {}),
  5999. l.add(w.warp, "minBurnsAngle", 0, 10).onFinishChange(function() {}),
  6000. l.add(w.warp, "brakeStrength", 1, 8).onFinishChange(function() {}),
  6001. l.add(w.warp, "minBrakeAngle", 0, 5).step(.01).onFinishChange(function() {}),
  6002. l.add(w.warp, "maxBrakeAngle", 0, 5).step(.01).onFinishChange(function() {}),
  6003. l.add(w.path, "mapGuides").onFinishChange(function() {}),
  6004. l.add(w.warp, "teleportTime", 0, 5e3).step(10).onFinishChange(function() {}),
  6005. l.add(w.warp, "outsideTime", 0, 5e3).step(10).onFinishChange(function() {}),
  6006. l.add(w.path, "typ", Object.keys(b)).onFinishChange(function() {
  6007. w.path.typ = b[w.path.typ]
  6008. }),
  6009. l.add(w.warp, "loop").onChange(function() {}).onFinishChange(function() {
  6010. e.endlessLoop = w.warp.loop
  6011. }),
  6012. l.add(w.warp, "walkSlideShowThreshhold", 1, 1e4).step(1).onFinishChange(function() {}),
  6013. l.add(w.warp, "walkExtraPanosDistance", 0, 3).step(.1).onFinishChange(function() {}),
  6014. l.add(w.transition, "fastForwardFactor", 1, 10).step(1).onFinishChange(function() {});
  6015. var c = s.addFolder("Long Warp Only");
  6016. c.add(w.warp, "minWarpTime", 0, 5e3).step(10).onFinishChange(function() {
  6017. w.warp.flySpeed = 0,
  6018. c.__controllers.forEach(function(e) {
  6019. e.updateDisplay()
  6020. })
  6021. }),
  6022. c.add(w.warp, "timePerMeter", 0, 5e3).step(10).onFinishChange(function() {}),
  6023. c.add(w.warp, "lookAheadMax", .01, 1).step(.01).onFinishChange(function() {}),
  6024. c.add(w.warp, "lookAheadDist", .01, 4).step(.01).onFinishChange(function() {}),
  6025. c.add(w.warp, "maxTurnPerSec", 0, 720).step(1).onFinishChange(function() {}),
  6026. c.add(w.warp, "maxAimPerSec", 0, 720).step(1).onFinishChange(function() {}),
  6027. c.add(w.warp, "turnFriction", 0, 1).step(.01).onFinishChange(function() {}),
  6028. c.add(w.warp, "walkDelay", 0, 2e3).step(10).onFinishChange(function() {}),
  6029. c.add(w.transition, "flytimeMaxDistanceThreshold", 0, 25).step(10).onFinishChange(function() {}),
  6030. c.add(w.warp, "walkMaxDist", 0, 100).step(1).onFinishChange(function() {});
  6031. var h = n.addFolder("Warp Esoterica");
  6032. h.add(w.warp, "nearPanoDist", .01, 12).step(0).onFinishChange(function() {}),
  6033. h.add(w.warp, "blur", .01, 1).onFinishChange(function() {}),
  6034. h.add(w.warp, "flySpeed", 0, 10).step(.01).onFinishChange(function() {
  6035. w.warp.minWarpTime = 0,
  6036. h.__controllers.forEach(function(e) {
  6037. e.updateDisplay()
  6038. })
  6039. }),
  6040. h.add(w.warp, "showBunny").onFinishChange(function() {}),
  6041. h.add(w.warp, "fastTime", 0, 2500).step(10).onFinishChange(function() {}),
  6042. h.add(w.warp, "movementEasing", Object.keys(I));
  6043. var u = n.addFolder("Misc");
  6044. u.add(w, "dollhouseFOV", 10, 180).onChange(function() {
  6045. i.cameras[E.DOLLHOUSE].fov = w.dollhouseFOV
  6046. }),
  6047. u.add(w, "insideFOV", 10, 180).onChange(function() {
  6048. i.cameras[E.PANORAMA].fov = w.insideFOV
  6049. }),
  6050. u.add(w, "insideLookSpeed", .01, .3).step(.01).onChange(function() {}),
  6051. u.add(w, "rotationAccelerationInside", .1, 10).step(.1).onChange(function() {}),
  6052. u.add(w, "rotationAccelerationOutside", .1, 10).step(.1).onChange(function() {});
  6053. var d = n.addFolder("Navigation");
  6054. d.add(w.navigation, "panoScores").onFinishChange(function() {
  6055. w.navigation.panoScores || t.panos.forEach(function(e) {
  6056. e.floor.remove(e.text3d),
  6057. e.text3d = null
  6058. })
  6059. }),
  6060. d.add(w.navigation, "mouseDirection"),
  6061. d.add(w.navigation, "filterStrictness", 0, 1),
  6062. d.add(w.navigation, "angleFactor", -60, 0),
  6063. d.add(w.navigation, "directionFactor", 1, 20),
  6064. d.add(w.navigation, "distanceFactor", -5, 5),
  6065. d.add(w.navigation, "optionalityFactor", .1, 10);
  6066. var p = n.addFolder("tags")
  6067. , f = p.addFolder("Tag Creation");
  6068. f.add(w.tags.pole, "enabled").name("poleEnabled"),
  6069. f.add(w.tags.pole, "height", 0, 2.5).step(.01).name("poleHeight"),
  6070. f.add(w.tags.pole, "width", 1, 10).step(1).name("poleWidth"),
  6071. f.add(w.tags.pole, "opacity", .1, 1).step(.1).name("poleOpacity");
  6072. var g = p.addFolder("Visibility");
  6073. g.add(w.tags.visibility, "anyDistance"),
  6074. g.add(w.tags.visibility, "visibleDistance", .1, 30).step(.1),
  6075. g.add(w.tags.visibility, "cameraClearance", 0, 1).step(.01),
  6076. g.add(w.tags.visibility, "hideViaFloor"),
  6077. g.add(w.tags.visibility, "hideOffScreenDisc").name("hideEdgeDisc"),
  6078. g.add(w.tags.visibility, "hideOffScreenObject").name("hideEdgeObject");
  6079. var m = p.addFolder("Disc Parameters");
  6080. m.add(w.tags.disc.scale, "nearBound", .1, 10).step(.1),
  6081. m.add(w.tags.disc.scale, "farBound", .1, 20).step(.1).listen(),
  6082. m.add(w.tags.disc.scale, "linkFarBound").onChange(function(e) {
  6083. e && (w.tags.disc.scale.farBound = w.tags.visibility.visibleDistance * (1 - w.tags.disc.scale.linkPercent / 100))
  6084. }),
  6085. m.add(w.tags.disc.scale, "linkPercent", 0, 100).step(1).onChange(function(e) {
  6086. w.tags.disc.scale.linkFarBound && (w.tags.disc.scale.farBound = w.tags.visibility.visibleDistance * (1 - e / 100))
  6087. }),
  6088. m.add(w.tags.disc.scale, "maxSize", 40, 200).step(1),
  6089. m.add(w.tags.disc.scale, "minSize", 20, 100).step(1),
  6090. m.add(w.tags.disc.scale, "responsiveness", 0, 100).step(1);
  6091. var v = p.addFolder("Navigate");
  6092. v.add(w.tags.navigate, "nearestPano").name("nearestPano"),
  6093. v.add(w.tags.navigate, "lineOfSight").name("lineOfSight"),
  6094. v.add(w.tags.navigate, "reactivate").name("reactivate"),
  6095. v.add(w.tags.navigate, "aimAt", ["disc", "object", "pole", "nothing"]).name("aim at"),
  6096. v.add(w.tags.navigate, "tiltTolerance", 0, 50).step(1),
  6097. v.add(w.tags.navigate, "rotateSpeedFactor", 0, 5).step(.1);
  6098. var y = n.addFolder("Debug");
  6099. y.add(w, "wireframe").onFinishChange(function() {
  6100. t.chunks.forEach(function(e) {
  6101. e.material && (e.wireframeTwin || (e.wireframeTwin = new C.WireframeHelper(e),
  6102. e.wireframeTwin.material.depthWrite = !1,
  6103. e.wireframeTwin.material.depthTest = !1,
  6104. e.wireframeTwin.material.opacity = .5,
  6105. e.wireframeTwin.material.transparent = !0),
  6106. w.wireframe ? t.add(e.wireframeTwin) : t.remove(e.wireframeTwin))
  6107. })
  6108. }),
  6109. y.add(w, "skyboxWireframe").onFinishChange(function() {
  6110. w.skyboxWireframe ? (t.skybox.wireframe = new C.WireframeHelper(t.skybox),
  6111. t.add(t.skybox.wireframe)) : (t.remove(t.skybox.wireframe),
  6112. t.skybox.wireframe = null)
  6113. }),
  6114. y.add(w, "showSweeps").onFinishChange(function() {
  6115. t.setSweepVisibility(w.showSweeps)
  6116. }),
  6117. y.add(w, "showMesh").onFinishChange(function() {
  6118. t.chunks.forEach(function(e) {
  6119. e.visible = w.showMesh
  6120. })
  6121. }),
  6122. y.add(w, "showFloors").onFinishChange(function() {
  6123. t.floors.forEach(function(e) {
  6124. e.collider.children.forEach(function(e) {
  6125. e.material.visible = w.showFloors
  6126. })
  6127. })
  6128. }),
  6129. y.add(w, "showSkyboxes").onFinishChange(function() {
  6130. t.panos.forEach(function(e) {
  6131. e.skyboxMesh.visible = w.showSkyboxes
  6132. })
  6133. }),
  6134. y.add(w, "showNeighbors").onChange(function() {}),
  6135. y.add(t, "alpha", 0, 1)
  6136. }
  6137. }
  6138. , {
  6139. "../enum/Colors": 19,
  6140. "../enum/Viewmode": 51,
  6141. "../enum/WarpStyle": 52,
  6142. "../lib/dat.gui": 93,
  6143. "../tag/tag": 123,
  6144. "../settings": 166,
  6145. "../util/easing": 186,
  6146. three: 217
  6147. }],
  6148. 64: [function(c, h, e) {
  6149. (function(e) {
  6150. "use strict";
  6151. function i(e, t, i, n) {
  6152. $(".gui-error .error-problem-text").text(e),
  6153. $(".gui-error .error-solution-text").text(t),
  6154. $(".gui-error .error-explanation").text(i),
  6155. $(".gui-error .error-actions").html(n),
  6156. $(window).resize(),
  6157. $(".gui-error").fadeIn(),
  6158. $("#bottom-logo").fadeIn()
  6159. }
  6160. function n(e) {
  6161. 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("");
  6162. i(e, s.ERROR_BROWSER_SOLUTION, s.ERROR_BROWSER_EXPLANATION, t),
  6163. r.isMobile() || $("[rel=tiletip]").tooltip({
  6164. placement: "bottom",
  6165. delay: {
  6166. show: 50,
  6167. hide: 0
  6168. },
  6169. trigger: "hover",
  6170. viewport: {
  6171. selector: "body",
  6172. padding: 10
  6173. }
  6174. })
  6175. }
  6176. function t() {
  6177. var e = r.isMobile() ? "" : '<span class="link install-browser">' + s.ERROR_GENERIC_ACTIONS_2 + "</span>" + s.ERROR_GENERIC_ACTIONS_3
  6178. , t = [s.ERROR_GENERIC_ACTIONS_1, e].join("");
  6179. i(s.ERROR_GENERIC_PROBLEM, s.ERROR_GENERIC_SOLUTION, "", t),
  6180. r.isMobile() || $(".install-browser").on("click touchstart", function(e) {
  6181. e.preventDefault(),
  6182. e.stopPropagation(),
  6183. n(" ")
  6184. })
  6185. }
  6186. var r = c("./../util/browser")
  6187. , o = c("./../analytics")
  6188. , a = c("./../settings")
  6189. , s = c("../localization/localize")
  6190. , l = new (c("./../util/logger"))(e);
  6191. h.exports.error = function(e) {
  6192. if ($("head title").text(a.pageTitle),
  6193. $("#gui-message, #gui-loading, #nprogress, #gui-thumb, #bottom-logo").hide(),
  6194. $("#gui-loading").fadeOut(250),
  6195. $("#quick-blackout").hide(),
  6196. o.track("showcase_error", {
  6197. error_key: e
  6198. }),
  6199. s.locale || s.init(),
  6200. "webgl-unsupported" === e)
  6201. r.isMobile() ? t() : n(s.ERROR_WEBGL_UNSUPPORTED_PROBLEM);
  6202. else if ("webgl-ios" === e)
  6203. 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>.");
  6204. else if ("webgl-safari" === e)
  6205. 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>.");
  6206. else if ("webgl-generic" === e)
  6207. t();
  6208. else if ("missing-urls" === e)
  6209. i(s.ERROR_MISSING_URLS_PROBLEM, "", s.ERROR_MISSING_URLS_EXPLANATION);
  6210. else if ("loading-failed" === e)
  6211. 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>.");
  6212. else {
  6213. if ("loading-failed-maintenance" !== e)
  6214. return void l.error("Unhandled error: " + e);
  6215. i(s.ERROR_MAINTENANCE_PROBLEM, s.ERROR_MAINTENANCE_SOLUTION)
  6216. }
  6217. }
  6218. }
  6219. ).call(this, "/js/gui/error.js")
  6220. }
  6221. , {
  6222. "../localization/localize": 108,
  6223. "./../analytics": 4,
  6224. "./../settings": 166,
  6225. "./../util/browser": 182,
  6226. "./../util/logger": 189
  6227. }],
  6228. 65: [function(Oe, Le, e) {
  6229. (function(e) {
  6230. "use strict";
  6231. function c() {
  6232. for (var e in Ce)
  6233. if (Ce.hasOwnProperty(e)) {
  6234. var t = Ce[e];
  6235. if (!t.visible)
  6236. for (var i = 0; i < t.elements.length; i++)
  6237. $(t.elements[i]).hide()
  6238. }
  6239. Ce.highlight.visible && $(".pinBottom").addClass("highlightExists"),
  6240. !1 === Ce.tourControls.visible && $("#drawer").addClass("fullWidth"),
  6241. ge = [],
  6242. Ce.floors.visible && ge.push(".gui-floor", ".gui-floor-title"),
  6243. ge.push(".hideTarget", ".pinTop.right")
  6244. }
  6245. function v(e, t) {
  6246. var i = !S.isMobile() && M.zoom.enabled && t.mode === ie.PANORAMA && !e.tourIsPlaying;
  6247. $("#gui-zoomin").toggle(i),
  6248. $("#gui-zoomout").toggle(i)
  6249. }
  6250. function l() {
  6251. n(),
  6252. $(".pinBottom").toggleClass("open"),
  6253. $("#drawer").toggleClass("open"),
  6254. $(".footer").toggleClass("open"),
  6255. $("#drawer").hasClass("open") ? ($("#pullTab .icon").attr("data-original-title", se.CLOSE_HIGHLIGHTS),
  6256. _e("highlights")) : ($("#pullTab .icon").attr("data-original-title", se.OPEN_HIGHLIGHTS),
  6257. O.resetDrawer()),
  6258. setTimeout(function() {
  6259. $("#pullTab").toggleClass("opened")
  6260. }, $("#drawer").hasClass("open") ? 0 : M.highlightAnimationDuration),
  6261. $(".pinBottom").hasClass("open") && t($(".vr-popup")) && $(".vr-popup").is(":visible") && X.dismiss()
  6262. }
  6263. function t(e) {
  6264. var t;
  6265. return "none" !== e.css("display") ? t = e.position().top + e.outerHeight() : (e.attr("style", "visibility: hidden"),
  6266. t = e.position().top + e.outerHeight(),
  6267. e.attr("style", "display: none")),
  6268. $("#player").outerHeight() - 130 < t + 25
  6269. }
  6270. function y(e) {
  6271. "touchstart" === e.type && e.preventDefault(),
  6272. e.stopPropagation()
  6273. }
  6274. function n() {
  6275. w && (w.reload(),
  6276. w.init())
  6277. }
  6278. function r() {
  6279. $("#gui-spinner").stop(!0, !0),
  6280. $("#gui-spinner").fadeOut(1e3),
  6281. !(Ae = !0)
  6282. }
  6283. function A(e, t) {
  6284. var i = e.mode
  6285. , n = t || e.currentPano;
  6286. $("#gui-modes-dollhouse").toggleClass("active", i === ie.DOLLHOUSE),
  6287. $("#gui-modes-floorplan").toggleClass("active", i === ie.FLOORPLAN),
  6288. $("#gui-modes-inside").toggleClass("active", i === ie.PANORAMA),
  6289. i === ie.PANORAMA ? ($("#view-controllers").slideUp(500),
  6290. M.show360Views.enabled && !n.isAligned() ? ($(".gui-floor").addClass("hidden"),
  6291. $("#gui-modes-outside").addClass("desktop-only")) : ($(".gui-floor").removeClass("hidden"),
  6292. $("#gui-modes-outside").removeClass("desktop-only")),
  6293. $("#gui-modes-outside").removeClass("hidden")) : i !== ie.TRANSITIONING && (r(),
  6294. pe = i,
  6295. $("#gui-modes-outside").addClass("hidden"),
  6296. e.model.has360Views && $(".gui-floor").removeClass("hidden"),
  6297. $("#view-controllers").is(":visible") || $("#view-controllers").slideDown(M.guiAnimationSpeed))
  6298. }
  6299. function C(t, i) {
  6300. function e() {
  6301. document.getElementById("vr").classList.remove("hidden"),
  6302. M.vr.allowWebVR ? S.getVRDisplay().then(function(e) {
  6303. S.supportsFullscreen() ? function(e) {
  6304. ue.info(e.displayName + " detected, VR button activates WebVR experience"),
  6305. Q.init(t.data, i, e, x),
  6306. Q.on(J.OPENED, _e.bind(gui, "vr")),
  6307. Q.on(J.SHOW_TERMS, W.show.bind(W))
  6308. }(e) : (ue.warn("Unable to use WebVR when full screen is not supported"),
  6309. $(".improper-embed").toggleClass("hidden", !1),
  6310. n())
  6311. }, function(e) {
  6312. n()
  6313. }) : n()
  6314. }
  6315. function n() {
  6316. var e;
  6317. ue.info("WebVR support not found, VR button activates native app VR modal"),
  6318. X.init(t.data, x),
  6319. X.on(Z.OPENED, (e = document.getElementById("vr-modal"),
  6320. function() {
  6321. _e("vr"),
  6322. V.open(e)
  6323. }
  6324. )),
  6325. X.on(Z.CLOSED, V.reset)
  6326. }
  6327. if (M.vr.enabled && t.supportsVR && !S.valueFromHash("mls", 0))
  6328. switch (M.vr.option) {
  6329. case le.CONTEXTUAL:
  6330. e();
  6331. break;
  6332. case le.ANDROID:
  6333. S.detectAndroid() && e();
  6334. break;
  6335. case le.NONE:
  6336. }
  6337. }
  6338. function h(e, i) {
  6339. for (var n = $(".gui-floor"), t = 0; t < e.floors.length; t++)
  6340. if ("372" !== getQueryVariable("m")) {
  6341. var r = $('<div class="floorChoice" data-index="' + t + '"></div>').text(e.floors.get(t).name);
  6342. $(".gui-floor").find(".container").prepend(r)
  6343. }
  6344. n.find(".container").prepend('<div class="floorChoice darkGlass allFloorBtn" data-index="all" style="display:none">' + se.FLOOR_ALL + "</div>"),
  6345. n.on("click", function(e) {
  6346. y(e),
  6347. _e("floor"),
  6348. n.toggleClass("open")
  6349. }),
  6350. $(".floorChoice").on("click", function(e) {
  6351. y(e);
  6352. var t = $(this).data("index");
  6353. "all" !== t ? (R.updateInteraction(oe.InteractionGui, "floor-control"),
  6354. i.player.gotoFloor(t),
  6355. R.track("showcase_gui", {
  6356. gui_action: "click_floor_select_button",
  6357. interaction_source: "gui"
  6358. })) : (R.updateInteraction(oe.InteractionGui, "floor-control"),
  6359. _e("move"),
  6360. i.allFloors(),
  6361. R.track("showcase_gui", {
  6362. gui_action: "click_toggle_all_floors_button",
  6363. interaction_source: "gui"
  6364. })),
  6365. n.removeClass("open")
  6366. })
  6367. }
  6368. function I(e, t) {
  6369. e && (t === ie.DOLLHOUSE || t === ie.FLOORPLAN ? ($(".allFloorBtn").show(),
  6370. $(".gui-floor-icon").hide(),
  6371. $(".gui-floor-title").show()) : ($(".allFloorBtn").hide(),
  6372. $(".gui-floor-icon").show(),
  6373. $(".gui-floor-title").hide()),
  6374. e.model.allFloorsVisible ? ($(".gui-floor-title").text(se.FLOOR_ALL),
  6375. $(".gui-floor-number").text(se.FLOOR_ALL),
  6376. $(".floorChoice").removeClass("active"),
  6377. $('.floorChoice[data-index="all"]').addClass("active")) : ($(".gui-floor-title").text(e.name),
  6378. $(".gui-floor-number").text(" " + (e.floorIndex + 1)),
  6379. $(".floorChoice").removeClass("active"),
  6380. $(".floorChoice[data-index=" + e.floorIndex + "]").addClass("active")))
  6381. }
  6382. function E() {
  6383. var e = $("#player").width() - 20
  6384. , t = $("#scroller")
  6385. , i = $("#drawer")
  6386. , n = $(".pinBottom");
  6387. $("#player").width() < 488 || $("#player").height() < 488 ? (t.addClass("hidden"),
  6388. i.addClass("noScroll"),
  6389. n.addClass("noScroll")) : e < T != !i.hasClass("noScroll") && (t.toggleClass("hidden"),
  6390. i.toggleClass("noScroll"),
  6391. n.toggleClass("noScroll"))
  6392. }
  6393. function _(e) {
  6394. e.waitQueue.length <= 0 ? r() : ye || function(e) {
  6395. e = e || 0,
  6396. Ae = !1,
  6397. window.setTimeout(function() {
  6398. Ae || (!0,
  6399. $("#gui-spinner").stop(!0, !0).show())
  6400. }
  6401. .bind(this), e)
  6402. }(M.modelComponentLoadSpinnerDelay)
  6403. }
  6404. function b(e, t) {
  6405. for (var i = []; e; )
  6406. i.push(e),
  6407. e = e.parentNode;
  6408. for (; t && -1 === i.indexOf(t); )
  6409. t = t.parentNode;
  6410. return t
  6411. }
  6412. var w, T, o, a, x, i, s, u, d, p, f, g, S = (Oe("three"),
  6413. Oe("../util/ajax"),
  6414. Oe("../util/browser")), M = Oe("../settings"), R = Oe("../analytics"), m = (Oe("../util/transitions"),
  6415. Oe("../util/camera"),
  6416. Oe("../util/logger")), P = (Oe("../objects/Snapshot"),
  6417. 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"),
  6418. Oe("../tag/Media/MediaEvent")), re = (Oe("../enum/PathDiscardMode"),
  6419. Oe("../enum/PathDisplayMode"),
  6420. Oe("../enum/DirectorEvents"),
  6421. Oe("../enum/PlayerEvents")), oe = Oe("../enum/ControlEvents"), ae = Oe("./sharing/ShareEvents"), se = Oe("../localization/localize"), le = (Oe("../enum/Vectors"),
  6422. Oe("../enum/WarpStyle"),
  6423. Oe("../enum/AlignmentType"),
  6424. Oe("../enum/VROption")), ce = Oe("./konami"), he = Oe("../lib/dat.gui"), ue = new m(e), de = (Oe("../util/showcase"),
  6425. Oe("../enum/ZoomEvents")), pe = ie.DOLLHOUSE, fe = 0, ge = [".hideTarget"], me = null, ve = null, ye = !1, Ae = !1, Ce = {
  6426. coBrand: {
  6427. visible: !0,
  6428. elements: [".co-brand", "#loaderCoBrand"]
  6429. },
  6430. help: {
  6431. visible: !0,
  6432. elements: [".nav-help", "#nav-help"]
  6433. },
  6434. tourControls: {
  6435. visible: !0,
  6436. elements: [".next", ".previous", "#play"]
  6437. },
  6438. highlight: {
  6439. visible: !0,
  6440. elements: ["#drawer", "#pullTab"]
  6441. },
  6442. share: {
  6443. visible: !0,
  6444. elements: [".socialButton", "#share"]
  6445. },
  6446. fullScreen: {
  6447. visible: !0,
  6448. elements: ["#gui-fullscreen"]
  6449. },
  6450. floors: {
  6451. visible: !0,
  6452. elements: [".gui-floor"]
  6453. }
  6454. }, Ie = (g = document.getElementById("drawer"),
  6455. function() {
  6456. $("#player").height() < 400 && g.classList.contains("open") && l()
  6457. }
  6458. ), Ee = (f = document.getElementById("meta-info"),
  6459. function() {
  6460. $("#player").height() < 400 && f.classList.contains("expand") && z.toggleMeta(!0)
  6461. }
  6462. ), _e = (i = document.getElementById("meta-info"),
  6463. s = document.getElementById("interaction-modal"),
  6464. u = $("#drawer").eq(0),
  6465. d = $(".gui-floor").eq(0),
  6466. p = $(".vr-popup").eq(0),
  6467. function(e) {
  6468. switch (e) {
  6469. case "info":
  6470. we(),
  6471. Te(),
  6472. Ie(),
  6473. Me(),
  6474. Re(),
  6475. xe(),
  6476. Pe();
  6477. break;
  6478. case "terms":
  6479. be(),
  6480. Te(),
  6481. Se(),
  6482. Me(),
  6483. Re(),
  6484. xe(),
  6485. Pe();
  6486. break;
  6487. case "help":
  6488. be(),
  6489. we(),
  6490. Me(),
  6491. Re(),
  6492. xe(),
  6493. Pe();
  6494. break;
  6495. case "vr":
  6496. be(),
  6497. we(),
  6498. Me(),
  6499. Re(),
  6500. Te(),
  6501. Pe(),
  6502. t(p) && Se();
  6503. break;
  6504. case "highlights":
  6505. Ee(),
  6506. we(),
  6507. Me(),
  6508. Re();
  6509. break;
  6510. case "share":
  6511. be(),
  6512. we(),
  6513. Te(),
  6514. Re(),
  6515. xe(),
  6516. Pe();
  6517. break;
  6518. case "floor":
  6519. we(),
  6520. Me(),
  6521. xe();
  6522. break;
  6523. case "view":
  6524. Re(),
  6525. Me(),
  6526. we(),
  6527. xe();
  6528. break;
  6529. case "tour":
  6530. case "move":
  6531. we(),
  6532. Me(),
  6533. Re(),
  6534. xe();
  6535. break;
  6536. case "resize":
  6537. be(),
  6538. Ie(),
  6539. Re();
  6540. break;
  6541. case "tag":
  6542. we(),
  6543. Te(),
  6544. Me(),
  6545. Re(),
  6546. xe()
  6547. }
  6548. }
  6549. );
  6550. function be() {
  6551. i.classList.contains("expand") && z.toggleMeta(!0)
  6552. }
  6553. function we() {
  6554. W.hide()
  6555. }
  6556. function Te() {
  6557. U.close()
  6558. }
  6559. function xe() {
  6560. X.dismiss()
  6561. }
  6562. function Se() {
  6563. u.hasClass("open") && l()
  6564. }
  6565. function Me() {
  6566. K.hide()
  6567. }
  6568. function Re() {
  6569. d.hasClass("open") && d.removeClass("open")
  6570. }
  6571. function Pe() {
  6572. s.classList.contains("fadeIn") && (s.classList.contains("landing") ? D.dismissModal() : s.classList.contains("tour") && q.dismissModal())
  6573. }
  6574. $(document).on("fullscreenchange webkitfullscreenchange mozfullscreenchange MSFullscreenChange", function(e) {
  6575. $("#gui-fullscreen").toggle(!S.isFullscreen()),
  6576. $("#gui-fullscreen-exit").toggle(!!S.isFullscreen()),
  6577. setTimeout(function() {
  6578. $(".icon:visible").hide().show(0)
  6579. }, 100)
  6580. }),
  6581. $("#gui-fullscreen").find("a").on("click", function(e) {
  6582. y(e),
  6583. S.requestFullscreen($("body")[0]),
  6584. R.track("showcase_gui", {
  6585. gui_action: "click_enter_fullscreen",
  6586. interaction_source: "gui"
  6587. })
  6588. }),
  6589. $("#gui-fullscreen-exit").find("a").on("click", function(e) {
  6590. y(e),
  6591. S.exitFullscreen(),
  6592. R.track("showcase_gui", {
  6593. gui_action: "click_exit_fullscreen",
  6594. interaction_source: "gui"
  6595. })
  6596. }),
  6597. $(window).on("resize", function(e) {
  6598. var t = e.target.innerHeight
  6599. , i = e.target.innerWidth;
  6600. t === o && i === a || (Ce.highlight.visible && E(),
  6601. _e("resize"),
  6602. $(".pinTop.right").removeClass("hideUnderMeta"),
  6603. n(),
  6604. o = t,
  6605. a = i)
  6606. }).resize(),
  6607. S.supportsFullscreen() || $("#gui-fullscreen").hide(),
  6608. $("#pullTab").on("click", function(e) {
  6609. y(e),
  6610. $("#drawer").hasClass("open") ? (R.trackAlways("showcase_gui", {
  6611. gui_action: "hide_highlight_reel"
  6612. }),
  6613. $(this).addClass("open").children("img").attr("src", "images/auto.png")) : (R.trackAlways("showcase_gui", {
  6614. gui_action: "show_highlight_reel"
  6615. }),
  6616. $(this).removeClass("open").children("img").attr("src", "images/auto-suspend.png")),
  6617. l()
  6618. }),
  6619. window.DATA.showHotListSta && ($("#hotList").css("display", ""),
  6620. $("#hotList").on("click", function(e) {
  6621. y(e);
  6622. var t = $("#hotListWrap")[0];
  6623. t.classList.contains("hotListActive") ? (t.classList.remove("hotListActive"),
  6624. this.classList.remove("active")) : (t.classList.add("hotListActive"),
  6625. this.classList.add("active"))
  6626. }),
  6627. $("#hotListContent ul").on("mouseover", function(e) {
  6628. y(e);
  6629. var t = e.target
  6630. , i = document.getElementById("hotListWrap");
  6631. if ("SPAN" === t.tagName) {
  6632. var n = t.parentElement.parentElement;
  6633. t.offsetWidth + 116 >= n.clientWidth ? i.style.width = t.offsetWidth + 116 + "px" : i.style.width = ""
  6634. } else if ("LI" === t.tagName) {
  6635. n = t.parentElement;
  6636. t.children[0].offsetWidth + 116 >= n.clientWidth ? i.style.width = t.children[0].offsetWidth + 116 + "px" : i.style.width = ""
  6637. } else
  6638. i.style.width = ""
  6639. }),
  6640. $("#hotListContent ul").on("click", function(e) {
  6641. y(e),
  6642. this.preElem && this.preElem.classList.remove("active"),
  6643. "SPAN" === e.target.tagName ? (e.target.parentElement.classList.add("active"),
  6644. e.target.parentElement.hot && e.target.parentElement.hot.examine(!0),
  6645. this.preElem = e.target.parentElement) : (e.target.classList.add("active"),
  6646. e.target.hot && e.target.hot.examine(!0),
  6647. this.preElem = e.target)
  6648. }),
  6649. $("#hotListClose").on("click", function(e) {
  6650. y(e),
  6651. $("#hotListWrap")[0].classList.remove("hotListActive"),
  6652. $("#hotListContent ul .active").removeClass("active"),
  6653. $("#hotList")[0].classList.remove("active")
  6654. })),
  6655. "true" === window.DATA.supportsVR && $("#vr").css("display", ""),
  6656. $("#more-menu-button").on("click", function(e) {
  6657. y(e),
  6658. $("#more-menu").toggleClass("open")
  6659. }),
  6660. Le.exports.init = function(s, l, c, e, t, i, n) {
  6661. var r;
  6662. x = n,
  6663. s.outsideAllowed() || $("#gui-modes-outside").addClass("invisible"),
  6664. s.supportedModes[ie.PANORAMA] || $("#gui-modes-inside").addClass("invisible"),
  6665. F.init(),
  6666. D.init(s, i),
  6667. ce.init(s, l, e),
  6668. $(".icon").on("mouseover", function() {
  6669. l.player && l.player.reticule.hide()
  6670. }),
  6671. function(e, t) {
  6672. var i = t.player;
  6673. $("#gui-modes-inside").on("mousedown touchstart", function(e) {
  6674. y(e),
  6675. R.updateInteraction(oe.InteractionGui, "inside-button"),
  6676. R.track("USER", {
  6677. event_type: "showcase_gui",
  6678. gui_action: "click_inside_mode_button"
  6679. }),
  6680. t.changeMode(ie.PANORAMA)
  6681. }),
  6682. $("#gui-modes-outside").find("a").on("click", function(e) {
  6683. y(e),
  6684. R.track("showcase_gui", {
  6685. gui_action: "click_outside_mode_button"
  6686. }),
  6687. t.changeMode(pe)
  6688. }),
  6689. $("#gui-modes-floorplan").on("click", function(e) {
  6690. y(e),
  6691. i.mode !== ie.FLOORPLAN && (R.track("showcase_gui", {
  6692. gui_action: "click_floorplan_mode_button"
  6693. }),
  6694. t.changeMode(ie.FLOORPLAN))
  6695. }),
  6696. $("#gui-modes-dollhouse").on("click", function(e) {
  6697. y(e),
  6698. i.mode !== ie.DOLLHOUSE && (R.track("showcase_gui", {
  6699. gui_action: "click_dollhouse_mode_button"
  6700. }),
  6701. t.changeMode(ie.DOLLHOUSE))
  6702. })
  6703. }(0, l),
  6704. function(e, t) {
  6705. $("#play").on("mousedown touchstart", function(e) {
  6706. y(e),
  6707. _e("tour"),
  6708. q.play(),
  6709. R.trackAlways("showcase_gui", {
  6710. gui_action: "play_highlights"
  6711. })
  6712. }),
  6713. window.startAndPlay = function(e) {
  6714. _e("tour"),
  6715. q.play(),
  6716. R.trackAlways("showcase_gui", {
  6717. gui_action: "play_highlights"
  6718. })
  6719. }
  6720. ,
  6721. $("#pause").on("mousedown touchstart", function(e) {
  6722. y(e),
  6723. q.pause(),
  6724. R.trackAlways("showcase_gui", {
  6725. gui_action: "pause_highlights"
  6726. })
  6727. }),
  6728. $("#gui-zoomin").find("a").on("click", function(e) {
  6729. y(e),
  6730. t.player.zoomInIncrementally()
  6731. }),
  6732. $("#gui-zoomout").find("a").on("click", function(e) {
  6733. y(e),
  6734. t.player.zoomOutIncrementally()
  6735. })
  6736. }(0, l),
  6737. s.data.enable_social_sharing && s.data.is_public && M.share.enabled && (K.init(DATA.name/* s.data.name */),
  6738. K.on(ae.OPENED, (r = document.getElementById("share-modal"),
  6739. function() {
  6740. _e("share"),
  6741. V.open(r)
  6742. }
  6743. )),
  6744. K.on(ae.CLOSED, V.reset)),
  6745. 0 < s.heroLocations.length ? function(e, i, t) {
  6746. var n = 100 / (fe = e.heroLocations.length) + "%"
  6747. , r = $("#thumb-container")
  6748. , o = $("#progressBar");
  6749. $("#status").find(".totalSteps").text(fe);
  6750. for (var a = 0; a < fe; a++) {
  6751. var s = e.heroLocations[a]
  6752. , l = $('<li class="thumbImg" data-index=""><img src=""></li>');
  6753. if(s.heroLocations){//有子项,选第一张截图
  6754. var tmp = s.heroLocations[0].thumbUrl.replace('https://','').replace('http://','')
  6755. }else{
  6756. var tmp = s.thumbUrl.replace('https://','').replace('http://','')
  6757. }
  6758. if (l.attr("data-index", a),
  6759. //Ce.highlight.visible && l.find("img").attr("src",'https://'+tmp),
  6760. Ce.highlight.visible && l.find("img").attr("src", 'http://'+tmp),// xzw改 导览图片 https在某些服务器打不开
  6761. s.name) {
  6762. var c = $('<div class="overlay"></div>').text(s.name);
  6763. l.prepend(c)
  6764. }
  6765. if (e.has360Views && s.cameraMode === ie.PANORAMA) {
  6766. var h = e.panos.get(s.panoId)
  6767. , 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>';
  6768. l.prepend(u)
  6769. }
  6770. r.append(l),
  6771. o.append('<div class="step" data-idx="' + a + '" style="width:' + n + '"></div>')
  6772. }
  6773. T = 144 * fe,
  6774. 111 * fe,
  6775. $(".thumbImg").on("mouseover", function() {
  6776. !function(e) {
  6777. return e.describe().inTransition
  6778. }(i) && t.showPathToHeroLocation([$(this).data("index"),0])//改
  6779. }),
  6780. $(".thumbImg").on("mouseout", function() {
  6781. i.clearPath()
  6782. }),
  6783. $(".thumbImg").on("click", function(e) {
  6784. y(e);
  6785. var t = $(this);
  6786. R.updateInteraction(oe.InteractionGui, "thumbnail"),
  6787. R.trackAlways("showcase_gui", {
  6788. gui_action: "click_highlight"
  6789. }),
  6790. i.goToHighlight([t.data("index"),0])//改
  6791. }),
  6792. $(".previous").find("a").on("click", function(e) {
  6793. y(e),
  6794. R.trackAlways("showcase_gui", {
  6795. gui_action: "prev_highlight"
  6796. }),
  6797. i.prevHighlight()
  6798. }),
  6799. $(".next").find("a").on("click", function(e) {
  6800. y(e),
  6801. R.trackAlways("showcase_gui", {
  6802. gui_action: "next_highlight"
  6803. }),
  6804. i.nextHighlight()
  6805. }),
  6806. $("#drawer").on("mouseleave", function(t) {
  6807. var i;
  6808. y(t);
  6809. try {
  6810. i = new MouseEvent("mouseup",{
  6811. clientX: t.clientX,
  6812. clientY: t.clientY,
  6813. screenX: t.screenX,
  6814. screenY: t.screenY
  6815. })
  6816. } catch (e) {
  6817. (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)
  6818. }
  6819. document.dispatchEvent(i)
  6820. }),
  6821. (w = new Sly($("#scrollFrame"),{
  6822. horizontal: !0,
  6823. itemNav: "centered",
  6824. smart: !0,
  6825. scrollTrap: !0,
  6826. scrollBy: 1,
  6827. mouseDragging: !0,
  6828. touchDragging: !0,
  6829. speed: 300,
  6830. dragHandle: !0,
  6831. dynamicHandle: !0,
  6832. clickBar: !0,
  6833. scrollBar: $("#scroller"),
  6834. activateOn: null
  6835. }).init()).on("active", function(e, t) {
  6836. t,
  6837. _e("tour"),
  6838. $(".step").removeClass("active"),
  6839. $("#status").find(".curIdx").text(t + 1);
  6840. for (var i = 0; i <= t; i++)
  6841. $("#progressBar").find("[data-idx='" + i + "']").addClass("active")
  6842. }),
  6843. E()
  6844. }(s, l, c) : (Ce.highlight.visible = !1,
  6845. Ce.tourControls.visible = !1),
  6846. z.on(G.OPEN_INFO, _e.bind(this, "info")),
  6847. function() {
  6848. var n;
  6849. document.body.addEventListener("mousedown", function(e) {
  6850. n = 0 === e.button || 1 === e.which ? e.target : null
  6851. }, !0),
  6852. document.body.addEventListener("mouseup", function(t) {
  6853. n !== t.target && (n = b(n, t.target));
  6854. var e = document.getElementById("gui-parent");
  6855. if (b(e, n) !== e && (n = null),
  6856. n) {
  6857. var i;
  6858. try {
  6859. i = new MouseEvent("click",t)
  6860. } catch (e) {
  6861. (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)
  6862. }
  6863. i.syntheticClick = !0,
  6864. n.dispatchEvent(i),
  6865. n = null
  6866. }
  6867. }, !0),
  6868. document.getElementById("gui-parent").addEventListener("click", function(e) {
  6869. e.syntheticClick || (e.stopPropagation(),
  6870. "A" === e.target.nodeName && e.preventDefault())
  6871. }, !0)
  6872. }(),
  6873. A(c),
  6874. C(s, t),
  6875. s.on("floor.changed", I),
  6876. s.on("waiting", function(e) {
  6877. _(e)
  6878. }
  6879. .bind(this, s)),
  6880. s.on("waiting-done", function(e) {
  6881. _(e)
  6882. }
  6883. .bind(this, s)),
  6884. c.on(re.ModeChanged, function(e, t) {
  6885. A(c),
  6886. v(l, c),
  6887. t === ie.PANORAMA && c.currentPano && !c.currentPano.isAligned() && (t = ie.OUTDOOR),
  6888. U.updateMode(t)
  6889. }),
  6890. e.on(oe.Move, _e.bind(this, "move")),
  6891. c.on(re.Ready, function() {
  6892. O.init(e, c, c.tagManager, l),
  6893. c.on(re.ModeChanged, function(e, t) {
  6894. e !== t && $(".vr-popup").is(":visible") && X.dismiss()
  6895. })
  6896. }),
  6897. c.on(re.PanoChosen, function(e, t) {
  6898. A(c, t),
  6899. U.updateMode(t && !t.isAligned() ? ie.OUTDOOR : ie.PANORAMA)
  6900. }),
  6901. V.on(k.CLOSE, function(e) {
  6902. switch (e) {
  6903. case "vr-modal":
  6904. X.dismiss();
  6905. break;
  6906. case "share-modal":
  6907. K.hide();
  6908. break;
  6909. case "terms-modal":
  6910. W.hide()
  6911. }
  6912. });
  6913. 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();
  6914. l.on("update.controls", function() {
  6915. var e, t, i, n = l.describe();
  6916. if (n.tourIsPlaying || c.isWarping() ? (Ce.tourControls.visible && (h.hide(),
  6917. u.show()),
  6918. n.tourInProgress && (d.forEach(function(e) {
  6919. e.classList.add("playing")
  6920. }),
  6921. p.addClass("playing"),
  6922. f.addClass("playing"))) : (Ce.tourControls.visible && (h.show(),
  6923. u.hide()),
  6924. n.tourInProgress || (q.stopTour(),
  6925. d.forEach(function(e) {
  6926. e.classList.remove("playing")
  6927. }),
  6928. p.removeClass("playing"),
  6929. f.removeClass("playing"))),
  6930. null !== n.currentItem) {
  6931. var r, o;
  6932. $("#status").find(".curIdx").text(n.currentItem[0] + 1),
  6933. n.onTheBus ? (r = "active",
  6934. o = "recent") : (o = "active",
  6935. r = "recent");
  6936. var a = null === n.destinationItem || n.currentItem[0] === n.destinationItem[0];
  6937. for (e = 0; e < s.heroLocations.length; e += 1)
  6938. i = g.eq(e),
  6939. t = m.eq(e),
  6940. i.removeClass(o),
  6941. t.removeClass(o),
  6942. n.onTheBus && e === n.destinationItem[0] ? (i.addClass(r),
  6943. t.addClass(r),
  6944. w.activate(e)) : n.onTheBus && a && e === n.currentItem[0] ? (i.addClass(r),
  6945. t.addClass(r)) : (i.removeClass(r),
  6946. t.removeClass(r))
  6947. } else
  6948. for (e = 0; e < s.heroLocations.length; e += 1)
  6949. i = g.eq(e),
  6950. t = m.eq(e),
  6951. i.removeClass("active recent"),
  6952. t.removeClass("active recent");
  6953. v(l, c)
  6954. }),
  6955. document.addEventListener("keydown", function(e) {
  6956. switch (R.updateInteraction(oe.InteractionKey),
  6957. e.which) {
  6958. case te.ZERO:
  6959. M.debug && s.toggleAlpha();
  6960. break;
  6961. case te.NINE:
  6962. M.debug && B.toggle();
  6963. break;
  6964. case te.ONE:
  6965. c.isInMode(ie.TRANSITIONING) || l.changeMode(ie.PANORAMA);
  6966. break;
  6967. case te.TWO:
  6968. s.outsideAllowed() && !c.isInMode(ie.DOLLHOUSE, ie.TRANSITIONING) && l.changeMode(ie.DOLLHOUSE);
  6969. break;
  6970. case te.THREE:
  6971. s.outsideAllowed() && !c.isInMode(ie.FLOORPLAN, ie.TRANSITIONING) && l.changeMode(ie.FLOORPLAN);
  6972. break;
  6973. case te.FOUR:
  6974. c.isInMode(ie.TRANSITIONING) || l.changeMode(ie.OUTDOOR);
  6975. break;
  6976. case te.SPACE:
  6977. Ce.tourControls.visible && ($("#playHead").hasClass("playing") || _e("tour"));
  6978. break;
  6979. case te.RETURN:
  6980. M.debug && s.toggleExplodeUp();
  6981. break;
  6982. case te.P:
  6983. !function(e) {
  6984. me.gui || (me.gui = function(e) {
  6985. var t = new he.GUI;
  6986. return t.add(M, "showSweeps").name("Show sweeps").onFinishChange(function() {
  6987. e.setSweepVisibility(M.showSweeps)
  6988. }),
  6989. t.add(M, "rotationAccelerationInside", .1, 10).name("Rotation speed").step(.1),
  6990. t.add(M.transition, "flyTime", 0, 5e3).name("Transition time").onFinishChange(function() {
  6991. M.transition.flySpeed = 0,
  6992. t.__controllers.forEach(function(e) {
  6993. e.updateDisplay()
  6994. })
  6995. }),
  6996. t.add(M.path, "opacity", 0, 1).name("Path opacity"),
  6997. $(t.__closeButton).hide(),
  6998. t
  6999. }(me.model)),
  7000. (me.visible = e) ? $(me.gui.domElement).show() : $(me.gui.domElement).hide()
  7001. }(!me.visible);
  7002. break;
  7003. case te.U:
  7004. !function(e) {
  7005. ve.gui || (ve.gui = function(t, i) {
  7006. function e() {
  7007. var e = i.toJSON();
  7008. n.linkToLocation = window.location.protocol + "//" + window.location.host + window.location.pathname + "?m=" + t.sid + "&start=" + ee.serialize(e),
  7009. i.tagManager.activeTag && (n.linkToLocation += "&tag=" + i.tagManager.activeTag.sid)
  7010. }
  7011. var n = {}
  7012. , r = new he.GUI({
  7013. autoPlace: !0,
  7014. width: "60%"
  7015. });
  7016. return e(),
  7017. i.on(re.ViewChanged, e),
  7018. r.add(n, "linkToLocation").name(se.LINK_TO_LOCATION).listen(),
  7019. r.domElement.id = "datLinks",
  7020. [].slice.call(r.domElement.querySelectorAll(".property-name")).forEach(function(e) {
  7021. if (!S.detectSafari()) {
  7022. var t = document.createElement("button");
  7023. t.classList.add("btn-deep-link"),
  7024. t.innerText = se.MENU_COPY,
  7025. e.nextSibling.appendChild(t);
  7026. var n = function() {
  7027. alert(se.LINK_ALERT_COPY),
  7028. t.hide()
  7029. };
  7030. t.addEventListener("click", function(e) {
  7031. try {
  7032. var t = e.target.parentNode.childNodes[0];
  7033. t.select();
  7034. var i = document.execCommand("copy");
  7035. t.blur(),
  7036. i || n()
  7037. } catch (e) {
  7038. n()
  7039. }
  7040. })
  7041. }
  7042. }),
  7043. $(r.__closeButton).hide(),
  7044. r
  7045. }(ve.model, ve.player)),
  7046. (ve.visible = e) ? $(ve.gui.domElement).show() : $(ve.gui.domElement).hide()
  7047. }(!ve.visible);
  7048. break;
  7049. case te.X:
  7050. M.debug && s.toggleExplode();
  7051. break;
  7052. case te.PLUSEQUALS:
  7053. l.player.activatePersistentZooming(!0),
  7054. O.hideUi();
  7055. break;
  7056. case te.DASHUNDERSCORE:
  7057. l.player.activatePersistentZooming(!1),
  7058. O.hideUi();
  7059. break;
  7060. case te.SEVEN:
  7061. ue.info("Zoom level: " + l.player.zoomLevel + ", FOV: " + l.player.zoomFov);
  7062. break;
  7063. case te.EIGHT:
  7064. l.player.decreaseZoomSpeed();
  7065. break;
  7066. case te.NINE:
  7067. l.player.increaseZoomSpeed()
  7068. }
  7069. return c && c.reticule.hide(),
  7070. !0
  7071. }
  7072. .bind(this)),
  7073. document.addEventListener("keyup", function(e) {
  7074. switch (e.which) {
  7075. case te.PLUSEQUALS:
  7076. l.player.deactivatePersistentZooming();
  7077. break;
  7078. case te.DASHUNDERSCORE:
  7079. l.player.deactivatePersistentZooming()
  7080. }
  7081. }
  7082. .bind(this)),
  7083. function(e) {
  7084. me = {
  7085. gui: null,
  7086. visible: !1,
  7087. model: e
  7088. }
  7089. }(s),
  7090. function(e, t) {
  7091. ve = {
  7092. gui: null,
  7093. visible: !1,
  7094. model: e,
  7095. player: t
  7096. }
  7097. }(s, l.player),
  7098. function(e) {
  7099. function t(e, i) {
  7100. $(e).find("a").each(function(e, t) {
  7101. i ? $(t).removeClass("buttonZoomDisabled").addClass("buttonZoomEnabled") : $(t).addClass("buttonZoomDisabled").removeClass("buttonZoomEnabled"),
  7102. t.style.pointerEvents = i ? "auto" : "none"
  7103. })
  7104. }
  7105. e.on(de.ZoomMax, function() {
  7106. t("#gui-zoomin", !1),
  7107. t("#gui-zoomout", !0)
  7108. }),
  7109. e.on(de.ZoomMin, function() {
  7110. t("#gui-zoomin", !0),
  7111. t("#gui-zoomout", !1)
  7112. }),
  7113. e.on(de.ZoomIn, function() {
  7114. t("#gui-zoomout", !0)
  7115. }),
  7116. e.on(de.ZoomOut, function() {
  7117. t("#gui-zoomin", !0)
  7118. }),
  7119. e.zoomLevel >= M.zoom.max ? t("#gui-zoomin", !1) : t("#gui-zoomin", !0),
  7120. e.zoomLevel <= M.zoom.min ? t("#gui-zoomout", !1) : t("#gui-zoomout", !0)
  7121. }(c),
  7122. P.setAutoPlay(s.heroCount()),
  7123. U.init(c, i.mode),
  7124. U.on(H.OPENED, _e.bind(this, "help")),
  7125. W.init(),
  7126. W.on(j.OPENED, (o = document.getElementById("terms-modal"),
  7127. function() {
  7128. _e("terms"),
  7129. V.open(o)
  7130. }
  7131. )),
  7132. W.on(j.CLOSED, V.reset),
  7133. M.quickstart.enabled || D.delayLanding(i.mode).then(D.showMessage.bind(this, c, l, Ce.coBrand.visible)),
  7134. (M.quickstart.enabled || c.model.outsideAllowed()) && O.init(e, c, c.tagManager, l),
  7135. M.profiling.enabled && B.show(),
  7136. q.init(l)
  7137. }
  7138. ,
  7139. Le.exports.startLoading = function(e, t, i, n, r, o) {
  7140. function a() {
  7141. o.setLoadingStartTime(),
  7142. function() {
  7143. function e(e) {
  7144. e.target === t || $.contains(t, e.target) || e.target === i || $.contains(i, e.target) || e.target === n || $.contains(n, e.target)
  7145. }
  7146. $("body").css("touch-action", "none"),
  7147. $("#gui-parent").find("*:not(#tag-billboards)").on("touchmove", function(e) {});
  7148. var t = document.getElementById("terms-text")
  7149. , i = document.getElementById("more-help-wrapper")
  7150. , n = (document.getElementById("navigation-help-wrapper"),
  7151. document.getElementById("help-dialog"),
  7152. document.getElementById("tag-billboards"));
  7153. M.useWheel && (document.body.addEventListener("mousewheel", e, {
  7154. passive: !1
  7155. }),
  7156. document.body.addEventListener("DOMMouseScroll", e)),
  7157. $("#terms-text, #more-help-wrapper, #navigation-help-wrapper").off("touchmove").on("touchmove", function(e) {
  7158. e.stopPropagation()
  7159. })
  7160. }(),
  7161. r ? (D.showMessage(t, i, Ce.coBrand.visible),
  7162. l()) : function(e) {
  7163. L.show(e),
  7164. c()
  7165. }(l)
  7166. }
  7167. var s = $.Deferred()
  7168. , l = s.resolve.bind(s);
  7169. ye = !0,
  7170. _(e);
  7171. e.data.player_options && function(e) {
  7172. Ce.tourControls.visible = true//e.tour_buttons && S.valueFromHash("gt", 1),
  7173. Ce.coBrand.visible = e.presented_by && 1 !== M.specialEdition && M.brand && !S.valueFromHash("mls", !1),
  7174. Ce.highlight.visible = /* e.highlight_reel && */ 1 !== M.specialEdition && M.showHighlights
  7175. }(e.data.player_options),
  7176. 1 === M.specialEdition && $("body").addClass("specialEdition");
  7177. se.localizeGUI();
  7178. !function(i) {
  7179. function e(e, t) {
  7180. return !!i.player_options[e] && i[t || e]
  7181. }
  7182. $(".model-title").text(i.name);
  7183. var t = M.pageTitle;
  7184. 2 !== S.valueFromHash("mls", 0) && i.name && (t = i.name),
  7185. document.title = t,
  7186. S.isMobile() ? $("#gui-fullscreen").css("display", "none") : ($("[rel=tooltip]").tooltip({
  7187. delay: {
  7188. show: 50,
  7189. hide: 0
  7190. },
  7191. trigger: "hover",
  7192. html: !1,
  7193. viewport: {
  7194. selector: "body",
  7195. padding: 10
  7196. }
  7197. }),
  7198. S.inIframe() && document.getElementsByClassName("pinBottom-container")[0].classList.add("embed")),
  7199. z.populate({
  7200. name: e("model_name", "name"),
  7201. coBrand: e("presented_by"),
  7202. description: e("model_summary", "summary") || "暂无内容",
  7203. contactName: e("contact_name"),
  7204. address: e("address"),
  7205. phone: e("contact_phone"),
  7206. formattedPhone: i.formatted_contact_phone,
  7207. email: e("contact_email"),
  7208. url: e("external_url"),
  7209. socialSharing: i.enable_social_sharing && i.is_public
  7210. })
  7211. }(e.data);
  7212. r || $(".quick").addClass("hidden");
  7213. n ? (R.impression(),
  7214. a()) : (o.setWaitingStartTime(),
  7215. N.show(r, a))
  7216. return s
  7217. }
  7218. ,
  7219. Le.exports.endLoading = function(e, t, i) {
  7220. var n = t.player;
  7221. function r() {
  7222. i.dismissExaminedTag(),
  7223. i.disableHovering()
  7224. }
  7225. $("#gui-thumb").fadeOut(2500),
  7226. L.hide(function() {
  7227. ye = !1
  7228. }),
  7229. Y.init(e, i),
  7230. z.finishSetup(Object.keys(e.tags).length),
  7231. i.on(ne.IMAGE_OPENED, _e.bind(this, "tag")),
  7232. X.on(Z.OPENED, r),
  7233. K.on(ae.OPENED, r),
  7234. U.on(H.OPENED, r),
  7235. W.on(j.OPENED, r);
  7236. var o = i.enableHovering.bind(i);
  7237. if (X.on(Z.CLOSED, o),
  7238. K.on(ae.CLOSED, o),
  7239. U.on(H.CLOSED, o),
  7240. W.on(j.CLOSED, o),
  7241. M.labels.enabled && Object.keys(e.labels).length,
  7242. e.floors.length <= 1 || !Ce.floors.visible ? Ce.floors.visible = !1 : (h(e, t),
  7243. I(e.currentFloor, n.mode)),
  7244. "372" === getQueryVariable("m") && (Ce.floors.visible = 1,
  7245. h(e, t)),
  7246. c(),
  7247. v(t, t.player),
  7248. $("#gui").fadeIn(1500),
  7249. Ce.highlight.visible && (2 !== M.startHighlights || e.has360Views) && setTimeout(function() {
  7250. l(),
  7251. (!e.has360Views && 1 !== M.startHighlights || e.has360Views && 0 === M.startHighlights) && setTimeout(l, 2e3)
  7252. }, 2e3),
  7253. !S.isMobile())
  7254. for (var a = ["a", "#title-toggle", ".next-button", ".prev-button", ".gui-floor", ".meta-toggle", ".thumbImg", "logo-button"], s = 0; s < a.length; s++)
  7255. $(a[s]).addClass("hasHover");
  7256. _(e),
  7257. z.setupToggling(),
  7258. window.editHotPanel && editHotPanel(),
  7259. function() {
  7260. var i = $("#pullTab")
  7261. , e = {
  7262. bottom: {
  7263. "border-bottom-left-radius": "10px",
  7264. "border-bottom-right-radius": "10px"
  7265. },
  7266. top: {
  7267. "border-top-left-radius": "10px",
  7268. "border-top-right-radius": "10px"
  7269. }
  7270. }
  7271. , t = {
  7272. bottom: {
  7273. "border-top-right-radius": "10px",
  7274. "border-bottom-right-radius": "10px"
  7275. },
  7276. top: {
  7277. "border-bottom-left-radius": "10px",
  7278. "border-top-left-radius": "10px"
  7279. }
  7280. };
  7281. function n(e, t) {
  7282. $("#gui-modes-map > div:visible:last").css(e),
  7283. i.is(":visible") ? $(".viewContainer > div:visible:first").css(t) : $("#gui-modes-map > div:visible:first").css(t)
  7284. }
  7285. /Android|webOS|iPhone|iPod|BlackBerry/i.test(navigator.userAgent) ? n(e.bottom, e.top) : n(t.bottom, t.top);
  7286. (window.DATA.model.special || "true" === window.DATA.special) && window.specialScene && specialScene.special().afterImplement()
  7287. }()
  7288. $(".toolRight a").removeClass('hasHover')
  7289. }
  7290. ,
  7291. Le.exports.onProgress = function(e) {
  7292. L.progress(e)
  7293. }
  7294. }
  7295. ).call(this, "/js/gui/gui.js")
  7296. }
  7297. , {
  7298. "../analytics": 4,
  7299. "../controls/serializer": 14,
  7300. "../enum/AlignmentType": 17,
  7301. "../enum/BlackoutStyle": 18,
  7302. "../enum/ControlEvents": 21,
  7303. "../enum/DirectorEvents": 23,
  7304. "../enum/Keys": 30,
  7305. "../enum/PathDiscardMode": 38,
  7306. "../enum/PathDisplayMode": 39,
  7307. "../enum/PlayerEvents": 40,
  7308. "../enum/VROption": 47,
  7309. "../enum/Vectors": 50,
  7310. "../enum/Viewmode": 51,
  7311. "../enum/WarpStyle": 52,
  7312. "../enum/ZoomEvents": 53,
  7313. "../lib/dat.gui": 93,
  7314. "../localization/localize": 108,
  7315. "../tag/Media/MediaEvent": 131,
  7316. "../objects/Snapshot": 153,
  7317. "../settings": 166,
  7318. "../util/ajax": 181,
  7319. "../util/browser": 182,
  7320. "../util/camera": 183,
  7321. "../util/logger": 189,
  7322. "../util/showcase": 193,
  7323. "../util/transitions": 195,
  7324. "./closer/ModalCloserEvent": 61,
  7325. "./closer/modalCloser": 62,
  7326. "./help/HelpEvent": 66,
  7327. "./help/help": 67,
  7328. "./helpManager": 68,
  7329. "./immersiveMode": 69,
  7330. "./konami": 70,
  7331. "./landingScreen": 71,
  7332. "./loadingScreen": 72,
  7333. "./memoryUsage": 73,
  7334. "./playButton": 74,
  7335. "./populateModal": 75,
  7336. "./sharing/ShareEvents": 76,
  7337. "./sharing/modal": 77,
  7338. "./terms/TermsEvent": 78,
  7339. "./terms/terms": 79,
  7340. "./title/TitleEvents": 80,
  7341. "./title/tagToggle": 81,
  7342. "./title/titleBar": 82,
  7343. "./tourInteraction": 84,
  7344. "./vr/vrEvent": 85,
  7345. "./vr/vrModal": 87,
  7346. "./webvr/WebVrEvent": 88,
  7347. "./webvr/webVRgui": 89,
  7348. three: 217
  7349. }],
  7350. 66: [function(e, t, i) {
  7351. "use strict";
  7352. t.exports = Object.freeze({
  7353. OPENED: "help.opened",
  7354. CLOSED: "help.closed"
  7355. })
  7356. }
  7357. , {}],
  7358. 67: [function(e, t, i) {
  7359. "use strict";
  7360. function n() {
  7361. p.on("click", function(e) {
  7362. T && T !== a.TRANSITIONING && (0 < window.getComputedStyle(v).getPropertyValue("opacity") && !x ? S.close() : T && T !== a.TRANSITIONING && (x = !0,
  7363. setTimeout(function() {
  7364. x = !1
  7365. }, h.help.modalStayDuration),
  7366. S.emit(l.OPENED),
  7367. f.addClass("open " + T),
  7368. p.addClass("open"),
  7369. o(),
  7370. r(),
  7371. v.style.removeProperty ? v.style.removeProperty("display") : v.style.removeAttribute("display"),
  7372. v.classList.add("fadeIn")))
  7373. }),
  7374. E.on("click", function(e) {
  7375. S.close()
  7376. }),
  7377. C.on("click", function(e) {
  7378. T && T !== a.TRANSITIONING && (o(),
  7379. r())
  7380. }),
  7381. I.on("click", function(e) {
  7382. o(),
  7383. I.addClass("underline-tab"),
  7384. c.fill(b, s.MORE_HELP),
  7385. f.addClass("more-help")
  7386. })
  7387. }
  7388. function r() {
  7389. C.addClass("underline-tab"),
  7390. c.fill(_, s.NAVIGATION, T),
  7391. f.addClass(T)
  7392. }
  7393. function o() {
  7394. f.removeClass("more-help " + a.PANORAMA + " " + a.DOLLHOUSE + " " + a.FLOORPLAN + " " + a.OUTDOOR),
  7395. A.forEach(function(e) {
  7396. e.classList.remove("underline-tab")
  7397. })
  7398. }
  7399. var a = e("../../enum/Viewmode")
  7400. , s = e("../../enum/HelpModalType")
  7401. , l = e("./HelpEvent")
  7402. , c = (e("../helpManager"),
  7403. e("./../populateModal"))
  7404. , h = e("../../settings")
  7405. , u = e("../../util/common")
  7406. , d = e("events").EventEmitter
  7407. , p = $(".footer-help").eq(0)
  7408. , f = $("#help-dialog").eq(0)
  7409. , g = document.querySelector("#quick-logo")
  7410. , m = document.querySelector("#loaderCoBrand")
  7411. , v = document.querySelector("#help-dialog")
  7412. , y = document.querySelector(".footer")
  7413. , A = $(".help-tabs").children().toArray()
  7414. , C = $(".navigation-tab").eq(0)
  7415. , I = $(".more-help-tab").eq(0)
  7416. , E = ($("#interaction-modal").eq(0).find(".interaction").toArray(),
  7417. f.find(".close").eq(0))
  7418. , _ = f.find(".interactions").toArray()
  7419. , b = f.find(".ui-instructions").toArray()
  7420. , w = a.PANORAMA
  7421. , T = a.PANORAMA
  7422. , x = !1
  7423. , S = {
  7424. init: function(e, t) {
  7425. w = T = t,
  7426. [v, m, g, y].forEach(function(e) {
  7427. e.classList.add(c.deviceType)
  7428. }),
  7429. n()
  7430. },
  7431. close: function() {
  7432. if (f.hasClass("open") && (this.emit(l.CLOSED),
  7433. p.removeClass("open"),
  7434. f.removeClass("open"),
  7435. v.classList.contains("fadeIn"))) {
  7436. v.classList.remove("fadeIn");
  7437. var e = T === a.TRANSITIONING ? w : T;
  7438. c.clear(_, s.NAVIGATION, e)
  7439. }
  7440. },
  7441. updateMode: function(e) {
  7442. w = T,
  7443. T = e
  7444. }
  7445. };
  7446. u.extendObject(S, d.prototype),
  7447. t.exports = S
  7448. }
  7449. , {
  7450. "../../enum/HelpModalType": 28,
  7451. "../../enum/Viewmode": 51,
  7452. "../../settings": 166,
  7453. "../../util/common": 185,
  7454. "../helpManager": 68,
  7455. "./../populateModal": 75,
  7456. "./HelpEvent": 66,
  7457. events: 202
  7458. }],
  7459. 68: [function(s, l, e) {
  7460. (function(e) {
  7461. "use strict";
  7462. var t = s("../util/browser")
  7463. , i = s("./../util/logger")
  7464. , n = s("./../settings")
  7465. , r = new i(e)
  7466. , o = function() {
  7467. var t;
  7468. try {
  7469. return t = window.localStorage.getItem("visitCount") || "0",
  7470. t = (parseFloat(t) + 1).toString(),
  7471. window.localStorage.setItem("visitCount", t),
  7472. r.debug("visitCount = " + t),
  7473. t
  7474. } catch (e) {
  7475. t = "1",
  7476. r.debug("couldn't set local storage")
  7477. }
  7478. }()
  7479. , a = !1;
  7480. l.exports = {
  7481. isHelpDisabled: function() {
  7482. return "0" === t.valueFromHash("help", null) || a
  7483. },
  7484. isLargeHelpEnabled: function() {
  7485. return ("1" === o || "1" === t.valueFromHash("help", null)) && !this.isHelpDisabled()
  7486. },
  7487. isSmallHelpEnabled: function() {
  7488. return "2" === t.valueFromHash("help", null) && !this.isHelpDisabled()
  7489. },
  7490. isHelpEnabled: function() {
  7491. return this.isLargeHelpEnabled() || this.isSmallHelpEnabled()
  7492. },
  7493. setAutoPlay: function(e) {
  7494. a = 0 <= n.warp.auto && 1 < e
  7495. }
  7496. }
  7497. }
  7498. ).call(this, "/js/gui/helpManager.js")
  7499. }
  7500. , {
  7501. "../util/browser": 182,
  7502. "./../settings": 166,
  7503. "./../util/logger": 189
  7504. }],
  7505. 69: [function(e, t, i) {
  7506. "use strict";
  7507. function r(e) {
  7508. M || n(e) && C.hasClass("playing") || (clearTimeout(x),
  7509. T = !0,
  7510. h.close(),
  7511. function(e) {
  7512. !n(e) && S ? v.forEach(function(e) {
  7513. e.classList.remove("drawerOpen"),
  7514. e.classList.add("duringTour")
  7515. }) : C.hasClass("open") ? v.forEach(function(e) {
  7516. e.classList.remove("duringTour"),
  7517. e.classList.add("drawerOpen")
  7518. }) : P || R === g.FLOORPLAN || R === g.DOLLHOUSE || v.forEach(function(e) {
  7519. e.classList.add("fadeOut")
  7520. })
  7521. }(e),
  7522. R !== g.DOLLHOUSE && R !== g.FLOORPLAN && (E.hasClass("expand") && !_.hasClass("closed") || l.valueFromHash("title", 1),
  7523. C.hasClass("playing") || (y.forEach(function(e) {
  7524. e.classList.add("detectHover")
  7525. }),
  7526. x = setTimeout(a, c.immersive.timeToShowAgain))))
  7527. }
  7528. function o() {
  7529. C.hasClass("playing") || (clearTimeout(x),
  7530. x = setTimeout(a, c.immersive.timeToShowAgain))
  7531. }
  7532. function a() {
  7533. clearTimeout(x),
  7534. T = !1,
  7535. m.forEach(function(e) {
  7536. e.classList.remove("drawerOpen")
  7537. }),
  7538. S || v.forEach(function(e) {
  7539. e.classList.remove("duringTour")
  7540. }),
  7541. y.forEach(function(e) {
  7542. e.classList.remove("detectHover")
  7543. })
  7544. }
  7545. function s() {
  7546. T ? a() : r(),
  7547. M = !0,
  7548. setTimeout(function() {
  7549. M = !1
  7550. }, c.immersive.uiStayDuration)
  7551. }
  7552. function n(e) {
  7553. return "mouse" === e || "touch" === e || "key" === e || "gui" === e
  7554. }
  7555. var l = e("../util/browser")
  7556. , c = e("../settings")
  7557. , h = e("./help/help")
  7558. , u = e("../enum/tagEvents")
  7559. , d = e("../enum/ControlEvents")
  7560. , p = e("../enum/PlayerEvents")
  7561. , f = e("../enum/DirectorEvents")
  7562. , g = (p = e("../enum/PlayerEvents"),
  7563. e("../enum/Viewmode"))
  7564. , m = $(".pinTop.left, .pinBottom-container, #drawer-container, #drawer, .footer").toArray()
  7565. , v = $(".pinBottom-container, #drawer-container, .footer").toArray()
  7566. , y = $("#hover-bottom, #hover-top").toArray()
  7567. , A = ($("#pullTab").eq(0),
  7568. $("#playHead").eq(0),
  7569. $(".pinBottom-container").eq(0))
  7570. , C = $("#drawer").eq(0)
  7571. , I = $("#drawer-container").eq(0)
  7572. , E = $("#meta-info").eq(0)
  7573. , _ = $(".pinTop.left").eq(0)
  7574. , b = $("#player").eq(0)
  7575. , w = document.getElementById("pullTab")
  7576. , T = !1
  7577. , x = null
  7578. , S = !1
  7579. , M = !1
  7580. , R = null
  7581. , P = !1;
  7582. t.exports.init = function(e, t, i, n) {
  7583. (function(t, i, e, n) {
  7584. [g.PANORAMA, g.DOLLHOUSE, g.FLOORPLAN].forEach(function(e) {
  7585. t.controls[e].on(d.Move, r),
  7586. t.controls[e].on(d.LongTap, s)
  7587. }),
  7588. b.on("mousewheel DOMMouseScroll", r),
  7589. e.on(u.TagActivated, r),
  7590. e.on(u.TagNavigation, r),
  7591. i.on(p.FlyingEnded, o),
  7592. i.on(p.ModeChanging, function(e, t) {
  7593. P = t !== g.PANORAMA && e !== g.PANORAMA
  7594. }),
  7595. i.on(p.ModeChanged, function(e, t) {
  7596. R = i.mode,
  7597. t !== g.TRANSITIONING ? a() : r("modeChange")
  7598. }),
  7599. n.on(f.TourStart, function() {
  7600. S = !0,
  7601. r()
  7602. }),
  7603. n.on(f.TourEnd, function() {
  7604. S = !1,
  7605. a()
  7606. }),
  7607. n.on(f.ActionInterrupted, function() {
  7608. S = !1
  7609. }),
  7610. w.addEventListener("touchend", function() {
  7611. $("#pullTab").hasClass("opened") && !S && a()
  7612. }, !0)
  7613. }
  7614. )(e, t, i, n),
  7615. l.isMobile() ? (y.forEach(function(e) {
  7616. e.classList.add("mobile")
  7617. }),
  7618. A.click(a)) : (y.forEach(function(e) {
  7619. e.addEventListener("mouseleave", function() {
  7620. !b.is(":hover") && y[0].classList.contains("detectHover") && a()
  7621. }, !0)
  7622. }),
  7623. b.mouseleave(function() {
  7624. y[0].classList.contains("detectHover") && a()
  7625. })),
  7626. R = t.mode
  7627. }
  7628. ,
  7629. t.exports.hideUi = r,
  7630. t.exports.resetDrawer = function() {
  7631. I.hasClass("duringTour") || (S = !1,
  7632. r("gui"),
  7633. a())
  7634. }
  7635. }
  7636. , {
  7637. "../enum/ControlEvents": 21,
  7638. "../enum/DirectorEvents": 23,
  7639. "../enum/tagEvents": 32,
  7640. "../enum/PlayerEvents": 40,
  7641. "../enum/Viewmode": 51,
  7642. "../settings": 166,
  7643. "../util/browser": 182,
  7644. "./help/help": 67
  7645. }],
  7646. 70: [function(i, n, e) {
  7647. (function(e) {
  7648. "use strict";
  7649. var t = i("./../util/logger")
  7650. , o = i("./../settings")
  7651. , a = i("./debug")
  7652. , s = i("./../util/common")
  7653. , l = (i("./gui"),
  7654. new t(e));
  7655. o.console && $("body").append('<div id="debug-console"></div>'),
  7656. n.exports.init = function(i, n, r) {
  7657. l.debug("konami has the modelInstance");
  7658. var t = [];
  7659. $(window).on("keydown", function(e) {
  7660. t.push(e.which),
  7661. t.length > o.secretPanelWord.length && t.shift(),
  7662. s.equalLists(t, o.secretPanelWord) && (l.debug("Developer mode active."),
  7663. o.debug = !0)
  7664. }),
  7665. $(window).on("keydown", function e(t) {
  7666. o.debug && 72 === t.which && (i && r ? (a.toggle(i, n, r),
  7667. $(window).off("keydown", e)) : console.warn("sorry we're not ready yet"))
  7668. })
  7669. }
  7670. }
  7671. ).call(this, "/js/gui/konami.js")
  7672. }
  7673. , {
  7674. "./../settings": 166,
  7675. "./../util/common": 185,
  7676. "./../util/logger": 189,
  7677. "./debug": 63,
  7678. "./gui": 65
  7679. }],
  7680. 71: [function(e, t, i) {
  7681. "use strict";
  7682. function r() {
  7683. s.clear(m, l.LANDING[v]),
  7684. g.removeClass("fadeIn")
  7685. }
  7686. var o = e("../settings")
  7687. , a = (e("./help/help"),
  7688. e("./helpManager"))
  7689. , s = e("./populateModal")
  7690. , l = e("../enum/HelpModalType")
  7691. , n = e("../enum/Viewmode")
  7692. , c = e("../enum/DirectorEvents")
  7693. , h = e("../enum/PlayerEvents")
  7694. , u = $("#quick-blackout").eq(0)
  7695. , d = $("#quick-logo").eq(0)
  7696. , p = $(".quick-brand").toArray()
  7697. , f = $("#loaderCoBrand").eq(0)
  7698. , g = $("#interaction-modal").eq(0)
  7699. , m = g.find(".interaction").toArray()
  7700. , v = ($("#model-title, .pinBottom-container, #drawer-container, #drawer, .footer").toArray(),
  7701. "");
  7702. t.exports.delayLanding = function(e) {
  7703. var t = $.Deferred();
  7704. e || t.resolve();
  7705. var i = o.startupFlyinDelay;
  7706. return e === n.PANORAMA && (i += o.dollhouse.transitionTime),
  7707. setTimeout(t.resolve.bind(t), i),
  7708. t
  7709. }
  7710. ,
  7711. t.exports.showMessage = function(e, t, i) {
  7712. var n = 0;
  7713. o.quickstart.enabled && (function(e) {
  7714. /* e && (f.addClass("quick-brand"), //quick-brand样式有问题 会遮住屏幕
  7715. d.before(f),
  7716. p = $(".quick-brand").toArray()), */
  7717. u.addClass("fadeOut")
  7718. /* setTimeout(function() {
  7719. p.forEach(function(e) {
  7720. e.classList.add("fadeIn")
  7721. })
  7722. }, o.quickstart.showTextDelay),
  7723. setTimeout(function() {
  7724. p.forEach(function(e) {
  7725. e.classList.add("fadeOut")
  7726. })
  7727. }, o.quickstart.fadeOutDelay) */
  7728. }(i),
  7729. n = o.quickstart.showTextDelay + o.quickstart.fadeOutDelay),
  7730. function(e, t) {
  7731. setTimeout(function() {
  7732. if (a.isHelpEnabled()) {
  7733. if (t(),
  7734. s.init(),
  7735. g.addClass("fadeIn landing " + s.deviceType),
  7736. a.isSmallHelpEnabled())
  7737. return void g.addClass("small");
  7738. s.fill(m, l.LANDING[v]),
  7739. g.addClass(v)
  7740. }
  7741. }, e);
  7742. var i = {
  7743. pc: ["images/pc_step1.png", "images/pc_step2.png", "images/pc_step3.png"],
  7744. mobile: ["images/phone_step1.png", "images/phone_step2.png", "images/phone_step3.png"]
  7745. }
  7746. , n = $(".nav-icon .icon");
  7747. /Android|webOS|iPhone|iPod|BlackBerry/i.test(navigator.userAgent) && n.attr("src", i.mobile[0]);
  7748. function r(e) {
  7749. e.on("click", function() {
  7750. var e = null;
  7751. if (e = "plus" == $(this).attr("data-id") ? +n.attr("data-page") + 1 : +n.attr("data-page") - 1,
  7752. i.length < e || e < 1)
  7753. return !1;
  7754. /Android|webOS|iPhone|iPod|BlackBerry/i.test(navigator.userAgent) ? n.attr({
  7755. "data-page": e,
  7756. src: i.mobile[e - 1]
  7757. }) : n.attr({
  7758. "data-page": e,
  7759. src: i.pc[e - 1]
  7760. })
  7761. })
  7762. }
  7763. r($(".next-button")),
  7764. r($(".prev-button"))
  7765. }(n, function() {
  7766. e.once(h.Move, r),
  7767. t.once(c.TourStart, r)
  7768. })
  7769. }
  7770. ,
  7771. t.exports.init = function(e, t) {
  7772. v = t.mode === n.PANORAMA && t.pano && !t.pano.isAligned() ? n.OUTDOOR : t.mode
  7773. }
  7774. ,
  7775. t.exports.dismissModal = r
  7776. }
  7777. , {
  7778. "../enum/DirectorEvents": 23,
  7779. "../enum/HelpModalType": 28,
  7780. "../enum/PlayerEvents": 40,
  7781. "../enum/Viewmode": 51,
  7782. "../settings": 166,
  7783. "./help/help": 67,
  7784. "./helpManager": 68,
  7785. "./populateModal": 75
  7786. }],
  7787. 72: [function(e, t, i) {
  7788. "use strict";
  7789. var n = e("./circleLoader").circleLoader;
  7790. t.exports = {
  7791. element: $("#gui-loading"),
  7792. hide: function(e) {
  7793. n.done(),
  7794. this.element.fadeOut(1500, e)
  7795. },
  7796. show: function(e) {
  7797. this.element.fadeIn(500, function() {
  7798. this.element.css("display", "table"),
  7799. e && e()
  7800. }
  7801. .bind(this))
  7802. },
  7803. progress: function(e) {
  7804. n.set(e)
  7805. }
  7806. }
  7807. }
  7808. , {
  7809. "./circleLoader": 60
  7810. }],
  7811. 73: [function(e, t, i) {
  7812. "use strict";
  7813. var n = e("../settings")
  7814. , r = $("#memory-info")
  7815. , o = r.find("#memory-gpu")
  7816. , a = !1;
  7817. t.exports = {
  7818. show: function() {
  7819. n.profiling.enabled && (r.show(),
  7820. a = !0)
  7821. },
  7822. hide: function() {
  7823. r.hide(),
  7824. a = !1
  7825. },
  7826. toggle: function() {
  7827. a ? this.hide() : this.show()
  7828. },
  7829. update: function(e) {
  7830. n.profiling.enabled && o.text(Math.floor(e / 1e6) + "MB")
  7831. }
  7832. }
  7833. }
  7834. , {
  7835. "../settings": 166
  7836. }],
  7837. 74: [function(e, t, i) {
  7838. "use strict";
  7839. e("../util/browser"),
  7840. e("../analytics");
  7841. e("../settings"),
  7842. t.exports = {
  7843. show: function(e, t) {
  7844. $("#gui-message").fadeOut(500, function() {
  7845. t()
  7846. })
  7847. }
  7848. }
  7849. }
  7850. , {
  7851. "../analytics": 4,
  7852. "../settings": 166,
  7853. "../util/browser": 182
  7854. }],
  7855. 75: [function(e, t, i) {
  7856. "use strict";
  7857. function n(e, t, i, n) {
  7858. i ? this.assets[t][i][this.deviceType] : this.assets[t][this.deviceType]
  7859. }
  7860. var r = e("../util/browser")
  7861. , o = e("../localization/localize")
  7862. , a = e("../enum/HelpModalType")
  7863. , s = (e("../enum/HelpModalSize"),
  7864. e("../enum/Viewmode"));
  7865. t.exports = {
  7866. init: function() {
  7867. if (!this.hasInitialized) {
  7868. this.hasInitialized = !0,
  7869. this.deviceType = r.isMobile() ? "mobile" : "desktop",
  7870. this.assets = {},
  7871. this.assets[a.LANDING[s.PANORAMA]] = {
  7872. desktop: {
  7873. left: {
  7874. "top-info": o.ROTATE,
  7875. "big-image": "images/nav_help_mouse_drag_left.png",
  7876. keyboard: "images/nav_help_keyboard_left_right.png"
  7877. },
  7878. middle: {
  7879. "top-info": o.MOVE,
  7880. "big-image": "images/nav_help_mouse_click.png",
  7881. keyboard: "images/nav_help_keyboard_up_down.png"
  7882. },
  7883. right: {
  7884. "top-info": o.ZOOM,
  7885. "big-image": "images/nav_help_mouse_zoom.png",
  7886. keyboard: "images/nav_help_zoom_keys.png"
  7887. }
  7888. },
  7889. mobile: {
  7890. left: {
  7891. "top-info": o.ROTATE,
  7892. "big-image": "images/nav_help_gesture_drag.png"
  7893. },
  7894. middle: {
  7895. "top-info": o.MOVE,
  7896. "big-image": "images/nav_help_gesture_tap.png"
  7897. },
  7898. right: {
  7899. "top-info": o.ZOOM,
  7900. "big-image": "images/nav_help_gesture_pinch.png"
  7901. }
  7902. }
  7903. },
  7904. this.assets[a.LANDING[s.OUTDOOR]] = JSON.parse(JSON.stringify(this.assets[a.LANDING[s.PANORAMA]])),
  7905. this.assets[a.LANDING[s.DOLLHOUSE]] = {
  7906. desktop: {
  7907. left: {
  7908. "top-info": o.ROTATE,
  7909. "big-image": "images/nav_help_mouse_drag_left.png",
  7910. keyboard: "images/nav_help_keyboard_left_right.png"
  7911. },
  7912. middle: {
  7913. "top-info": o.MOVE,
  7914. "big-image": "images/nav_help_mouse_position_right.png"
  7915. }
  7916. },
  7917. mobile: {
  7918. left: {
  7919. "top-info": o.ROTATE,
  7920. "big-image": "images/nav_help_gesture_drag.png"
  7921. },
  7922. middle: {
  7923. "top-info": o.MOVE,
  7924. "big-image": "images/nav_help_gesture_position_two_finger.png"
  7925. }
  7926. }
  7927. },
  7928. this.assets[a.LANDING[s.FLOORPLAN]] = {
  7929. desktop: {
  7930. left: {
  7931. "top-info": o.MOVE,
  7932. "big-image": "images/nav_help_mouse_position_left.png"
  7933. },
  7934. middle: {
  7935. "top-info": o.ROTATE,
  7936. "big-image": "images/nav_help_mouse_drag_right.png",
  7937. keyboard: "images/nav_help_keyboard_left_right.png"
  7938. }
  7939. },
  7940. mobile: {
  7941. left: {
  7942. "top-info": o.MOVE,
  7943. "big-image": "images/nav_help_gesture_position.png"
  7944. },
  7945. middle: {
  7946. "top-info": o.ROTATE,
  7947. "big-image": "images/nav_help_gesture_drag_two_finger.png"
  7948. }
  7949. }
  7950. };
  7951. var e = {
  7952. "top-info": o.INSIDE,
  7953. "big-image": "images/nav_help_click_inside.png",
  7954. keyboard: "images/nav_help_inside_key.png"
  7955. };
  7956. this.assets[a.LANDING[s.OUTDOOR]].desktop.middle = e,
  7957. this.assets[a.LANDING[s.DOLLHOUSE]].desktop.right = e,
  7958. this.assets[a.LANDING[s.FLOORPLAN]].desktop.right = e;
  7959. var t = {
  7960. "top-info": o.INSIDE,
  7961. "big-image": "images/nav_help_tap_inside.png"
  7962. };
  7963. this.assets[a.LANDING[s.OUTDOOR]].mobile.middle = t,
  7964. this.assets[a.LANDING[s.DOLLHOUSE]].mobile.right = t,
  7965. this.assets[a.LANDING[s.FLOORPLAN]].mobile.right = t,
  7966. this.assets[a.NAVIGATION] = {},
  7967. this.assets[a.NAVIGATION][s.PANORAMA] = {
  7968. desktop: {
  7969. left: {
  7970. "top-info": o.HELP_DESKTOP_PANORAMA_1A,
  7971. "bottom-info": o.HELP_DESKTOP_PANORAMA_1B,
  7972. "big-image": "images/nav_help_mouse_drag_left.png",
  7973. keyboard: "images/nav_help_keyboard_left_right.png"
  7974. },
  7975. middle: {
  7976. "top-info": o.HELP_DESKTOP_PANORAMA_2A,
  7977. "bottom-info": o.HELP_DESKTOP_PANORAMA_2B,
  7978. "big-image": "images/nav_help_mouse_click.png",
  7979. keyboard: "images/nav_help_keyboard_up_down.png"
  7980. },
  7981. right: {
  7982. "top-info": o.HELP_DESKTOP_PANORAMA_3A,
  7983. "bottom-info": o.HELP_DESKTOP_PANORAMA_3B,
  7984. "big-image": "images/nav_help_mouse_zoom.png",
  7985. keyboard: "images/nav_help_zoom_keys.png"
  7986. }
  7987. },
  7988. mobile: {
  7989. left: {
  7990. "top-info": o.HELP_MOBILE_PANORAMA_1,
  7991. "big-image": "images/nav_help_gesture_drag.png"
  7992. },
  7993. middle: {
  7994. "top-info": o.HELP_MOBILE_PANORAMA_2,
  7995. "big-image": "images/nav_help_gesture_tap.png"
  7996. },
  7997. right: {
  7998. "top-info": o.HELP_MOBILE_3,
  7999. "big-image": "images/nav_help_gesture_pinch.png"
  8000. }
  8001. }
  8002. },
  8003. this.assets[a.NAVIGATION][s.DOLLHOUSE] = {
  8004. desktop: {
  8005. left: {
  8006. "top-info": o.HELP_DESKTOP_DOLLHOUSE_1A,
  8007. "bottom-info": o.HELP_DESKTOP_DOLLHOUSE_1B,
  8008. "big-image": "images/nav_help_mouse_drag_left.png",
  8009. keyboard: "images/nav_help_keyboard_all.png"
  8010. },
  8011. middle: {
  8012. "top-info": o.HELP_DESKTOP_DOLLHOUSE_2A,
  8013. "big-image": "images/nav_help_mouse_position_right.png"
  8014. },
  8015. right: {
  8016. "top-info": o.HELP_DESKTOP_DOLLHOUSE_3A,
  8017. "big-image": "images/nav_help_mouse_zoom.png"
  8018. }
  8019. },
  8020. mobile: {
  8021. left: {
  8022. "top-info": o.HELP_MOBILE_DOLLHOUSE_1,
  8023. "big-image": "images/nav_help_gesture_drag.png"
  8024. },
  8025. middle: {
  8026. "top-info": o.HELP_MOBILE_DOLLHOUSE_2,
  8027. "big-image": "images/nav_help_gesture_position_two_finger.png"
  8028. },
  8029. right: {
  8030. "top-info": o.HELP_MOBILE_3,
  8031. "big-image": "images/nav_help_gesture_pinch.png"
  8032. }
  8033. }
  8034. },
  8035. this.assets[a.NAVIGATION][s.FLOORPLAN] = {
  8036. desktop: {
  8037. left: {
  8038. "top-info": o.HELP_DESKTOP_FLOORPLAN_1A,
  8039. "big-image": "images/nav_help_mouse_position_left.png"
  8040. },
  8041. middle: {
  8042. "top-info": o.HELP_DESKTOP_FLOORPLAN_2A,
  8043. "bottom-info": o.HELP_DESKTOP_FLOORPLAN_2B,
  8044. "big-image": "images/nav_help_mouse_drag_right.png",
  8045. keyboard: "images/nav_help_keyboard_left_right.png"
  8046. },
  8047. right: {
  8048. "top-info": o.HELP_DESKTOP_FLOORPLAN_3A,
  8049. "bottom-info": o.HELP_DESKTOP_FLOORPLAN_3B,
  8050. "big-image": "images/nav_help_mouse_zoom.png",
  8051. keyboard: "images/nav_help_keyboard_up_down.png"
  8052. }
  8053. },
  8054. mobile: {
  8055. left: {
  8056. "top-info": o.HELP_MOBILE_FLOORPLAN_1,
  8057. "big-image": "images/nav_help_gesture_position.png"
  8058. },
  8059. middle: {
  8060. "top-info": o.HELP_MOBILE_FLOORPLAN_2,
  8061. "big-image": "images/nav_help_gesture_drag_two_finger.png"
  8062. },
  8063. right: {
  8064. "top-info": o.HELP_MOBILE_3,
  8065. "big-image": "images/nav_help_gesture_pinch.png"
  8066. }
  8067. }
  8068. },
  8069. this.assets[a.NAVIGATION][s.OUTDOOR] = JSON.parse(JSON.stringify(this.assets[a.NAVIGATION][s.PANORAMA])),
  8070. this.assets[a.NAVIGATION][s.OUTDOOR].desktop.middle = {
  8071. "top-info": o.HELP_DESKTOP_360_2A,
  8072. "bottom-info": o.HELP_DESKTOP_360_2B,
  8073. "big-image": "images/nav_help_click_inside.png",
  8074. keyboard: "images/nav_help_inside_key.png"
  8075. },
  8076. this.assets[a.NAVIGATION][s.OUTDOOR].mobile.middle = {
  8077. "top-info": o.HELP_MOBILE_360_2,
  8078. "big-image": "images/nav_help_tap_inside.png"
  8079. },
  8080. this.assets[a.MORE_HELP] = {
  8081. desktop: {
  8082. "more-help-hlr": {
  8083. "top-info": o.HELP_MORE_HLR_A,
  8084. "big-image": "images/nav_help_expand.svg",
  8085. "bottom-info": o.HELP_DESKTOP_MORE_HLR_B
  8086. },
  8087. "more-help-dollhouse": {
  8088. "top-info": o.HELP_MORE_DOLLHOUSE_A,
  8089. "big-image": "images/nav_help_dollhouse.svg",
  8090. "bottom-info": o.HELP_DESKTOP_MORE_DOLLHOUSE_B
  8091. },
  8092. "more-help-floors": {
  8093. "top-info": o.HELP_MORE_FLOORS_A,
  8094. "big-image": "images/nav_help_floor picker.svg",
  8095. "bottom-info": o.HELP_DESKTOP_MORE_FLOORS_B
  8096. },
  8097. "more-help-tag": {
  8098. "top-info": o.HELP_MORE_TAG_A,
  8099. "big-image": "images/nav_help_tag.svg",
  8100. "bottom-info": o.HELP_DESKTOP_MORE_TAG_B
  8101. },
  8102. "more-help-zoom": {
  8103. "top-info": o.HELP_MORE_ZOOM_A,
  8104. "big-image": "images/nav_help_zoom.svg",
  8105. "bottom-info": o.HELP_DESKTOP_MORE_ZOOM_B
  8106. },
  8107. "more-help-tour": {
  8108. "top-info": o.HELP_MORE_TOUR_A,
  8109. "big-image": "images/nav_help_play.png",
  8110. "bottom-info": o.HELP_DESKTOP_MORE_TOUR_B
  8111. },
  8112. "more-help-inside": {
  8113. "top-info": o.HELP_MORE_INSIDE_A,
  8114. "big-image": "images/nav_help_inside.svg",
  8115. "bottom-info": o.HELP_DESKTOP_MORE_INSIDE_B
  8116. },
  8117. "more-help-vr": {
  8118. "top-info": o.HELP_MORE_VR_A,
  8119. "big-image": "images/nav_help_vr.svg",
  8120. "bottom-info": o.HELP_DESKTOP_MORE_VR_B
  8121. },
  8122. "more-help-360": {
  8123. "top-info": o.HELP_MORE_360_A,
  8124. "big-image": "images/nav_help_360.svg",
  8125. "bottom-info": o.HELP_DESKTOP_MORE_360_B
  8126. },
  8127. "more-help-fullscreen": {
  8128. "top-info": o.HELP_MORE_FULLSCREEN_A,
  8129. "big-image": "images/nav_help_fullscreen.svg",
  8130. "bottom-info": o.HELP_DESKTOP_MORE_FULLSCREEN_B
  8131. }
  8132. },
  8133. mobile: {
  8134. "more-help-hlr": {
  8135. "top-info": o.HELP_MORE_HLR_A,
  8136. "big-image": "images/nav_help_expand.svg",
  8137. "bottom-info": o.HELP_DESKTOP_MORE_HLR_B
  8138. },
  8139. "more-help-dollhouse": {
  8140. "top-info": o.HELP_MORE_DOLLHOUSE_A,
  8141. "big-image": "images/nav_help_dollhouse.svg",
  8142. "bottom-info": o.HELP_MOBILE_MORE_DOLLHOUSE_B
  8143. },
  8144. "more-help-floors": {
  8145. "top-info": o.HELP_MORE_FLOORS_A,
  8146. "big-image": "images/nav_help_floor picker.svg",
  8147. "bottom-info": o.HELP_DESKTOP_MORE_FLOORS_B
  8148. },
  8149. "more-help-tag": {
  8150. "top-info": o.HELP_MORE_TAG_A,
  8151. "big-image": "images/nav_help_tag.svg",
  8152. "bottom-info": o.HELP_MOBILE_MORE_TAG_B
  8153. },
  8154. "more-help-tour": {
  8155. "top-info": o.HELP_MORE_TOUR_A,
  8156. "big-image": "images/nav_help_play.png",
  8157. "bottom-info": o.HELP_DESKTOP_MORE_TOUR_B
  8158. },
  8159. "more-help-inside": {
  8160. "top-info": o.HELP_MORE_INSIDE_A,
  8161. "big-image": "images/nav_help_inside.svg",
  8162. "bottom-info": o.HELP_MOBILE_MORE_INSIDE_B
  8163. },
  8164. "more-help-vr": {
  8165. "top-info": o.HELP_MORE_VR_A,
  8166. "big-image": "images/webvr.svg",
  8167. "bottom-info": o.HELP_MOBILE_MORE_VR_B
  8168. },
  8169. "more-help-360": {
  8170. "top-info": o.HELP_MORE_360_A,
  8171. "big-image": "images/nav_help_360.svg",
  8172. "bottom-info": o.HELP_MOBILE_MORE_360_B
  8173. }
  8174. }
  8175. },
  8176. this.assets[a.TOUR_INTERACTION[s.PANORAMA]] = {
  8177. desktop: {
  8178. left: {
  8179. "top-info": o.ROTATE,
  8180. "big-image": "images/nav_help_mouse_drag_left.png",
  8181. keyboard: "images/nav_help_keyboard_left_right.png"
  8182. },
  8183. middle: {
  8184. "top-info": o.MOVE,
  8185. "big-image": "images/nav_help_mouse_click.png",
  8186. keyboard: "images/nav_help_keyboard_up_down.png"
  8187. },
  8188. right: {
  8189. "top-info": o.PLAY,
  8190. "big-image": "images/Desktop-help-play-button.svg",
  8191. keyboard: "images/Desktop-help-spacebar-2.svg"
  8192. }
  8193. },
  8194. mobile: {
  8195. left: {
  8196. "top-info": o.ROTATE,
  8197. "big-image": "images/nav_help_gesture_drag.png"
  8198. },
  8199. middle: {
  8200. "top-info": o.MOVE,
  8201. "big-image": "images/nav_help_gesture_tap.png"
  8202. },
  8203. right: {
  8204. "top-info": o.PLAY,
  8205. "big-image": "images/mobile-help-play-button.svg"
  8206. }
  8207. }
  8208. },
  8209. this.assets[a.TOUR_INTERACTION[s.OUTDOOR]] = JSON.parse(JSON.stringify(this.assets[a.TOUR_INTERACTION[s.PANORAMA]])),
  8210. this.assets[a.TOUR_INTERACTION[s.OUTDOOR]].desktop.middle = this.assets[a.LANDING[s.OUTDOOR]].desktop.middle,
  8211. this.assets[a.TOUR_INTERACTION[s.OUTDOOR]].mobile.middle = this.assets[a.LANDING[s.OUTDOOR]].mobile.middle,
  8212. this.assets[a.TOUR_INTERACTION[s.FLOORPLAN]] = JSON.parse(JSON.stringify(this.assets[a.TOUR_INTERACTION[s.OUTDOOR]])),
  8213. this.assets[a.TOUR_INTERACTION[s.FLOORPLAN]].desktop.left = this.assets[a.LANDING[s.FLOORPLAN]].desktop.left,
  8214. this.assets[a.TOUR_INTERACTION[s.FLOORPLAN]].mobile.left = this.assets[a.LANDING[s.FLOORPLAN]].mobile.left
  8215. }
  8216. },
  8217. fill: function(e, t, i) {
  8218. n.call(this, e, t, i, !0)
  8219. },
  8220. clear: function(e, t, i) {
  8221. n.call(this, e, t, i, !1)
  8222. }
  8223. }
  8224. }
  8225. , {
  8226. "../enum/HelpModalSize": 27,
  8227. "../enum/HelpModalType": 28,
  8228. "../enum/Viewmode": 51,
  8229. "../localization/localize": 108,
  8230. "../util/browser": 182
  8231. }],
  8232. 76: [function(e, t, i) {
  8233. "use strict";
  8234. t.exports = Object.freeze({
  8235. OPENED: "share.open",
  8236. CLOSED: "share.closed",
  8237. LINK_CLICKED: "share.linked"
  8238. })
  8239. }
  8240. , {}],
  8241. 77: [function(e, t, i) {
  8242. "use strict";
  8243. function n(n) {
  8244. function e(e, t) {
  8245. var i = "top=" + (window.screenY + ($("#player").height() - t) / 2) + ",left=" + (window.screenX + ($("#player").width() - e) / 2) + ",width=" + e + ",height=" + t;
  8246. I.emit(l.LINK_CLICKED, {
  8247. channel: n
  8248. }),
  8249. window.open(C[n], "shareWindow", i)
  8250. }
  8251. switch (n) {
  8252. case A.FACEBOOK:
  8253. e(580, 420);
  8254. break;
  8255. case A.TWITTER:
  8256. e(550, 440);
  8257. break;
  8258. case A.MAIL:
  8259. I.emit(l.LINK_CLICKED, {
  8260. channel: "email"
  8261. }),
  8262. window.open(C[n], "_blank");
  8263. break;
  8264. case A.LINKEDIN:
  8265. }
  8266. }
  8267. function r(e) {
  8268. I.emit(l.LINK_CLICKED, {
  8269. channel: "copylink"
  8270. });
  8271. var t = document.createRange();
  8272. t.selectNodeContents(v);
  8273. var i = window.getSelection();
  8274. i.removeAllRanges(),
  8275. i.addRange(t),
  8276. document.execCommand("copy"),
  8277. y.classList.remove("hidden"),
  8278. v.classList.add("highlighted")
  8279. }
  8280. function o(e) {
  8281. e && (e.stopPropagation(),
  8282. e.target === v) || (window.getSelection().removeAllRanges(),
  8283. v.classList.remove("highlighted"),
  8284. y.classList.add("hidden"))
  8285. }
  8286. var a = e("../../util/browser")
  8287. , s = e("../../localization/localize")
  8288. , l = e("./ShareEvents")
  8289. , c = e("../../util/common")
  8290. , h = e("events").EventEmitter
  8291. , u = document.getElementById("sharing")
  8292. , d = document.getElementById("share-modal")
  8293. , p = document.getElementById("share-close")
  8294. , f = document.getElementById("facebook-share")
  8295. , g = document.getElementById("twitter-share")
  8296. , m = document.getElementById("mail-share")
  8297. , v = document.getElementById("share-url-text")
  8298. , y = document.getElementById("copy-success")
  8299. , A = Object.freeze({
  8300. FACEBOOK: "facebook",
  8301. TWITTER: "twitter",
  8302. MAIL: "mail",
  8303. LINKEDIN: "linkedin"
  8304. })
  8305. , C = {};
  8306. C[A.FACEBOOK] = "http://www.facebook.com/sharer.php?u=" + encodeURIComponent(window.location.href + "&utm_source=1") + "&t=",
  8307. C[A.TWITTER] = "http://twitter.com/intent/tweet?text=",
  8308. C[A.MAIL] = "mailto:?subject=";
  8309. var I = {
  8310. init: function(e) {
  8311. var t = encodeURIComponent(s.SHARE_EXPLORE + e + " " + s.SHARE_AT + " ");
  8312. C[A.FACEBOOK] += t + encodeURIComponent(window.location.href + "&utm_source=1"),
  8313. C[A.TWITTER] += t + encodeURIComponent(window.location.href + "&utm_source=2 " + s.SHARE_WITH + " #port"),
  8314. C[A.MAIL] += encodeURIComponent(s.SHARE_EXPLORE + e + s.SHARE_3D) + "&body=" + t + encodeURIComponent(window.location.href + "&utm_source=3"),
  8315. u.addEventListener("click", this.toggle.bind(this)),
  8316. p.addEventListener("click", this.hide.bind(this)),
  8317. v.addEventListener("click", r),
  8318. d.addEventListener("click", o),
  8319. f.addEventListener("click", n.bind(this, A.FACEBOOK)),
  8320. g.addEventListener("click", n.bind(this, A.TWITTER)),
  8321. m.addEventListener("click", n.bind(this, A.MAIL)),
  8322. v.textContent = window.location.href + "&utm_source=4",
  8323. d.classList.add(a.isMobile() ? "mobile" : "desktop"),
  8324. u.classList.remove("hidden")
  8325. },
  8326. show: function() {
  8327. this.emit(l.OPENED),
  8328. d.classList.add("fadeIn")
  8329. },
  8330. hide: function() {
  8331. d.classList.contains("fadeIn") && (this.emit(l.CLOSED),
  8332. document.selection && document.selection.empty(),
  8333. window.getSelection().removeAllRanges(),
  8334. o(),
  8335. d.classList.remove("fadeIn"))
  8336. },
  8337. toggle: function() {
  8338. d.classList.contains("fadeIn") ? this.hide() : this.show()
  8339. }
  8340. };
  8341. c.extendObject(I, h.prototype),
  8342. t.exports = I
  8343. }
  8344. , {
  8345. "../../localization/localize": 108,
  8346. "../../util/browser": 182,
  8347. "../../util/common": 185,
  8348. "./ShareEvents": 76,
  8349. events: 202
  8350. }],
  8351. 78: [function(e, t, i) {
  8352. "use strict";
  8353. t.exports = Object.freeze({
  8354. OPENED: "terms.opened",
  8355. CLOSED: "terms.closed"
  8356. })
  8357. }
  8358. , {}],
  8359. 79: [function(e, t, i) {
  8360. "use strict";
  8361. var n = e("./TermsEvent")
  8362. , r = e("../../localization/localize")
  8363. , o = e("../../analytics")
  8364. , a = e("../../util/ajax")
  8365. , s = e("../../util/common")
  8366. , l = e("events").EventEmitter
  8367. , c = document.getElementById("terms-modal")
  8368. , h = {
  8369. init: function() {
  8370. $(".footer-terms").on("click", function(e) {
  8371. e.preventDefault(),
  8372. this.show()
  8373. }
  8374. .bind(this)),
  8375. $("#terms-modal .close").on("click", this.hide.bind(this))
  8376. },
  8377. show: function() {
  8378. this.emit(n.OPENED),
  8379. a.get("static/" + r.TERMS_TEXT_FILE).done(function(e) {
  8380. var t = $("#terms-text").html(e);
  8381. o.track("showcase_gui", {
  8382. gui_action: "click_terms_button",
  8383. interaction_source: "gui"
  8384. }),
  8385. t.find("a").attr("target", "_blank")
  8386. }).fail(function() {
  8387. $("#terms-text").html("<h1>" + r.TERMS_OF_USE + "</h1><p>" + r.TERMS_FAIL)
  8388. }),
  8389. c.classList.add("fadeIn")
  8390. },
  8391. hide: function(e) {
  8392. e && e.preventDefault(),
  8393. c.classList.contains("fadeIn") && this.emit(n.CLOSED),
  8394. c.classList.remove("fadeIn")
  8395. }
  8396. };
  8397. s.extendObject(h, l.prototype),
  8398. t.exports = h
  8399. }
  8400. , {
  8401. "../../analytics": 4,
  8402. "../../localization/localize": 108,
  8403. "../../util/ajax": 181,
  8404. "../../util/common": 185,
  8405. "./TermsEvent": 78,
  8406. events: 202
  8407. }],
  8408. 80: [function(e, t, i) {
  8409. "use strict";
  8410. t.exports = Object.freeze({
  8411. OPEN_INFO: "title.open.info",
  8412. CLOSE_INFO: "title.close.info",
  8413. SHOW_INFO: "title.show.info",
  8414. HIDE_INFO: "title.hide.info",
  8415. LINK_CLICKED: "title.link.click",
  8416. CONTACT_LINK_CLICKED: "title.contact.click",
  8417. ORIGIN_LINK_CLICKED: "title.origin.click"
  8418. })
  8419. }
  8420. , {}],
  8421. 81: [function(e, t, i) {
  8422. "use strict";
  8423. var o = e("../../settings");
  8424. t.exports.init = function(e, t) {
  8425. o.tags.enabled && 0 !== Object.keys(e.tags).length && function(t, i) {
  8426. function e(e) {
  8427. t.shouldShowtags = "show" === this.value,
  8428. t.shouldShowtags ? i.showAlltags(o.tags.startup.fadeInDuration) : i.hideAlltags(o.tags.startup.fadeInDuration)
  8429. }
  8430. document.getElementById("tag-toggles").classList.remove("hidden"),
  8431. document.getElementById("radio-tag-show").checked = !0;
  8432. for (var n = document.getElementById("tag-inputs").querySelectorAll("input"), r = 0; r < n.length; r++)
  8433. n[r].addEventListener("change", e)
  8434. }(e, t)
  8435. }
  8436. }
  8437. , {
  8438. "../../settings": 166
  8439. }],
  8440. 82: [function(S, M, e) {
  8441. (function(e) {
  8442. "use strict";
  8443. function i(e) {
  8444. return !(!e || l.inIframe() && document.referrer === e || (E.classList.remove("hidden"),
  8445. _.innerHTML = r.WEBVR_LEARN_MORE + ": ",
  8446. _.appendChild(function(e) {
  8447. var t = document.createElement("a");
  8448. return t.id = "url",
  8449. t.target = "_blank",
  8450. t.href = e,
  8451. t.innerText = e,
  8452. t.addEventListener("click", x.emit.bind(x, a.ORIGIN_LINK_CLICKED)),
  8453. t
  8454. }(e)),
  8455. b.forEach(function(e) {
  8456. e.classList.add("share-link")
  8457. }),
  8458. 0))
  8459. }
  8460. function s(e, t) {
  8461. var i = e
  8462. , n = t;
  8463. return function(e, t) {
  8464. i.push(t || n, e)
  8465. }
  8466. }
  8467. var l = S("../../util/browser")
  8468. , t = S("../../util/common")
  8469. , n = S("../../util/logger")
  8470. , r = S("../../localization/localize")
  8471. , o = S("./titleBarSettings")
  8472. , c = S("../../settings")
  8473. , a = S("./TitleEvents")
  8474. , h = S("events").EventEmitter
  8475. , u = new n(e)
  8476. , d = document.querySelector(".pinTop.left")
  8477. , p = document.getElementsByClassName("title-container")[0]
  8478. , f = document.getElementById("title-toggle").querySelector("i")
  8479. , g = document.getElementById("meta-info-wrapper")
  8480. , m = document.getElementById("meta-info")
  8481. , v = document.getElementById("meta-description")
  8482. , y = document.getElementsByClassName("contact-info")[0]
  8483. , A = document.getElementById("contact-data")
  8484. , C = document.getElementById("addressTxt")
  8485. , I = document.getElementById("tag-toggles")
  8486. , E = document.getElementById("share-origin")
  8487. , _ = document.getElementById("share-link-wrapper")
  8488. , b = [m, g, p]
  8489. , w = !1
  8490. , T = !1
  8491. , x = {
  8492. populate: function(e) {
  8493. if (function(e, t) {
  8494. return e && l.valueFromHash("title", 1) && 2 !== l.valueFromHash("mls", 0) ? (document.getElementsByClassName("titleText")[0].innerText = e,
  8495. (g_weixinObj.title = e).length > o.minTooltipCharacters && p.parentElement.setAttribute("data-original-title", e),
  8496. t && 1 !== c.specialEdition && c.brand && !c.mls ? document.getElementById("cobrandTitle").innerText = t : (document.getElementsByClassName("co-brand")[0].classList.add("hidden"),
  8497. document.getElementById("gui-name").classList.add("noCoBrand"),
  8498. document.getElementById("cobrandTitle").classList.add("hidden")),
  8499. !0) : (document.getElementById("model-title").classList.add("hidden"),
  8500. !1)
  8501. }(DATA.name, e.coBrand)) {
  8502. if (function(e) {
  8503. e ? (w = !0,
  8504. v.innerHTML = e) : v.classList.add("hidden")
  8505. }(e.description),
  8506. function(e, t, i, n) {
  8507. if ((e || t || i) && c.brand && !l.valueFromHash("mls", !1)) {
  8508. w = !0;
  8509. var r = []
  8510. , o = s(r, "<br>");
  8511. if (e && o('<span id="contactName">' + e + "</span>"),
  8512. t) {
  8513. var a = n || t;
  8514. o(l.isMobile() ? '<a id="phone" href="callto:' + t + '">' + a + "</a>" : "<span>" + a + "</span>")
  8515. }
  8516. i && o('<a id="email" href="mailTo:' + i + '">' + i + "</a>"),
  8517. r[0] = "",
  8518. A.innerHTML = r.join("")
  8519. } else
  8520. y.classList.add("hidden")
  8521. }(e.contactName, e.phone, e.email, e.formatted_contact_phone),
  8522. function(e) {
  8523. if ("string" == typeof e)
  8524. try {
  8525. e = JSON.parse(e)
  8526. } catch (e) {
  8527. return u.warn("Unable to parse address data"),
  8528. C.parentElement.classList.add("hidden")
  8529. }
  8530. if (e && (e.address_1 || e.address_2 || e.city || e.state || e.zip)) {
  8531. w = !0;
  8532. var t = []
  8533. , i = s(t, " ");
  8534. e.address_1 && i(e.address_1),
  8535. e.address_2 && i(e.address_2),
  8536. e.city && i(e.city, ", "),
  8537. e.state && i(e.state, ", "),
  8538. e.zip && i(e.zip, e.state ? " " : ", "),
  8539. t[0] = "",
  8540. C.innerText = t.join("")
  8541. } else
  8542. C.parentElement.classList.add("hidden")
  8543. }(e.address),
  8544. w) {
  8545. var t = document.createElement("br");
  8546. I.insertBefore(t, I.firstElementChild)
  8547. }
  8548. e.socialSharing && c.share.enabled && (T = i(e.url))
  8549. }
  8550. },
  8551. finishSetup: function(e) {
  8552. w = w || !!e,
  8553. document.getElementById("title-toggle").addEventListener("click", x.toggleTitle.bind(x)),
  8554. w && p.addEventListener("click", x.toggleMeta.bind(x, !1)),
  8555. [].slice.call(v.querySelectorAll("a")).forEach(function(e) {
  8556. e.addEventListener("click", x.emit.bind(x, a.LINK_CLICKED))
  8557. }),
  8558. [].slice.call(y.querySelectorAll("a")).forEach(function(e) {
  8559. e.addEventListener("click", x.emit.bind(x, a.CONTACT_LINK_CLICKED, {
  8560. contact_type: e.getAttribute("id")
  8561. }))
  8562. }),
  8563. w || (T ? p.classList.add("share-only") : p.classList.add("no-meta"))
  8564. },
  8565. toggleMeta: function(e, t) {
  8566. var i = document.getElementById("model-title");
  8567. t && t.preventDefault();
  8568. var n = m.classList.contains("expand");
  8569. e && !n || (n ? (b.forEach(function(e) {
  8570. e.classList.remove("expand")
  8571. }),
  8572. this.emit(a.CLOSE_INFO),
  8573. i.classList.remove("expand")) : (b.forEach(function(e) {
  8574. e.classList.add("expand")
  8575. }),
  8576. i.classList.add("expand"),
  8577. this.emit(a.OPEN_INFO)))
  8578. },
  8579. setupToggling: function() {
  8580. g.style.height = m.offsetHeight + "px",
  8581. m.addEventListener("transitionend", function() {
  8582. g.style.height = m.offsetHeight + "px"
  8583. })
  8584. },
  8585. toggleTitle: function(e) {
  8586. e && e.preventDefault(),
  8587. d.classList.contains("closed") ? (d.classList.add("open"),
  8588. f.classList.remove("icon-dpad-right"),
  8589. f.classList.add("icon-dpad-left"),
  8590. this.emit(a.SHOW_INFO),
  8591. setTimeout(function() {
  8592. d.classList.remove("closed"),
  8593. d.classList.remove("open")
  8594. }, o.removeAnimationClasses)) : (d.classList.add("closed"),
  8595. f.classList.remove("icon-dpad-left"),
  8596. f.classList.add("icon-dpad-right"),
  8597. this.emit(a.HIDE_INFO))
  8598. }
  8599. };
  8600. t.extendObject(x, h.prototype),
  8601. M.exports = x
  8602. }
  8603. ).call(this, "/js/gui/title/titleBar.js")
  8604. }
  8605. , {
  8606. "../../localization/localize": 108,
  8607. "../../settings": 166,
  8608. "../../util/browser": 182,
  8609. "../../util/common": 185,
  8610. "../../util/logger": 189,
  8611. "./TitleEvents": 80,
  8612. "./titleBarSettings": 83,
  8613. events: 202
  8614. }],
  8615. 83: [function(e, t, i) {
  8616. "use strict";
  8617. t.exports = Object.freeze({
  8618. minTooltipCharacters: 19,
  8619. removeAnimationClasses: 500
  8620. })
  8621. }
  8622. , {}],
  8623. 84: [function(e, t, i) {
  8624. "use strict";
  8625. function n() {
  8626. v.playTour(),
  8627. y && clearTimeout(y),
  8628. c(),
  8629. E.removeClass("fadeIn")
  8630. }
  8631. function r() {
  8632. A.classList.contains("playing") && (v.stopTour(),
  8633. E.addClass("fadeIn"),
  8634. setTimeout(function() {
  8635. E.removeClass("fadeIn")
  8636. }, h.tourInteraction.showPauseButton),
  8637. M || (clearTimeout(y),
  8638. y = setTimeout(s, h.tourInteraction.showModal)),
  8639. setTimeout(function() {
  8640. A.classList.remove("playing")
  8641. }, h.tourInteraction.allowNextClick))
  8642. }
  8643. function o() {
  8644. v.tourInProgress && (v.stopTour(),
  8645. v.endTourProgress(),
  8646. A.classList.remove("playing"))
  8647. }
  8648. function a() {
  8649. _.is(":visible") ? n() : r()
  8650. }
  8651. function s() {//去掉导览结束时的提示
  8652. /* if (!h.tourInteraction.disabled) {
  8653. T.removeClass("small landing " + d.FLOORPLAN + " " + d.OUTDOOR + " " + d.PANORAMA),
  8654. T.addClass("fadeIn tour " + p.deviceType);
  8655. var e, t = h.tourInteraction.smallModal ? m.SMALL : m.LARGE;
  8656. if (!h.tourInteraction.smallModal)
  8657. 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,
  8658. p.fill(x, g.TOUR_INTERACTION[e]),
  8659. T.addClass(e);
  8660. T.addClass(t)
  8661. } */
  8662. }
  8663. function l(e, t) {
  8664. if (t) {
  8665. var i = "keydown" === t.type
  8666. , n = t.which === u.SPACE || v.tourIsPlaying;
  8667. i && n || e || (M = !0),
  8668. v.atEndOfTour() && c(),
  8669. !v.tourIsPlaying && v.tourInProgress && (E.removeClass("fadeIn"),
  8670. c(),
  8671. t.which !== u.SPACE && o()),
  8672. i && n && a()
  8673. }
  8674. }
  8675. function c() {
  8676. T.removeClass("fadeIn")
  8677. }
  8678. var h = (e("../util/browser"),
  8679. e("../settings"))
  8680. , u = e("../enum/Keys")
  8681. , d = e("../enum/Viewmode")
  8682. , p = (e("./helpManager"),
  8683. e("./populateModal"))
  8684. , f = e("../enum/DirectorEvents")
  8685. , g = e("../enum/HelpModalType")
  8686. , m = e("../enum/HelpModalSize")
  8687. , v = null
  8688. , y = null
  8689. , A = document.getElementById("pause-overlay")
  8690. , C = document.getElementById("player")
  8691. , I = document.getElementById("gui")
  8692. , E = $("#pause-icon").eq(0)
  8693. , _ = $("#play").eq(0)
  8694. , b = $("#playHead").eq(0)
  8695. , w = $(".rightViewContainer, #previous, #next, #gui-modes-inside, #gui-modes-outside, #gui-modes-dollhouse, #gui-modes-floorplan").toArray()
  8696. , T = $("#interaction-modal").eq(0)
  8697. , x = $("#interaction-modal .interaction").toArray()
  8698. , S = ["touchstart", "mousedown", "pointerdown"]
  8699. , M = !1;
  8700. t.exports.init = function(e) {
  8701. v = e,
  8702. S.forEach(function(t) {
  8703. C.addEventListener(t, l.bind(this, !1), !0),
  8704. I.addEventListener(t, l.bind(this, !0), !0),
  8705. A.addEventListener(t, r, !0),
  8706. w.forEach(function(e) {
  8707. e.addEventListener(t, o, !0)
  8708. }),
  8709. $("#drawer img").on(t, o)
  8710. }),
  8711. document.addEventListener("keydown", l.bind(this, !1), !0),
  8712. v.on(f.TourStart, function() {
  8713. A.classList.add("playing")
  8714. })
  8715. }
  8716. ,
  8717. t.exports.play = n,
  8718. t.exports.pause = r,
  8719. t.exports.pauseWithoutCTA = o,
  8720. t.exports.togglePlay = a,
  8721. t.exports.stopTour = function() {
  8722. b.hasClass("playing") && (clearTimeout(y),
  8723. v.atEndOfTour() ? (A.classList.remove("playing"),
  8724. s()) : E.removeClass("fadeIn"))
  8725. }
  8726. ,
  8727. t.exports.dismissModal = c
  8728. }
  8729. , {
  8730. "../enum/DirectorEvents": 23,
  8731. "../enum/HelpModalSize": 27,
  8732. "../enum/HelpModalType": 28,
  8733. "../enum/Keys": 30,
  8734. "../enum/Viewmode": 51,
  8735. "../settings": 166,
  8736. "../util/browser": 182,
  8737. "./helpManager": 68,
  8738. "./populateModal": 75
  8739. }],
  8740. 85: [function(e, t, i) {
  8741. "use strict";
  8742. t.exports = Object.freeze({
  8743. OPENED: "vr.modal.opened",
  8744. LAUNCH: "vr.modal.launch",
  8745. CLOSED: "vr.modal.closed",
  8746. NEXT: "vr.modal.next",
  8747. PREV: "vr.modal.prev",
  8748. STORE: "vr.modal.store",
  8749. falseICECHOSEN: "vr.modal.device"
  8750. })
  8751. }
  8752. , {}],
  8753. 86: [function(e, t, i) {
  8754. "use strict";
  8755. var h = e("../../util/browser")
  8756. , u = e("../../enum/VRApps")
  8757. , n = e("../../enum/VRPlatforms")
  8758. , d = e("../../util/ajax")
  8759. , p = e("../../settings")
  8760. , r = {};
  8761. for (var o in r[u.CardboardAndroid] = "https://play.google.com/store/apps/details?id=com.port.mpvrcardboard&redirect_uri=",
  8762. r[u.CardboardIOS] = "https://itunes.apple.com/us/app/port-vr/id1168808473&redirect_uri=",
  8763. r[u.GearVR] = "https://www.oculus.com/experiences/gear-vr/811670972252145/?redirect_uri=",
  8764. u) {
  8765. var a = u[o];
  8766. r[a] += encodeURIComponent(document.referrer + "&display=" + a)
  8767. }
  8768. var s, f = {}, g = (-1 === (s = window.location.host).indexOf(".port.com") && -1 === s.indexOf("localhost") && (s = "my.port.com"),
  8769. "https://" + s);
  8770. t.exports.init = function(e, t, o) {
  8771. function a(e, t, i, n) {
  8772. function r() {
  8773. return "&utm_medium=" + (h.inIframe() ? "embed" : "direct") + ("&utm_source=" + s) + ("&utm_showcase_session_id=" + o)
  8774. }
  8775. 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()
  8776. }
  8777. var s = h.inIframe() ? encodeURIComponent(document.referrer) : encodeURIComponent(window.location.href)
  8778. , l = g + "/vr/dlist/?ret=" + s
  8779. , c = g + "/vr/show/?ret=" + s;
  8780. switch (e) {
  8781. case n.IOS:
  8782. !function(t, e, i, n) {
  8783. var r = a(t, e, i, n)
  8784. , o = {
  8785. responseType: "json",
  8786. data: {
  8787. branch_key: p.appConfig.branch_key,
  8788. data: {
  8789. m: e,
  8790. full_url: r,
  8791. $desktop_url: "",
  8792. $og_app_id: "331853976762864119",
  8793. $og_title: i,
  8794. $og_description: n,
  8795. $og_image_url: location.origin + "/api/v1/player/models/" + e + "/thumb",
  8796. $canonical_url: window.location.href
  8797. }
  8798. }
  8799. };
  8800. d.post("https://api.branch.io/v1/url", o).done(function(e) {
  8801. f[t] = e.url
  8802. }).fail(function(e) {
  8803. f[t] = e
  8804. }
  8805. .bind(this, r))
  8806. }(u.CardboardIOS, t.sid, t.name, t.summary);
  8807. break;
  8808. default:
  8809. !function(e, t, i) {
  8810. for (var n in u) {
  8811. var r = u[n]
  8812. , o = a(r, e, t, i);
  8813. f[r] = o
  8814. }
  8815. }(t.sid, t.name, t.summary)
  8816. }
  8817. }
  8818. ,
  8819. t.exports.launch = function(e) {
  8820. var t = f[e];
  8821. window.open(t, "_blank")
  8822. }
  8823. ,
  8824. t.exports.launchStore = function(e) {
  8825. var t = r[e];
  8826. window.open(t, "_blank")
  8827. }
  8828. }
  8829. , {
  8830. "../../enum/VRApps": 46,
  8831. "../../enum/VRPlatforms": 49,
  8832. "../../settings": 166,
  8833. "../../util/ajax": 181,
  8834. "../../util/browser": 182
  8835. }],
  8836. 87: [function(e, t, i) {
  8837. "use strict";
  8838. function c(e) {
  8839. var t;
  8840. switch (e) {
  8841. case y.IOS:
  8842. return 9 < (t = g.iosVersion()).major || 9 === t.major && 1 <= t.minor;
  8843. case y.Android:
  8844. return 4 < (t = g.androidVersion()).major || 4 === t.major && 4 < t.minor || 4 === t.major && 4 === t.minor && 4 <= t.patch
  8845. }
  8846. return !1
  8847. }
  8848. function h(e) {
  8849. switch (e) {
  8850. case y.Android:
  8851. x.filter(".cardboard").off().on("click", q.cardboardAndroid),
  8852. x.filter(".gearvr").off().on("click", q.gear),
  8853. n(k, U, "logo-button", "same-line");
  8854. break;
  8855. case y.UnsupportedAndroid:
  8856. n("", H, "", "");
  8857. break;
  8858. case y.IOS:
  8859. x.filter(".cardboard").off().on("click", q.cardboardIOS),
  8860. n(k, "", "logo-button", "");
  8861. break;
  8862. case y.Desktop:
  8863. x.filter(".cardboard").off().on("click", r.bind(this, null, N, B)),
  8864. x.filter(".gearvr").off().on("click", r.bind(this, U, F, null)),
  8865. n(k, U, "logo-button", "same-line"),
  8866. Q.cardboard()
  8867. }
  8868. }
  8869. function u(e) {
  8870. $(".p1, .p2, .p3").hide(),
  8871. l.insertAfter(T),
  8872. w.removeClass("front-page"),
  8873. w.removeClass("details-page"),
  8874. w.removeClass("lastPage"),
  8875. x.removeClass("logo-button"),
  8876. x.removeClass("same-line"),
  8877. T.removeClass("headsetOptions"),
  8878. S.attr("src", ""),
  8879. S.filter(".second").removeClass("gear"),
  8880. S.css("display", "inline-block"),
  8881. S.off(),
  8882. M.filter(".second").css("display", ""),
  8883. O.css("display", "none"),
  8884. $(".p" + (e + 1) + _).show(),
  8885. S.filter(".third").insertBefore(M.filter(".third"))
  8886. }
  8887. function n(e, t, i, n) {
  8888. w.addClass("front-page"),
  8889. S.filter(".first").attr("src", e),
  8890. S.filter(".second").attr("src", t),
  8891. x.filter(".first").addClass(i),
  8892. x.filter(".second").addClass(i),
  8893. x.addClass(n),
  8894. ".show-desktop" === _ && T.insertAfter(l)
  8895. }
  8896. function r(e, t, i) {
  8897. T.addClass("headsetOptions"),
  8898. x.off(),
  8899. S.filter(".second").attr("src", t),
  8900. O.css("display", "block"),
  8901. M.filter(".second").css("display", "none"),
  8902. O.on("click", function() {
  8903. u(b.Title),
  8904. h(y.Desktop)
  8905. }),
  8906. e && (X.emit(C.falseICECHOSEN, {
  8907. name: v.GearVR
  8908. }),
  8909. S.filter(".first").attr("src", e),
  8910. S.filter(".second").addClass("gear"),
  8911. S.filter(".second").on("click", m.launchStore.bind(this, v.GearVR)),
  8912. Q.gearvr()),
  8913. i && (X.emit(C.falseICECHOSEN, {
  8914. name: v.Cardboard
  8915. }),
  8916. S.filter(".third").attr("src", i),
  8917. S.filter(".third").show(),
  8918. S.filter(".third").insertAfter(S.filter(".second")),
  8919. S.filter(".third").addClass("link"),
  8920. S.filter(".second").addClass("link"),
  8921. S.filter(".second").on("click", m.launchStore.bind(this, v.CardboardIOS)),
  8922. S.filter(".third").on("click", m.launchStore.bind(this, v.CardboardAndroid)),
  8923. Q.cardboard())
  8924. }
  8925. function d(e, t) {
  8926. switch (t) {
  8927. case y.IOS:
  8928. j = W,
  8929. Y = G;
  8930. break;
  8931. case y.Desktop:
  8932. e === b.Cardboard ? (j = N,
  8933. Y = B,
  8934. S.filter(".second").on("click", m.launchStore.bind(this, v.CardboardIOS)),
  8935. S.filter(".third").on("click", m.launchStore.bind(this, v.CardboardAndroid))) : (j = F,
  8936. S.filter(".second").on("click", m.launchStore.bind(this, v.GearVR)),
  8937. Y = "");
  8938. break;
  8939. default:
  8940. Y = e === b.Cardboard ? (j = H,
  8941. G) : (j = V,
  8942. z)
  8943. }
  8944. }
  8945. function p(e, t, i) {
  8946. w.find(".inner").addClass("details-page"),
  8947. w.addClass("details-page"),
  8948. S.filter(".first").attr("src", e),
  8949. S.filter(".second").attr("src", t),
  8950. S.filter(".third").attr("src", i)
  8951. }
  8952. function f() {
  8953. var e = 1 < g.aspectRatio() && g.isMobile();
  8954. w.toggleClass("landscape", e).toggleClass("portrait", !e),
  8955. w.toggleClass("tiny", $("#player").height() <= o.narrowLandscapeHeight),
  8956. w.toggleClass("tinier", $("#player").height() <= o.reallyNarrowLandscapeHeight)
  8957. }
  8958. var g = e("../../util/browser")
  8959. , m = e("./vrLink")
  8960. , v = e("../../enum/VRApps")
  8961. , y = e("../../enum/VRPlatforms")
  8962. , A = e("../../enum/VRPages")
  8963. , C = e("./vrEvent")
  8964. , o = (e("../../settings"),
  8965. e("../../constants"))
  8966. , I = e("../../localization/localize")
  8967. , a = e("../../util/common")
  8968. , s = e("events").EventEmitter
  8969. , E = 0
  8970. , _ = null
  8971. , b = A.standard
  8972. , w = $(".vr-popup")
  8973. , l = w.find(".vr-popup-body")
  8974. , T = w.find(".vr-images")
  8975. , x = w.find(".img-container")
  8976. , S = w.find(".vr-sm-image")
  8977. , M = x.find(".vr-img-caption")
  8978. , R = $(".vr-buttons").find(".prev-button")
  8979. , P = $(".vr-buttons").find(".next-button")
  8980. , O = T.find(".front-close")
  8981. , L = $(".vr-page")
  8982. , D = w.find("img")
  8983. , N = "images/apple-store.png"
  8984. , F = "images/badge-oculus.png"
  8985. , B = "images/badge-cardboard.png"
  8986. , V = "images/logo-samsung.png"
  8987. , k = "images/headset-cardboard.png"
  8988. , U = "images/headset-gearvr.png"
  8989. , H = "images/ico-android-robot.png"
  8990. , z = "images/ico-gearvr.png"
  8991. , G = "images/ico-vr.png"
  8992. , W = "images/apple-logo-white.svg"
  8993. , j = null
  8994. , Y = null
  8995. , q = {}
  8996. , X = {
  8997. init: function(e, t) {
  8998. function i(e) {
  8999. X.emit(C.STORE, {
  9000. type: e
  9001. }),
  9002. m.launchStore(e)
  9003. }
  9004. function n(e) {
  9005. switch (e !== b.pageCount && (u(e),
  9006. L.text(e + 1 + " / " + b.pageCount)),
  9007. e) {
  9008. case b.Title:
  9009. R.css("display", "none"),
  9010. P.text(a[e]),
  9011. h(r);
  9012. break;
  9013. case b.Cardboard:
  9014. R.css("display", "block"),
  9015. P.text(a[e]),
  9016. x.filter(".cardboard").off(),
  9017. x.filter(".gearvr").off(),
  9018. d(e, r),
  9019. p(k, j, Y);
  9020. break;
  9021. case b.Gear:
  9022. P.text(a[e]),
  9023. d(e, r),
  9024. w.addClass("lastPage"),
  9025. p(U, j, Y);
  9026. break;
  9027. case b.pageCount:
  9028. w.removeClass("fadeIn"),
  9029. X.emit(C.CLOSED)
  9030. }
  9031. D.filter("[src='']").hide()
  9032. }
  9033. var r = g.detectAndroid() ? g.detectAndroidMobile() && c(y.Android) ? (w.addClass("supported"),
  9034. _ = ".show-supported",
  9035. y.Android) : (w.addClass("unsupported"),
  9036. _ = ".show-unsupported",
  9037. y.UnsupportedAndroid) : g.detectIPhone() || g.detectIPod() ? (w.addClass("ios"),
  9038. _ = ".show-ios",
  9039. b = A.ios,
  9040. y.IOS) : (w.addClass("desktop"),
  9041. _ = ".show-desktop",
  9042. y.Desktop);
  9043. function o(e) {
  9044. X.emit(C.LAUNCH, {
  9045. vr_platform: r,
  9046. vr_app: e
  9047. }),
  9048. m.launch(e)
  9049. }
  9050. m.init(r, e, t),
  9051. r !== y.Desktop && w.addClass("mobile"),
  9052. q.cardboardAndroid = o.bind(this, v.CardboardAndroid),
  9053. q.gear = o.bind(this, v.GearVR),
  9054. q.cardboardIOS = o.bind(this, v.CardboardIOS),
  9055. f(),
  9056. $(".show-supported, .show-unsupported, .show-ios, .show-desktop").hide(),
  9057. $(_).show();
  9058. var a = [I.VR_LEARN_MORE_CAPS, I.VR_NEXT_CAPS, I.VR_GOT_IT_CAPS]
  9059. , s = ["vr_modal_learn_more", "vr_modal_next", "vr_modal_done"];
  9060. r === y.IOS && (a.splice(1, 1),
  9061. s.splice(1, 1)),
  9062. $("#vr").on("click", function(e) {
  9063. e.preventDefault(),
  9064. window.vrEnabled || (window.vrEnabled = !0,
  9065. this.classList.add("active"),
  9066. $("#gui div").not("#vrOff").addClass("vrHide"),
  9067. $("#vrOffImg").css({
  9068. display: "inline-block"
  9069. }))
  9070. }),
  9071. $("#vrOff").on("click", function() {
  9072. window.vrEnabled = !1,
  9073. $("#gui div").not("#vrOff").removeClass("vrHide"),
  9074. $("#vrOffImg").css({
  9075. display: "none"
  9076. }),
  9077. $("#player canvas").css({
  9078. width: "",
  9079. height: ""
  9080. }),
  9081. $("#vr").removeClass("active")
  9082. });
  9083. var l = "https://my.port.com/vr/show/?m=" + e.sid;
  9084. r === y.IOS ? $(".cardboardLink").on("click", i.bind(this, v.CardboardIOS)) : $(".cardboardLink").on("click", i.bind(this, v.CardboardAndroid)),
  9085. $(".gearLink").on("click", i.bind(this, v.GearVR)),
  9086. $("span.modelLink").text(l),
  9087. R.on("click", function(e) {
  9088. X.emit(C.PREV),
  9089. n(--E)
  9090. }),
  9091. P.on("click", function(e) {
  9092. P.text(),
  9093. X.emit(C.NEXT, {
  9094. nextAction: s[E]
  9095. }),
  9096. n(++E)
  9097. }),
  9098. w.find(".close").on("click", X.dismiss)
  9099. },
  9100. dismiss: function() {
  9101. w.hasClass("fadeIn") && (w.removeClass("fadeIn"),
  9102. X.emit(C.CLOSED))
  9103. },
  9104. isDeviceSupported: c
  9105. };
  9106. a.extendObject(X, s.prototype),
  9107. $(window).resize(f);
  9108. var Z, K, Q = (Z = M.filter(".first").find(".cardboard"),
  9109. K = M.filter(".first").find(".gearvr"),
  9110. {
  9111. cardboard: function() {
  9112. K.addClass("hidden"),
  9113. Z.removeClass("hidden")
  9114. },
  9115. gearvr: function() {
  9116. Z.addClass("hidden"),
  9117. K.removeClass("hidden")
  9118. }
  9119. });
  9120. t.exports = X
  9121. }
  9122. , {
  9123. "../../constants": 8,
  9124. "../../enum/VRApps": 46,
  9125. "../../enum/VRPages": 48,
  9126. "../../enum/VRPlatforms": 49,
  9127. "../../localization/localize": 108,
  9128. "../../settings": 166,
  9129. "../../util/browser": 182,
  9130. "../../util/common": 185,
  9131. "./vrEvent": 85,
  9132. "./vrLink": 86,
  9133. events: 202
  9134. }],
  9135. 88: [function(e, t, i) {
  9136. "use strict";
  9137. t.exports = Object.freeze({
  9138. OPENED: "webvr.modal.opened",
  9139. SHOW_TERMS: "webvr.footer.show.terms"
  9140. })
  9141. }
  9142. , {}],
  9143. 89: [function(B, V, e) {
  9144. (function(e) {
  9145. "use strict";
  9146. function a() {
  9147. function t() {
  9148. p.isPresenting || (r.info("exiting webVR"),
  9149. c("webvr_exit_app"),
  9150. -1 === window.location.search.indexOf("&qs=1") ? window.location = window.location + "&qs=1" : window.location = window.location,
  9151. window.removeEventListener("vrdisplaypresentchange", t))
  9152. }
  9153. r.info("Headset mounted"),
  9154. u.suspend();
  9155. var e = document.createElement("canvas");
  9156. for (e.getContext("webgl"),
  9157. e.className = "webvr-canvas",
  9158. document.bgColor = "#000",
  9159. document.body.style.backgroundColor = "#000"; document.body.firstChild; )
  9160. document.body.removeChild(document.body.firstChild);
  9161. document.body.appendChild(e),
  9162. c("webvr_enter_app"),
  9163. p.requestPresent([{
  9164. source: e,
  9165. predistorted: !0
  9166. }]).catch(function(e) {
  9167. r.error("Failed to present: " + e),
  9168. c("webvr_exit_calibrate"),
  9169. t()
  9170. }),
  9171. d.then(function() {
  9172. window.dispatchEvent(new Event("vrapp-start"))
  9173. }),
  9174. window.addEventListener("vrdisplaypresentchange", t)
  9175. }
  9176. function s() {
  9177. c("webvr_modal_close"),
  9178. _.find(".enter-button").off("click", a),
  9179. E.fadeOut(g.guiAnimationSpeed, function() {
  9180. _.toggleClass("hidden", !1),
  9181. b.toggleClass("hidden", !0),
  9182. f.exitFullscreen()
  9183. }),
  9184. I.fadeIn(g.guiAnimationSpeed)
  9185. }
  9186. function t() {
  9187. M.toggleClass("hidden", !0),
  9188. S.toggleClass("hidden", !1)
  9189. }
  9190. function l() {
  9191. _.toggleClass("hidden"),
  9192. b.toggleClass("hidden")
  9193. }
  9194. function c(e) {
  9195. var t = f.isLandscape() ? "landscape" : "portrait";
  9196. i.trackAlways("showcase_gui", {
  9197. gui_action: e,
  9198. orientation: t
  9199. })
  9200. }
  9201. function h() {
  9202. var e = f.isLandscape();
  9203. E.toggleClass("landscape", e).toggleClass("portrait", !e)
  9204. }
  9205. var u, d, p, f = B("../../util/browser"), g = B("../../settings"), m = (B("./../gui"),
  9206. B("../../enum/VRPlatforms")), v = B("../../enum/VRApps"), y = B("./../vr/vrLink"), A = B("./WebVrEvent"), i = B("../../analytics"), C = (B("../../constants"),
  9207. 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 = {
  9208. init: function(e, t, i, n) {
  9209. function r(e) {
  9210. e.preventDefault(),
  9211. o(e.currentTarget.id)
  9212. }
  9213. function o(i) {
  9214. F[i](),
  9215. Object.keys(F).map(function(e, t) {
  9216. $("#" + e).toggleClass("tabs-underlined", e === i)
  9217. })
  9218. }
  9219. p = i,
  9220. u = t,
  9221. y.init(m.Android, e, n),
  9222. h(),
  9223. new RegExp("daydream","i").test(p.displayName) ? (o("tabdaydream"),
  9224. w.filter(".device-headset-side").attr("src", "images/device-daydream-side.png"),
  9225. _.find(".title").text(C.localizeText("WEBVR_FOR_DAYDREAM"))) : (o("tabcardboard"),
  9226. w.filter(".device-headset-side").attr("src", R),
  9227. _.find(".title").text(C.localizeText("WEBVR_FOR_CARDBOARD"))),
  9228. $("#vr").on("click", function(e) {
  9229. e.preventDefault(),
  9230. c("click_webvr_button"),
  9231. E.is(":hidden") && (N.emit(A.OPENED),
  9232. I.fadeOut(g.guiAnimationSpeed),
  9233. E.fadeIn(g.guiAnimationSpeed),
  9234. function() {
  9235. if (!d) {
  9236. var n = "https://static.port.com/webvr/" + (f.valueFromHash("webvr") || g.appConfig.webvr_version) + "/js/main.js";
  9237. d = new Promise(function(e, t) {
  9238. var i = document.createElement("script");
  9239. i.type = "text/javascript",
  9240. i.src = n,
  9241. i.onload = e,
  9242. document.head.appendChild(i)
  9243. }
  9244. )
  9245. }
  9246. _.find(".enter-button").on("click", a)
  9247. }())
  9248. }),
  9249. $(".webvr-popup .close").on("click", function(e) {
  9250. e.preventDefault(),
  9251. _.hasClass("hidden") ? (c("webvr_help_close"),
  9252. l()) : s()
  9253. }),
  9254. $("#tabcardboard").on("click", r),
  9255. $("#tabdaydream").on("click", r),
  9256. $("#tabnative").on("click", r),
  9257. $(".webvr-popup .open-with-app").on("click", function(e) {
  9258. e.preventDefault(),
  9259. c("webvr_learn_more"),
  9260. o("tabnative"),
  9261. l()
  9262. }),
  9263. $(".webvr-popup .help").on("click", function(e) {
  9264. e.preventDefault(),
  9265. c(_.hasClass("hidden") ? "webvr_help_close" : "webvr_help_show"),
  9266. l()
  9267. }),
  9268. $(".webvr-popup .terms").on("click", function(e) {
  9269. e.preventDefault(),
  9270. c("webvr_click_terms"),
  9271. s(),
  9272. N.emit(A.SHOW_TERMS)
  9273. }),
  9274. T.on("click", function(e) {
  9275. e.preventDefault(),
  9276. c(D),
  9277. window.open(L, "_blank")
  9278. }),
  9279. x.on("click", function(e) {
  9280. e.preventDefault(),
  9281. c("webvr_phone_link"),
  9282. window.open("https://vr.google.com/daydream/phones/", "_blank")
  9283. }),
  9284. $(".webvr-popup .badge-cardboard").on("click", function(e) {
  9285. e.preventDefault(),
  9286. c("webvr_cardboard_link"),
  9287. y.launch(v.CardboardAndroid)
  9288. }),
  9289. $(".webvr-popup .badge-oculus").on("click", function(e) {
  9290. e.preventDefault(),
  9291. c("webvr_oculus_link"),
  9292. y.launch(v.GearVR)
  9293. })
  9294. }
  9295. }, F = {
  9296. tabcardboard: function() {
  9297. w.filter(".device-headset").attr("src", R),
  9298. w.filter(".device-phone").attr("src", "images/ico-android-robot.png"),
  9299. L = "https://vr.google.com/cardboard/get-cardboard/",
  9300. D = "webvr_cardboard_link",
  9301. T.text(C.localizeText("VR_GOOGLE_CARDBOARD")),
  9302. x.text(C.localizeText("VR_COMPATIBLE_ANDROID_LONG")),
  9303. $(".webvr-popup .detail.daydream-label").toggleClass("hidden", !0),
  9304. t()
  9305. },
  9306. tabdaydream: function() {
  9307. w.filter(".device-headset").attr("src", "images/device-daydream.png"),
  9308. w.filter(".device-phone").attr("src", "images/device-pixel.png"),
  9309. L = P,
  9310. D = O,
  9311. T.text(C.localizeText("WEBVR_DAYDREAM_VIEW")),
  9312. x.text(C.localizeText("VR_NEED_DAYDREAM_PHONE")),
  9313. $(".webvr-popup .detail.daydream-label").toggleClass("hidden", !1),
  9314. t()
  9315. },
  9316. tabnative: function() {
  9317. w.filter(".badge-cardboard").attr("src", "images/badge-cardboard.png"),
  9318. w.filter(".badge-oculus").attr("src", "images/badge-oculus.png"),
  9319. M.toggleClass("hidden", !1),
  9320. S.toggleClass("hidden", !0)
  9321. }
  9322. };
  9323. n.extendObject(N, o.prototype),
  9324. $(window).resize(h),
  9325. V.exports = N
  9326. }
  9327. ).call(this, "/js/gui/webvr/webVRgui.js")
  9328. }
  9329. , {
  9330. "../../analytics": 4,
  9331. "../../constants": 8,
  9332. "../../enum/VRApps": 46,
  9333. "../../enum/VRPlatforms": 49,
  9334. "../../localization/localize": 108,
  9335. "../../settings": 166,
  9336. "../../util/browser": 182,
  9337. "../../util/common": 185,
  9338. "../../util/logger": 189,
  9339. "./../gui": 65,
  9340. "./../vr/vrLink": 86,
  9341. "./WebVrEvent": 88,
  9342. events: 202
  9343. }],
  9344. 90: [function(e, t, i) {
  9345. "use strict";
  9346. function n(e, t, i, n, r) {
  9347. this.floorId = n || 0 === n ? n : -1,
  9348. this.roomId = r || "",
  9349. this.labelId = e,
  9350. this.position = (new o.Vector3).copy(t),
  9351. this.text = i
  9352. }
  9353. var o = e("three")
  9354. , r = e("../util/browser");
  9355. n.prototype.build = function() {
  9356. var e = window.document.createElement("div");
  9357. r.isMobile() ? e.setAttribute("class", "gui-floorplan-label gui-floorplan-label-mobile") : e.setAttribute("class", "gui-floorplan-label");
  9358. var t = window.document.createElement("div");
  9359. t.setAttribute("class", "gui-floorplan-label-text");
  9360. var i = window.document.createTextNode(this.text);
  9361. t.appendChild(i),
  9362. e.appendChild(t),
  9363. window.document.body.appendChild(e),
  9364. this.labelGui = e,
  9365. this.textBlock = t,
  9366. $(this.labelGui).hide();
  9367. var n = window.getComputedStyle(this.labelGui);
  9368. this.initialTransform = n.transform || n.webkitTransform
  9369. }
  9370. ,
  9371. t.exports = n
  9372. }
  9373. , {
  9374. "../util/browser": 182,
  9375. three: 217
  9376. }],
  9377. 91: [function(e, t, i) {
  9378. "use strict";
  9379. function n() {
  9380. this.player = null,
  9381. this.modelManager = null,
  9382. this.container = null
  9383. }
  9384. var c, o, r = e("three"), a = (e("../util/common"),
  9385. e("../enum/PlayerEvents")), s = (e("../enum/DirectorEvents"),
  9386. e("../enum/ModelManagerEvents")), l = e("../settings"), h = e("../enum/Viewmode"), u = (e("../enum/WarpStyle"),
  9387. e("../util/transitions"),
  9388. e("../util/lerp"),
  9389. e("../util/browser"));
  9390. n.prototype.init = function(e, t, i) {
  9391. this.player = e,
  9392. this.modelManager = t,
  9393. this.container = i,
  9394. this.updateModel(),
  9395. this.bindEvents()
  9396. }
  9397. ,
  9398. n.prototype.bindEvents = function() {
  9399. this.modelManager.on(s.ActiveModelChanged, this.updateModel.bind(this)),
  9400. this.player.on(a.ViewChanged, this.handlePlayerViewChanged.bind(this)),
  9401. this.player.on(a.ModeChanged, this.handlePlayerViewChanged.bind(this)),
  9402. this.player.on(a.StartInside, this.handleStartInside.bind(this)),
  9403. this.player.on(a.StartOutside, this.handleStartOutside.bind(this))
  9404. }
  9405. ,
  9406. n.prototype.updateModel = function() {
  9407. this.model = this.modelManager.getActiveModel()
  9408. }
  9409. ,
  9410. n.prototype.handlePlayerViewChanged = function() {
  9411. this.updateLabelVisibility(),
  9412. this.updateLabelDisplay()
  9413. }
  9414. ,
  9415. n.prototype.getLabelsForFloor = function(t, i) {
  9416. return (i = i || []).length = 0,
  9417. this.model.labels.forEach(function(e) {
  9418. this.labelVisibleForFloor(e, t) && i.push(e)
  9419. }
  9420. .bind(this)),
  9421. i
  9422. }
  9423. ,
  9424. n.prototype.getLabelsForCurrentFloor = function(e) {
  9425. return this.getLabelsForFloor(this.model.currentFloor.floorIndex, e)
  9426. }
  9427. ,
  9428. n.prototype.labelVisibleForFloor = function(e, t) {
  9429. var i = u.isMobile() && this.player.getLabelScaleFactor() < l.labels.zoomHideThreshhold.mobile || !u.isMobile() && this.player.getLabelScaleFactor() < l.labels.zoomHideThreshhold.desktop;
  9430. if (!this.model.showingLabels || !e.labelGui || !i)
  9431. return !1;
  9432. var n = e.floorId === this.model.floors.size() - 1;
  9433. return this.model.allFloorsVisible ? n : e.floorId === t
  9434. }
  9435. ,
  9436. n.prototype.updateLabelVisibility = function(e) {
  9437. this.model.labels.forEach(function(e) {
  9438. 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)
  9439. }
  9440. .bind(this))
  9441. }
  9442. ,
  9443. n.prototype.showAllLabels = function(t, i) {
  9444. this.model.labels.forEach(function(e) {
  9445. this.showLabel(e, t, i)
  9446. }
  9447. .bind(this))
  9448. }
  9449. ,
  9450. n.prototype.hideAllLabels = function(t, i) {
  9451. this.model.labels.forEach(function(e) {
  9452. this.hideLabel(e, t, i)
  9453. }
  9454. .bind(this))
  9455. }
  9456. ,
  9457. n.prototype.showLabel = function(e, t, i) {
  9458. this.model.showingLabels && (e.visible || (e.visible = !0,
  9459. e.labelGui.style.display = "block",
  9460. e.labelGui.style.opacity = 0,
  9461. $(e.labelGui).delay(t).fadeTo(i, 1)))
  9462. }
  9463. ,
  9464. n.prototype.hideLabel = function(e, t, i) {
  9465. e.visible && (e.visible = !1,
  9466. u.isMobile() ? $(e.labelGui).hide() : $(e.labelGui).delay(t).fadeOut(i))
  9467. }
  9468. ,
  9469. n.prototype.supportedMode = function() {
  9470. return this.player.mode === h.FLOORPLAN
  9471. }
  9472. ,
  9473. n.prototype.updateLabelDisplay = (new r.Vector3,
  9474. new r.Vector3,
  9475. o = [],
  9476. function() {
  9477. var e = this.player.getLabelScaleFactor()
  9478. , t = 1.2 * (1 - e) + .6
  9479. , i = u.isMobile() ? l.labels.zoomTruncateThreshhold.mobile : l.labels.zoomTruncateThreshhold.desktop;
  9480. this.getLabelsForCurrentFloor(o);
  9481. for (var n = 0; n < o.length; n++) {
  9482. var r = o[n];
  9483. this.supportedMode() && r.labelGui && (this.updateProjectedGuiElement(r.labelGui, r.textBlock, r.position, t, t),
  9484. 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)
  9485. }
  9486. }
  9487. ),
  9488. n.prototype.updateProjectedGuiElement = (c = new r.Vector3,
  9489. new r.Vector3,
  9490. function(e, t, i, n, r) {
  9491. t.style.fontSize = 100 * r + "%";
  9492. var o = .5 * $("#player").width()
  9493. , a = .5 * $("#player").height();
  9494. c.copy(i),
  9495. c.project(this.player.camera);
  9496. var s = c.x * o + o
  9497. , l = -c.y * a + a;
  9498. s -= e.offsetWidth / 2,
  9499. l -= e.offsetHeight / 2,
  9500. e.style.left = s + "px",
  9501. e.style.top = l + "px"
  9502. }
  9503. ),
  9504. n.prototype.handleStartInside = function(e) {
  9505. this.updateLabelVisibility()
  9506. }
  9507. ,
  9508. n.prototype.handleStartOutside = function() {
  9509. this.updateLabelVisibility()
  9510. }
  9511. ,
  9512. t.exports = n
  9513. }
  9514. , {
  9515. "../enum/DirectorEvents": 23,
  9516. "../enum/ModelManagerEvents": 33,
  9517. "../enum/PlayerEvents": 40,
  9518. "../enum/Viewmode": 51,
  9519. "../enum/WarpStyle": 52,
  9520. "../settings": 166,
  9521. "../util/browser": 182,
  9522. "../util/common": 185,
  9523. "../util/lerp": 188,
  9524. "../util/transitions": 195,
  9525. three: 217
  9526. }],
  9527. 92: [function(e, t, i) {
  9528. "use strict";
  9529. Array.prototype.findIndex || (Array.prototype.findIndex = function(e) {
  9530. if (null == this)
  9531. throw new TypeError("Array.prototype.findIndex called on null or undefined");
  9532. if ("function" != typeof e)
  9533. throw new TypeError("predicate must be a function");
  9534. for (var t, i = Object(this), n = i.length >>> 0, r = arguments[1], o = 0; o < n; o++)
  9535. if (t = i[o],
  9536. e.call(r, t, o, i))
  9537. return o;
  9538. return -1
  9539. }
  9540. ),
  9541. Array.prototype.find || Object.defineProperty(Array.prototype, "find", {
  9542. value: function(e) {
  9543. if (null == this)
  9544. throw new TypeError('"this" is null or not defined');
  9545. var t = Object(this)
  9546. , i = t.length >>> 0;
  9547. if ("function" != typeof e)
  9548. throw new TypeError("predicate must be a function");
  9549. for (var n = arguments[1], r = 0; r < i; ) {
  9550. var o = t[r];
  9551. if (e.call(n, o, r, t))
  9552. return o;
  9553. r++
  9554. }
  9555. }
  9556. })
  9557. }
  9558. , {}],
  9559. 93: [function(e, t, i) {
  9560. "use strict";
  9561. 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 || {};
  9562. function te() {
  9563. this.backgroundElement = document.createElement("div"),
  9564. r.extend(this.backgroundElement.style, {
  9565. backgroundColor: "rgba(0,0,0,0.8)",
  9566. top: 0,
  9567. left: 0,
  9568. display: "none",
  9569. zIndex: "1000",
  9570. opacity: 0,
  9571. WebkitTransition: "opacity 0.2s linear"
  9572. }),
  9573. n.makeFullscreen(this.backgroundElement),
  9574. this.backgroundElement.style.position = "fixed",
  9575. this.domElement = document.createElement("div"),
  9576. r.extend(this.domElement.style, {
  9577. position: "fixed",
  9578. display: "none",
  9579. zIndex: "1001",
  9580. opacity: 0,
  9581. WebkitTransition: "-webkit-transform 0.2s ease-out, opacity 0.2s linear"
  9582. }),
  9583. document.body.appendChild(this.backgroundElement),
  9584. document.body.appendChild(this.domElement);
  9585. var e = this;
  9586. n.bind(this.backgroundElement, "click", function() {
  9587. e.hide()
  9588. })
  9589. }
  9590. function ie(e, t, i) {
  9591. Object.defineProperty(e, t, {
  9592. get: function() {
  9593. return "RGB" === this.__state.space || re(this, t, i),
  9594. this.__state[t]
  9595. },
  9596. set: function(e) {
  9597. "RGB" !== this.__state.space && (re(this, t, i),
  9598. this.__state.space = "RGB"),
  9599. this.__state[t] = e
  9600. }
  9601. })
  9602. }
  9603. function ne(e, t) {
  9604. Object.defineProperty(e, t, {
  9605. get: function() {
  9606. return "HSV" === this.__state.space || oe(this),
  9607. this.__state[t]
  9608. },
  9609. set: function(e) {
  9610. "HSV" !== this.__state.space && (oe(this),
  9611. this.__state.space = "HSV"),
  9612. this.__state[t] = e
  9613. }
  9614. })
  9615. }
  9616. function re(e, t, i) {
  9617. if ("HEX" === e.__state.space)
  9618. e.__state[t] = a.component_from_hex(e.__state.hex, i);
  9619. else {
  9620. if ("HSV" !== e.__state.space)
  9621. throw "Corrupted color state";
  9622. l.extend(e.__state, a.hsv_to_rgb(e.__state.h, e.__state.s, e.__state.v))
  9623. }
  9624. }
  9625. function oe(e) {
  9626. var t = a.rgb_to_hsv(e.r, e.g, e.b);
  9627. l.extend(e.__state, {
  9628. s: t.s,
  9629. v: t.v
  9630. }),
  9631. l.isNaN(t.h) ? l.isUndefined(e.__state.h) && (e.__state.h = 0) : e.__state.h = t.h
  9632. }
  9633. function ae() {
  9634. if (this.__state = o.apply(this, arguments),
  9635. !1 === this.__state)
  9636. throw "Failed to interpret color arguments";
  9637. this.__state.a = this.__state.a || 1
  9638. }
  9639. function se(e) {
  9640. return -1 < (e = e.toString()).indexOf(".") ? e.length - e.indexOf(".") - 1 : 0
  9641. }
  9642. function le(e, t) {
  9643. this.initialValue = e[t],
  9644. this.domElement = document.createElement("div"),
  9645. this.object = e,
  9646. this.property = t,
  9647. this.__onChange = void 0,
  9648. this.__onFinishChange = void 0
  9649. }
  9650. (t.exports = ee).gui = ee.gui || {},
  9651. ee.utils = ee.utils || {},
  9652. ee.controllers = ee.controllers || {},
  9653. ee.dom = ee.dom || {},
  9654. ee.color = ee.color || {},
  9655. ee.utils.css = {
  9656. load: function(e, t) {
  9657. var i = (t = t || document).createElement("link");
  9658. i.type = "text/css",
  9659. i.rel = "stylesheet",
  9660. i.href = e,
  9661. t.getElementsByTagName("head")[0].appendChild(i)
  9662. },
  9663. inject: function(e, t) {
  9664. t = t || document;
  9665. var i = document.createElement("style");
  9666. i.type = "text/css",
  9667. i.innerHTML = e,
  9668. t.getElementsByTagName("head")[0].appendChild(i)
  9669. }
  9670. },
  9671. ee.utils.common = (Q = Array.prototype.forEach,
  9672. J = Array.prototype.slice,
  9673. {
  9674. BREAK: {},
  9675. extend: function(i) {
  9676. return this.each(J.call(arguments, 1), function(e) {
  9677. for (var t in e)
  9678. this.isUndefined(e[t]) || (i[t] = e[t])
  9679. }, this),
  9680. i
  9681. },
  9682. defaults: function(i) {
  9683. return this.each(J.call(arguments, 1), function(e) {
  9684. for (var t in e)
  9685. this.isUndefined(i[t]) && (i[t] = e[t])
  9686. }, this),
  9687. i
  9688. },
  9689. compose: function() {
  9690. var i = J.call(arguments);
  9691. return function() {
  9692. for (var e = J.call(arguments), t = i.length - 1; 0 <= t; t--)
  9693. e = [i[t].apply(this, e)];
  9694. return e[0]
  9695. }
  9696. },
  9697. each: function(e, t, i) {
  9698. if (e)
  9699. if (Q && e.forEach && e.forEach === Q)
  9700. e.forEach(t, i);
  9701. else if (e.length === e.length + 0) {
  9702. for (var n = 0, r = e.length; n < r; n++)
  9703. if (n in e && t.call(i, e[n], n) === this.BREAK)
  9704. return
  9705. } else
  9706. for (var n in e)
  9707. if (t.call(i, e[n], n) === this.BREAK)
  9708. return
  9709. },
  9710. defer: function(e) {
  9711. setTimeout(e, 0)
  9712. },
  9713. toArray: function(e) {
  9714. return e.toArray ? e.toArray() : J.call(e)
  9715. },
  9716. isUndefined: function(e) {
  9717. return void 0 === e
  9718. },
  9719. isNull: function(e) {
  9720. return null === e
  9721. },
  9722. isNaN: function(e) {
  9723. return e != e
  9724. },
  9725. isArray: Array.isArray || function(e) {
  9726. return e.constructor === Array
  9727. }
  9728. ,
  9729. isObject: function(e) {
  9730. return e === Object(e)
  9731. },
  9732. isNumber: function(e) {
  9733. return e === e + 0
  9734. },
  9735. isString: function(e) {
  9736. return e === e + ""
  9737. },
  9738. isBoolean: function(e) {
  9739. return !1 === e || !0 === e
  9740. },
  9741. isFunction: function(e) {
  9742. return "[object Function]" === Object.prototype.toString.call(e)
  9743. }
  9744. }),
  9745. ee.controllers.Controller = (ee.utils.common.extend(le.prototype, {
  9746. onChange: function(e) {
  9747. return this.__onChange = e,
  9748. this
  9749. },
  9750. onFinishChange: function(e) {
  9751. return this.__onFinishChange = e,
  9752. this
  9753. },
  9754. setValue: function(e) {
  9755. return this.object[this.property] = e,
  9756. this.__onChange && this.__onChange.call(this, e),
  9757. this.updateDisplay(),
  9758. this
  9759. },
  9760. getValue: function() {
  9761. return this.object[this.property]
  9762. },
  9763. updateDisplay: function() {
  9764. return this
  9765. },
  9766. isModified: function() {
  9767. return this.initialValue !== this.getValue()
  9768. }
  9769. }),
  9770. le),
  9771. ee.dom.dom = function(c) {
  9772. function i(e) {
  9773. if ("0" === e || c.isUndefined(e))
  9774. return 0;
  9775. var t = e.match(n);
  9776. return c.isNull(t) ? 0 : parseFloat(t[1])
  9777. }
  9778. var h = {};
  9779. c.each({
  9780. HTMLEvents: ["change"],
  9781. MouseEvents: ["click", "mousemove", "mousedown", "mouseup", "mouseover"],
  9782. KeyboardEvents: ["keydown"]
  9783. }, function(e, t) {
  9784. c.each(e, function(e) {
  9785. h[e] = t
  9786. })
  9787. });
  9788. var n = /(\d+(\.\d+)?)px/
  9789. , r = {
  9790. makeSelectable: function(e, t) {
  9791. void 0 !== e && void 0 !== e.style && (e.onselectstart = t ? function() {
  9792. return !1
  9793. }
  9794. : function() {}
  9795. ,
  9796. e.style.MozUserSelect = t ? "auto" : "none",
  9797. e.style.KhtmlUserSelect = t ? "auto" : "none",
  9798. e.unselectable = t ? "on" : "off")
  9799. },
  9800. makeFullscreen: function(e, t, i) {
  9801. c.isUndefined(t) && (t = !0),
  9802. c.isUndefined(i) && (i = !0),
  9803. e.style.position = "absolute",
  9804. t && (e.style.left = 0,
  9805. e.style.right = 0),
  9806. i && (e.style.top = 0,
  9807. e.style.bottom = 0)
  9808. },
  9809. fakeEvent: function(e, t, i, n) {
  9810. i = i || {};
  9811. var r = h[t];
  9812. if (!r)
  9813. throw new Error("Event type " + t + " not supported.");
  9814. var o = document.createEvent(r);
  9815. switch (r) {
  9816. case "MouseEvents":
  9817. var a = i.x || i.clientX || 0
  9818. , s = i.y || i.clientY || 0;
  9819. o.initMouseEvent(t, i.bubbles || !1, i.cancelable || !0, window, i.clickCount || 1, 0, 0, a, s, !1, !1, !1, !1, 0, null);
  9820. break;
  9821. case "KeyboardEvents":
  9822. var l = o.initKeyboardEvent || o.initKeyEvent;
  9823. c.defaults(i, {
  9824. cancelable: !0,
  9825. ctrlKey: !1,
  9826. altKey: !1,
  9827. shiftKey: !1,
  9828. metaKey: !1,
  9829. keyCode: void 0,
  9830. charCode: void 0
  9831. }),
  9832. l(t, i.bubbles || !1, i.cancelable, window, i.ctrlKey, i.altKey, i.shiftKey, i.metaKey, i.keyCode, i.charCode);
  9833. break;
  9834. default:
  9835. o.initEvent(t, i.bubbles || !1, i.cancelable || !0)
  9836. }
  9837. c.defaults(o, n),
  9838. e.dispatchEvent(o)
  9839. },
  9840. bind: function(e, t, i, n) {
  9841. return n = n || !1,
  9842. e.addEventListener ? e.addEventListener(t, i, n) : e.attachEvent && e.attachEvent("on" + t, i),
  9843. r
  9844. },
  9845. unbind: function(e, t, i, n) {
  9846. return n = n || !1,
  9847. e.removeEventListener ? e.removeEventListener(t, i, n) : e.detachEvent && e.detachEvent("on" + t, i),
  9848. r
  9849. },
  9850. addClass: function(e, t) {
  9851. if (void 0 === e.className)
  9852. e.className = t;
  9853. else if (e.className !== t) {
  9854. var i = e.className.split(/ +/);
  9855. -1 == i.indexOf(t) && (i.push(t),
  9856. e.className = i.join(" ").replace(/^\s+/, "").replace(/\s+$/, ""))
  9857. }
  9858. return r
  9859. },
  9860. removeClass: function(e, t) {
  9861. if (t)
  9862. if (void 0 === e.className)
  9863. ;
  9864. else if (e.className === t)
  9865. e.removeAttribute("class");
  9866. else {
  9867. var i = e.className.split(/ +/)
  9868. , n = i.indexOf(t);
  9869. -1 != n && (i.splice(n, 1),
  9870. e.className = i.join(" "))
  9871. }
  9872. else
  9873. e.className = void 0;
  9874. return r
  9875. },
  9876. hasClass: function(e, t) {
  9877. return new RegExp("(?:^|\\s+)" + t + "(?:\\s+|$)").test(e.className) || !1
  9878. },
  9879. getWidth: function(e) {
  9880. var t = getComputedStyle(e);
  9881. return i(t["border-left-width"]) + i(t["border-right-width"]) + i(t["padding-left"]) + i(t["padding-right"]) + i(t.width)
  9882. },
  9883. getHeight: function(e) {
  9884. var t = getComputedStyle(e);
  9885. return i(t["border-top-width"]) + i(t["border-bottom-width"]) + i(t["padding-top"]) + i(t["padding-bottom"]) + i(t.height)
  9886. },
  9887. getOffset: function(e) {
  9888. var t = {
  9889. left: 0,
  9890. top: 0
  9891. };
  9892. if (e.offsetParent)
  9893. for (; t.left += e.offsetLeft,
  9894. t.top += e.offsetTop,
  9895. e = e.offsetParent; )
  9896. ;
  9897. return t
  9898. },
  9899. isActive: function(e) {
  9900. return e === document.activeElement && (e.type || e.href)
  9901. }
  9902. };
  9903. return r
  9904. }(ee.utils.common),
  9905. ee.controllers.OptionController = (q = ee.controllers.Controller,
  9906. X = ee.dom.dom,
  9907. Z = ee.utils.common,
  9908. (K = function(e, t, i) {
  9909. K.superclass.call(this, e, t);
  9910. var n = this;
  9911. if (this.__select = document.createElement("select"),
  9912. Z.isArray(i)) {
  9913. var r = {};
  9914. Z.each(i, function(e) {
  9915. r[e] = e
  9916. }),
  9917. i = r
  9918. }
  9919. Z.each(i, function(e, t) {
  9920. var i = document.createElement("option");
  9921. i.innerHTML = t,
  9922. i.setAttribute("value", e),
  9923. n.__select.appendChild(i)
  9924. }),
  9925. this.updateDisplay(),
  9926. X.bind(this.__select, "change", function() {
  9927. var e = this.options[this.selectedIndex].value;
  9928. n.setValue(e)
  9929. }),
  9930. this.domElement.appendChild(this.__select)
  9931. }
  9932. ).superclass = q,
  9933. Z.extend(K.prototype, q.prototype, {
  9934. setValue: function(e) {
  9935. var t = K.superclass.prototype.setValue.call(this, e);
  9936. return this.__onFinishChange && this.__onFinishChange.call(this, this.getValue()),
  9937. t
  9938. },
  9939. updateDisplay: function() {
  9940. return this.__select.value = this.getValue(),
  9941. K.superclass.prototype.updateDisplay.call(this)
  9942. }
  9943. }),
  9944. K),
  9945. ee.controllers.NumberController = (W = ee.controllers.Controller,
  9946. j = ee.utils.common,
  9947. (Y = function(e, t, i) {
  9948. Y.superclass.call(this, e, t),
  9949. i = i || {},
  9950. this.__min = i.min,
  9951. this.__max = i.max,
  9952. this.__step = i.step,
  9953. 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,
  9954. this.__precision = se(this.__impliedStep)
  9955. }
  9956. ).superclass = W,
  9957. j.extend(Y.prototype, W.prototype, {
  9958. setValue: function(e) {
  9959. return void 0 !== this.__min && e < this.__min ? e = this.__min : void 0 !== this.__max && e > this.__max && (e = this.__max),
  9960. void 0 !== this.__step && e % this.__step != 0 && (e = Math.round(e / this.__step) * this.__step),
  9961. Y.superclass.prototype.setValue.call(this, e)
  9962. },
  9963. min: function(e) {
  9964. return this.__min = e,
  9965. this
  9966. },
  9967. max: function(e) {
  9968. return this.__max = e,
  9969. this
  9970. },
  9971. step: function(e) {
  9972. return this.__step = e,
  9973. this.__impliedStep = e,
  9974. this.__precision = se(e),
  9975. this
  9976. }
  9977. }),
  9978. Y),
  9979. ee.controllers.NumberControllerBox = (U = ee.controllers.NumberController,
  9980. H = ee.dom.dom,
  9981. z = ee.utils.common,
  9982. (G = function(e, t, i) {
  9983. function n() {
  9984. var e = parseFloat(s.__input.value);
  9985. z.isNaN(e) || s.setValue(e)
  9986. }
  9987. function r(e) {
  9988. var t = a - e.clientY;
  9989. s.setValue(s.getValue() + t * s.__impliedStep),
  9990. a = e.clientY
  9991. }
  9992. function o() {
  9993. H.unbind(window, "mousemove", r),
  9994. H.unbind(window, "mouseup", o)
  9995. }
  9996. this.__truncationSuspended = !1,
  9997. G.superclass.call(this, e, t, i);
  9998. var a, s = this;
  9999. this.__input = document.createElement("input"),
  10000. this.__input.setAttribute("type", "text"),
  10001. H.bind(this.__input, "change", n),
  10002. H.bind(this.__input, "blur", function() {
  10003. n(),
  10004. s.__onFinishChange && s.__onFinishChange.call(s, s.getValue())
  10005. }),
  10006. H.bind(this.__input, "mousedown", function(e) {
  10007. H.bind(window, "mousemove", r),
  10008. H.bind(window, "mouseup", o),
  10009. a = e.clientY
  10010. }),
  10011. H.bind(this.__input, "keydown", function(e) {
  10012. 13 === e.keyCode && (s.__truncationSuspended = !0,
  10013. this.blur(),
  10014. s.__truncationSuspended = !1)
  10015. }),
  10016. this.updateDisplay(),
  10017. this.domElement.appendChild(this.__input)
  10018. }
  10019. ).superclass = U,
  10020. z.extend(G.prototype, U.prototype, {
  10021. updateDisplay: function() {
  10022. return this.__input.value = this.__truncationSuspended ? this.getValue() : function(e, t) {
  10023. var i = Math.pow(10, t);
  10024. return Math.round(e * i) / i
  10025. }(this.getValue(), this.__precision),
  10026. G.superclass.prototype.updateDisplay.call(this)
  10027. }
  10028. }),
  10029. G),
  10030. ee.controllers.NumberControllerSlider = (N = ee.controllers.NumberController,
  10031. F = ee.dom.dom,
  10032. B = ee.utils.css,
  10033. V = ee.utils.common,
  10034. (k = function(e, t, i, n, r) {
  10035. function o(e) {
  10036. e.preventDefault();
  10037. var t = F.getOffset(s.__background)
  10038. , i = F.getWidth(s.__background);
  10039. return s.setValue(function(e, t, i, n, r) {
  10040. return n + (e - t) / (i - t) * (r - n)
  10041. }(e.clientX, t.left, t.left + i, s.__min, s.__max)),
  10042. !1
  10043. }
  10044. function a() {
  10045. F.unbind(window, "mousemove", o),
  10046. F.unbind(window, "mouseup", a),
  10047. s.__onFinishChange && s.__onFinishChange.call(s, s.getValue())
  10048. }
  10049. k.superclass.call(this, e, t, {
  10050. min: i,
  10051. max: n,
  10052. step: r
  10053. });
  10054. var s = this;
  10055. this.__background = document.createElement("div"),
  10056. this.__foreground = document.createElement("div"),
  10057. F.bind(this.__background, "mousedown", function(e) {
  10058. F.bind(window, "mousemove", o),
  10059. F.bind(window, "mouseup", a),
  10060. o(e)
  10061. }),
  10062. F.addClass(this.__background, "slider"),
  10063. F.addClass(this.__foreground, "slider-fg"),
  10064. this.updateDisplay(),
  10065. this.__background.appendChild(this.__foreground),
  10066. this.domElement.appendChild(this.__background)
  10067. }
  10068. ).superclass = N,
  10069. k.useDefaultStyles = function() {
  10070. 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}")
  10071. }
  10072. ,
  10073. V.extend(k.prototype, N.prototype, {
  10074. updateDisplay: function() {
  10075. var e = (this.getValue() - this.__min) / (this.__max - this.__min);
  10076. return this.__foreground.style.width = 100 * e + "%",
  10077. k.superclass.prototype.updateDisplay.call(this)
  10078. }
  10079. }),
  10080. k),
  10081. ee.controllers.FunctionController = (P = ee.controllers.Controller,
  10082. O = ee.dom.dom,
  10083. L = ee.utils.common,
  10084. (D = function(e, t, i) {
  10085. D.superclass.call(this, e, t);
  10086. var n = this;
  10087. this.__button = document.createElement("div"),
  10088. this.__button.innerHTML = void 0 === i ? "Fire" : i,
  10089. O.bind(this.__button, "click", function(e) {
  10090. return e.preventDefault(),
  10091. n.fire(),
  10092. !1
  10093. }),
  10094. O.addClass(this.__button, "button"),
  10095. this.domElement.appendChild(this.__button)
  10096. }
  10097. ).superclass = P,
  10098. L.extend(D.prototype, P.prototype, {
  10099. fire: function() {
  10100. this.__onChange && this.__onChange.call(this),
  10101. this.__onFinishChange && this.__onFinishChange.call(this, this.getValue()),
  10102. this.getValue().call(this.object)
  10103. }
  10104. }),
  10105. D),
  10106. ee.controllers.BooleanController = (x = ee.controllers.Controller,
  10107. S = ee.dom.dom,
  10108. M = ee.utils.common,
  10109. (R = function(e, t) {
  10110. R.superclass.call(this, e, t);
  10111. var i = this;
  10112. this.__prev = this.getValue(),
  10113. this.__checkbox = document.createElement("input"),
  10114. this.__checkbox.setAttribute("type", "checkbox"),
  10115. S.bind(this.__checkbox, "change", function() {
  10116. i.setValue(!i.__prev)
  10117. }, !1),
  10118. this.domElement.appendChild(this.__checkbox),
  10119. this.updateDisplay()
  10120. }
  10121. ).superclass = x,
  10122. M.extend(R.prototype, x.prototype, {
  10123. setValue: function(e) {
  10124. var t = R.superclass.prototype.setValue.call(this, e);
  10125. return this.__onFinishChange && this.__onFinishChange.call(this, this.getValue()),
  10126. this.__prev = this.getValue(),
  10127. t
  10128. },
  10129. updateDisplay: function() {
  10130. return !0 === this.getValue() ? (this.__checkbox.setAttribute("checked", "checked"),
  10131. this.__checkbox.checked = !0) : this.__checkbox.checked = !1,
  10132. R.superclass.prototype.updateDisplay.call(this)
  10133. }
  10134. }),
  10135. R),
  10136. ee.color.toString = (T = ee.utils.common,
  10137. function(e) {
  10138. if (1 == e.a || T.isUndefined(e.a)) {
  10139. for (var t = e.hex.toString(16); t.length < 6; )
  10140. t = "0" + t;
  10141. return "#" + t
  10142. }
  10143. return "rgba(" + Math.round(e.r) + "," + Math.round(e.g) + "," + Math.round(e.b) + "," + e.a + ")"
  10144. }
  10145. ),
  10146. ee.color.interpret = (I = ee.color.toString,
  10147. E = ee.utils.common,
  10148. w = [{
  10149. litmus: E.isString,
  10150. conversions: {
  10151. THREE_CHAR_HEX: {
  10152. read: function(e) {
  10153. var t = e.match(/^#([A-F0-9])([A-F0-9])([A-F0-9])$/i);
  10154. return null !== t && {
  10155. space: "HEX",
  10156. hex: parseInt("0x" + t[1].toString() + t[1].toString() + t[2].toString() + t[2].toString() + t[3].toString() + t[3].toString())
  10157. }
  10158. },
  10159. write: I
  10160. },
  10161. SIX_CHAR_HEX: {
  10162. read: function(e) {
  10163. var t = e.match(/^#([A-F0-9]{6})$/i);
  10164. return null !== t && {
  10165. space: "HEX",
  10166. hex: parseInt("0x" + t[1].toString())
  10167. }
  10168. },
  10169. write: I
  10170. },
  10171. CSS_RGB: {
  10172. read: function(e) {
  10173. var t = e.match(/^rgb\(\s*(.+)\s*,\s*(.+)\s*,\s*(.+)\s*\)/);
  10174. return null !== t && {
  10175. space: "RGB",
  10176. r: parseFloat(t[1]),
  10177. g: parseFloat(t[2]),
  10178. b: parseFloat(t[3])
  10179. }
  10180. },
  10181. write: I
  10182. },
  10183. CSS_RGBA: {
  10184. read: function(e) {
  10185. var t = e.match(/^rgba\(\s*(.+)\s*,\s*(.+)\s*,\s*(.+)\s*\,\s*(.+)\s*\)/);
  10186. return null !== t && {
  10187. space: "RGB",
  10188. r: parseFloat(t[1]),
  10189. g: parseFloat(t[2]),
  10190. b: parseFloat(t[3]),
  10191. a: parseFloat(t[4])
  10192. }
  10193. },
  10194. write: I
  10195. }
  10196. }
  10197. }, {
  10198. litmus: E.isNumber,
  10199. conversions: {
  10200. HEX: {
  10201. read: function(e) {
  10202. return {
  10203. space: "HEX",
  10204. hex: e,
  10205. conversionName: "HEX"
  10206. }
  10207. },
  10208. write: function(e) {
  10209. return e.hex
  10210. }
  10211. }
  10212. }
  10213. }, {
  10214. litmus: E.isArray,
  10215. conversions: {
  10216. RGB_ARRAY: {
  10217. read: function(e) {
  10218. return 3 == e.length && {
  10219. space: "RGB",
  10220. r: e[0],
  10221. g: e[1],
  10222. b: e[2]
  10223. }
  10224. },
  10225. write: function(e) {
  10226. return [e.r, e.g, e.b]
  10227. }
  10228. },
  10229. RGBA_ARRAY: {
  10230. read: function(e) {
  10231. return 4 == e.length && {
  10232. space: "RGB",
  10233. r: e[0],
  10234. g: e[1],
  10235. b: e[2],
  10236. a: e[3]
  10237. }
  10238. },
  10239. write: function(e) {
  10240. return [e.r, e.g, e.b, e.a]
  10241. }
  10242. }
  10243. }
  10244. }, {
  10245. litmus: E.isObject,
  10246. conversions: {
  10247. RGBA_OBJ: {
  10248. read: function(e) {
  10249. return !!(E.isNumber(e.r) && E.isNumber(e.g) && E.isNumber(e.b) && E.isNumber(e.a)) && {
  10250. space: "RGB",
  10251. r: e.r,
  10252. g: e.g,
  10253. b: e.b,
  10254. a: e.a
  10255. }
  10256. },
  10257. write: function(e) {
  10258. return {
  10259. r: e.r,
  10260. g: e.g,
  10261. b: e.b,
  10262. a: e.a
  10263. }
  10264. }
  10265. },
  10266. RGB_OBJ: {
  10267. read: function(e) {
  10268. return !!(E.isNumber(e.r) && E.isNumber(e.g) && E.isNumber(e.b)) && {
  10269. space: "RGB",
  10270. r: e.r,
  10271. g: e.g,
  10272. b: e.b
  10273. }
  10274. },
  10275. write: function(e) {
  10276. return {
  10277. r: e.r,
  10278. g: e.g,
  10279. b: e.b
  10280. }
  10281. }
  10282. },
  10283. HSVA_OBJ: {
  10284. read: function(e) {
  10285. return !!(E.isNumber(e.h) && E.isNumber(e.s) && E.isNumber(e.v) && E.isNumber(e.a)) && {
  10286. space: "HSV",
  10287. h: e.h,
  10288. s: e.s,
  10289. v: e.v,
  10290. a: e.a
  10291. }
  10292. },
  10293. write: function(e) {
  10294. return {
  10295. h: e.h,
  10296. s: e.s,
  10297. v: e.v,
  10298. a: e.a
  10299. }
  10300. }
  10301. },
  10302. HSV_OBJ: {
  10303. read: function(e) {
  10304. return !!(E.isNumber(e.h) && E.isNumber(e.s) && E.isNumber(e.v)) && {
  10305. space: "HSV",
  10306. h: e.h,
  10307. s: e.s,
  10308. v: e.v
  10309. }
  10310. },
  10311. write: function(e) {
  10312. return {
  10313. h: e.h,
  10314. s: e.s,
  10315. v: e.v
  10316. }
  10317. }
  10318. }
  10319. }
  10320. }],
  10321. function() {
  10322. b = !1;
  10323. var i = 1 < arguments.length ? E.toArray(arguments) : arguments[0];
  10324. return E.each(w, function(e) {
  10325. if (e.litmus(i))
  10326. return E.each(e.conversions, function(e, t) {
  10327. if (_ = e.read(i),
  10328. !1 === b && !1 !== _)
  10329. return (b = _).conversionName = t,
  10330. _.conversion = e,
  10331. E.BREAK
  10332. }),
  10333. E.BREAK
  10334. }),
  10335. b
  10336. }
  10337. ),
  10338. ee.GUI = ee.gui.GUI = function(e, t, i, c, h, u, d, p, f, n, g, r, o, m, v) {
  10339. function y(e, t, i, n) {
  10340. if (void 0 === t[i])
  10341. throw new Error("Object " + t + ' has no property "' + i + '"');
  10342. var r;
  10343. if (n.color)
  10344. r = new g(t,i);
  10345. else {
  10346. var o = [t, i].concat(n.factoryArgs);
  10347. r = c.apply(e, o)
  10348. }
  10349. n.before instanceof h && (n.before = n.before.__li),
  10350. C(e, r),
  10351. m.addClass(r.domElement, "c");
  10352. var a = document.createElement("span");
  10353. m.addClass(a, "property-name"),
  10354. a.innerHTML = r.property;
  10355. var s = document.createElement("div");
  10356. s.appendChild(a),
  10357. s.appendChild(r.domElement);
  10358. var l = A(e, s, n.before);
  10359. return m.addClass(l, R.CLASS_CONTROLLER_ROW),
  10360. m.addClass(l, typeof r.getValue()),
  10361. function(t, i, n) {
  10362. if (n.__li = i,
  10363. n.__gui = t,
  10364. v.extend(n, {
  10365. options: function(e) {
  10366. return 1 < arguments.length ? (n.remove(),
  10367. y(t, n.object, n.property, {
  10368. before: n.__li.nextElementSibling,
  10369. factoryArgs: [v.toArray(arguments)]
  10370. })) : v.isArray(e) || v.isObject(e) ? (n.remove(),
  10371. y(t, n.object, n.property, {
  10372. before: n.__li.nextElementSibling,
  10373. factoryArgs: [e]
  10374. })) : void 0
  10375. },
  10376. name: function(e) {
  10377. return n.__li.firstElementChild.firstElementChild.innerHTML = e,
  10378. n
  10379. },
  10380. listen: function() {
  10381. return n.__gui.listen(n),
  10382. n
  10383. },
  10384. remove: function() {
  10385. return n.__gui.remove(n),
  10386. n
  10387. }
  10388. }),
  10389. n instanceof f) {
  10390. var r = new p(n.object,n.property,{
  10391. min: n.__min,
  10392. max: n.__max,
  10393. step: n.__step
  10394. });
  10395. v.each(["updateDisplay", "onChange", "onFinishChange"], function(e) {
  10396. var t = n[e]
  10397. , i = r[e];
  10398. n[e] = r[e] = function() {
  10399. var e = Array.prototype.slice.call(arguments);
  10400. return t.apply(n, e),
  10401. i.apply(r, e)
  10402. }
  10403. }),
  10404. m.addClass(i, "has-slider"),
  10405. n.domElement.insertBefore(r.domElement, n.domElement.firstElementChild)
  10406. } else if (n instanceof p) {
  10407. var e = function(e) {
  10408. return v.isNumber(n.__min) && v.isNumber(n.__max) ? (n.remove(),
  10409. y(t, n.object, n.property, {
  10410. before: n.__li.nextElementSibling,
  10411. factoryArgs: [n.__min, n.__max, n.__step]
  10412. })) : e
  10413. };
  10414. n.min = v.compose(e, n.min),
  10415. n.max = v.compose(e, n.max)
  10416. } else
  10417. n instanceof u ? (m.bind(i, "click", function() {
  10418. m.fakeEvent(n.__checkbox, "click")
  10419. }),
  10420. m.bind(n.__checkbox, "click", function(e) {
  10421. e.stopPropagation()
  10422. })) : n instanceof d ? (m.bind(i, "click", function() {
  10423. m.fakeEvent(n.__button, "click")
  10424. }),
  10425. m.bind(i, "mouseover", function() {
  10426. m.addClass(n.__button, "hover")
  10427. }),
  10428. m.bind(i, "mouseout", function() {
  10429. m.removeClass(n.__button, "hover")
  10430. })) : n instanceof g && (m.addClass(i, "color"),
  10431. n.updateDisplay = v.compose(function(e) {
  10432. return i.style.borderLeftColor = n.__color.toString(),
  10433. e
  10434. }, n.updateDisplay),
  10435. n.updateDisplay());
  10436. n.setValue = v.compose(function(e) {
  10437. return t.getRoot().__preset_select && n.isModified() && _(t.getRoot(), !0),
  10438. e
  10439. }, n.setValue)
  10440. }(e, l, r),
  10441. e.__controllers.push(r),
  10442. r
  10443. }
  10444. function A(e, t, i) {
  10445. var n = document.createElement("li");
  10446. return t && n.appendChild(t),
  10447. i ? e.__ul.insertBefore(n, params.before) : e.__ul.appendChild(n),
  10448. e.onResize(),
  10449. n
  10450. }
  10451. function C(e, t) {
  10452. var i = e.getRoot()
  10453. , n = i.__rememberedObjects.indexOf(t.object);
  10454. if (-1 != n) {
  10455. var r = i.__rememberedObjectIndecesToControllers[n];
  10456. if (void 0 === r && (r = {},
  10457. i.__rememberedObjectIndecesToControllers[n] = r),
  10458. r[t.property] = t,
  10459. i.load && i.load.remembered) {
  10460. var o, a = i.load.remembered;
  10461. if (a[e.preset])
  10462. o = a[e.preset];
  10463. else {
  10464. if (!a[T])
  10465. return;
  10466. o = a[T]
  10467. }
  10468. if (o[n] && void 0 !== o[n][t.property]) {
  10469. var s = o[n][t.property];
  10470. t.initialValue = s,
  10471. t.setValue(s)
  10472. }
  10473. }
  10474. }
  10475. }
  10476. function I(e, t) {
  10477. return document.location.href + "." + t
  10478. }
  10479. function l(e, t) {
  10480. e.domElement.style.width = t + "px",
  10481. e.__save_row && e.autoPlace && (e.__save_row.style.width = t + "px"),
  10482. e.__closeButton && (e.__closeButton.style.width = t + "px")
  10483. }
  10484. function a(r, o) {
  10485. var a = {};
  10486. return v.each(r.__rememberedObjects, function(e, t) {
  10487. var i = {}
  10488. , n = r.__rememberedObjectIndecesToControllers[t];
  10489. v.each(n, function(e, t) {
  10490. i[t] = o ? e.initialValue : e.getValue()
  10491. }),
  10492. a[t] = i
  10493. }),
  10494. a
  10495. }
  10496. function E(e, t, i) {
  10497. var n = document.createElement("option");
  10498. n.innerHTML = t,
  10499. n.value = t,
  10500. e.__preset_select.appendChild(n),
  10501. i && (e.__preset_select.selectedIndex = e.__preset_select.length - 1)
  10502. }
  10503. function _(e, t) {
  10504. var i = e.__preset_select[e.__preset_select.selectedIndex];
  10505. i.innerHTML = t ? i.value + "*" : i.value
  10506. }
  10507. 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");
  10508. var b, w, T = "Default", x = function() {
  10509. try {
  10510. return "localStorage"in window && null !== window.localStorage
  10511. } catch (e) {
  10512. return !1
  10513. }
  10514. }(), S = !0, s = !1, M = [], R = function(t) {
  10515. var i = this;
  10516. this.domElement = document.createElement("div"),
  10517. this.__ul = document.createElement("ul"),
  10518. this.domElement.appendChild(this.__ul),
  10519. m.addClass(this.domElement, "dg"),
  10520. this.__folders = {},
  10521. this.__controllers = [],
  10522. this.__rememberedObjects = [],
  10523. this.__rememberedObjectIndecesToControllers = [],
  10524. this.__listening = [],
  10525. t = t || {},
  10526. t = v.defaults(t, {
  10527. autoPlace: !0,
  10528. width: R.DEFAULT_WIDTH
  10529. }),
  10530. t = v.defaults(t, {
  10531. resizable: t.autoPlace,
  10532. hideable: t.autoPlace
  10533. }),
  10534. v.isUndefined(t.load) ? t.load = {
  10535. preset: T
  10536. } : t.preset && (t.load.preset = t.preset),
  10537. v.isUndefined(t.parent) && t.hideable && M.push(this),
  10538. t.resizable = v.isUndefined(t.parent) && t.resizable,
  10539. t.autoPlace && v.isUndefined(t.scrollable) && (t.scrollable = !0);
  10540. var n, e, r = x && "true" === localStorage.getItem(I(0, "isLocal"));
  10541. if (Object.defineProperties(this, {
  10542. parent: {
  10543. get: function() {
  10544. return t.parent
  10545. }
  10546. },
  10547. scrollable: {
  10548. get: function() {
  10549. return t.scrollable
  10550. }
  10551. },
  10552. autoPlace: {
  10553. get: function() {
  10554. return t.autoPlace
  10555. }
  10556. },
  10557. preset: {
  10558. get: function() {
  10559. return i.parent ? i.getRoot().preset : t.load.preset
  10560. },
  10561. set: function(e) {
  10562. i.parent ? i.getRoot().preset = e : t.load.preset = e,
  10563. function(e) {
  10564. for (var t = 0; t < e.__preset_select.length; t++)
  10565. e.__preset_select[t].value == e.preset && (e.__preset_select.selectedIndex = t)
  10566. }(this),
  10567. i.revert()
  10568. }
  10569. },
  10570. width: {
  10571. get: function() {
  10572. return t.width
  10573. },
  10574. set: function(e) {
  10575. t.width = e,
  10576. l(i, e)
  10577. }
  10578. },
  10579. name: {
  10580. get: function() {
  10581. return t.name
  10582. },
  10583. set: function(e) {
  10584. t.name = e,
  10585. a && (a.innerHTML = t.name)
  10586. }
  10587. },
  10588. closed: {
  10589. get: function() {
  10590. return t.closed
  10591. },
  10592. set: function(e) {
  10593. t.closed = e,
  10594. t.closed ? m.addClass(i.__ul, R.CLASS_CLOSED) : m.removeClass(i.__ul, R.CLASS_CLOSED),
  10595. this.onResize(),
  10596. i.__closeButton && (i.__closeButton.innerHTML = e ? R.TEXT_OPEN : R.TEXT_CLOSED)
  10597. }
  10598. },
  10599. load: {
  10600. get: function() {
  10601. return t.load
  10602. }
  10603. },
  10604. useLocalStorage: {
  10605. get: function() {
  10606. return r
  10607. },
  10608. set: function(e) {
  10609. x && ((r = e) ? m.bind(window, "unload", n) : m.unbind(window, "unload", n),
  10610. localStorage.setItem(I(0, "isLocal"), e))
  10611. }
  10612. }
  10613. }),
  10614. v.isUndefined(t.parent)) {
  10615. if (t.closed = !1,
  10616. m.addClass(this.domElement, R.CLASS_MAIN),
  10617. m.makeSelectable(this.domElement, !1),
  10618. x && r) {
  10619. i.useLocalStorage = !0;
  10620. var o = localStorage.getItem(I(0, "gui"));
  10621. o && (t.load = JSON.parse(o))
  10622. }
  10623. this.__closeButton = document.createElement("div"),
  10624. this.__closeButton.innerHTML = R.TEXT_CLOSED,
  10625. m.addClass(this.__closeButton, R.CLASS_CLOSE_BUTTON),
  10626. this.domElement.appendChild(this.__closeButton),
  10627. m.bind(this.__closeButton, "click", function() {
  10628. i.closed = !i.closed
  10629. })
  10630. } else {
  10631. void 0 === t.closed && (t.closed = !0);
  10632. var a = document.createTextNode(t.name);
  10633. m.addClass(a, "controller-name");
  10634. var s = A(i, a);
  10635. m.addClass(this.__ul, R.CLASS_CLOSED),
  10636. m.addClass(s, "title"),
  10637. m.bind(s, "click", function(e) {
  10638. return e.preventDefault(),
  10639. i.closed = !i.closed,
  10640. !1
  10641. }),
  10642. t.closed || (this.closed = !1)
  10643. }
  10644. t.autoPlace && (v.isUndefined(t.parent) && (S && (w = document.createElement("div"),
  10645. m.addClass(w, "dg"),
  10646. m.addClass(w, R.CLASS_AUTO_PLACE_CONTAINER),
  10647. document.body.appendChild(w),
  10648. S = !1),
  10649. w.appendChild(this.domElement),
  10650. m.addClass(this.domElement, R.CLASS_AUTO_PLACE)),
  10651. this.parent || l(i, t.width)),
  10652. m.bind(window, "resize", function() {
  10653. i.onResize()
  10654. }),
  10655. m.bind(this.__ul, "webkitTransitionEnd", function() {
  10656. i.onResize()
  10657. }),
  10658. m.bind(this.__ul, "transitionend", function() {
  10659. i.onResize()
  10660. }),
  10661. m.bind(this.__ul, "oTransitionEnd", function() {
  10662. i.onResize()
  10663. }),
  10664. this.onResize(),
  10665. t.resizable && function(t) {
  10666. function e(e) {
  10667. return e.preventDefault(),
  10668. r = e.clientX,
  10669. m.addClass(t.__closeButton, R.CLASS_DRAG),
  10670. m.bind(window, "mousemove", i),
  10671. m.bind(window, "mouseup", n),
  10672. !1
  10673. }
  10674. function i(e) {
  10675. return e.preventDefault(),
  10676. t.width += r - e.clientX,
  10677. t.onResize(),
  10678. r = e.clientX,
  10679. !1
  10680. }
  10681. function n() {
  10682. m.removeClass(t.__closeButton, R.CLASS_DRAG),
  10683. m.unbind(window, "mousemove", i),
  10684. m.unbind(window, "mouseup", n)
  10685. }
  10686. var r;
  10687. t.__resize_handle = document.createElement("div"),
  10688. v.extend(t.__resize_handle.style, {
  10689. width: "6px",
  10690. marginLeft: "-3px",
  10691. height: "200px",
  10692. cursor: "ew-resize",
  10693. position: "absolute"
  10694. }),
  10695. m.bind(t.__resize_handle, "mousedown", e),
  10696. m.bind(t.__closeButton, "mousedown", e),
  10697. t.domElement.insertBefore(t.__resize_handle, t.domElement.firstElementChild)
  10698. }(this),
  10699. n = function() {
  10700. x && "true" === localStorage.getItem(I(0, "isLocal")) && localStorage.setItem(I(0, "gui"), JSON.stringify(i.getSaveObject()))
  10701. }
  10702. ,
  10703. this.saveToLocalStorageIfPossible = n,
  10704. i.getRoot(),
  10705. t.parent || ((e = i.getRoot()).width += 1,
  10706. v.defer(function() {
  10707. e.width -= 1
  10708. }))
  10709. };
  10710. return R.toggleHide = function() {
  10711. s = !s,
  10712. v.each(M, function(e) {
  10713. e.domElement.style.zIndex = s ? -999 : 999,
  10714. e.domElement.style.opacity = s ? 0 : 1
  10715. })
  10716. }
  10717. ,
  10718. R.CLASS_AUTO_PLACE = "a",
  10719. R.CLASS_AUTO_PLACE_CONTAINER = "ac",
  10720. R.CLASS_MAIN = "main",
  10721. R.CLASS_CONTROLLER_ROW = "cr",
  10722. R.CLASS_TOO_TALL = "taller-than-window",
  10723. R.CLASS_CLOSED = "closed",
  10724. R.CLASS_CLOSE_BUTTON = "close-button",
  10725. R.CLASS_DRAG = "drag",
  10726. R.DEFAULT_WIDTH = 245,
  10727. R.TEXT_CLOSED = "Close Controls",
  10728. R.TEXT_OPEN = "Open Controls",
  10729. m.bind(window, "keydown", function(e) {
  10730. "text" === document.activeElement.type || 72 !== e.which && 72 != e.keyCode || R.toggleHide()
  10731. }, !1),
  10732. v.extend(R.prototype, {
  10733. add: function(e, t) {
  10734. return y(this, e, t, {
  10735. factoryArgs: Array.prototype.slice.call(arguments, 2)
  10736. })
  10737. },
  10738. addColor: function(e, t) {
  10739. return y(this, e, t, {
  10740. color: !0
  10741. })
  10742. },
  10743. remove: function(e) {
  10744. this.__ul.removeChild(e.__li),
  10745. this.__controllers.slice(this.__controllers.indexOf(e), 1);
  10746. var t = this;
  10747. v.defer(function() {
  10748. t.onResize()
  10749. })
  10750. },
  10751. destroy: function() {
  10752. this.autoPlace && w.removeChild(this.domElement)
  10753. },
  10754. addFolder: function(e) {
  10755. if (void 0 !== this.__folders[e])
  10756. throw new Error('You already have a folder in this GUI by the name "' + e + '"');
  10757. var t = {
  10758. name: e,
  10759. parent: this
  10760. };
  10761. t.autoPlace = this.autoPlace,
  10762. this.load && this.load.folders && this.load.folders[e] && (t.closed = this.load.folders[e].closed,
  10763. t.load = this.load.folders[e]);
  10764. var i = new R(t);
  10765. this.__folders[e] = i;
  10766. var n = A(this, i.domElement);
  10767. return m.addClass(n, "folder"),
  10768. i
  10769. },
  10770. open: function() {
  10771. this.closed = !1
  10772. },
  10773. close: function() {
  10774. this.closed = !0
  10775. },
  10776. onResize: function() {
  10777. var t = this.getRoot();
  10778. if (t.scrollable) {
  10779. var e = m.getOffset(t.__ul).top
  10780. , i = 0;
  10781. v.each(t.__ul.childNodes, function(e) {
  10782. t.autoPlace && e === t.__save_row || (i += m.getHeight(e))
  10783. }),
  10784. $("#player").height() - e - 20 < i ? (m.addClass(t.domElement, R.CLASS_TOO_TALL),
  10785. t.__ul.style.height = $("#player").height() - e - 20 + "px") : (m.removeClass(t.domElement, R.CLASS_TOO_TALL),
  10786. t.__ul.style.height = "auto")
  10787. }
  10788. t.__resize_handle && v.defer(function() {
  10789. t.__resize_handle.style.height = t.__ul.offsetHeight + "px"
  10790. }),
  10791. t.__closeButton && (t.__closeButton.style.width = t.width + "px")
  10792. },
  10793. remember: function() {
  10794. 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>'),
  10795. this.parent)
  10796. throw new Error("You can only call remember on a top level GUI.");
  10797. var t = this;
  10798. v.each(Array.prototype.slice.call(arguments), function(e) {
  10799. 0 == t.__rememberedObjects.length && function(i) {
  10800. var e = i.__save_row = document.createElement("li");
  10801. m.addClass(i.domElement, "has-save"),
  10802. i.__ul.insertBefore(e, i.__ul.firstChild),
  10803. m.addClass(e, "save-row");
  10804. var t = document.createElement("span");
  10805. t.innerHTML = "&nbsp;",
  10806. m.addClass(t, "button gears");
  10807. var n = document.createElement("span");
  10808. n.innerHTML = "Save",
  10809. m.addClass(n, "button"),
  10810. m.addClass(n, "save");
  10811. var r = document.createElement("span");
  10812. r.innerHTML = "New",
  10813. m.addClass(r, "button"),
  10814. m.addClass(r, "save-as");
  10815. var o = document.createElement("span");
  10816. o.innerHTML = "Revert",
  10817. m.addClass(o, "button"),
  10818. m.addClass(o, "revert");
  10819. var a = i.__preset_select = document.createElement("select");
  10820. if (i.load && i.load.remembered ? v.each(i.load.remembered, function(e, t) {
  10821. E(i, t, t == i.preset)
  10822. }) : E(i, T, !1),
  10823. m.bind(a, "change", function() {
  10824. for (var e = 0; e < i.__preset_select.length; e++)
  10825. i.__preset_select[e].innerHTML = i.__preset_select[e].value;
  10826. i.preset = this.value
  10827. }),
  10828. e.appendChild(a),
  10829. e.appendChild(t),
  10830. e.appendChild(n),
  10831. e.appendChild(r),
  10832. e.appendChild(o),
  10833. x) {
  10834. var s = document.getElementById("dg-save-locally")
  10835. , l = document.getElementById("dg-local-explain");
  10836. s.style.display = "block";
  10837. var c = document.getElementById("dg-local-storage");
  10838. "true" === localStorage.getItem(I(0, "isLocal")) && c.setAttribute("checked", "checked");
  10839. var h = function() {
  10840. l.style.display = i.useLocalStorage ? "block" : "none"
  10841. };
  10842. h(),
  10843. m.bind(c, "change", function() {
  10844. i.useLocalStorage = !i.useLocalStorage,
  10845. h()
  10846. })
  10847. }
  10848. var u = document.getElementById("dg-new-constructor");
  10849. m.bind(u, "keydown", function(e) {
  10850. !e.metaKey || 67 !== e.which && 67 != e.keyCode || b.hide()
  10851. }),
  10852. m.bind(t, "click", function() {
  10853. u.innerHTML = JSON.stringify(i.getSaveObject(), void 0, 2),
  10854. b.show(),
  10855. u.focus(),
  10856. u.select()
  10857. }),
  10858. m.bind(n, "click", function() {
  10859. i.save()
  10860. }),
  10861. m.bind(r, "click", function() {
  10862. var e = prompt("Enter a new preset name.");
  10863. e && i.saveAs(e)
  10864. }),
  10865. m.bind(o, "click", function() {
  10866. i.revert()
  10867. })
  10868. }(t),
  10869. -1 == t.__rememberedObjects.indexOf(e) && t.__rememberedObjects.push(e)
  10870. }),
  10871. this.autoPlace && l(this, this.width)
  10872. },
  10873. getRoot: function() {
  10874. for (var e = this; e.parent; )
  10875. e = e.parent;
  10876. return e
  10877. },
  10878. getSaveObject: function() {
  10879. var i = this.load;
  10880. return i.closed = this.closed,
  10881. 0 < this.__rememberedObjects.length && (i.preset = this.preset,
  10882. i.remembered || (i.remembered = {}),
  10883. i.remembered[this.preset] = a(this)),
  10884. i.folders = {},
  10885. v.each(this.__folders, function(e, t) {
  10886. i.folders[t] = e.getSaveObject()
  10887. }),
  10888. i
  10889. },
  10890. save: function() {
  10891. this.load.remembered || (this.load.remembered = {}),
  10892. this.load.remembered[this.preset] = a(this),
  10893. _(this, !1),
  10894. this.saveToLocalStorageIfPossible()
  10895. },
  10896. saveAs: function(e) {
  10897. this.load.remembered || (this.load.remembered = {},
  10898. this.load.remembered[T] = a(this, !0)),
  10899. this.load.remembered[e] = a(this),
  10900. this.preset = e,
  10901. E(this, e, !0),
  10902. this.saveToLocalStorageIfPossible()
  10903. },
  10904. revert: function(t) {
  10905. v.each(this.__controllers, function(e) {
  10906. this.getRoot().load.remembered ? C(t || this.getRoot(), e) : e.setValue(e.initialValue)
  10907. }, this),
  10908. v.each(this.__folders, function(e) {
  10909. e.revert(e)
  10910. }),
  10911. t || _(this.getRoot(), !1)
  10912. },
  10913. listen: function(e) {
  10914. var t = 0 == this.__listening.length;
  10915. this.__listening.push(e),
  10916. t && function e(t) {
  10917. 0 != t.length && r(function() {
  10918. e(t)
  10919. }),
  10920. v.each(t, function(e) {
  10921. e.updateDisplay()
  10922. })
  10923. }(this.__listening)
  10924. }
  10925. }),
  10926. R
  10927. }(ee.utils.css, 0, 0, ee.controllers.factory = (h = ee.controllers.OptionController,
  10928. u = ee.controllers.NumberControllerBox,
  10929. d = ee.controllers.NumberControllerSlider,
  10930. p = ee.controllers.StringController = (v = ee.controllers.Controller,
  10931. y = ee.dom.dom,
  10932. A = ee.utils.common,
  10933. (C = function(e, t) {
  10934. function i() {
  10935. n.setValue(n.__input.value)
  10936. }
  10937. C.superclass.call(this, e, t);
  10938. var n = this;
  10939. this.__input = document.createElement("input"),
  10940. this.__input.setAttribute("type", "text"),
  10941. y.bind(this.__input, "keyup", i),
  10942. y.bind(this.__input, "change", i),
  10943. y.bind(this.__input, "blur", function() {
  10944. n.__onFinishChange && n.__onFinishChange.call(n, n.getValue())
  10945. }),
  10946. y.bind(this.__input, "keydown", function(e) {
  10947. 13 === e.keyCode && this.blur()
  10948. }),
  10949. this.updateDisplay(),
  10950. this.domElement.appendChild(this.__input)
  10951. }
  10952. ).superclass = v,
  10953. A.extend(C.prototype, v.prototype, {
  10954. updateDisplay: function() {
  10955. return y.isActive(this.__input) || (this.__input.value = this.getValue()),
  10956. C.superclass.prototype.updateDisplay.call(this)
  10957. }
  10958. }),
  10959. C),
  10960. f = ee.controllers.FunctionController,
  10961. g = ee.controllers.BooleanController,
  10962. m = ee.utils.common,
  10963. function(e, t) {
  10964. var i = e[t];
  10965. 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,{
  10966. min: arguments[2],
  10967. max: arguments[3]
  10968. }) : m.isString(i) ? new p(e,t) : m.isFunction(i) ? new f(e,t,"") : m.isBoolean(i) ? new g(e,t) : void 0
  10969. }
  10970. ), 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) {
  10971. function f(t, i, n, r) {
  10972. t.style.background = "",
  10973. p.each(o, function(e) {
  10974. t.style.cssText += "background: " + e + "linear-gradient(" + i + ", " + n + " 0%, " + r + " 100%); "
  10975. })
  10976. }
  10977. var g = function(e, t) {
  10978. function i(e) {
  10979. a(e),
  10980. h.bind(window, "mousemove", a),
  10981. h.bind(window, "mouseup", n)
  10982. }
  10983. function n() {
  10984. h.unbind(window, "mousemove", a),
  10985. h.unbind(window, "mouseup", n)
  10986. }
  10987. function r() {
  10988. var e = d(this.value);
  10989. !1 !== e ? (l.__color.__state = e,
  10990. l.setValue(l.__color.toOriginal())) : this.value = l.__color.toString()
  10991. }
  10992. function o() {
  10993. h.unbind(window, "mousemove", s),
  10994. h.unbind(window, "mouseup", o)
  10995. }
  10996. function a(e) {
  10997. e.preventDefault();
  10998. var t = h.getWidth(l.__saturation_field)
  10999. , i = h.getOffset(l.__saturation_field)
  11000. , n = (e.clientX - i.left + document.body.scrollLeft) / t
  11001. , r = 1 - (e.clientY - i.top + document.body.scrollTop) / t;
  11002. return 1 < r ? r = 1 : r < 0 && (r = 0),
  11003. 1 < n ? n = 1 : n < 0 && (n = 0),
  11004. l.__color.v = r,
  11005. l.__color.s = n,
  11006. l.setValue(l.__color.toOriginal()),
  11007. !1
  11008. }
  11009. function s(e) {
  11010. e.preventDefault();
  11011. var t = h.getHeight(l.__hue_field)
  11012. , i = h.getOffset(l.__hue_field)
  11013. , n = 1 - (e.clientY - i.top + document.body.scrollTop) / t;
  11014. return 1 < n ? n = 1 : n < 0 && (n = 0),
  11015. l.__color.h = 360 * n,
  11016. l.setValue(l.__color.toOriginal()),
  11017. !1
  11018. }
  11019. g.superclass.call(this, e, t),
  11020. this.__color = new u(this.getValue()),
  11021. this.__temp = new u(0);
  11022. var l = this;
  11023. this.domElement = document.createElement("div"),
  11024. h.makeSelectable(this.domElement, !1),
  11025. this.__selector = document.createElement("div"),
  11026. this.__selector.className = "selector",
  11027. this.__saturation_field = document.createElement("div"),
  11028. this.__saturation_field.className = "saturation-field",
  11029. this.__field_knob = document.createElement("div"),
  11030. this.__field_knob.className = "field-knob",
  11031. this.__field_knob_border = "2px solid ",
  11032. this.__hue_knob = document.createElement("div"),
  11033. this.__hue_knob.className = "hue-knob",
  11034. this.__hue_field = document.createElement("div"),
  11035. this.__hue_field.className = "hue-field",
  11036. this.__input = document.createElement("input"),
  11037. this.__input.type = "text",
  11038. this.__input_textShadow = "0 1px 1px ",
  11039. h.bind(this.__input, "keydown", function(e) {
  11040. 13 === e.keyCode && r.call(this)
  11041. }),
  11042. h.bind(this.__input, "blur", r),
  11043. h.bind(this.__selector, "mousedown", function(e) {
  11044. h.addClass(this, "drag").bind(window, "mouseup", function(e) {
  11045. h.removeClass(l.__selector, "drag")
  11046. })
  11047. });
  11048. var c = document.createElement("div");
  11049. p.extend(this.__selector.style, {
  11050. width: "122px",
  11051. height: "102px",
  11052. padding: "3px",
  11053. backgroundColor: "#222",
  11054. boxShadow: "0px 1px 3px rgba(0,0,0,0.3)"
  11055. }),
  11056. p.extend(this.__field_knob.style, {
  11057. position: "absolute",
  11058. width: "12px",
  11059. height: "12px",
  11060. border: this.__field_knob_border + (this.__color.v < .5 ? "#fff" : "#000"),
  11061. boxShadow: "0px 1px 3px rgba(0,0,0,0.5)",
  11062. borderRadius: "12px",
  11063. zIndex: 1
  11064. }),
  11065. p.extend(this.__hue_knob.style, {
  11066. position: "absolute",
  11067. width: "15px",
  11068. height: "2px",
  11069. borderRight: "4px solid #fff",
  11070. zIndex: 1
  11071. }),
  11072. p.extend(this.__saturation_field.style, {
  11073. width: "100px",
  11074. height: "100px",
  11075. border: "1px solid #555",
  11076. marginRight: "3px",
  11077. display: "inline-block",
  11078. cursor: "pointer"
  11079. }),
  11080. p.extend(c.style, {
  11081. width: "100%",
  11082. height: "100%",
  11083. background: "none"
  11084. }),
  11085. f(c, "top", "rgba(0,0,0,0)", "#000"),
  11086. p.extend(this.__hue_field.style, {
  11087. width: "15px",
  11088. height: "100px",
  11089. display: "inline-block",
  11090. border: "1px solid #555",
  11091. cursor: "ns-resize"
  11092. }),
  11093. function(e) {
  11094. e.style.background = "",
  11095. e.style.cssText += "background: -moz-linear-gradient(top, #ff0000 0%, #ff00ff 17%, #0000ff 34%, #00ffff 50%, #00ff00 67%, #ffff00 84%, #ff0000 100%);",
  11096. e.style.cssText += "background: -webkit-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);",
  11097. e.style.cssText += "background: -o-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);",
  11098. e.style.cssText += "background: -ms-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);",
  11099. e.style.cssText += "background: linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);"
  11100. }(this.__hue_field),
  11101. p.extend(this.__input.style, {
  11102. outline: "none",
  11103. textAlign: "center",
  11104. color: "#fff",
  11105. border: 0,
  11106. fontWeight: "bold",
  11107. textShadow: this.__input_textShadow + "rgba(0,0,0,0.7)"
  11108. }),
  11109. h.bind(this.__saturation_field, "mousedown", i),
  11110. h.bind(this.__field_knob, "mousedown", i),
  11111. h.bind(this.__hue_field, "mousedown", function(e) {
  11112. s(e),
  11113. h.bind(window, "mousemove", s),
  11114. h.bind(window, "mouseup", o)
  11115. }),
  11116. this.__saturation_field.appendChild(c),
  11117. this.__selector.appendChild(this.__field_knob),
  11118. this.__selector.appendChild(this.__saturation_field),
  11119. this.__selector.appendChild(this.__hue_field),
  11120. this.__hue_field.appendChild(this.__hue_knob),
  11121. this.domElement.appendChild(this.__input),
  11122. this.domElement.appendChild(this.__selector),
  11123. this.updateDisplay()
  11124. };
  11125. g.superclass = e,
  11126. p.extend(g.prototype, e.prototype, {
  11127. updateDisplay: function() {
  11128. var t = d(this.getValue());
  11129. if (!1 !== t) {
  11130. var i = !1;
  11131. p.each(u.COMPONENTS, function(e) {
  11132. if (!p.isUndefined(t[e]) && !p.isUndefined(this.__color.__state[e]) && t[e] !== this.__color.__state[e])
  11133. return i = !0,
  11134. {}
  11135. }, this),
  11136. i && p.extend(this.__color.__state, t)
  11137. }
  11138. p.extend(this.__temp.__state, this.__color.__state),
  11139. this.__temp.a = 1;
  11140. var e = this.__color.v < .5 || .5 < this.__color.s ? 255 : 0
  11141. , n = 255 - e;
  11142. p.extend(this.__field_knob.style, {
  11143. marginLeft: 100 * this.__color.s - 7 + "px",
  11144. marginTop: 100 * (1 - this.__color.v) - 7 + "px",
  11145. backgroundColor: this.__temp.toString(),
  11146. border: this.__field_knob_border + "rgb(" + e + "," + e + "," + e + ")"
  11147. }),
  11148. this.__hue_knob.style.marginTop = 100 * (1 - this.__color.h / 360) + "px",
  11149. this.__temp.s = 1,
  11150. this.__temp.v = 1,
  11151. f(this.__saturation_field, "left", "#fff", this.__temp.toString()),
  11152. p.extend(this.__input.style, {
  11153. backgroundColor: this.__input.value = this.__color.toString(),
  11154. color: "rgb(" + e + "," + e + "," + e + ")",
  11155. textShadow: this.__input_textShadow + "rgba(" + n + "," + n + "," + n + ",.7)"
  11156. })
  11157. }
  11158. });
  11159. var o = ["-moz-", "-o-", "-webkit-", "-ms-", ""];
  11160. return g
  11161. }(ee.controllers.Controller, ee.dom.dom, ee.color.Color = (o = ee.color.interpret,
  11162. a = ee.color.math = {
  11163. hsv_to_rgb: function(e, t, i) {
  11164. var n = Math.floor(e / 60) % 6
  11165. , r = e / 60 - Math.floor(e / 60)
  11166. , o = i * (1 - t)
  11167. , a = i * (1 - r * t)
  11168. , s = i * (1 - (1 - r) * t)
  11169. , l = [[i, s, o], [a, i, o], [o, i, s], [o, a, i], [s, o, i], [i, o, a]][n];
  11170. return {
  11171. r: 255 * l[0],
  11172. g: 255 * l[1],
  11173. b: 255 * l[2]
  11174. }
  11175. },
  11176. rgb_to_hsv: function(e, t, i) {
  11177. var n, r = Math.min(e, t, i), o = Math.max(e, t, i), a = o - r;
  11178. return 0 == o ? {
  11179. h: NaN,
  11180. s: 0,
  11181. v: 0
  11182. } : (n = e == o ? (t - i) / a : t == o ? 2 + (i - e) / a : 4 + (e - t) / a,
  11183. (n /= 6) < 0 && (n += 1),
  11184. {
  11185. h: 360 * n,
  11186. s: a / o,
  11187. v: o / 255
  11188. })
  11189. },
  11190. rgb_to_hex: function(e, t, i) {
  11191. var n = this.hex_with_component(0, 2, e);
  11192. return n = this.hex_with_component(n, 1, t),
  11193. this.hex_with_component(n, 0, i)
  11194. },
  11195. component_from_hex: function(e, t) {
  11196. return e >> 8 * t & 255
  11197. },
  11198. hex_with_component: function(e, t, i) {
  11199. return i << (c = 8 * t) | e & ~(255 << c)
  11200. }
  11201. },
  11202. s = ee.color.toString,
  11203. l = ee.utils.common,
  11204. ae.COMPONENTS = ["r", "g", "b", "h", "s", "v", "hex", "a"],
  11205. l.extend(ae.prototype, {
  11206. toString: function() {
  11207. return s(this)
  11208. },
  11209. toOriginal: function() {
  11210. return this.__state.conversion.write(this)
  11211. }
  11212. }),
  11213. ie(ae.prototype, "r", 2),
  11214. ie(ae.prototype, "g", 1),
  11215. ie(ae.prototype, "b", 0),
  11216. ne(ae.prototype, "h"),
  11217. ne(ae.prototype, "s"),
  11218. ne(ae.prototype, "v"),
  11219. Object.defineProperty(ae.prototype, "a", {
  11220. get: function() {
  11221. return this.__state.a
  11222. },
  11223. set: function(e) {
  11224. this.__state.a = e
  11225. }
  11226. }),
  11227. Object.defineProperty(ae.prototype, "hex", {
  11228. get: function() {
  11229. return "HEX" !== !this.__state.space && (this.__state.hex = a.rgb_to_hex(this.r, this.g, this.b)),
  11230. this.__state.hex
  11231. },
  11232. set: function(e) {
  11233. this.__state.space = "HEX",
  11234. this.__state.hex = e
  11235. }
  11236. }),
  11237. ae), ee.color.interpret, ee.utils.common), ee.utils.requestAnimationFrame = window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || window.oRequestAnimationFrame || window.msRequestAnimationFrame || function(e, t) {
  11238. window.setTimeout(e, 1e3 / 60)
  11239. }
  11240. , ee.dom.CenteredDiv = (n = ee.dom.dom,
  11241. r = ee.utils.common,
  11242. te.prototype.show = function() {
  11243. var e = this;
  11244. this.backgroundElement.style.display = "block",
  11245. this.domElement.style.display = "block",
  11246. this.domElement.style.opacity = 0,
  11247. this.domElement.style.webkitTransform = "scale(1.1)",
  11248. this.layout(),
  11249. r.defer(function() {
  11250. e.backgroundElement.style.opacity = 1,
  11251. e.domElement.style.opacity = 1,
  11252. e.domElement.style.webkitTransform = "scale(1)"
  11253. })
  11254. }
  11255. ,
  11256. te.prototype.hide = function() {
  11257. var e = this
  11258. , t = function() {
  11259. e.domElement.style.display = "none",
  11260. e.backgroundElement.style.display = "none",
  11261. n.unbind(e.domElement, "webkitTransitionEnd", t),
  11262. n.unbind(e.domElement, "transitionend", t),
  11263. n.unbind(e.domElement, "oTransitionEnd", t)
  11264. };
  11265. n.bind(this.domElement, "webkitTransitionEnd", t),
  11266. n.bind(this.domElement, "transitionend", t),
  11267. n.bind(this.domElement, "oTransitionEnd", t),
  11268. this.backgroundElement.style.opacity = 0,
  11269. this.domElement.style.opacity = 0,
  11270. this.domElement.style.webkitTransform = "scale(1.1)"
  11271. }
  11272. ,
  11273. te.prototype.layout = function() {
  11274. this.domElement.style.left = $("#player").width() / 2 - n.getWidth(this.domElement) / 2 + "px",
  11275. this.domElement.style.top = $("#player").height() / 2 - n.getHeight(this.domElement) / 2 + "px"
  11276. }
  11277. ,
  11278. te), ee.dom.dom, ee.utils.common)
  11279. }
  11280. , {}],
  11281. 94: [function(e, t, i) {
  11282. (function(J) {
  11283. "use strict";
  11284. function i(e) {
  11285. function t(e, t) {
  11286. for (var i = 0, n = 0, r = new Array, o = 1; o <= 16; o++) {
  11287. for (var a = 1; a <= e[o]; a++)
  11288. r[t[n]] = [],
  11289. r[t[n]][0] = i,
  11290. r[t[n]][1] = o,
  11291. n++,
  11292. i++;
  11293. i *= 2
  11294. }
  11295. return r
  11296. }
  11297. function _(e) {
  11298. for (var t = e[0], i = e[1] - 1; 0 <= i; )
  11299. t & 1 << i && (B |= 1 << V),
  11300. i--,
  11301. --V < 0 && (255 == B ? (b(255),
  11302. b(0)) : b(B),
  11303. V = 7,
  11304. B = 0)
  11305. }
  11306. function b(e) {
  11307. F.push(e)
  11308. }
  11309. function w(e) {
  11310. b(e >> 8 & 255),
  11311. b(255 & e)
  11312. }
  11313. function T(e, t, i, n, r) {
  11314. for (var o, a = r[0], s = r[240], l = function(e, t) {
  11315. var i, n, r, o, a, s, l, c, h, u, d = 0;
  11316. for (h = 0; h < 8; ++h) {
  11317. i = e[d],
  11318. n = e[d + 1],
  11319. r = e[d + 2],
  11320. o = e[d + 3],
  11321. a = e[d + 4],
  11322. s = e[d + 5],
  11323. l = e[d + 6];
  11324. var p = i + (c = e[d + 7])
  11325. , f = i - c
  11326. , g = n + l
  11327. , m = n - l
  11328. , v = r + s
  11329. , y = r - s
  11330. , A = o + a
  11331. , C = o - a
  11332. , I = p + A
  11333. , E = p - A
  11334. , _ = g + v
  11335. , b = g - v;
  11336. e[d] = I + _,
  11337. e[d + 4] = I - _;
  11338. var w = .707106781 * (b + E);
  11339. e[d + 2] = E + w,
  11340. e[d + 6] = E - w;
  11341. var T = .382683433 * ((I = C + y) - (b = m + f))
  11342. , x = .5411961 * I + T
  11343. , S = 1.306562965 * b + T
  11344. , M = .707106781 * (_ = y + m)
  11345. , R = f + M
  11346. , P = f - M;
  11347. e[d + 5] = P + x,
  11348. e[d + 3] = P - x,
  11349. e[d + 1] = R + S,
  11350. e[d + 7] = R - S,
  11351. d += 8
  11352. }
  11353. for (h = d = 0; h < 8; ++h) {
  11354. i = e[d],
  11355. n = e[d + 8],
  11356. r = e[d + 16],
  11357. o = e[d + 24],
  11358. a = e[d + 32],
  11359. s = e[d + 40],
  11360. l = e[d + 48];
  11361. var O = i + (c = e[d + 56])
  11362. , L = i - c
  11363. , D = n + l
  11364. , N = n - l
  11365. , F = r + s
  11366. , B = r - s
  11367. , V = o + a
  11368. , k = o - a
  11369. , U = O + V
  11370. , H = O - V
  11371. , z = D + F
  11372. , G = D - F;
  11373. e[d] = U + z,
  11374. e[d + 32] = U - z;
  11375. var W = .707106781 * (G + H);
  11376. e[d + 16] = H + W,
  11377. e[d + 48] = H - W;
  11378. var j = .382683433 * ((U = k + B) - (G = N + L))
  11379. , Y = .5411961 * U + j
  11380. , q = 1.306562965 * G + j
  11381. , X = .707106781 * (z = B + N)
  11382. , Z = L + X
  11383. , K = L - X;
  11384. e[d + 40] = K + Y,
  11385. e[d + 24] = K - Y,
  11386. e[d + 8] = Z + q,
  11387. e[d + 56] = Z - q,
  11388. d++
  11389. }
  11390. for (h = 0; h < 64; ++h)
  11391. u = e[h] * t[h],
  11392. Q[h] = 0 < u ? .5 + u | 0 : u - .5 | 0;
  11393. return Q
  11394. }(e, t), c = 0; c < 64; ++c)
  11395. A[C[c]] = l[c];
  11396. var h = A[0] - i;
  11397. i = A[0],
  11398. 0 == h ? _(n[0]) : (_(n[y[o = 32767 + h]]),
  11399. _(v[o]));
  11400. for (var u = 63; 0 < u && 0 == A[u]; u--)
  11401. ;
  11402. if (0 == u)
  11403. return _(a),
  11404. i;
  11405. for (var d, p = 1; p <= u; ) {
  11406. for (var f = p; 0 == A[p] && p <= u; ++p)
  11407. ;
  11408. var g = p - f;
  11409. if (16 <= g) {
  11410. d = g >> 4;
  11411. for (var m = 1; m <= d; ++m)
  11412. _(s);
  11413. g &= 15
  11414. }
  11415. o = 32767 + A[p],
  11416. _(r[(g << 4) + y[o]]),
  11417. _(v[o]),
  11418. p++
  11419. }
  11420. return 63 != u && _(a),
  11421. i
  11422. }
  11423. function x(e) {
  11424. if (e <= 0 && (e = 1),
  11425. 100 < e && (e = 100),
  11426. i != e) {
  11427. (function(e) {
  11428. 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++) {
  11429. var n = u((t[i] * e + 50) / 100);
  11430. n < 1 ? n = 1 : 255 < n && (n = 255),
  11431. O[C[i]] = n
  11432. }
  11433. 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++) {
  11434. var a = u((r[o] * e + 50) / 100);
  11435. a < 1 ? a = 1 : 255 < a && (a = 255),
  11436. L[C[o]] = a
  11437. }
  11438. for (var s = [1, 1.387039845, 1.306562965, 1.175875602, 1, .785694958, .5411961, .275899379], l = 0, c = 0; c < 8; c++)
  11439. for (var h = 0; h < 8; h++)
  11440. D[l] = 1 / (O[C[l]] * s[c] * s[h] * 8),
  11441. N[l] = 1 / (L[C[l]] * s[c] * s[h] * 8),
  11442. l++
  11443. }
  11444. )(e < 50 ? Math.floor(5e3 / e) : Math.floor(200 - 2 * e)),
  11445. i = e
  11446. }
  11447. }
  11448. var S, M, R, P, i, u = (Math.round,
  11449. 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];
  11450. this.encode = function(e, t) {
  11451. var i = ((new Date).getTime(),
  11452. t.quality);
  11453. i && x(i),
  11454. F = new Array,
  11455. B = 0,
  11456. V = 7,
  11457. w(65496),
  11458. w(65504),
  11459. w(16),
  11460. b(74),
  11461. b(70),
  11462. b(73),
  11463. b(70),
  11464. b(0),
  11465. b(1),
  11466. b(1),
  11467. b(0),
  11468. w(1),
  11469. w(1),
  11470. b(0),
  11471. b(0),
  11472. function() {
  11473. w(65499),
  11474. w(132),
  11475. b(0);
  11476. for (var e = 0; e < 64; e++)
  11477. b(O[e]);
  11478. b(1);
  11479. for (var t = 0; t < 64; t++)
  11480. b(L[t])
  11481. }(),
  11482. function(e, t) {
  11483. w(65472),
  11484. w(17),
  11485. b(8),
  11486. w(t),
  11487. w(e),
  11488. b(3),
  11489. b(1),
  11490. b(17),
  11491. b(0),
  11492. b(2),
  11493. b(17),
  11494. b(1),
  11495. b(3),
  11496. b(17),
  11497. b(1)
  11498. }(e.width, e.height),
  11499. function() {
  11500. w(65476),
  11501. w(418),
  11502. b(0);
  11503. for (var e = 0; e < 16; e++)
  11504. b(G[e + 1]);
  11505. for (var t = 0; t <= 11; t++)
  11506. b(W[t]);
  11507. b(16);
  11508. for (var i = 0; i < 16; i++)
  11509. b(j[i + 1]);
  11510. for (var n = 0; n <= 161; n++)
  11511. b(Y[n]);
  11512. b(1);
  11513. for (var r = 0; r < 16; r++)
  11514. b(q[r + 1]);
  11515. for (var o = 0; o <= 11; o++)
  11516. b(X[o]);
  11517. b(17);
  11518. for (var a = 0; a < 16; a++)
  11519. b(Z[a + 1]);
  11520. for (var s = 0; s <= 161; s++)
  11521. b(K[s])
  11522. }(),
  11523. w(65498),
  11524. w(12),
  11525. b(3),
  11526. b(1),
  11527. b(0),
  11528. b(2),
  11529. b(17),
  11530. b(3),
  11531. b(17),
  11532. b(0),
  11533. b(63),
  11534. b(0);
  11535. var n = 0
  11536. , r = 0
  11537. , o = 0;
  11538. B = 0,
  11539. V = 7,
  11540. this.encode.displayName = "_encode_";
  11541. 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; ) {
  11542. for (a = 0; a < A; ) {
  11543. for (u = h = A * C + a,
  11544. d = -1,
  11545. f = p = 0; f < 64; f++)
  11546. u = h + (p = (y ? 63 - f : f) >> 3) * A + (d = 4 * (7 & f)),
  11547. v <= C + p && (u -= A * (C + 1 + p - v)),
  11548. A <= a + d && (u -= a + d - A + 4),
  11549. s = g[u++],
  11550. l = g[u++],
  11551. c = g[u++],
  11552. k[f] = (z[s] + z[l + 256 >> 0] + z[c + 512 >> 0] >> 16) - 128,
  11553. U[f] = (z[s + 768 >> 0] + z[l + 1024 >> 0] + z[c + 1280 >> 0] >> 16) - 128,
  11554. H[f] = (z[s + 1280 >> 0] + z[l + 1536 >> 0] + z[c + 1792 >> 0] >> 16) - 128;
  11555. n = T(k, D, n, S, R),
  11556. r = T(U, N, r, M, P),
  11557. o = T(H, N, o, M, P),
  11558. a += 32
  11559. }
  11560. C += I
  11561. }
  11562. if (0 <= V) {
  11563. var E = [];
  11564. E[1] = V + 1,
  11565. E[0] = (1 << V + 1) - 1,
  11566. _(E)
  11567. }
  11568. return w(65497),
  11569. new J(F)
  11570. }
  11571. ,
  11572. (new Date).getTime(),
  11573. e = e || 50,
  11574. function() {
  11575. for (var e = String.fromCharCode, t = 0; t < 256; t++)
  11576. n[t] = e(t)
  11577. }(),
  11578. S = t(G, W),
  11579. M = t(q, X),
  11580. R = t(j, Y),
  11581. P = t(Z, K),
  11582. function() {
  11583. for (var e = 1, t = 2, i = 1; i <= 15; i++) {
  11584. for (var n = e; n < t; n++)
  11585. y[32767 + n] = i,
  11586. v[32767 + n] = [],
  11587. v[32767 + n][1] = i,
  11588. v[32767 + n][0] = n;
  11589. for (var r = -(t - 1); r <= -e; r++)
  11590. y[32767 + r] = i,
  11591. v[32767 + r] = [],
  11592. v[32767 + r][1] = i,
  11593. v[32767 + r][0] = t - 1 + r;
  11594. e <<= 1,
  11595. t <<= 1
  11596. }
  11597. }(),
  11598. function() {
  11599. for (var e = 0; e < 256; e++)
  11600. z[e] = 19595 * e,
  11601. z[e + 256 >> 0] = 38470 * e,
  11602. z[e + 512 >> 0] = 7471 * e + 32768,
  11603. z[e + 768 >> 0] = -11059 * e,
  11604. z[e + 1024 >> 0] = -21709 * e,
  11605. z[e + 1280 >> 0] = 32768 * e + 8421375,
  11606. z[e + 1536 >> 0] = -27439 * e,
  11607. z[e + 1792 >> 0] = -5329 * e
  11608. }(),
  11609. x(e),
  11610. (new Date).getTime()
  11611. }
  11612. t.exports.encode = function(e, t) {
  11613. return (t = t || {}).quality = t.quality || 50,
  11614. {
  11615. data: new i(t.quality).encode(e, t),
  11616. width: e.width,
  11617. height: e.height
  11618. }
  11619. }
  11620. }
  11621. ).call(this, e("buffer").Buffer)
  11622. }
  11623. , {
  11624. buffer: 198
  11625. }],
  11626. 95: [function(e, t, i) {
  11627. "use strict";
  11628. !function() {
  11629. if ("performance"in window == 0 && (window.performance = {}),
  11630. Date.now = Date.now || function() {
  11631. return (new Date).getTime()
  11632. }
  11633. ,
  11634. "now"in window.performance == 0) {
  11635. var e = Date.now();
  11636. performance.timing && performance.timing.navigationStart && (e = performance.timing.navigationStart),
  11637. window.performance.now = function() {
  11638. return Date.now() - e
  11639. }
  11640. }
  11641. }()
  11642. }
  11643. , {}],
  11644. 96: [function(e, t, i) {
  11645. "use strict";
  11646. var a = e("three");
  11647. a.EffectComposer = function(e, t) {
  11648. if (this.renderer = e,
  11649. void 0 === t) {
  11650. var i = {
  11651. minFilter: a.LinearFilter,
  11652. magFilter: a.LinearFilter,
  11653. format: a.RGBAFormat,
  11654. stencilBuffer: !1
  11655. }
  11656. , n = e.getSize();
  11657. t = new a.WebGLRenderTarget(n.width,n.height,i)
  11658. }
  11659. this.renderTarget1 = t,
  11660. this.renderTarget2 = t.clone(),
  11661. this.writeBuffer = this.renderTarget1,
  11662. this.readBuffer = this.renderTarget2,
  11663. this.passes = [],
  11664. void 0 === a.CopyShader && console.error("THREE.EffectComposer relies on THREE.CopyShader"),
  11665. this.copyPass = new a.ShaderPass(a.CopyShader)
  11666. }
  11667. ,
  11668. a.EffectComposer.prototype = {
  11669. swapBuffers: function() {
  11670. var e = this.readBuffer;
  11671. this.readBuffer = this.writeBuffer,
  11672. this.writeBuffer = e
  11673. },
  11674. addPass: function(e) {
  11675. this.passes.push(e)
  11676. },
  11677. insertPass: function(e, t) {
  11678. this.passes.splice(t, 0, e)
  11679. },
  11680. render: function(e) {
  11681. this.writeBuffer = this.renderTarget1,
  11682. this.readBuffer = this.renderTarget2;
  11683. var t, i, n = !1, r = this.passes.length;
  11684. for (i = 0; i < r; i++)
  11685. if ((t = this.passes[i]).enabled) {
  11686. if (t.render(this.renderer, this.writeBuffer, this.readBuffer, e, n),
  11687. t.needsSwap) {
  11688. if (n) {
  11689. var o = this.renderer.context;
  11690. o.stencilFunc(o.NOTEQUAL, 1, 4294967295),
  11691. this.copyPass.render(this.renderer, this.writeBuffer, this.readBuffer, e),
  11692. o.stencilFunc(o.EQUAL, 1, 4294967295)
  11693. }
  11694. this.swapBuffers()
  11695. }
  11696. t instanceof a.MaskPass ? n = !0 : t instanceof a.ClearMaskPass && (n = !1)
  11697. }
  11698. },
  11699. reset: function(e) {
  11700. if (void 0 === e) {
  11701. var t = this.renderer.getSize();
  11702. (e = this.renderTarget1.clone()).setSize(t.width, t.height)
  11703. }
  11704. this.renderTarget1.dispose(),
  11705. this.renderTarget2.dispose(),
  11706. this.renderTarget1 = e,
  11707. this.renderTarget2 = e.clone(),
  11708. this.writeBuffer = this.renderTarget1,
  11709. this.readBuffer = this.renderTarget2
  11710. },
  11711. setSize: function(e, t) {
  11712. this.renderTarget1.setSize(e, t),
  11713. this.renderTarget2.setSize(e, t)
  11714. }
  11715. }
  11716. }
  11717. , {
  11718. three: 217
  11719. }],
  11720. 97: [function(e, t, i) {
  11721. "use strict";
  11722. var n = e("three");
  11723. n.MaskPass = function(e, t) {
  11724. this.scene = e,
  11725. this.camera = t,
  11726. this.enabled = !0,
  11727. this.clear = !0,
  11728. this.needsSwap = !1,
  11729. this.inverse = !1
  11730. }
  11731. ,
  11732. n.MaskPass.prototype = {
  11733. render: function(e, t, i, n) {
  11734. var r, o, a = e.context;
  11735. a.colorMask(!1, !1, !1, !1),
  11736. a.depthMask(!1),
  11737. o = this.inverse ? (r = 0,
  11738. 1) : (r = 1,
  11739. 0),
  11740. a.enable(a.STENCIL_TEST),
  11741. a.stencilOp(a.REPLACE, a.REPLACE, a.REPLACE),
  11742. a.stencilFunc(a.ALWAYS, r, 4294967295),
  11743. a.clearStencil(o),
  11744. e.render(this.scene, this.camera, i, this.clear),
  11745. e.render(this.scene, this.camera, t, this.clear),
  11746. a.colorMask(!0, !0, !0, !0),
  11747. a.depthMask(!0),
  11748. a.stencilFunc(a.EQUAL, 1, 4294967295),
  11749. a.stencilOp(a.KEEP, a.KEEP, a.KEEP)
  11750. }
  11751. },
  11752. n.ClearMaskPass = function() {
  11753. this.enabled = !0
  11754. }
  11755. ,
  11756. n.ClearMaskPass.prototype = {
  11757. render: function(e, t, i, n) {
  11758. var r = e.context;
  11759. r.disable(r.STENCIL_TEST)
  11760. }
  11761. }
  11762. }
  11763. , {
  11764. three: 217
  11765. }],
  11766. 98: [function(e, t, i) {
  11767. "use strict";
  11768. var o = e("three");
  11769. o.RenderPass = function(e, t, i, n, r) {
  11770. this.scene = e,
  11771. this.camera = t,
  11772. this.overrideMaterial = i,
  11773. this.clearColor = n,
  11774. this.clearAlpha = void 0 !== r ? r : 1,
  11775. this.oldClearColor = new o.Color,
  11776. this.oldClearAlpha = 1,
  11777. this.enabled = !0,
  11778. this.clear = !0,
  11779. this.needsSwap = !1
  11780. }
  11781. ,
  11782. o.RenderPass.prototype = {
  11783. render: function(e, t, i, n) {
  11784. this.scene.overrideMaterial = this.overrideMaterial,
  11785. this.clearColor && (this.oldClearColor.copy(e.getClearColor()),
  11786. this.oldClearAlpha = e.getClearAlpha(),
  11787. e.setClearColor(this.clearColor, this.clearAlpha)),
  11788. e.render(this.scene, this.camera, i, this.clear),
  11789. this.clearColor && e.setClearColor(this.oldClearColor, this.oldClearAlpha),
  11790. this.scene.overrideMaterial = null
  11791. }
  11792. }
  11793. }
  11794. , {
  11795. three: 217
  11796. }],
  11797. 99: [function(e, t, i) {
  11798. "use strict";
  11799. var n = e("three");
  11800. n.ShaderPass = function(e, t) {
  11801. this.textureID = void 0 !== t ? t : "tDiffuse",
  11802. e instanceof n.ShaderMaterial ? (this.uniforms = e.uniforms,
  11803. this.material = e) : e && (this.uniforms = n.UniformsUtils.clone(e.uniforms),
  11804. this.material = new n.ShaderMaterial({
  11805. defines: e.defines || {},
  11806. uniforms: this.uniforms,
  11807. vertexShader: e.vertexShader,
  11808. fragmentShader: e.fragmentShader
  11809. })),
  11810. this.renderToScreen = !1,
  11811. this.enabled = !0,
  11812. this.needsSwap = !0,
  11813. this.clear = !1,
  11814. this.camera = new n.OrthographicCamera(-1,1,1,-1,0,1),
  11815. this.scene = new n.Scene,
  11816. this.quad = new n.Mesh(new n.PlaneBufferGeometry(2,2),null),
  11817. this.scene.add(this.quad)
  11818. }
  11819. ,
  11820. n.ShaderPass.prototype = {
  11821. render: function(e, t, i, n) {
  11822. this.uniforms[this.textureID] && (this.uniforms[this.textureID].value = i),
  11823. this.quad.material = this.material,
  11824. this.renderToScreen ? e.render(this.scene, this.camera) : e.render(this.scene, this.camera, t, this.clear)
  11825. }
  11826. }
  11827. }
  11828. , {
  11829. three: 217
  11830. }],
  11831. 100: [function(e, t, i) {
  11832. "use strict";
  11833. e("three").CopyShader = {
  11834. uniforms: {
  11835. tDiffuse: {
  11836. type: "t",
  11837. value: null
  11838. },
  11839. opacity: {
  11840. type: "f",
  11841. value: 1
  11842. }
  11843. },
  11844. vertexShader: ["varying vec2 vUv;", "void main() {", "vUv = uv;", "gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );", "}"].join("\n"),
  11845. fragmentShader: ["uniform float opacity;", "uniform sampler2D tDiffuse;", "varying vec2 vUv;", "void main() {", "vec4 texel = texture2D( tDiffuse, vUv );", "gl_FragColor = opacity * texel;", "}"].join("\n")
  11846. }
  11847. }
  11848. , {
  11849. three: 217
  11850. }],
  11851. 101: [function(e, t, i) {
  11852. "use strict";
  11853. e("three").HorizontalBlurShader = {
  11854. uniforms: {
  11855. tDiffuse: {
  11856. type: "t",
  11857. value: null
  11858. },
  11859. h: {
  11860. type: "f",
  11861. value: 1 / 512
  11862. }
  11863. },
  11864. vertexShader: ["varying vec2 vUv;", "void main() {", "vUv = uv;", "gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );", "}"].join("\n"),
  11865. 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")
  11866. }
  11867. }
  11868. , {
  11869. three: 217
  11870. }],
  11871. 102: [function(e, t, i) {
  11872. "use strict";
  11873. e("three").VerticalBlurShader = {
  11874. uniforms: {
  11875. tDiffuse: {
  11876. type: "t",
  11877. value: null
  11878. },
  11879. v: {
  11880. type: "f",
  11881. value: 1 / 512
  11882. }
  11883. },
  11884. vertexShader: ["varying vec2 vUv;", "void main() {", "vUv = uv;", "gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );", "}"].join("\n"),
  11885. 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")
  11886. }
  11887. }
  11888. , {
  11889. three: 217
  11890. }],
  11891. 103: [function(e, t, i) {
  11892. "use strict";
  11893. var z = e("three");
  11894. !function() {
  11895. if ("performance"in window == 0 && (window.performance = {}),
  11896. "now"in window.performance == 0) {
  11897. var e = Date.now();
  11898. performance.timing && performance.timing.navigationStart && (e = performance.timing.navigationStart),
  11899. window.performance.now = function() {
  11900. return Date.now() - e
  11901. }
  11902. }
  11903. }(),
  11904. z.WebGLRenderer.prototype.paramThreeToGL = function(e) {
  11905. var t, i = this.extensions, n = this.context;
  11906. if (e === z.RepeatWrapping)
  11907. return n.REPEAT;
  11908. if (e === z.ClampToEdgeWrapping)
  11909. return n.CLAMP_TO_EDGE;
  11910. if (e === z.MirroredRepeatWrapping)
  11911. return n.MIRRORED_REPEAT;
  11912. if (e === z.NearestFilter)
  11913. return n.NEAREST;
  11914. if (e === z.NearestMipMapNearestFilter)
  11915. return n.NEAREST_MIPMAP_NEAREST;
  11916. if (e === z.NearestMipMapLinearFilter)
  11917. return n.NEAREST_MIPMAP_LINEAR;
  11918. if (e === z.LinearFilter)
  11919. return n.LINEAR;
  11920. if (e === z.LinearMipMapNearestFilter)
  11921. return n.LINEAR_MIPMAP_NEAREST;
  11922. if (e === z.LinearMipMapLinearFilter)
  11923. return n.LINEAR_MIPMAP_LINEAR;
  11924. if (e === z.UnsignedByteType)
  11925. return n.UNSIGNED_BYTE;
  11926. if (e === z.UnsignedShort4444Type)
  11927. return n.UNSIGNED_SHORT_4_4_4_4;
  11928. if (e === z.UnsignedShort5551Type)
  11929. return n.UNSIGNED_SHORT_5_5_5_1;
  11930. if (e === z.UnsignedShort565Type)
  11931. return n.UNSIGNED_SHORT_5_6_5;
  11932. if (e === z.ByteType)
  11933. return n.BYTE;
  11934. if (e === z.ShortType)
  11935. return n.SHORT;
  11936. if (e === z.UnsignedShortType)
  11937. return n.UNSIGNED_SHORT;
  11938. if (e === z.IntType)
  11939. return n.INT;
  11940. if (e === z.UnsignedIntType)
  11941. return n.UNSIGNED_INT;
  11942. if (e === z.FloatType)
  11943. return n.FLOAT;
  11944. if (null !== (t = i.get("OES_texture_half_float")) && e === z.HalfFloatType)
  11945. return t.HALF_FLOAT_OES;
  11946. if (e === z.AlphaFormat)
  11947. return n.ALPHA;
  11948. if (e === z.RGBFormat)
  11949. return n.RGB;
  11950. if (e === z.RGBAFormat)
  11951. return n.RGBA;
  11952. if (e === z.LuminanceFormat)
  11953. return n.LUMINANCE;
  11954. if (e === z.LuminanceAlphaFormat)
  11955. return n.LUMINANCE_ALPHA;
  11956. if (e === z.AddEquation)
  11957. return n.FUNC_ADD;
  11958. if (e === z.SubtractEquation)
  11959. return n.FUNC_SUBTRACT;
  11960. if (e === z.ReverseSubtractEquation)
  11961. return n.FUNC_REVERSE_SUBTRACT;
  11962. if (e === z.ZeroFactor)
  11963. return n.ZERO;
  11964. if (e === z.OneFactor)
  11965. return n.ONE;
  11966. if (e === z.SrcColorFactor)
  11967. return n.SRC_COLOR;
  11968. if (e === z.OneMinusSrcColorFactor)
  11969. return n.ONE_MINUS_SRC_COLOR;
  11970. if (e === z.SrcAlphaFactor)
  11971. return n.SRC_ALPHA;
  11972. if (e === z.OneMinusSrcAlphaFactor)
  11973. return n.ONE_MINUS_SRC_ALPHA;
  11974. if (e === z.DstAlphaFactor)
  11975. return n.DST_ALPHA;
  11976. if (e === z.OneMinusDstAlphaFactor)
  11977. return n.ONE_MINUS_DST_ALPHA;
  11978. if (e === z.DstColorFactor)
  11979. return n.DST_COLOR;
  11980. if (e === z.OneMinusDstColorFactor)
  11981. return n.ONE_MINUS_DST_COLOR;
  11982. if (e === z.SrcAlphaSaturateFactor)
  11983. return n.SRC_ALPHA_SATURATE;
  11984. if (null !== (t = i.get("WEBGL_compressed_texture_s3tc"))) {
  11985. if (e === z.RGB_S3TC_DXT1_Format)
  11986. return t.COMPRESSED_RGB_S3TC_DXT1_EXT;
  11987. if (e === z.RGBA_S3TC_DXT1_Format)
  11988. return t.COMPRESSED_RGBA_S3TC_DXT1_EXT;
  11989. if (e === z.RGBA_S3TC_DXT3_Format)
  11990. return t.COMPRESSED_RGBA_S3TC_DXT3_EXT;
  11991. if (e === z.RGBA_S3TC_DXT5_Format)
  11992. return t.COMPRESSED_RGBA_S3TC_DXT5_EXT
  11993. }
  11994. if (null !== (t = i.get("WEBGL_compressed_texture_pvrtc"))) {
  11995. if (e === z.RGB_PVRTC_4BPPV1_Format)
  11996. return t.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;
  11997. if (e === z.RGB_PVRTC_2BPPV1_Format)
  11998. return t.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;
  11999. if (e === z.RGBA_PVRTC_4BPPV1_Format)
  12000. return t.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;
  12001. if (e === z.RGBA_PVRTC_2BPPV1_Format)
  12002. return t.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG
  12003. }
  12004. if (null !== (t = i.get("WEBGL_compressed_texture_etc1")) && e === z.RGB_ETC1_Format)
  12005. return t.COMPRESSED_RGB_ETC1_WEBGL;
  12006. if (null !== (t = i.get("EXT_blend_minmax"))) {
  12007. if (e === z.MinEquation)
  12008. return t.MIN_EXT;
  12009. if (e === z.MaxEquation)
  12010. return t.MAX_EXT
  12011. }
  12012. return 0
  12013. }
  12014. ,
  12015. z.WebGLState = function(l, i, c) {
  12016. var n = this
  12017. , r = new z.Vector4
  12018. , e = l.getParameter(l.MAX_VERTEX_ATTRIBS)
  12019. , o = new Uint8Array(e)
  12020. , a = new Uint8Array(e)
  12021. , s = new Uint8Array(e)
  12022. , t = {}
  12023. , h = null
  12024. , u = null
  12025. , d = null
  12026. , p = null
  12027. , f = null
  12028. , g = null
  12029. , m = null
  12030. , v = null
  12031. , y = !1
  12032. , A = null
  12033. , C = null
  12034. , I = null
  12035. , E = null
  12036. , _ = null
  12037. , b = null
  12038. , w = null
  12039. , T = null
  12040. , x = null
  12041. , S = null
  12042. , M = null
  12043. , R = null
  12044. , P = null
  12045. , O = null
  12046. , L = null
  12047. , D = l.getParameter(l.MAX_TEXTURE_IMAGE_UNITS)
  12048. , N = void 0
  12049. , F = {}
  12050. , B = new z.Vector4
  12051. , V = null
  12052. , k = null
  12053. , U = new z.Vector4
  12054. , H = new z.Vector4;
  12055. this.init = function() {
  12056. this.clearColor(0, 0, 0, 1),
  12057. this.clearDepth(1),
  12058. this.clearStencil(0),
  12059. this.enable(l.DEPTH_TEST),
  12060. l.depthFunc(l.LEQUAL),
  12061. l.frontFace(l.CCW),
  12062. l.cullFace(l.BACK),
  12063. this.enable(l.CULL_FACE),
  12064. this.enable(l.BLEND),
  12065. l.blendEquation(l.FUNC_ADD),
  12066. l.blendFunc(l.SRC_ALPHA, l.ONE_MINUS_SRC_ALPHA)
  12067. }
  12068. ,
  12069. this.initAttributes = function() {
  12070. for (var e = 0, t = o.length; e < t; e++)
  12071. o[e] = 0
  12072. }
  12073. ,
  12074. this.enableAttribute = function(e) {
  12075. o[e] = 1,
  12076. 0 === a[e] && (l.enableVertexAttribArray(e),
  12077. a[e] = 1),
  12078. 0 !== s[e] && (i.get("ANGLE_instanced_arrays").vertexAttribDivisorANGLE(e, 0),
  12079. s[e] = 0)
  12080. }
  12081. ,
  12082. this.enableAttributeAndDivisor = function(e, t, i) {
  12083. o[e] = 1,
  12084. 0 === a[e] && (l.enableVertexAttribArray(e),
  12085. a[e] = 1),
  12086. s[e] !== t && (i.vertexAttribDivisorANGLE(e, t),
  12087. s[e] = t)
  12088. }
  12089. ,
  12090. this.disableUnusedAttributes = function() {
  12091. for (var e = 0, t = a.length; e < t; e++)
  12092. a[e] !== o[e] && (l.disableVertexAttribArray(e),
  12093. a[e] = 0)
  12094. }
  12095. ,
  12096. this.enable = function(e) {
  12097. !0 !== t[e] && (l.enable(e),
  12098. t[e] = !0)
  12099. }
  12100. ,
  12101. this.disable = function(e) {
  12102. !1 !== t[e] && (l.disable(e),
  12103. t[e] = !1)
  12104. }
  12105. ,
  12106. this.getCompressedTextureFormats = function() {
  12107. if (null === h && (h = [],
  12108. i.get("WEBGL_compressed_texture_pvrtc") || i.get("WEBGL_compressed_texture_s3tc") || i.get("WEBGL_compressed_texture_etc1")))
  12109. for (var e = l.getParameter(l.COMPRESSED_TEXTURE_FORMATS), t = 0; t < e.length; t++)
  12110. h.push(e[t]);
  12111. return h
  12112. }
  12113. ,
  12114. this.setBlending = function(e, t, i, n, r, o, a, s) {
  12115. e === z.NoBlending ? this.disable(l.BLEND) : this.enable(l.BLEND),
  12116. e === u && s === y || (e === z.AdditiveBlending ? s ? (l.blendEquationSeparate(l.FUNC_ADD, l.FUNC_ADD),
  12117. l.blendFuncSeparate(l.ONE, l.ONE, l.ONE, l.ONE)) : (l.blendEquation(l.FUNC_ADD),
  12118. l.blendFunc(l.SRC_ALPHA, l.ONE)) : e === z.SubtractiveBlending ? s ? (l.blendEquationSeparate(l.FUNC_ADD, l.FUNC_ADD),
  12119. l.blendFuncSeparate(l.ZERO, l.ZERO, l.ONE_MINUS_SRC_COLOR, l.ONE_MINUS_SRC_ALPHA)) : (l.blendEquation(l.FUNC_ADD),
  12120. l.blendFunc(l.ZERO, l.ONE_MINUS_SRC_COLOR)) : e === z.MultiplyBlending ? s ? (l.blendEquationSeparate(l.FUNC_ADD, l.FUNC_ADD),
  12121. l.blendFuncSeparate(l.ZERO, l.ZERO, l.SRC_COLOR, l.SRC_ALPHA)) : (l.blendEquation(l.FUNC_ADD),
  12122. l.blendFunc(l.ZERO, l.SRC_COLOR)) : s ? (l.blendEquationSeparate(l.FUNC_ADD, l.FUNC_ADD),
  12123. l.blendFuncSeparate(l.ONE, l.ONE_MINUS_SRC_ALPHA, l.ONE, l.ONE_MINUS_SRC_ALPHA)) : (l.blendEquationSeparate(l.FUNC_ADD, l.FUNC_ADD),
  12124. l.blendFuncSeparate(l.SRC_ALPHA, l.ONE_MINUS_SRC_ALPHA, l.ONE, l.ONE_MINUS_SRC_ALPHA)),
  12125. u = e,
  12126. y = s),
  12127. e === z.CustomBlending ? (r = r || t,
  12128. o = o || i,
  12129. a = a || n,
  12130. t === d && r === g || (l.blendEquationSeparate(c(t), c(r)),
  12131. d = t,
  12132. g = r),
  12133. i === p && n === f && o === m && a === v || (l.blendFuncSeparate(c(i), c(n), c(o), c(a)),
  12134. p = i,
  12135. f = n,
  12136. m = o,
  12137. v = a)) : v = m = g = f = p = d = null
  12138. }
  12139. ,
  12140. this.setDepthFunc = function(e) {
  12141. if (A !== e) {
  12142. if (e)
  12143. switch (e) {
  12144. case z.NeverDepth:
  12145. l.depthFunc(l.NEVER);
  12146. break;
  12147. case z.AlwaysDepth:
  12148. l.depthFunc(l.ALWAYS);
  12149. break;
  12150. case z.LessDepth:
  12151. l.depthFunc(l.LESS);
  12152. break;
  12153. case z.LessEqualDepth:
  12154. l.depthFunc(l.LEQUAL);
  12155. break;
  12156. case z.EqualDepth:
  12157. l.depthFunc(l.EQUAL);
  12158. break;
  12159. case z.GreaterEqualDepth:
  12160. l.depthFunc(l.GEQUAL);
  12161. break;
  12162. case z.GreaterDepth:
  12163. l.depthFunc(l.GREATER);
  12164. break;
  12165. case z.NotEqualDepth:
  12166. l.depthFunc(l.NOTEQUAL);
  12167. break;
  12168. default:
  12169. l.depthFunc(l.LEQUAL)
  12170. }
  12171. else
  12172. l.depthFunc(l.LEQUAL);
  12173. A = e
  12174. }
  12175. }
  12176. ,
  12177. this.setDepthTest = function(e) {
  12178. e ? this.enable(l.DEPTH_TEST) : this.disable(l.DEPTH_TEST)
  12179. }
  12180. ,
  12181. this.setDepthWrite = function(e) {
  12182. C !== e && (l.depthMask(e),
  12183. C = e)
  12184. }
  12185. ,
  12186. this.setColorWrite = function(e) {
  12187. I !== e && (l.colorMask(e, e, e, e),
  12188. I = e)
  12189. }
  12190. ,
  12191. this.setStencilFunc = function(e, t, i) {
  12192. _ === e && b === t && w === i || (l.stencilFunc(e, t, i),
  12193. _ = e,
  12194. b = t,
  12195. w = i)
  12196. }
  12197. ,
  12198. this.setStencilOp = function(e, t, i) {
  12199. T === e && x === t && S === i || (l.stencilOp(e, t, i),
  12200. T = e,
  12201. x = t,
  12202. S = i)
  12203. }
  12204. ,
  12205. this.setStencilTest = function(e) {
  12206. e ? this.enable(l.STENCIL_TEST) : this.disable(l.STENCIL_TEST)
  12207. }
  12208. ,
  12209. this.setStencilWrite = function(e) {
  12210. E !== e && (l.stencilMask(e),
  12211. E = e)
  12212. }
  12213. ,
  12214. this.setFlipSided = function(e) {
  12215. M !== e && (e ? l.frontFace(l.CW) : l.frontFace(l.CCW),
  12216. M = e)
  12217. }
  12218. ,
  12219. this.setLineWidth = function(e) {
  12220. e !== R && (l.lineWidth(e),
  12221. R = e)
  12222. }
  12223. ,
  12224. this.setPolygonOffset = function(e, t, i) {
  12225. e ? this.enable(l.POLYGON_OFFSET_FILL) : this.disable(l.POLYGON_OFFSET_FILL),
  12226. !e || P === t && O === i || (l.polygonOffset(t, i),
  12227. P = t,
  12228. O = i)
  12229. }
  12230. ,
  12231. this.getScissorTest = function() {
  12232. return L
  12233. }
  12234. ,
  12235. this.setScissorTest = function(e) {
  12236. (L = e) ? this.enable(l.SCISSOR_TEST) : this.disable(l.SCISSOR_TEST)
  12237. }
  12238. ,
  12239. this.activeTexture = function(e) {
  12240. void 0 === e && (e = l.TEXTURE0 + D - 1),
  12241. N !== e && (l.activeTexture(e),
  12242. N = e)
  12243. }
  12244. ,
  12245. this.bindTexture = function(e, t) {
  12246. void 0 === N && n.activeTexture();
  12247. var i = F[N];
  12248. void 0 === i && (i = {
  12249. type: void 0,
  12250. texture: void 0
  12251. },
  12252. F[N] = i),
  12253. i.type === e && i.texture === t || (l.bindTexture(e, t),
  12254. i.type = e,
  12255. i.texture = t)
  12256. }
  12257. ,
  12258. this.compressedTexImage2D = function() {
  12259. try {
  12260. l.compressedTexImage2D.apply(l, arguments)
  12261. } catch (e) {
  12262. console.error(e)
  12263. }
  12264. }
  12265. ,
  12266. this.texImage2D = function() {
  12267. try {
  12268. l.texImage2D.apply(l, arguments)
  12269. } catch (e) {
  12270. console.error(e)
  12271. }
  12272. }
  12273. ,
  12274. this.clearColor = function(e, t, i, n) {
  12275. r.set(e, t, i, n),
  12276. !1 === B.equals(r) && (l.clearColor(e, t, i, n),
  12277. B.copy(r))
  12278. }
  12279. ,
  12280. this.clearDepth = function(e) {
  12281. V !== e && (l.clearDepth(e),
  12282. V = e)
  12283. }
  12284. ,
  12285. this.clearStencil = function(e) {
  12286. k !== e && (l.clearStencil(e),
  12287. k = e)
  12288. }
  12289. ,
  12290. this.scissor = function(e) {
  12291. !1 === U.equals(e) && (l.scissor(e.x, e.y, e.z, e.w),
  12292. U.copy(e))
  12293. }
  12294. ,
  12295. this.viewport = function(e) {
  12296. !1 === H.equals(e) && (l.viewport(e.x, e.y, e.z, e.w),
  12297. H.copy(e))
  12298. }
  12299. ,
  12300. this.reset = function() {
  12301. for (var e = 0; e < a.length; e++)
  12302. 1 === a[e] && (l.disableVertexAttribArray(e),
  12303. a[e] = 0);
  12304. t = {},
  12305. N = void 0,
  12306. F = {},
  12307. M = E = C = I = u = h = null
  12308. }
  12309. }
  12310. }
  12311. , {
  12312. three: 217
  12313. }],
  12314. 104: [function(a, h, e) {
  12315. (function(i, e) {
  12316. "use strict";
  12317. function t(e) {
  12318. this.urls = e;
  12319. var t = i("bWVzc2FnZSBiaW5hcnlfbWVzaCB7CglyZXBlYXRlZCBjaHVua19zaW1wbGUgY2h1bmsgPSAxOwoJcmVwZWF0ZWQgY2h1bmtfcXVhbnRpemVkIHF1YW50aXplZF9jaHVuayA9IDI7Cn0KCi8vIERlZmluaXRpb24gb2YgdmVydGljZXM6IDNEIGNvb3JkaW5hdGVzLCBhbmQgMkQgdGV4dHVyZSBjb29yZGluYXRlcy4KbWVzc2FnZSB2ZXJ0aWNlc19zaW1wbGUgewoJcmVwZWF0ZWQgZmxvYXQgeHl6ID0gMSBbcGFja2VkPXRydWVdOyAgLy8geF8wLHlfMCx6XzAsIHhfMSx5XzEsel8xLCAuLi4KCXJlcGVhdGVkIGZsb2F0IHV2ID0gMiBbcGFja2VkPXRydWVdOyAgLy8gdV8wLHZfMCwgdV8xLHZfMSwgLi4uCn0KCi8vIEluZGV4ZXMgb2YgdmVydGljZXMgb2YgZmFjZXMKbWVzc2FnZSBmYWNlc19zaW1wbGUgewoJcmVwZWF0ZWQgdWludDMyIGZhY2VzID0gMSBbcGFja2VkPXRydWVdOyAvLyBpMDAsaTAxLGkwMiwgaTEwLGkxMSxpMTIsIC4uLgp9CgovLyBBIHNpbXBseSBlbmNvZGVkIGNodW5rLgovLyBUT0RPOiBhZGQgY2h1bmsgcHJvcGVyaXRlcyAoc3VjaCBhcyAicmVmbGVjdGl2ZSIpCm1lc3NhZ2UgY2h1bmtfc2ltcGxlIHsKCW9wdGlvbmFsIHZlcnRpY2VzX3NpbXBsZSB2ZXJ0aWNlcyA9IDE7CglvcHRpb25hbCBmYWNlc19zaW1wbGUgZmFjZXMgPSAyOwoJb3B0aW9uYWwgc3RyaW5nIGNodW5rX25hbWUgPSAzOwoJb3B0aW9uYWwgc3RyaW5nIG1hdGVyaWFsX25hbWUgPSA0Owp9CgovLyBRdWFudGl6ZWQgdmVyc2lvbnMgZm9sbG93OgptZXNzYWdlIHZlcnRpY2VzX3F1YW50aXplZCB7CglvcHRpb25hbCBmbG9hdCBxdWFudGl6YXRpb24gPSAxOwoJcmVwZWF0ZWQgZmxvYXQgdHJhbnNsYXRpb24gPSAyOwoJcmVwZWF0ZWQgc2ludDMyIHggPSAzIFtwYWNrZWQ9dHJ1ZV07CglyZXBlYXRlZCBzaW50MzIgeSA9IDQgW3BhY2tlZD10cnVlXTsKCXJlcGVhdGVkIHNpbnQzMiB6ID0gNSBbcGFja2VkPXRydWVdOwp9CgptZXNzYWdlIHV2X3F1YW50aXplZCB7CglvcHRpb25hbCBzdHJpbmcgbmFtZSA9IDE7CglvcHRpb25hbCBmbG9hdCBxdWFudGl6YXRpb24gPSAyOwoJcmVwZWF0ZWQgc2ludDMyIHUgPSAzIFtwYWNrZWQ9dHJ1ZV07CglyZXBlYXRlZCBzaW50MzIgdiA9IDQgW3BhY2tlZD10cnVlXTsKfQoKLy8gSW5kZXhlcyBvZiB2ZXJ0aWNlcyBvZiBmYWNlcwptZXNzYWdlIGZhY2VzX2NvbXByZXNzZWQgewoJcmVwZWF0ZWQgc2ludDMyIGZhY2VzID0gMSBbcGFja2VkPXRydWVdOyAvLyBpMDAsaTAxLGkwMiwgaTEwLGkxMSxpMTIsIC4uLgp9CgptZXNzYWdlIGNodW5rX3F1YW50aXplZCB7CglvcHRpb25hbCBzdHJpbmcgY2h1bmtfbmFtZSA9IDE7CglvcHRpb25hbCBzdHJpbmcgbWF0ZXJpYWxfbmFtZSA9IDI7CglvcHRpb25hbCB2ZXJ0aWNlc19xdWFudGl6ZWQgdmVydGljZXMgPSAzOwoJcmVwZWF0ZWQgdXZfcXVhbnRpemVkIHV2cyA9IDQ7CglvcHRpb25hbCBmYWNlc19zaW1wbGUgZmFjZXMgPSA1Owp9Cg==", "base64");
  12320. this.builder = n.loadProto(t),
  12321. this.decoder = this.builder.build("binary_mesh")
  12322. }
  12323. var s = a("three")
  12324. , n = a("protobufjs")
  12325. , r = a("../util/logger")
  12326. , o = (a("../util/common"),
  12327. a("../util/ajax"))
  12328. , l = a("../objects/Chunk")
  12329. , c = new r(e);
  12330. t.prototype = {
  12331. constructor: t,
  12332. load: function(t, i, n, r) {
  12333. return c.time("download"),
  12334. o.get(t, {
  12335. responseType: "arraybuffer"
  12336. }).done(function(e) {
  12337. c.timeEnd("download"),
  12338. this.parse(e, t, i, n, r)
  12339. }
  12340. .bind(this)).fail(r)
  12341. },
  12342. parse: function(e, t, i, n, r) {
  12343. var o = this.readProtobuf(e);
  12344. if (!o)
  12345. return r();
  12346. try {
  12347. c.time("convert to webgl"),
  12348. this.convertProtobufToSceneObject(o, t, i, n, r),
  12349. c.timeEnd("convert to webgl")
  12350. } catch (e) {
  12351. return c.error("failed parsing .dam"),
  12352. c.error(e.message),
  12353. r()
  12354. }
  12355. },
  12356. readProtobuf: function(e) {
  12357. var t;
  12358. try {
  12359. c.time("parse proto"),
  12360. t = this.decoder.decode(e),
  12361. c.timeEnd("parse proto")
  12362. } catch (e) {
  12363. return c.error("failed parsing proto for .dam"),
  12364. c.error(e.message),
  12365. null
  12366. }
  12367. return t
  12368. },
  12369. convertProtobufToSceneObject: function(e, i, t, n, r) {
  12370. if (0 === e.chunk.length)
  12371. return c.warn("No chunks in damfile..."),
  12372. t([]);
  12373. var o = new s.Matrix4;
  12374. o.set(1, 0, 0, 0, 0, 0, 1, 0, 0, -1, 0, 0, 0, 0, 0, 1);
  12375. var a = e.chunk.map(function(e) {
  12376. var t = new s.BufferGeometry;
  12377. return t.addAttribute("position", new s.BufferAttribute(new Float32Array(e.vertices.xyz,0,3),3)),
  12378. 0 < e.vertices.uv.length && t.addAttribute("uv", new s.BufferAttribute(new Float32Array(e.vertices.uv,0,2),2)),
  12379. t.setIndex(new s.BufferAttribute(new Uint32Array(e.faces.faces,0,1),1)),
  12380. t.applyMatrix(o),
  12381. t.computeBoundingBox(),
  12382. new l({
  12383. geometry: t,
  12384. textureName: e.material_name,
  12385. name: e.chunk_name,
  12386. meshUrl: i
  12387. })
  12388. });
  12389. return a ? t(a) : (c.error(".dam protobuf came out with no chunks..."),
  12390. r())
  12391. }
  12392. },
  12393. h.exports = t
  12394. }
  12395. ).call(this, a("buffer").Buffer, "/js/loaders/DamLoader.js")
  12396. }
  12397. , {
  12398. "../objects/Chunk": 144,
  12399. "../util/ajax": 181,
  12400. "../util/common": 185,
  12401. "../util/logger": 189,
  12402. buffer: 198,
  12403. protobufjs: 214,
  12404. three: 217
  12405. }],
  12406. 105: [function(n, r, e) {
  12407. (function(e) {
  12408. "use strict";
  12409. var t = (n("three"),
  12410. n("../settings"),
  12411. n("../util/browser"),
  12412. n("./DamLoader"))
  12413. , i = n("../util/logger")
  12414. , u = (n("../ab"),
  12415. new i(e));
  12416. r.exports = {
  12417. getLoaders: function() {
  12418. return [["_50k", ".dam", t], ["", ".dam", t]]
  12419. },
  12420. load: function(e, t, i, n, r, o) {
  12421. var a = this.getLoaders()[o = o || 0];
  12422. if (a) {
  12423. var s = a[0]
  12424. , l = a[1]
  12425. , c = new a[2](t)
  12426. , h = t.get(e + s + l);
  12427. h ? (u.debug("Trying " + s + l),
  12428. c.load(h, i, n, function() {
  12429. this.load(e, t, i, n, r, ++o)
  12430. }
  12431. .bind(this))) : (u.debug("Skipping " + l + ", not available"),
  12432. this.load(e, t, i, n, r, ++o))
  12433. } else
  12434. r && r("No suitable model file found...")
  12435. }
  12436. }
  12437. }
  12438. ).call(this, "/js/loaders/ModelLoader.js")
  12439. }
  12440. , {
  12441. "../ab": 3,
  12442. "../settings": 166,
  12443. "../util/browser": 182,
  12444. "../util/logger": 189,
  12445. "./DamLoader": 104,
  12446. three: 217
  12447. }],
  12448. 106: [function(i, n, e) {
  12449. (function(e) {
  12450. "use strict";
  12451. var l = i("../util/common")
  12452. , c = i("../util/texture")
  12453. , h = i("../util/browser")
  12454. , t = i("../util/logger")
  12455. , u = i("../settings")
  12456. , d = new t(e);
  12457. n.exports = {
  12458. load: function(i, n) {
  12459. if (!i.chunks[0] || !i.chunks[0].meshUrl)
  12460. return $.when();
  12461. var r = l.countUnique(i.chunks.map(function(e) {
  12462. return e.textureName
  12463. }))
  12464. , e = -1 !== i.chunks[0].meshUrl.indexOf("_50k") ? "_50k" : ""
  12465. , t = "_50k" == e ? "high" : "low";
  12466. u.minimalMemoryMode && "high" === t && (h.detectSamsungS6() ? (d.warn("Galaxy S6 cannot handle large textures, turning down quality."),
  12467. t = "low") : r > u.maxMobileTextures && (d.warn("Model probably too large for mobile, turning down quality."),
  12468. t = "low"));
  12469. var o = i.data.job.uuid + e + "_texture_jpg_" + t + "/"
  12470. , a = $.Deferred()
  12471. , s = 0;
  12472. return i.chunks.forEach(function(e) {
  12473. if (!e.material.map && e.textureName) {
  12474. var t = i.urls.get(o + e.textureName);
  12475. e.setTextureMap(c.load(t, function(e, t) {
  12476. e || (n.push(t),
  12477. s++,
  12478. a.notify(s, r),
  12479. s === r && a.resolve())
  12480. }
  12481. .bind(this, c.isLoaded(t))))
  12482. }
  12483. }),
  12484. a.promise()
  12485. }
  12486. }
  12487. }
  12488. ).call(this, "/js/loaders/ModelTextureLoader.js")
  12489. }
  12490. , {
  12491. "../settings": 166,
  12492. "../util/browser": 182,
  12493. "../util/common": 185,
  12494. "../util/logger": 189,
  12495. "../util/texture": 194
  12496. }],
  12497. 107: [function(s, l, e) {
  12498. (function(n, e) {
  12499. "use strict";
  12500. function t(e) {
  12501. this.model = e,
  12502. this.modelDataPath = this.model.urls.get("vision.modeldata")+"?m="+new Date().getTime(),
  12503. this.sweepLocationsPath = this.model.urls.get("sweep_locations.csv");
  12504. var t = n("Ly8gUHJvdG9jb2wgQnVmZmVyIGZvciBwdWNrIHZpc2liaWxpdHkgYW5kIHJlbGF0ZWQgZGF0YQovLwovLyBUbyBkdW1wIG91dCBhIGJpbnJheSBtYW5pZmVzdCBpbiB0ZXh0IGZvcm1hdCwgeW91IGNhbiB1c2UgcHJvdG9jIGRpcmVjdGx5OgovLyAgIHByb3RvYyAtLXByb3RvX3BhdGggfi9kZXYvbXBfdmlzaW9uLyAgLS1kZWNvZGU9ZW9zLnN0b3JhZ2UuVmlzaW9uTW9kZWxkYXRhIH4vZGV2L21wX3Zpc2lvbi9lb3Mvc3RvcmFnZS92aXNpb25fbW9kZWxkYXRhLnByb3RvIDwgdmlzaW9uLm1vZGVsZGF0YQoKLy8gcGFja2FnZSBlb3Muc3RvcmFnZTsKCi8vIGltcG9ydCAiZW9zL2luZnJhL2NvbW1vbi5wcm90byI7Ci8vIFRoZSBmb2xsb3dpbmcgd2VyZSBtYW51YWxseSBleHRyYWN0ZWQgaGVyZSwgSlMgZG9lcyBub3QgbGlrZSBwcm90b2J1ZiBpbXBvcnRzCgptZXNzYWdlIEFmZmluZTNmIHsKCW9wdGlvbmFsIFF1YXRlcm5pb25mIHJvdGF0aW9uID0gMTsKCW9wdGlvbmFsIFZlY3RvcjNmIHRyYW5zbGF0aW9uID0gMjsKfQoKbWVzc2FnZSBRdWF0ZXJuaW9uZiB7CglvcHRpb25hbCBmbG9hdCB3ID0gMTsKCW9wdGlvbmFsIGZsb2F0IHggPSAyOwoJb3B0aW9uYWwgZmxvYXQgeSA9IDM7CglvcHRpb25hbCBmbG9hdCB6ID0gNDsKfQoKbWVzc2FnZSBWZWN0b3IzZiB7CglvcHRpb25hbCBmbG9hdCB4ID0gMTsKCW9wdGlvbmFsIGZsb2F0IHkgPSAyOwoJb3B0aW9uYWwgZmxvYXQgeiA9IDM7Cn0KCi8vCi8vIE9uZSBzd2VlcCAvIHBhbm8KLy8KbWVzc2FnZSBTd2VlcExvY2F0aW9uIHsKCW9wdGlvbmFsIGJ5dGVzIHV1aWQgPSAxOyAgLyogdXVpZCAqLwoJb3B0aW9uYWwgQWZmaW5lM2YgcG9zZSA9IDI7ICAvKiBjYW1lcmEgcG9zZSAoeCwgeSx6KSBpbiBtZXRlciBhbmQgYSBxdWF0ZXJuaW9uKi8KCW9wdGlvbmFsIFZlY3RvcjNmIHB1Y2sgPSAzOyAgLyogcHVjayBsb2NhdGlvbiAtIHggYW55IGlzIGdlbmVyYWxseSB0aGUgc2FtZSBhcyBwb3NlLCB6IGlzIHRoZSBoZWlnaHQgb2YgdGhlIGNsb3Nlc3QgZmxvb3IgdW5kZXIgdGhlIGNhbWVyYSAqLwoJb3B0aW9uYWwgaW50MzIgZ3JvdXAgPSA0OyAgLyogZmxvb3IgaW5kZXggKi8KCW9wdGlvbmFsIGludDMyIHN1Ymdyb3VwID0gNTsgIC8qIHJvb20gaW5kZXggKi8KCXJlcGVhdGVkIGludDMyIHZpc2libGVzID0gNjsgIC8qIGxpc3Qgb2YgaW5kaWNlcyB0byBhbGwgcHVja3MgdmlzaWJsZSBmcm9tIHRoaXMgcHVjayAqLwoJcmVwZWF0ZWQgZmxvYXQgc2NvcmVzID0gNzsgLyogdXNlZCBhcyBwYXJ0IG9mIHNjb3JpbmcgZnVuY3Rpb24gZm9yIGRldGVybWluaW5nIHdoaWNoIHB1Y2sgdG8gZ28gdG8gbmV4dCAqLwogIG9wdGlvbmFsIHN0cmluZyBzd2VlcF9uYW1lID0gODsKCiAgLy8gV2l0aCBvdXRkb29yIHBhbm9zLCB3ZSBoYXZlIGEgY291cGxlIG9mIGRpZmZlcmVudCBzaXR1YXRpb25zIGZvciBhbGlnbm1lbnQuIFRoZSBjb21tb24KICAvLyBjYXNlIGlzIHRoYXQgdGhlIHBhbm8gYWxpZ25lZCBub3JtYWxseS4gSXQgY291bGQgYWxzbyBoYXZlIGJlZW4gcGxhY2VkIG1hbnVhbGx5IGluCiAgLy8gQ2FwdHVyZUFwcCBvciBXb3Jrc2hvcCwgb3IgbGVmdCB1bmFsaWduZWQgZm9yIGhpZ2hsaWdodC1yZWVsIHZpZXdpbmcuCiAgZW51bSBBbGlnbm1lbnRUeXBlCiAgewogICAgICBVTktOT1dOID0gMDsKICAgICAgQUxJR05FRCA9IDE7CiAgICAgIFVOQUxJR05FRCA9IDI7CiAgICAgIE1BTlVBTExZX1BMQUNFRCA9IDM7CiAgfQogIG9wdGlvbmFsIEFsaWdubWVudFR5cGUgYWxpZ25tZW50X3R5cGUgPSA5IFtkZWZhdWx0ID0gQUxJR05FRF07Cn0KCm1lc3NhZ2UgU3ViZ3JvdXBJbmZvIHsKCW9wdGlvbmFsIGludDMyIHN1Ymdyb3VwID0gMTsKCW9wdGlvbmFsIGZsb2F0IGFyZWEgPSAyOyAvKiBmbG9vciBhcmVhIGluIG1eMiAoc3F1YXJlIG1ldGVyYWdlKSAqLwp9CgovKiBBbGwgcHVja3MgaW4gYSBtb2RlbC4gUHVja3MgYXJlIHN0b3JlZCBpbiBzY2FubmluZyBvcmRlci4gKi8KbWVzc2FnZSBWaXNpb25Nb2RlbGRhdGEgewoJcmVwZWF0ZWQgU3dlZXBMb2NhdGlvbiBzd2VlcExvY2F0aW9ucyA9IDE7CglyZXBlYXRlZCBTdWJncm91cEluZm8gc3ViZ3JvdXBJbmZvcyA9IDI7Cn0K", "base64")
  12505. , i = r.loadProto(t);
  12506. this.decoder = i.build("VisionModeldata")
  12507. }
  12508. var r = s("protobufjs")
  12509. , i = s("../util/ajax")
  12510. , o = (s("../util/common"),
  12511. s("../util/math"))
  12512. , a = new (s("../util/logger"))(e);
  12513. t.prototype.load = function() {
  12514. return this.modelDataPath ? (a.info("Using vision.modeldata"),
  12515. this.loadVisionModelData()) : this.sweepLocationsPath ? (a.warn("Using sweep_locations.csv"),
  12516. this.loadSweepLocationsCSV()) : (a.warn("No sweep file found"),
  12517. $.when([]))
  12518. }
  12519. ,
  12520. t.prototype.loadVisionModelData = function() {
  12521. return i.get(this.modelDataPath, {
  12522. responseType: "arraybuffer"
  12523. }).then(function(e) {
  12524. var t;
  12525. try {
  12526. t = this.decoder.decode(e)
  12527. } catch (e) {
  12528. return a.warn("Could not decode vision.modeldata, trying sweep_locations.csv"),
  12529. this.loadSweepLocationsCSV()
  12530. }
  12531. var i = t.sweepLocations.map(function(e) {
  12532. return {
  12533. uuid: e.uuid.toUTF8().replace(/-/g, ""),
  12534. position: {
  12535. x: e.pose.translation.x,
  12536. y: e.pose.translation.y,
  12537. z: e.pose.translation.z
  12538. },
  12539. quaternion: {
  12540. x: e.pose.rotation.x,
  12541. y: e.pose.rotation.y,
  12542. z: e.pose.rotation.z,
  12543. w: e.pose.rotation.w
  12544. },
  12545. puck: {
  12546. x: e.puck.x,
  12547. y: e.puck.y,
  12548. z: e.puck.z
  12549. },
  12550. floor: e.group,
  12551. neighbours: e.visibles,
  12552. alignmentType: e.alignment_type
  12553. }
  12554. }).map(function(e) {
  12555. return e.position = o.convertVisionVector(e.position),
  12556. e.quaternion = o.convertVisionQuaternion(e.quaternion),
  12557. e.puck = o.convertVisionVector(e.puck),
  12558. e
  12559. });
  12560. return i.forEach(function(e) {
  12561. if(e.neighbours.find(a=>a==-1)){
  12562. console.log('%c neighbours 存在-1 ' +e.uuid ,"color:#f00")
  12563. }
  12564. e.neighbours = e.neighbours.filter(e=>i[e])
  12565. e.neighbours = e.neighbours.map(function(e) {
  12566. return i[e].uuid
  12567. })
  12568. }),
  12569. i
  12570. }
  12571. .bind(this), function() {
  12572. return a.warn("Could not load vision.modeldata, trying sweep_locations.csv"),
  12573. this.loadSweepLocationsCSV()
  12574. }
  12575. .bind(this))
  12576. }
  12577. ,
  12578. t.prototype.loadSweepLocationsCSV = function() {
  12579. return i.get(this.sweepLocationsPath).then(function(e) {
  12580. return e.split("\n").map(function(e) {
  12581. return e.split(", ")
  12582. }).filter(function(e) {
  12583. return 1 < e.length
  12584. }).map(function(e) {
  12585. return {
  12586. uuid: e[0],
  12587. position: {
  12588. x: parseFloat(e[1]),
  12589. y: parseFloat(e[2]),
  12590. z: parseFloat(e[3])
  12591. },
  12592. quaternion: {
  12593. x: parseFloat(e[4]),
  12594. y: parseFloat(e[5]),
  12595. z: parseFloat(e[6]),
  12596. w: parseFloat(e[7])
  12597. }
  12598. }
  12599. }).map(function(e) {
  12600. return e.position = o.convertVisionVector(e.position),
  12601. e.quaternion = o.convertVisionQuaternion(e.quaternion),
  12602. e
  12603. })
  12604. }).fail(function() {
  12605. a.warn("Could not load sweep_locations.csv, no sweeps loaded.")
  12606. })
  12607. }
  12608. ,
  12609. l.exports = t
  12610. }
  12611. ).call(this, s("buffer").Buffer, "/js/loaders/SweepDataLoader.js")
  12612. }
  12613. , {
  12614. "../util/ajax": 181,
  12615. "../util/common": 185,
  12616. "../util/logger": 189,
  12617. "../util/math": 190,
  12618. buffer: 198,
  12619. protobufjs: 214
  12620. }],
  12621. 108: [function(s, l, e) {
  12622. (function(e) {
  12623. "use strict";
  12624. function t() {
  12625. this.locale = null
  12626. }
  12627. var i = s("../settings")
  12628. , n = s("../util/common")
  12629. , r = s("../util/logger")
  12630. , o = s("../enum/Locale")
  12631. , a = new r(e);
  12632. t.prototype.init = function() {
  12633. var e;
  12634. switch (i.languageTag) {
  12635. case null:
  12636. case "en":
  12637. case o.EN_US:
  12638. this.locale = o.EN_US,
  12639. e = s("./strings-en-US");
  12640. break;
  12641. case "es":
  12642. case o.ES_MX:
  12643. this.locale = o.ES_MX,
  12644. e = s("./strings-es-MX");
  12645. break;
  12646. case "fr":
  12647. case o.FR_FR:
  12648. this.locale = o.FR_FR,
  12649. e = s("./strings-fr-FR");
  12650. break;
  12651. case "de":
  12652. case o.DE_DE:
  12653. this.locale = o.DE_DE,
  12654. e = s("./strings-de-DE");
  12655. break;
  12656. case "ru":
  12657. case o.RU_RU:
  12658. this.locale = o.RU_RU,
  12659. e = s("./strings-ru-RU");
  12660. break;
  12661. case "cn":
  12662. case o.CN_CN:
  12663. this.locale = o.CN_CN,
  12664. e = s("./strings-cn-CN");
  12665. break;
  12666. case "jp":
  12667. case o.JP_JP:
  12668. this.locale = o.JP_JP,
  12669. e = s("./strings-jp-JP");
  12670. break;
  12671. default:
  12672. a.info("Unsupported language tag, defaulting to 'en-US'"),
  12673. this.locale = o.EN_US,
  12674. e = s("./strings-en-US")
  12675. }
  12676. a.info("Using locale '" + this.locale + "'"),
  12677. n.extendObject(this, e)
  12678. }
  12679. ,
  12680. t.prototype.localizeGUI = function() {
  12681. var e = document.querySelector("#gui-parent");
  12682. this.localizeTree(e),
  12683. this.localizeLoadingText()
  12684. }
  12685. ,
  12686. t.prototype.localizeLoadingText = function() {
  12687. document.querySelector("#help-dialog").classList.add(this.locale),
  12688. document.querySelector("#interaction-modal").classList.add(this.locale),
  12689. document.querySelector("#gui").classList.add(this.locale)
  12690. }
  12691. ,
  12692. t.prototype.localizeTree = function(e) {
  12693. var t, i, n = /{\[{ ?(\w+) ?}\]}/;
  12694. if (e.nodeType === Node.TEXT_NODE)
  12695. (t = e.data.match(n)) && (i = t[1],
  12696. e.data = this.localizeText(i) || i);
  12697. else if (e.nodeType === Node.ELEMENT_NODE) {
  12698. var r = e.getAttribute("title");
  12699. r && ((t = r.match(n)) && (i = t[1],
  12700. e.setAttribute("title", this.localizeText(i) || i)))
  12701. }
  12702. for (e = e.firstChild; e; )
  12703. this.localizeTree(e),
  12704. e = e.nextSibling
  12705. }
  12706. ,
  12707. t.prototype.localizeText = function(e) {
  12708. var t = this[e];
  12709. return t || this.locale === o.EN_US || (a.warn("Localization key '" + e + "' not available for locale '" + this.locale + "', defaulting to English."),
  12710. t = s("./strings-en-US")[e]),
  12711. t || a.warn("Localization key '" + e + "' not available for locale 'en-US'"),
  12712. t
  12713. }
  12714. ,
  12715. l.exports = new t
  12716. }
  12717. ).call(this, "/js/localization/localize.js")
  12718. }
  12719. , {
  12720. "../enum/Locale": 31,
  12721. "../settings": 166,
  12722. "../util/common": 185,
  12723. "../util/logger": 189,
  12724. "./strings-cn-CN": 109,
  12725. "./strings-de-DE": 110,
  12726. "./strings-en-US": 111,
  12727. "./strings-es-MX": 112,
  12728. "./strings-fr-FR": 113,
  12729. "./strings-jp-JP": 114,
  12730. "./strings-ru-RU": 115
  12731. }],
  12732. 109: [function(e, t, i) {
  12733. "use strict";
  12734. t.exports = {
  12735. PAGE_TITLE: "",
  12736. LOADING: "正在加载",
  12737. PRESENTED_BY_CAPS: "呈现者:",
  12738. POWERED_BY: "技术支持:",
  12739. POWERED_BY_CAPS: "技术支持:",
  12740. DESKTOP_SHORT_CTA: "点击一次以探索这个 3D 空间。",
  12741. MOBILE_SHORT_CTA: "点击一次以探索这个 3D 空间。",
  12742. PRESENTED_BY: "呈现者:",
  12743. MORE: "更多 ",
  12744. LESS: "更少 ",
  12745. TAG_CONTENT: "tag™ 内容",
  12746. SHOW: "显示",
  12747. HIDE: "隐藏",
  12748. DOLLHOUSE: "场景屋",
  12749. FLOOR_PLAN: "楼层平面图",
  12750. OPEN_HIGHLIGHTS: "打开精彩片段",
  12751. CLOSE_HIGHLIGHTS: "关闭",
  12752. PREVIOUS: "上一个",
  12753. PLAY: "播放",
  12754. PAUSE: "暂停",
  12755. NEXT: "下一个",
  12756. EXPLORE_3D_SPACE: "探索 3D 空间",
  12757. VIEW_DOLLHOUSE: "观看场景屋",
  12758. SOCIAL_SHARING: "分享这个空间",
  12759. VIEW_IN_VR: "以 VR 观看",
  12760. VIEW_FULLSCREEN: "全屏观看",
  12761. EXIT_FULLSCREEN: " 退出全屏",
  12762. ZOOM_IN: "放大",
  12763. ZOOM_OUT: "缩小",
  12764. FLOOR_NAME: "楼层",
  12765. FLOOR_ALL: "ALL",
  12766. FLOOR_Lang: ["Floor", ""],
  12767. TERMS: "条款",
  12768. PORT_TERMS: "port 条款",
  12769. TERMS_OF_USE: "使用条款",
  12770. CLOSE_TERMS: "关闭",
  12771. TERMS_TEXT_FILE: "terms-cn-CN.html",
  12772. TERMS_FAIL: "无法获取条款。请确保您有互联网连接以查看使用条款。",
  12773. WEBVR_FOR_DAYDREAM: "用于 Daydream 视图",
  12774. WEBVR_ENTER_WEBVR: "进入 VR",
  12775. WEBVR_DIFFERENT_HEADSET: "有其他耳机吗?",
  12776. WEBVR_LEARN_MORE: "了解更多",
  12777. WEBVR_VIEW_SPACE: "在 VR 中观看空间",
  12778. WEBVR_DAYDREAM_VIEW: "Daydream 视图",
  12779. WEBVR_DAYDREAM_PHONE: "支持 Daydream 的手机",
  12780. WEBVR_FOR_CARDBOARD: "用于 Google Cardboard",
  12781. WEBVR_VIEW_CARDBOARD: "或在 Google Cardboard 上观看",
  12782. VR_VIEW_SPACE: "在虚拟现实中观看空间",
  12783. VR_LEARN_MORE_CAPS: "了解更多",
  12784. VR_PREVIOUS_CAPS: "上一个’,",
  12785. VR_NEXT_CAPS: "下一个",
  12786. VR_GOT_IT_CAPS: "明白了",
  12787. VR_SHOW_SUPPORTED: "点击以使用 VR 观看空间",
  12788. VR_SHOW_UNSUPPORTED: "很遗憾,您的设备不符合在 VR 中观看空间的最低要求。",
  12789. VR_SHOW_IOS_1: "点击以使用 VR 观看空间",
  12790. VR_SHOW_IOS_2: "需要有 port VR 应用程序和兼容的 iPhone 才能观看",
  12791. VR_WHAT_YOU_NEED: "关于...您需要什么",
  12792. VR_NEED_CARDBOARD: "您使用 Google Cardboard 时需要什么",
  12793. VR_NEED_SAMSUNG: "您使用 Samsung Gear VR 时需要什么",
  12794. VR_NEED_DAYDREAM: "需要事先与 DAYDREAM VIEW 配对",
  12795. VR_NEED_DAYDREAM_PHONE: "支持 Daydream 的手机",
  12796. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  12797. VR_GOOGLE_DAYDREAM: "Google Daydream",
  12798. VR_APP: "port VR 应用程序",
  12799. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  12800. VR_COMPATIBLE_IPHONES_1: "iPhones",
  12801. VR_COMPATIBLE_IPHONES_2: "iPhone 5s 和更高版本,运行 iOS 9.1 和更高版本",
  12802. VR_COMPATIBLE_IPHONES_3: "兼容的 iPhone",
  12803. VR_COMPATIBLE_ANDROID: "兼容的 Android 设备",
  12804. VR_COMPATIBLE_ANDROID_LONG: "4.5-5.5 英寸、运行 Android OS 4.4.4 和更高版本的兼容型 Android 设备显示屏",
  12805. VR_ANDROID_DETAIL: "4.5 至 5.5 英寸、运行 Android OS 4.4.4 和更高版本的显示屏",
  12806. VR_ANDROID_DVICES: "Android 设备",
  12807. VR_COMPATIBLE_SAMSUNG: "兼容的 Samsung 设备",
  12808. VR_SAMSUNG_DETAIL: "Galaxy S6 和更高版本",
  12809. VR_APP_FOR_CARDBOARD: "用于 Google Cardboard 的 port VR 应用程序",
  12810. VR_APP_FOR_SAMSUNG: "用于 Gear VR 的 port VR 应用程序",
  12811. VR_APP_FOR_ANDROID: "用于 Android 手机的 port VR 应用程序",
  12812. VR_APP_OPEN: "请使用 port VR 应用程序打开",
  12813. VR_DOWNLOAD_HERE: "在此下载",
  12814. VR_REQUIRE_HEADSET: "需要一副 VR 耳机并安装用于 Android 的 port VR 应用程序",
  12815. VR_REDIRECT_TO_STORE: "如果未安装应用程序,您将跳转到应用程序商店。",
  12816. VR_IMPROPER_EMBED: "port 空间未正确嵌入,无法在您的 Web 浏览器支持 VR。",
  12817. VR_OPEN_ANDROID_LINK: "在您的手机上打开链接",
  12818. VR_ANDROID_OPTIONS: "可用的 VR 耳机选项",
  12819. SHARE_TO: "分享到",
  12820. SHARE_LINK: "直接链接",
  12821. SHARE_EXPLORE: "探索",
  12822. SHARE_AT: "在",
  12823. SHARE_WITH: "使用",
  12824. SHARE_3D: "以 3D",
  12825. SHARE_COPIED: "已复制!",
  12826. ERROR_BROWSER_SOLUTION: "安装更新的浏览器以探索 3D。",
  12827. ERROR_BROWSER_EXPLANATION: "WebGL 需要现代的浏览器。",
  12828. ERROR_GENERIC_PROBLEM: "糟糕,出现问题。",
  12829. ERROR_GENERIC_SOLUTION: "重新启动您的浏览器。",
  12830. ERROR_GENERIC_ACTIONS_1: "如果问题仍然存在,",
  12831. ERROR_GENERIC_ACTIONS_2: "请安装支持的浏览器",
  12832. ERROR_GENERIC_ACTIONS_3: " 或",
  12833. ERROR_GENERIC_ACTIONS_4: "查看我们的故障排除指南",
  12834. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "浏览器不受支持。",
  12835. ERROR_WEBGL_IOS_PROBLEM: "iOS 版本不受支持。",
  12836. ERROR_WEBGL_IOS_SOLUTION: "升级到 iOS 8 或更高版本以在 3D 中探索。",
  12837. ERROR_WEBGL_IOS_ACTIONS_1: "点击 ",
  12838. ERROR_WEBGL_IOS_ACTIONS_2: "设置 > 通用 > 软件更新",
  12839. ERROR_WEBGL_SAFARI_PROBLEM: "启用 WebGL 以在 3D 中探索。",
  12840. ERROR_WEBGL_SAFARI_ACTIONS_1: "单击",
  12841. ERROR_WEBGL_SAFARI_ACTIONS_2: "菜单栏中的首选项 > 高级 > 显示开发菜单",
  12842. ERROR_WEBGL_SAFARI_ACTIONS_3: "然后单击",
  12843. ERROR_WEBGL_SAFARI_ACTIONS_4: "开发 > 启用 WebGL",
  12844. ERROR_MISSING_URLS_PROBLEM: "糟糕,没有此模型的全景。",
  12845. ERROR_MISSING_URLS_EXPLANATION: "这是较早的模型。网站所有者可能正在开发一种新模型。",
  12846. ERROR_LOADING_FAILED_PROBLEM: "糟糕,模式不可用。",
  12847. ERROR_LOADING_FAILED_ACTIONS_1: "如果问题仍然存在,",
  12848. ERROR_LOADING_FAILED_ACTIONS_2: "查看我们的故障排除指南",
  12849. ERROR_MAINTENANCE_PROBLEM: "正在进行维护",
  12850. ERROR_MAINTENANCE_SOLUTION: "请过几分钟再来。",
  12851. LINK_TO_LOCATION: "地点链接",
  12852. MENU_COPY: "复制",
  12853. LINK_ALERT_COPY: "请使用 CTRL/CMD + C 复制。",
  12854. ROTATE: "旋转",
  12855. MOVE: "移动",
  12856. INSIDE: "内部",
  12857. ZOOM: "缩放",
  12858. HELP: "小帮手",
  12859. HELP_NAVIGATION_TAB: "导航",
  12860. HELP_MORE_HELP_TAB: "更多帮助",
  12861. HELP_DESKTOP_PANORAMA_1A: "单击并拖动以环顾空间。",
  12862. HELP_DESKTOP_PANORAMA_2A: "单击整个空间内的圆环以四处移动。",
  12863. HELP_DESKTOP_PANORAMA_3A: "使用鼠标滚轮来放大和缩小。",
  12864. HELP_DESKTOP_PANORAMA_1B: "或者,使用箭头键向左向右转。",
  12865. HELP_DESKTOP_PANORAMA_2B: "或者,使用箭头键向前移动和向后移动。",
  12866. HELP_DESKTOP_PANORAMA_3B: "或者,使用加号和减号键来放大和缩小。",
  12867. HELP_DESKTOP_360_2A: "单击内部视图图标以进入空间。",
  12868. HELP_DESKTOP_360_2B: "或者,按 1 号键进入内部视图。 ",
  12869. HELP_DESKTOP_DOLLHOUSE_1A: "左键单击并向左、向右、向上和向下拖动以旋转场景屋。",
  12870. HELP_DESKTOP_DOLLHOUSE_2A: "右键单击并向左、向右、向上和向下拖动以改变场景屋在屏幕上的位置。",
  12871. HELP_DESKTOP_DOLLHOUSE_3A: "使用鼠标滚轮来放大和缩小。",
  12872. HELP_DESKTOP_DOLLHOUSE_1B: "或者,使用箭头键来旋转场景屋。",
  12873. HELP_DESKTOP_FLOORPLAN_1A: "左键单击并向左、向右、向上和向下拖动以改变楼层平面图在屏幕上的位置。",
  12874. HELP_DESKTOP_FLOORPLAN_2A: "右键单击并向左或向右拖动以旋转楼层平面图。",
  12875. HELP_DESKTOP_FLOORPLAN_3A: "使用鼠标滚轮来放大和缩小。",
  12876. HELP_DESKTOP_FLOORPLAN_2B: "或者,使用箭头键以向左或向右旋转。",
  12877. HELP_DESKTOP_FLOORPLAN_3B: "或者,使用箭头键来放大和缩小。",
  12878. HELP_MOBILE_PANORAMA_1: "触摸并拖动以环顾空间。",
  12879. HELP_MOBILE_PANORAMA_2: "点击整个空间内的圆环以四处移动。",
  12880. HELP_MOBILE_3: "使用捏合手势来放大和缩小。",
  12881. HELP_MOBILE_360_2: "点击内部视图图标以进入空间。",
  12882. HELP_MOBILE_DOLLHOUSE_1: "触摸并向上、向下、向左和向右拖动以旋转场景屋。",
  12883. HELP_MOBILE_DOLLHOUSE_2: "用两指触摸并拖动以定位场景屋。",
  12884. HELP_MOBILE_FLOORPLAN_1: "触摸并拖动以定位楼层平面图。",
  12885. HELP_MOBILE_FLOORPLAN_2: "用两指触摸并拖动以旋转楼层平面图。",
  12886. HELP_MORE_HLR_A: "精彩片段集锦",
  12887. HELP_DESKTOP_MORE_HLR_B: "打开以使用缩略图图像在空间中流览。",
  12888. HELP_MORE_DOLLHOUSE_A: "场景屋",
  12889. HELP_DESKTOP_MORE_DOLLHOUSE_B: "单击以查看和旋转 3D 内整个空间的俯视图。",
  12890. HELP_MOBILE_MORE_DOLLHOUSE_B: "点击以查看和旋转 3D 内整个空间的俯视图。",
  12891. HELP_MORE_FLOORS_A: "楼层选择器",
  12892. HELP_DESKTOP_MORE_FLOORS_B: "在空间中的楼层之间切换。",
  12893. HELP_MORE_TAG_A: "tag™ 贴文",
  12894. HELP_DESKTOP_MORE_TAG_B: "单击或悬停鼠标以查看空间中的功能信息。",
  12895. HELP_MOBILE_MORE_TAG_B: "点击以查看空间中的功能信息。",
  12896. HELP_MORE_ZOOM_A: "缩放控件",
  12897. HELP_DESKTOP_MORE_ZOOM_B: "使用这些控件来放大和缩小或使用滚轮。",
  12898. HELP_MORE_TOUR_A: "导览控件",
  12899. HELP_DESKTOP_MORE_TOUR_B: "通过导览播放、暂停以及向前和向后流览。",
  12900. HELP_MORE_INSIDE_A: "内部视图",
  12901. HELP_DESKTOP_MORE_INSIDE_B: "单击以探索空间内部。",
  12902. HELP_MOBILE_MORE_INSIDE_B: "点击以探索空间内部。",
  12903. HELP_MORE_VR_A: "VR 模式",
  12904. HELP_DESKTOP_MORE_VR_B: "单击以在虚拟现实中启动空间。",
  12905. HELP_MOBILE_MORE_VR_B: "点击以在虚拟现实中启动空间。",
  12906. HELP_MORE_360_A: "360° 视图",
  12907. HELP_DESKTOP_MORE_360_B: "单击精彩片段集锦中的 360 视图中以观看室外场景。",
  12908. HELP_MOBILE_MORE_360_B: "点击精彩片段集锦中的 360 视图中以观看室外场景。",
  12909. HELP_MORE_FULLSCREEN_A: "全屏",
  12910. HELP_DESKTOP_MORE_FULLSCREEN_B: "将 3D Showcase 扩展到全屏。",
  12911. CLOSE: "关闭"
  12912. }
  12913. }
  12914. , {}],
  12915. 110: [function(e, t, i) {
  12916. "use strict";
  12917. t.exports = {
  12918. PAGE_TITLE: "",
  12919. LOADING: "Lädt",
  12920. PRESENTED_BY_CAPS: "PRÄSENTIERT VON",
  12921. POWERED_BY: "Angetrieben von",
  12922. POWERED_BY_CAPS: "ANGETRIEBEN VON",
  12923. DESKTOP_SHORT_CTA: "Sehen sie sich in diesem 3D Raum um.",
  12924. MOBILE_SHORT_CTA: "Sehen sie sich in diesem 3D Raum um.",
  12925. PRESENTED_BY: "Präsentiert von ",
  12926. MORE: "Mehr ",
  12927. LESS: "Weniger ",
  12928. TAG_CONTENT: "tag™ Inhalt",
  12929. SHOW: "Anzeigen",
  12930. HIDE: "Verbergen",
  12931. DOLLHOUSE: "Puppenhaus",
  12932. FLOOR_PLAN: "Grundriss",
  12933. OPEN_HIGHLIGHTS: "Highlights anzeigen",
  12934. CLOSE_HIGHLIGHTS: "Schließen",
  12935. PREVIOUS: "Vorheriges",
  12936. PLAY: "Abspielen",
  12937. PAUSE: "Pausieren",
  12938. NEXT: "Nächstes",
  12939. EXPLORE_3D_SPACE: "Innenraum betreten",
  12940. VIEW_DOLLHOUSE: "Puppenhaus ansehen",
  12941. SOCIAL_SHARING: "Teilen Sie diesen Raum",
  12942. VIEW_IN_VR: "In VR ansehen",
  12943. VIEW_FULLSCREEN: "Ansicht im Vollbildmodus",
  12944. EXIT_FULLSCREEN: "Beenden des Vollbildmodus",
  12945. ZOOM_IN: "Vergrößern",
  12946. ZOOM_OUT: "Verkleinern",
  12947. FLOOR_NAME: "Etage ",
  12948. FLOOR_ALL: "Alle",
  12949. TERMS: "Bedingungen",
  12950. PORT_TERMS: "port Bedingungen",
  12951. TERMS_OF_USE: "Nutzungsbedingungen",
  12952. TERMS_TEXT_FILE: "terms-de-DE.html",
  12953. CLOSE_TERMS: "Schließen",
  12954. TERMS_FAIL: "Konnte die Nutzungsbedingungen nicht abrufen. Bitte stellen Sie sicher, dass Sie zum Internet verbunden sind.",
  12955. HELP: "Hilfe",
  12956. HELP_NAVIGATION_TAB: "Navigation",
  12957. HELP_MORE_HELP_TAB: "Hilfe-Details",
  12958. CLOSE: "Schließen",
  12959. HELP_DESKTOP_PANORAMA_1A: "Klicken und ziehen Sie um sich im Raum umzusehen.",
  12960. HELP_DESKTOP_PANORAMA_2A: "Klicken Sie auf die Ringe im Raum um sich zu bewegen.",
  12961. HELP_DESKTOP_PANORAMA_3A: "Verwenden Sie das Scrollrad zum Vergrößern und Verkleinern.",
  12962. HELP_DESKTOP_PANORAMA_1B: "Oder verwenden Sie die Pfeiltasten um sich nach links und rechts zu bewegen.",
  12963. HELP_DESKTOP_PANORAMA_2B: "Oder verwenden Sie die Pfeiltasten um sich vorwärts und rückwärts zubewegen.",
  12964. HELP_DESKTOP_PANORAMA_3B: "Oder verwenden Sie die Plus- und Minus-Tasten zum Vergrößern und Verkleinern.",
  12965. HELP_DESKTOP_360_2A: "Klicken Sie die Innenansicht ikone, um diesen Raum zu starten .",
  12966. HELP_DESKTOP_360_2B: "Oder, drücken Sie die 1-Taste um die Innenraumansicht zu starten.",
  12967. HELP_DESKTOP_DOLLHOUSE_1A: "Klicken Sie mit der linken Maustaste und ziehen Sie nach links, rechts, oben und unten um das Puppenhaus zu drehen.",
  12968. 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.",
  12969. HELP_DESKTOP_DOLLHOUSE_3A: "Verwenden Sie das Scrollrad zum Vergrößern und Verkleinern.",
  12970. HELP_DESKTOP_DOLLHOUSE_1B: "Oder verwenden Sie die Pfeiltasten um das Puppenhaus zu drehen.",
  12971. 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.",
  12972. HELP_DESKTOP_FLOORPLAN_2A: "Klicken Sie mit der rechten Maustaste und ziehen Sie nach links oder rechts um den Grundriss zu drehen.",
  12973. HELP_DESKTOP_FLOORPLAN_3A: "Verwenden Sie das Scrollrad zum Vergrößern und Verkleinern.",
  12974. HELP_DESKTOP_FLOORPLAN_2B: "Oder verwenden Sie die Pfeiltasten um das Modell nach links oder rechts zu drehen.",
  12975. HELP_DESKTOP_FLOORPLAN_3B: "Oder verwenden Sie die Pfeiltasten zum Vergrößern und Verkleinern.",
  12976. HELP_MOBILE_PANORAMA_1: "Berühren und ziehen an dem Raum um sich umzusehen.",
  12977. HELP_MOBILE_PANORAMA_2: "Klicken Sie auf die Ringe im Raum, um sich zu bewegen.",
  12978. HELP_MOBILE_3: "Benutzen Sie die Zoom-Gäste zum Vergrößern und Verkleinern.",
  12979. HELP_MOBILE_360_2: "Tippen Sie die Innenansicht ikone, um diesen Raum zu starten.",
  12980. HELP_MOBILE_DOLLHOUSE_1: "Berühren und nach oben, unten, links und rechts ziehen um das Puppenhaus zu drehen.",
  12981. HELP_MOBILE_DOLLHOUSE_2: "Berühren und mit zwei Fingern ziehen um das Puppenhaus zu positionieren.",
  12982. HELP_MOBILE_FLOORPLAN_1: "Berühren und ziehen, um den Grundriss zu positionieren.",
  12983. HELP_MOBILE_FLOORPLAN_2: "Berühren und ziehen mit zwei Fingern, um den Grundriss zu drehen.",
  12984. HELP_MORE_HLR_A: "Liste das Highlight",
  12985. HELP_DESKTOP_MORE_HLR_B: "Öffnen um durch den Raum mit Vorschau-Bildern zu navigieren.",
  12986. HELP_MORE_DOLLHOUSE_A: "Puppenhaus Ansicht",
  12987. HELP_DESKTOP_MORE_DOLLHOUSE_B: "Klicken Sie um die von oben nach unten Sicht des gesamten Raumes in 3D anzuzeigen und zu drehen.",
  12988. HELP_MOBILE_MORE_DOLLHOUSE_B: "Tippen Sie um die von oben nach unten Sicht des gesamten Raumes in 3D anzuzeigen und zu drehen.",
  12989. HELP_MORE_FLOORS_A: "Etage auswählen",
  12990. HELP_DESKTOP_MORE_FLOORS_B: "Zwischen den Etagen im Raum wechseln.",
  12991. HELP_MORE_TAG_A: "tag™ Posts",
  12992. HELP_DESKTOP_MORE_TAG_B: "Klicken Sie auf oder bewegen Sie Ihren Mauszeiger über die Informationen über die Funktionen im Raum.",
  12993. HELP_MOBILE_MORE_TAG_B: "Tippen Sie für Informationen über die Funktionen im Raum.",
  12994. HELP_MORE_ZOOM_A: "Zoom Steuerung",
  12995. HELP_DESKTOP_MORE_ZOOM_B: "Verwenden Sie diese Steuerung oder das Scrollrad zum Vergrößern und Verkleinern.",
  12996. HELP_MORE_TOUR_A: "Tour Steuerung",
  12997. HELP_DESKTOP_MORE_TOUR_B: "Abspielen, pausieren und vorwärts und rückwärts durch eine geführte Tour navigieren.",
  12998. HELP_MORE_INSIDE_A: "Innenansicht",
  12999. HELP_DESKTOP_MORE_INSIDE_B: "Klicken Sie hier um sich im Raum umzusehen.",
  13000. HELP_MOBILE_MORE_INSIDE_B: "Sehen Sie sich in diesen 3D Raum um.",
  13001. HELP_MORE_VR_A: "VR Modus",
  13002. HELP_DESKTOP_MORE_VR_B: "Klicken Sie hier, um den Raum in der virtuellen Realität zu starten.",
  13003. HELP_MOBILE_MORE_VR_B: "Tippen Sie um den Raum in der virtuellen Realität zu starten.",
  13004. HELP_MORE_360_A: "360° Views Ansicht ",
  13005. HELP_DESKTOP_MORE_360_B: "Klicken Sie die 360° Views Ansicht in das Highlight um Aussen-Szenen zu sehen.",
  13006. HELP_MOBILE_MORE_360_B: "Tippen Sie die 360° Views Ansicht in das Highlight um Aussen-Szenen zu sehen.",
  13007. HELP_MORE_FULLSCREEN_A: "Vollbild",
  13008. HELP_DESKTOP_MORE_FULLSCREEN_B: "Erweitern Sie 3D Showcase im Vollbildmodus.",
  13009. WEBVR_FOR_CARDBOARD: "Für Google Cardboard",
  13010. WEBVR_FOR_DAYDREAM: "Für Daydream View",
  13011. WEBVR_ENTER_WEBVR: "Starten Sie VR",
  13012. WEBVR_DIFFERENT_HEADSET: "Haben Sie anderes Headset?",
  13013. WEBVR_LEARN_MORE: "Mehr Infos",
  13014. WEBVR_VIEW_SPACE: "Ansicht des Raumes in VR",
  13015. WEBVR_DAYDREAM_VIEW: "Daydream View",
  13016. WEBVR_DAYDREAM_PHONE: "Daydream-fähiges Handy",
  13017. WEBVR_VIEW_CARDBOARD: "Oder mit Google Cardboard ansehen",
  13018. VR_WHAT_YOU_NEED: "Was Sie dafür brauchen...",
  13019. VR_NEED_DAYDREAM_PHONE: "Daydream-fähiges Handy",
  13020. VR_GOOGLE_DAYDREAM: "Google Daydream",
  13021. VR_APP: "port VR App",
  13022. VR_APP_OPEN: "Oder öffnen Sie die port VR App",
  13023. 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",
  13024. VR_SAMSUNG_DETAIL: "Galaxy S6 und neuer",
  13025. VR_APP_FOR_ANDROID: "port VR app für Android",
  13026. VR_NEED_DAYDREAM: "ERFORDERT VOR DER 'PAIRING' MIT DAYDREAM VIEW",
  13027. VR_VIEW_SPACE: "Ansicht des Raumes in VR",
  13028. VR_LEARN_MORE_CAPS: "MEHR INFOS",
  13029. VR_PREVIOUS_CAPS: "ZURÜCK",
  13030. VR_NEXT_CAPS: "WEITER",
  13031. VR_GOT_IT_CAPS: "VERSTANDEN",
  13032. VR_SHOW_SUPPORTED: "Tippen Sie um den Raum in VR zu sehen",
  13033. VR_SHOW_UNSUPPORTED: "Schade, aber Ihr Gerät erfüllt nicht die Mindestanforderungen um den Raum in VR zu sehen.",
  13034. VR_SHOW_IOS_1: "Tippen Sie um den Raum in VR zu sehen",
  13035. VR_SHOW_IOS_2: "port VR App sowie kompatibles iPhone sind von nöten um diesen Raum zu sehen",
  13036. VR_NEED_CARDBOARD: "Was Sie dafür brauchen ist Google Cardboard",
  13037. VR_NEED_SAMSUNG: "Was Sie dafür brauchen ist Samsung Gear VR",
  13038. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  13039. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  13040. VR_COMPATIBLE_IPHONES_1: "iPhones",
  13041. VR_COMPATIBLE_IPHONES_2: "iPhone 5s oder neuer, mit iOS 9.1 und später",
  13042. VR_COMPATIBLE_IPHONES_3: "Kompatibles iPhones",
  13043. VR_COMPATIBLE_ANDROID: "Kompatibles Android Gerät",
  13044. VR_ANDROID_DETAIL: "Bildschirmdiagonale von 11,5 bis 14 cm (4,5 - 5,5 Zoll) und Android 4.4.4 und neuer",
  13045. VR_ANDROID_DVICES: "Android Geräte",
  13046. VR_COMPATIBLE_SAMSUNG: "Kompatible Samsung Geräte",
  13047. VR_APP_FOR_CARDBOARD: "port VR App für Google Cardboard",
  13048. VR_APP_FOR_SAMSUNG: "port VR App für Gear VR",
  13049. VR_DOWNLOAD_HERE: "Hier runterladen",
  13050. VR_REQUIRE_HEADSET: "Benötigt das ein VR-Headset und port VR App für Android installiert wird",
  13051. VR_REDIRECT_TO_STORE: "Wenn App nicht installiert ist, werden Sie zum App Store umgeleitet.",
  13052. VR_IMPROPER_EMBED: "Der port Raum ist nicht richtig eingebettet um VR in Ihrem Webbrowser zu unterstützen.",
  13053. VR_OPEN_ANDROID_LINK: "Öffnen Sie den Link auf Ihrem Handy",
  13054. VR_ANDROID_OPTIONS: "VR Headset Optionen",
  13055. SHARE_TO: "Teilen auf",
  13056. SHARE_LINK: "Direkter Link",
  13057. SHARE_EXPLORE: "Umsehen",
  13058. SHARE_AT: "auf",
  13059. SHARE_WITH: "mit",
  13060. SHARE_3D: "in 3D",
  13061. SHARE_COPIED: "Kopiert!",
  13062. ERROR_BROWSER_SOLUTION: "Installieren Sie einen neueren Browser um sich in 3D umzusehen.",
  13063. ERROR_BROWSER_EXPLANATION: "WebGL benötigt einen modernen Browser.",
  13064. ERROR_GENERIC_PROBLEM: "Huch, etwas ist schief gelaufen.",
  13065. ERROR_GENERIC_SOLUTION: "Starten Sie Ihren Browser neu.",
  13066. ERROR_GENERIC_ACTIONS_1: "Wenn das Problem weiterhin besteht, ",
  13067. ERROR_GENERIC_ACTIONS_2: "Installieren Sie einen unterstützten Browser",
  13068. ERROR_GENERIC_ACTIONS_3: " oder ",
  13069. ERROR_GENERIC_ACTIONS_4: "Sehen Sie unseren Leitfaden zur Fehlerbehebung",
  13070. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "Browser wird nicht unterstützt.",
  13071. ERROR_WEBGL_IOS_PROBLEM: "iOS-Version wird nicht unterstützt.",
  13072. ERROR_WEBGL_IOS_SOLUTION: "Aktualisieren Sie auf iOS 8 oder neuer um sich in 3D umzusehen.",
  13073. ERROR_WEBGL_IOS_ACTIONS_1: "Tippen ",
  13074. ERROR_WEBGL_IOS_ACTIONS_2: "Einstellungen > Allgemein > Softwareaktualisierung",
  13075. ERROR_WEBGL_SAFARI_PROBLEM: "Aktivieren Sie WebVR um sich in 3D umzusehen.",
  13076. ERROR_WEBGL_SAFARI_ACTIONS_1: "Klicken ",
  13077. ERROR_WEBGL_SAFARI_ACTIONS_2: "Präferenzen > Fortgeschrittene > Entwickler-Menü anzeigen",
  13078. ERROR_WEBGL_SAFARI_ACTIONS_3: "Klicken Sie dann ",
  13079. ERROR_WEBGL_SAFARI_ACTIONS_4: "Entwickler > WebGL Aktivieren",
  13080. ERROR_MISSING_URLS_PROBLEM: "Huch, es gibt keine Panoramen für dieses Modell .",
  13081. ERROR_MISSING_URLS_EXPLANATION: "Dies ist ein älteres Modell. Der Website-Besitzer hat eventuell ein neues Modell in Arbeit.",
  13082. ERROR_LOADING_FAILED_PROBLEM: "Huch, das Modell ist nicht verfügbar.",
  13083. ERROR_LOADING_FAILED_ACTIONS_1: "Wenn das Problem weiterhin besteht, ",
  13084. ERROR_LOADING_FAILED_ACTIONS_2: "sehen Sie unseren Leitfaden zur Fehlerbehebung",
  13085. ERROR_MAINTENANCE_PROBLEM: "Wartung im Gange.",
  13086. ERROR_MAINTENANCE_SOLUTION: "Bitte versuchen Sie es in ein paar Minuten nochmal.",
  13087. LINK_TO_LOCATION: "Link zu",
  13088. MENU_COPY: "Kopieren",
  13089. LINK_ALERT_COPY: "Bitte benutzen Sie CTRL/CMD + C zum kopieren.",
  13090. ROTATE: "Drehen",
  13091. INSIDE: "Drinnen",
  13092. MOVE: "Bewegen",
  13093. ZOOM: "Vergrößern"
  13094. }
  13095. }
  13096. , {}],
  13097. 111: [function(e, t, i) {
  13098. "use strict";
  13099. t.exports = {
  13100. PAGE_TITLE: "",
  13101. LOADING: "Loading",
  13102. PRESENTED_BY_CAPS: "PRESENTED BY",
  13103. POWERED_BY: "powered by ",
  13104. POWERED_BY_CAPS: "POWERED BY",
  13105. DESKTOP_SHORT_CTA: "Click to explore this 3D space.",
  13106. MOBILE_SHORT_CTA: "Tap to explore this 3D space.",
  13107. PRESENTED_BY: "Presented by ",
  13108. MORE: "More ",
  13109. LESS: "Less ",
  13110. TAG_CONTENT: "tag™ Content",
  13111. SHOW: "Show",
  13112. HIDE: "Hide",
  13113. DOLLHOUSE: "Dollhouse",
  13114. FLOOR_PLAN: "Floor plan",
  13115. OPEN_HIGHLIGHTS: "Open Highlights",
  13116. CLOSE_HIGHLIGHTS: "Close",
  13117. PREVIOUS: "Previous",
  13118. PLAY: "Play",
  13119. PAUSE: "Pause",
  13120. NEXT: "Next",
  13121. EXPLORE_3D_SPACE: "Explore 3D Space",
  13122. VIEW_DOLLHOUSE: "View dollhouse",
  13123. SOCIAL_SHARING: "Share this Space",
  13124. VIEW_IN_VR: "View in VR",
  13125. VIEW_FULLSCREEN: "全屏",
  13126. EXIT_FULLSCREEN: "退出全屏",
  13127. ZOOM_IN: "Zoom in",
  13128. ZOOM_OUT: "Zoom out",
  13129. FLOOR_NAME: "Floor ",
  13130. FLOOR_ALL: "全部",
  13131. TERMS: "Terms",
  13132. PORT_TERMS: "port terms",
  13133. TERMS_OF_USE: "Terms of Use",
  13134. TERMS_TEXT_FILE: "terms-en-US.html",
  13135. CLOSE_TERMS: "Close",
  13136. TERMS_FAIL: "Could not fetch terms. Please make sure you have an internet connection to view the terms of use.",
  13137. HELP: "Help",
  13138. HELP_NAVIGATION_TAB: "Navigation",
  13139. HELP_MORE_HELP_TAB: "More Help",
  13140. CLOSE: "Close",
  13141. HELP_DESKTOP_PANORAMA_1A: "Click and Drag to look around the Space.",
  13142. HELP_DESKTOP_PANORAMA_2A: "Click on the rings throughout the space to move around.",
  13143. HELP_DESKTOP_PANORAMA_3A: "Use the scroll wheel to zoom in and out.",
  13144. HELP_DESKTOP_PANORAMA_1B: "Or, use the arrow keys to turn left and right.",
  13145. HELP_DESKTOP_PANORAMA_2B: "Or, use the arrow keys to move forward and back.",
  13146. HELP_DESKTOP_PANORAMA_3B: "Or, use the plus and minus keys to zoom in and out.",
  13147. HELP_DESKTOP_360_2A: "Click the Inside View icon to enter the Space.",
  13148. HELP_DESKTOP_360_2B: "Or, press the number 1 key to enter Inside View.",
  13149. HELP_DESKTOP_DOLLHOUSE_1A: "Left click and drag left, right, up, and down to rotate the Dollhouse.",
  13150. HELP_DESKTOP_DOLLHOUSE_2A: "Right click and drag left, right, up, and down to change the Dollhouse position on screen.",
  13151. HELP_DESKTOP_DOLLHOUSE_3A: "Use the scroll wheel to zoom in and out.",
  13152. HELP_DESKTOP_DOLLHOUSE_1B: "Or, use the arrow keys to rotate the Dollhouse.",
  13153. HELP_DESKTOP_FLOORPLAN_1A: "Left click and drag left, right, up, and down to change the Floorplan position on screen.",
  13154. HELP_DESKTOP_FLOORPLAN_2A: "Right click and drag left or right to rotate the Floorplan.",
  13155. HELP_DESKTOP_FLOORPLAN_3A: "Use the scroll wheel to zoom in and out.",
  13156. HELP_DESKTOP_FLOORPLAN_2B: "Or, use the arrow keys to rotate left or right.",
  13157. HELP_DESKTOP_FLOORPLAN_3B: "Or, use the arrow keys to zoom in and out.",
  13158. HELP_MOBILE_PANORAMA_1: "Touch and Drag to look around the Space.",
  13159. HELP_MOBILE_PANORAMA_2: "Tap on the rings throughout the Space to move around.",
  13160. HELP_MOBILE_3: "Use a pinch gesture to zoom in and out.",
  13161. HELP_MOBILE_360_2: "Tap the Inside View icon to enter the Space.",
  13162. HELP_MOBILE_DOLLHOUSE_1: "Touch and drag up, down, left, and right to rotate the Dollhouse.",
  13163. HELP_MOBILE_DOLLHOUSE_2: "Touch and drag with two fingers to position the Dollhouse.",
  13164. HELP_MOBILE_FLOORPLAN_1: "Touch and drag to position the Floorplan.",
  13165. HELP_MOBILE_FLOORPLAN_2: "Touch and drag with two fingers to rotate the Floorplan.",
  13166. HELP_MORE_HLR_A: "Highlight Reel",
  13167. HELP_DESKTOP_MORE_HLR_B: "Open to navigate through the Space using thumbnail images.",
  13168. HELP_MORE_DOLLHOUSE_A: "Dollhouse View",
  13169. HELP_DESKTOP_MORE_DOLLHOUSE_B: "Click to view and rotate a top-down view of the entire Space in 3D.",
  13170. HELP_MOBILE_MORE_DOLLHOUSE_B: "Tap to view and rotate a top-down view of the entire Space in 3D.",
  13171. HELP_MORE_FLOORS_A: "Floor Selector",
  13172. HELP_DESKTOP_MORE_FLOORS_B: "Switch between floors in the Space.",
  13173. HELP_MORE_TAG_A: "tag™ Posts",
  13174. HELP_DESKTOP_MORE_TAG_B: "Click or hover over for information about features in the Space.",
  13175. HELP_MOBILE_MORE_TAG_B: "Tap for information about features in the Space.",
  13176. HELP_MORE_ZOOM_A: "Zoom Controls",
  13177. HELP_DESKTOP_MORE_ZOOM_B: "Use these controls to zoom in and out or use the scroll wheel.",
  13178. HELP_MORE_TOUR_A: "Tour Controls",
  13179. HELP_DESKTOP_MORE_TOUR_B: "Play, pause, and navigate forward and backward through a Guided Tour.",
  13180. HELP_MORE_INSIDE_A: "Inside View",
  13181. HELP_DESKTOP_MORE_INSIDE_B: "Click to explore inside the Space.",
  13182. HELP_MOBILE_MORE_INSIDE_B: "Tap to explore inside the Space.",
  13183. HELP_MORE_VR_A: "VR Mode",
  13184. HELP_DESKTOP_MORE_VR_B: "Click to launch the Space in virtual reality.",
  13185. HELP_MOBILE_MORE_VR_B: "Tap to launch the Space in virtual reality.",
  13186. HELP_MORE_360_A: "360° Views",
  13187. HELP_DESKTOP_MORE_360_B: "Click 360 Views in the Highlight Reel to view outdoor scenes.",
  13188. HELP_MOBILE_MORE_360_B: "Tap 360 Views in the Highlight Reel to view outdoor scenes.",
  13189. HELP_MORE_FULLSCREEN_A: "Full screen",
  13190. HELP_DESKTOP_MORE_FULLSCREEN_B: "Expand 3D Showcase to full screen.",
  13191. WEBVR_FOR_CARDBOARD: "For Google Cardboard",
  13192. WEBVR_VIEW_CARDBOARD: "Or View on Google Cardboard",
  13193. WEBVR_FOR_DAYDREAM: "For Daydream View",
  13194. WEBVR_ENTER_WEBVR: "ENTER VR",
  13195. WEBVR_DIFFERENT_HEADSET: "Have a different headset?",
  13196. WEBVR_LEARN_MORE: "Learn more",
  13197. WEBVR_VIEW_SPACE: "View Space in VR",
  13198. WEBVR_DAYDREAM_VIEW: "Daydream View",
  13199. WEBVR_DAYDREAM_PHONE: "Daydream-ready phone",
  13200. VR_VIEW_SPACE: "View Space in Virtual Reality",
  13201. VR_LEARN_MORE_CAPS: "LEARN MORE",
  13202. VR_PREVIOUS_CAPS: "PREVIOUS",
  13203. VR_NEXT_CAPS: "NEXT",
  13204. VR_GOT_IT_CAPS: "GOT IT",
  13205. VR_SHOW_SUPPORTED: "Tap to view the Space in VR with",
  13206. VR_SHOW_UNSUPPORTED: "Sorry, but your device doesn't meet the minimum requirements to view a space in VR.",
  13207. VR_SHOW_IOS_1: "Tap to view the space in VR",
  13208. VR_SHOW_IOS_2: "Requires port VR app and compatible iPhone to view",
  13209. VR_WHAT_YOU_NEED: "What You'll Need For...",
  13210. VR_NEED_CARDBOARD: "What you'll need with Google Cardboard",
  13211. VR_NEED_SAMSUNG: "What you'll need with Samsung Gear VR",
  13212. VR_NEED_DAYDREAM: "NEEDS PRIOR PAIRING WITH DAYDREAM VIEW",
  13213. VR_NEED_DAYDREAM_PHONE: "Daydream-ready phone",
  13214. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  13215. VR_GOOGLE_DAYDREAM: "Google Daydream",
  13216. VR_APP: "port VR App",
  13217. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  13218. VR_COMPATIBLE_IPHONES_1: "iPhones",
  13219. VR_COMPATIBLE_IPHONES_2: "iPhone 5s and newer, running iOS 9.1 and higher",
  13220. VR_COMPATIBLE_IPHONES_3: "Compatible iPhones",
  13221. VR_COMPATIBLE_ANDROID: "Compatible Android Devices",
  13222. VR_COMPATIBLE_ANDROID_LONG: 'Compatible Android Devices Displays from 4.5"-5.5" running Android OS 4.4.4 and higher',
  13223. VR_ANDROID_DETAIL: 'Displays from 4.5"-5.5" running Android OS 4.4.4 and higher',
  13224. VR_ANDROID_DVICES: "Android Devices",
  13225. VR_COMPATIBLE_SAMSUNG: "Compatible Samsung Devices",
  13226. VR_SAMSUNG_DETAIL: "Galaxy S6 and Above",
  13227. VR_APP_FOR_CARDBOARD: "port VR app for Google Cardboard",
  13228. VR_APP_FOR_SAMSUNG: "port VR app for Gear VR",
  13229. VR_APP_FOR_ANDROID: "port VR app for Android Phones",
  13230. VR_APP_OPEN: "Open with the port VR app instead",
  13231. VR_DOWNLOAD_HERE: "Download here",
  13232. VR_REQUIRE_HEADSET: "Requires a VR headset and port VR app for Android to be installed",
  13233. VR_REDIRECT_TO_STORE: "If app is not installed, you will be redirected to the app store.",
  13234. VR_IMPROPER_EMBED: "The port Space is not embedded properly to support VR in your web browser.",
  13235. VR_OPEN_ANDROID_LINK: "Open the Link on Your Mobile Phone",
  13236. VR_ANDROID_OPTIONS: "Available VR Headset Options",
  13237. SHARE_TO: "Share to",
  13238. SHARE_LINK: "Direct Link",
  13239. SHARE_EXPLORE: "Explore ",
  13240. SHARE_AT: "at",
  13241. SHARE_WITH: "with",
  13242. SHARE_3D: " in 3D",
  13243. SHARE_COPIED: "Copied!",
  13244. ERROR_BROWSER_SOLUTION: "Install a new browser to explore in 3D.",
  13245. ERROR_BROWSER_EXPLANATION: "WebGL requires a modern browser.",
  13246. ERROR_GENERIC_PROBLEM: "Oops, something went wrong.",
  13247. ERROR_GENERIC_SOLUTION: "Restart your browser.",
  13248. ERROR_GENERIC_ACTIONS_1: "If the problem persists, ",
  13249. ERROR_GENERIC_ACTIONS_2: "install a supported browser",
  13250. ERROR_GENERIC_ACTIONS_3: " or ",
  13251. ERROR_GENERIC_ACTIONS_4: "see our troubleshooting guide",
  13252. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "Browser not supported.",
  13253. ERROR_WEBGL_IOS_PROBLEM: "iOS version not supported.",
  13254. ERROR_WEBGL_IOS_SOLUTION: "Upgrade to iOS 8 or higher to explore in 3D.",
  13255. ERROR_WEBGL_IOS_ACTIONS_1: "Tap ",
  13256. ERROR_WEBGL_IOS_ACTIONS_2: "Settings > General > Software Update",
  13257. ERROR_WEBGL_SAFARI_PROBLEM: "Enable WebGL to explore in 3D.",
  13258. ERROR_WEBGL_SAFARI_ACTIONS_1: "Click ",
  13259. ERROR_WEBGL_SAFARI_ACTIONS_2: "Preferences > Advanced > Show Develop menu",
  13260. ERROR_WEBGL_SAFARI_ACTIONS_3: "Then click ",
  13261. ERROR_WEBGL_SAFARI_ACTIONS_4: "Develop > Enable WebGL",
  13262. ERROR_MISSING_URLS_PROBLEM: "Oops, there are no panoramas for this model.",
  13263. ERROR_MISSING_URLS_EXPLANATION: "This is an older model. The website owner may have a new model on the way.",
  13264. ERROR_LOADING_FAILED_PROBLEM: "模型不可用.",
  13265. ERROR_LOADING_FAILED_ACTIONS_1: "If the problem persists, ",
  13266. ERROR_LOADING_FAILED_ACTIONS_2: "see our troubleshooting guide",
  13267. ERROR_MAINTENANCE_PROBLEM: "Maintenance in progress.",
  13268. ERROR_MAINTENANCE_SOLUTION: "Please come back in a few minutes.",
  13269. LINK_TO_LOCATION: "Link to location",
  13270. MENU_COPY: "Copy",
  13271. LINK_ALERT_COPY: "Please use CTRL/CMD + C to copy.",
  13272. ROTATE: "Rotate",
  13273. INSIDE: "Inside",
  13274. MOVE: "Move",
  13275. ZOOM: "Zoom"
  13276. }
  13277. }
  13278. , {}],
  13279. 112: [function(e, t, i) {
  13280. "use strict";
  13281. t.exports = {
  13282. PAGE_TITLE: "",
  13283. LOADING: "Cargando",
  13284. PRESENTED_BY_CAPS: "PRESENTADO POR",
  13285. POWERED_BY: "potenciando por ",
  13286. POWERED_BY_CAPS: "POTENCIADO POR ",
  13287. DESKTOP_SHORT_CTA: "Haga clic para explorar este Espacio 3D.",
  13288. MOBILE_SHORT_CTA: "Pulse para explorar este Espacio 3D.",
  13289. PRESENTED_BY: "Presentado por ",
  13290. MORE: "Más ",
  13291. LESS: "Menos ",
  13292. TAG_CONTENT: "Contenido de tag™",
  13293. SHOW: "Mostrar",
  13294. HIDE: "Ocultar",
  13295. DOLLHOUSE: "Dollhouse",
  13296. FLOOR_PLAN: "Planos",
  13297. OPEN_HIGHLIGHTS: "Aspectos Destacados",
  13298. CLOSE_HIGHLIGHTS: "Cerrar",
  13299. PREVIOUS: "Anterior",
  13300. PLAY: "Play",
  13301. PAUSE: "Pausa",
  13302. NEXT: "Siguiente",
  13303. EXPLORE_3D_SPACE: "Explorar el Espacio 3D",
  13304. VIEW_DOLLHOUSE: "Ver dollhouse",
  13305. SOCIAL_SHARING: "Compartir este espacio",
  13306. VIEW_IN_VR: "Ver en realidad virtual",
  13307. VIEW_FULLSCREEN: "Ver en pantalla completa",
  13308. EXIT_FULLSCREEN: "Salir de pantalla completa",
  13309. ZOOM_IN: "Acercar",
  13310. ZOOM_OUT: "Alejar",
  13311. FLOOR_NAME: "Piso ",
  13312. FLOOR_ALL: "Todas",
  13313. TERMS: "Condiciones",
  13314. PORT_TERMS: "port términos de uso",
  13315. TERMS_OF_USE: "Términos de uso",
  13316. TERMS_TEXT_FILE: "terms-es-MX.html",
  13317. CLOSE_TERMS: "Cerrar",
  13318. 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.",
  13319. HELP: "Ayuda",
  13320. HELP_NAVIGATION_TAB: "Navegación",
  13321. HELP_MORE_HELP_TAB: "Más Ayuda",
  13322. CLOSE: "Cerrar",
  13323. HELP_DESKTOP_PANORAMA_1A: "Haga clic y arrastre para mirar alrededor del espacio.",
  13324. HELP_DESKTOP_PANORAMA_2A: "Haga clic en los aros a lo largo del espacio para moverse.",
  13325. HELP_DESKTOP_PANORAMA_3A: "Use la rueda de desplazamiento para acercar o alejar.",
  13326. HELP_DESKTOP_PANORAMA_1B: "O use las teclas de flecha para girar a la izquierda y a la derecha.",
  13327. HELP_DESKTOP_PANORAMA_2B: "O use las teclas de dirección para adelantar o retroceder.",
  13328. HELP_DESKTOP_PANORAMA_3B: "O use la tecla más para acercar y la tecla menos para alejar.",
  13329. HELP_DESKTOP_360_2A: "Haga clic en el icono Vista Interior para ingresar al Espacio.",
  13330. HELP_DESKTOP_360_2B: "O bien, presione la tecla numero 1 para entrar en la Vista Interior.",
  13331. HELP_DESKTOP_DOLLHOUSE_1A: "Haga clic izquierdo y arrastre hacia la izquierda, derecha, arriba o abajo para girar la Dollhouse.",
  13332. HELP_DESKTOP_DOLLHOUSE_2A: "Haga clic derecho y arrastre hacia la izquierda, derecha, arriba o abajo para cambiar la posición della dollhouse.",
  13333. HELP_DESKTOP_DOLLHOUSE_3A: "Use la rueda de desplazamiento para acercar o alejar.",
  13334. HELP_DESKTOP_DOLLHOUSE_1B: "O use las teclas de dirección para girar la Dollhouse.",
  13335. 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.",
  13336. HELP_DESKTOP_FLOORPLAN_2A: "Haga clic derecho y arrastre hacia la izquierda o derecha para girar la planta.",
  13337. HELP_DESKTOP_FLOORPLAN_3A: "Use la rueda de desplazamiento para acercar o alejar.",
  13338. HELP_DESKTOP_FLOORPLAN_2B: "O use las teclas para girar hacia la izquierda o derecha.",
  13339. HELP_DESKTOP_FLOORPLAN_3B: "O use las teclas de dirección para acercar o alejar.",
  13340. HELP_MOBILE_PANORAMA_1: "Toque y arrastre para mirar alrededor del espacio.",
  13341. HELP_MOBILE_PANORAMA_2: "Toque en los aros a lo largo del espacio para moverse.",
  13342. HELP_MOBILE_3: "Use el gesto de pellizcar para acercar o alejar.",
  13343. HELP_MOBILE_360_2: "Toque el ícono Vista Interior para entrar en el Espacio.",
  13344. HELP_MOBILE_DOLLHOUSE_1: "Toque y arrastre con dos dedos para cambiar la posición della dollhouse.",
  13345. HELP_MOBILE_DOLLHOUSE_2: "Toque y arrastre con dos dedos para cambiar la posición de la vista aérea.",
  13346. HELP_MOBILE_FLOORPLAN_1: "Toque y arrastre para cambiar la posición de la planta.",
  13347. HELP_MOBILE_FLOORPLAN_2: "Toque y arrastre con dos dedos para girar la planta.",
  13348. HELP_MORE_HLR_A: "Galería destacada",
  13349. HELP_DESKTOP_MORE_HLR_B: "Abra para navegar a través del espacio utilizando imágenes en miniatura.",
  13350. HELP_MORE_DOLLHOUSE_A: "Vista aérea por pisos",
  13351. HELP_DESKTOP_MORE_DOLLHOUSE_B: "Haga clic para ver y girar la Dollhouse del espacio completo en 3D.",
  13352. HELP_MOBILE_MORE_DOLLHOUSE_B: "Toque para ver y girar la vista Dollhouse del espacio completo en 3D.",
  13353. HELP_MORE_FLOORS_A: "Seleccionador de plantas",
  13354. HELP_DESKTOP_MORE_FLOORS_B: "Cambie de una planta a otra en el espacio.",
  13355. HELP_MORE_TAG_A: "tag™ Posts",
  13356. HELP_DESKTOP_MORE_TAG_B: "Haga clic o coloque el cursor para obtener más información acerca de las características del espacio.",
  13357. HELP_MOBILE_MORE_TAG_B: "Toque para obtener más información acerca de las características del espacio.",
  13358. HELP_MORE_ZOOM_A: "Controles de zoom",
  13359. HELP_DESKTOP_MORE_ZOOM_B: "Use estos controles o la rueda de desplazamiento para acercar o alejar.",
  13360. HELP_MORE_TOUR_A: "Controles de recorrido",
  13361. HELP_DESKTOP_MORE_TOUR_B: "Reproduzca, pause, adelante o retroceda a través de un recorrido guiado.",
  13362. HELP_MORE_INSIDE_A: "Vista interior",
  13363. HELP_DESKTOP_MORE_INSIDE_B: "Haga clic para explorar el interior del espacio.",
  13364. HELP_MOBILE_MORE_INSIDE_B: "Toque para explorar el interior del espacio.",
  13365. HELP_MORE_VR_A: "Modo de realidad virtual",
  13366. HELP_DESKTOP_MORE_VR_B: "Toque para ver el espacio en realidad virtual.",
  13367. HELP_MOBILE_MORE_VR_B: "Toque para ver el espacio en realidad virtual.",
  13368. HELP_MORE_360_A: "360° Views",
  13369. HELP_DESKTOP_MORE_360_B: "Una vez que se encuentre en galería destacada, haga clic en vistas de 360º para ver el exterior.",
  13370. HELP_MOBILE_MORE_360_B: "Una vez que se encuentre en galería destacada, toque en vistas de 360º para ver el exterior.",
  13371. HELP_MORE_FULLSCREEN_A: "Pantalla completa",
  13372. HELP_DESKTOP_MORE_FULLSCREEN_B: "Expanda el escenario 3D para verlo en pantalla completa.",
  13373. WEBVR_FOR_CARDBOARD: "Para Google Cardboard",
  13374. WEBVR_FOR_DAYDREAM: "Para Daydream View",
  13375. WEBVR_ENTER_WEBVR: "ENTRAR VR",
  13376. WEBVR_DIFFERENT_HEADSET: "¿Tiene un auricular diferente?",
  13377. WEBVR_LEARN_MORE: "Más información",
  13378. WEBVR_VIEW_SPACE: "Ver Espacio en VR",
  13379. WEBVR_DAYDREAM_VIEW: "Daydream View",
  13380. WEBVR_DAYDREAM_PHONE: "Daydream Teléfono listos",
  13381. WEBVR_VIEW_CARDBOARD: "O Ver en Google Cardboard",
  13382. VR_NEED_DAYDREAM: "Necesidades antes de acoplarse con Daydream View",
  13383. VR_NEED_DAYDREAM_PHONE: "Teléfono listo para Daydream",
  13384. VR_GOOGLE_DAYDREAM: "Daydream de Google",
  13385. VR_APP: "port VR App",
  13386. VR_COMPATIBLE_ANDROID_LONG: 'Compatible con los Dispositivos Android con Pantallas de 4.5"-5.5" operando Android OS 4.4.4 y posteriores',
  13387. VR_APP_FOR_ANDROID: "Aplicación port VR para Teléfonos Android",
  13388. VR_APP_OPEN: "Abrir con la aplicación port VR en su lugar",
  13389. VR_VIEW_SPACE: "Ver Espacio en realidad virtual",
  13390. VR_LEARN_MORE_CAPS: "SABER MÁS",
  13391. VR_PREVIOUS_CAPS: "ANTERIOR",
  13392. VR_NEXT_CAPS: "SIGUIENTE",
  13393. VR_GOT_IT_CAPS: "COMPRENDIDO",
  13394. VR_SHOW_SUPPORTED: "Pulse para ver el Espacio en realidad virtual con",
  13395. VR_SHOW_UNSUPPORTED: "Lo sentimos, pero su dispositivo no cumple los requisitos mínimos para ver un Espacio en realidad virtual.",
  13396. VR_SHOW_IOS_1: "Pulse para ver el Espacio en realidad virtual",
  13397. VR_SHOW_IOS_2: "Necesita la aplicación port VR y un iPhone compatible para ver",
  13398. VR_WHAT_YOU_NEED: "Lo que necesitaras...",
  13399. VR_NEED_CARDBOARD: "Lo que necesitaras con Google Cardboard",
  13400. VR_NEED_SAMSUNG: "Lo que necesitaras con el Samsung Gear VR",
  13401. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  13402. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  13403. VR_COMPATIBLE_IPHONES_1: "iPhones",
  13404. VR_COMPATIBLE_IPHONES_2: "Compatible con iPhone 6S o superior y con iOS 9.1 en adelante",
  13405. VR_COMPATIBLE_IPHONES_3: "iPhones compatibles",
  13406. VR_COMPATIBLE_ANDROID: "Dispositivos Android compatibles",
  13407. VR_ANDROID_DETAIL: "Pantallas de 11.43 cm a 13.97 cm con OS de Android 4.4.4 en adelante",
  13408. VR_ANDROID_DVICES: "Dispositivos Android",
  13409. VR_COMPATIBLE_SAMSUNG: "Dispositivos compatibles del Samsung",
  13410. VR_SAMSUNG_DETAIL: "Galaxy S5 en adelante",
  13411. VR_APP_FOR_CARDBOARD: "Aplicación port VR para Google Cardboard",
  13412. VR_APP_FOR_SAMSUNG: "Aplicación port VR para Gear VR",
  13413. VR_DOWNLOAD_HERE: "Descargar aquí",
  13414. VR_REQUIRE_HEADSET: "Necesita un casco de realidad virtual y que se instale la aplicación port VR para Android",
  13415. VR_REDIRECT_TO_STORE: "Si la aplicación no está instalada, se le redirigirá a la tienda de aplicaciones.",
  13416. VR_IMPROPER_EMBED: "El espacio de port no está incorporado correctamente para apoyar VR en su navegador web.",
  13417. VR_OPEN_ANDROID_LINK: "Abre el enlace en tu teléfono móvil",
  13418. VR_ANDROID_OPTIONS: "Opciones de auriculares en RV disponibles",
  13419. SHARE_TO: "Compartir en",
  13420. SHARE_LINK: "Enlace directo",
  13421. SHARE_EXPLORE: "Explorar ",
  13422. SHARE_AT: "en",
  13423. SHARE_WITH: "con",
  13424. SHARE_3D: " en 3D",
  13425. SHARE_COPIED: "¡Copiado!",
  13426. ERROR_BROWSER_SOLUTION: "Instale un nuevo navegador para explorar en 3D.",
  13427. ERROR_BROWSER_EXPLANATION: "WebGL requiere un navegador moderno.",
  13428. ERROR_GENERIC_PROBLEM: "Vaya, algo ha ido mal.",
  13429. ERROR_GENERIC_SOLUTION: "Reinicie su navegador.",
  13430. ERROR_GENERIC_ACTIONS_1: "Si el problema persiste, ",
  13431. ERROR_GENERIC_ACTIONS_2: "instale un navegador compatible",
  13432. ERROR_GENERIC_ACTIONS_3: " o ",
  13433. ERROR_GENERIC_ACTIONS_4: "consulte nuestra guía de solución de problemas",
  13434. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "Navegador no compatible.",
  13435. ERROR_WEBGL_IOS_PROBLEM: "Versión de iOS no compatible.",
  13436. ERROR_WEBGL_IOS_SOLUTION: "Actualice a iOS 8 o superior para explorar en 3D.",
  13437. ERROR_WEBGL_IOS_ACTIONS_1: "Pulse ",
  13438. ERROR_WEBGL_IOS_ACTIONS_2: "Ajustes > General > Actualización de software",
  13439. ERROR_WEBGL_SAFARI_PROBLEM: "Habilite WebGL para explorar en 3D.",
  13440. ERROR_WEBGL_SAFARI_ACTIONS_1: "Haga clic en ",
  13441. ERROR_WEBGL_SAFARI_ACTIONS_2: "Preferencias > Avanzado > Mostrar el menú Desarrollar",
  13442. ERROR_WEBGL_SAFARI_ACTIONS_3: "Después, haga clic en ",
  13443. ERROR_WEBGL_SAFARI_ACTIONS_4: "Desarrollar > Habilitar WebGL",
  13444. ERROR_MISSING_URLS_PROBLEM: "Vaya, no hay panoramas para este modelo.",
  13445. ERROR_MISSING_URLS_EXPLANATION: "Este es un modelo antiguo. El propietario del sitio web puede tener un nuevo modelo en mente.",
  13446. ERROR_LOADING_FAILED_PROBLEM: "Vaya, modelo no disponible.",
  13447. ERROR_LOADING_FAILED_ACTIONS_1: "Si el problema persiste, ",
  13448. ERROR_LOADING_FAILED_ACTIONS_2: "consulte nuestra guía de solución de problemas",
  13449. ERROR_MAINTENANCE_PROBLEM: "Mantenimiento en progreso.",
  13450. ERROR_MAINTENANCE_SOLUTION: "Regrese en unos minutos.",
  13451. LINK_TO_LOCATION: "Enlace a la ubicación",
  13452. MENU_COPY: "Copiar",
  13453. LINK_ALERT_COPY: "Utilice CTRL/CMD + C para copiar.",
  13454. ROTATE: "Girar",
  13455. INSIDE: "Interior",
  13456. MOVE: "Moverse",
  13457. ZOOM: "Acercar o alejar"
  13458. }
  13459. }
  13460. , {}],
  13461. 113: [function(e, t, i) {
  13462. "use strict";
  13463. t.exports = {
  13464. PAGE_TITLE: "",
  13465. LOADING: "Chargement",
  13466. PRESENTED_BY_CAPS: "PRÉSENTÉ PAR",
  13467. POWERED_BY: "alimenté par ",
  13468. POWERED_BY_CAPS: "ALIMENTÉ PAR",
  13469. DESKTOP_SHORT_CTA: "Cliquez pour explorer l'Espace 3D.",
  13470. MOBILE_SHORT_CTA: "Cliquez pour explorer l'Espace 3D.",
  13471. PRESENTED_BY: "Présenté par ",
  13472. MORE: "Plus ",
  13473. LESS: "Moins ",
  13474. TAG_CONTENT: "Contenu tag™",
  13475. SHOW: "Montrer",
  13476. HIDE: "Cacher",
  13477. DOLLHOUSE: "Dollhouse",
  13478. FLOOR_PLAN: "Plan de sol",
  13479. OPEN_HIGHLIGHTS: "Ouvrir les faits saillants",
  13480. CLOSE_HIGHLIGHTS: "Fermer",
  13481. PREVIOUS: "Précédent",
  13482. PLAY: "Lecture",
  13483. PAUSE: "Pause",
  13484. NEXT: "Suivant",
  13485. EXPLORE_3D_SPACE: "Explorer l'Espace en 3D",
  13486. VIEW_DOLLHOUSE: "Voir dollhouse",
  13487. SOCIAL_SHARING: "Partager cet espace",
  13488. VIEW_IN_VR: "Voir en VR",
  13489. VIEW_FULLSCREEN: "Plein écran",
  13490. EXIT_FULLSCREEN: "Fermer plein écran",
  13491. ZOOM_IN: "Zoom avant",
  13492. ZOOM_OUT: "Zoom arrière",
  13493. FLOOR_NAME: "Étage ",
  13494. FLOOR_ALL: "Tous",
  13495. TERMS: "Mentions légales",
  13496. PORT_TERMS: "port mentions légales",
  13497. TERMS_OF_USE: "Conditions d'utilisation",
  13498. TERMS_TEXT_FILE: "terms-fr-FR.html",
  13499. CLOSE_TERMS: "Fermer",
  13500. TERMS_FAIL: "Impossible d'accéder aux mentions légales. Vérifiez que vous avez une connexion Internet pour afficher les conditions d'utilisation.",
  13501. HELP: "Aide",
  13502. HELP_NAVIGATION_TAB: "Navigation",
  13503. HELP_MORE_HELP_TAB: "Aide",
  13504. CLOSE: "Fermer",
  13505. HELP_DESKTOP_PANORAMA_1A: "Cliquez et faites glisser pour regarder autour de l’espace.",
  13506. HELP_DESKTOP_PANORAMA_2A: "Cliquez sur les anneaux pour vous déplacer.",
  13507. HELP_DESKTOP_PANORAMA_3A: "Utilisez la molette de votre souris pour zoomer.",
  13508. HELP_DESKTOP_PANORAMA_1B: "Ou utilisez les touches pour tourner.",
  13509. HELP_DESKTOP_PANORAMA_2B: "Ou utilisez les touches pour avancer et reculer.",
  13510. HELP_DESKTOP_PANORAMA_3B: "Ou utilisez les touches plus et moins pour zoomer.",
  13511. HELP_DESKTOP_360_2A: "Cliquez sur l’icône Vue Intérieure pour entrer dans l’Espace.",
  13512. HELP_DESKTOP_360_2B: "Ou, appuyez sur la touche numéro 1 pour entrer dans la Vue Intérieure.",
  13513. HELP_DESKTOP_DOLLHOUSE_1A: "Faites un clic gauche et bougez votre souris pour faire pivoter la vue Dollhouse.",
  13514. HELP_DESKTOP_DOLLHOUSE_2A: "Faites un clic droit et bougez votre souris pour changer la position de la vue Dollhouse.",
  13515. HELP_DESKTOP_DOLLHOUSE_3A: "Utilisez la molette de votre souris pour zoomer.",
  13516. HELP_DESKTOP_DOLLHOUSE_1B: "Ou utilisez les touches pour faire pivoter la vue Dollhouse.",
  13517. HELP_DESKTOP_FLOORPLAN_1A: "Faites un clic droit pour changer la position du plan sur l’écran.",
  13518. HELP_DESKTOP_FLOORPLAN_2A: "Faites un clic droit et faites glisser à gauche ou à droite pour faire pivoter le plan.",
  13519. HELP_DESKTOP_FLOORPLAN_3A: "Utilisez la molette de votre souris pour zoomer.",
  13520. HELP_DESKTOP_FLOORPLAN_2B: "Ou utilisez les touches pour faire pivoter à gauche ou à droite.",
  13521. HELP_DESKTOP_FLOORPLAN_3B: "Ou utilisez les touches pour effectuer un zoom avant ou arrière.",
  13522. HELP_MOBILE_PANORAMA_1: "Touchez et faites glisser pour regarder autour de l’espace.",
  13523. HELP_MOBILE_PANORAMA_2: "Tapez sur les anneaux dans tout l’espace pour vous déplacer.",
  13524. HELP_MOBILE_3: "Utilisez un geste de pincement pour zoomer avant/arrière.",
  13525. HELP_MOBILE_360_2: "Tapez sur l’icône Vue Intérieure pour entrer dans l’Espace.",
  13526. HELP_MOBILE_DOLLHOUSE_1: "Touchez et faites glisser vers le haut/bas/gauche/droite pour faire pivoter la vue Dollhouse.",
  13527. HELP_MOBILE_DOLLHOUSE_2: "Touchez et faites glisser avec deux doigts pour positionner vue en coupe.",
  13528. HELP_MOBILE_FLOORPLAN_1: "Touchez et faites glisser pour positionner le plan.",
  13529. HELP_MOBILE_FLOORPLAN_2: "Touchez et faites glisser avec deux doigts pour faire pivoter le plan.",
  13530. HELP_MORE_HLR_A: "Carrousel",
  13531. HELP_DESKTOP_MORE_HLR_B: "Ouvrez pour naviguer dans l’espace en utilisant les vignettes.",
  13532. HELP_MORE_DOLLHOUSE_A: "Vue en coupe",
  13533. HELP_DESKTOP_MORE_DOLLHOUSE_B: "Cliquez pour afficher et faire pivoter l’espace entier en 3D.",
  13534. HELP_MOBILE_MORE_DOLLHOUSE_B: "Tapez pour afficher et faire pivoter l’espace entier en 3D.",
  13535. HELP_MORE_FLOORS_A: "Sélecteur d’étage",
  13536. HELP_DESKTOP_MORE_FLOORS_B: "Basculer entre les étages dans l’espace.",
  13537. HELP_MORE_TAG_A: "tag™ Posts",
  13538. HELP_DESKTOP_MORE_TAG_B: "Cliquez ou survolez pour obtenir des informations sur l’espace.",
  13539. HELP_MOBILE_MORE_TAG_B: "Tapez pour obtenir des informations sur l’espace.",
  13540. HELP_MORE_ZOOM_A: "Commandes de zoom",
  13541. HELP_DESKTOP_MORE_ZOOM_B: "Utilisez votre clavier ou la molette de votre souris pour zoomer.",
  13542. HELP_MORE_TOUR_A: "Commandes de la visite",
  13543. HELP_DESKTOP_MORE_TOUR_B: "Mettez en marche ou en pause, avancez et reculez lors d'une visite guidée.",
  13544. HELP_MORE_INSIDE_A: "Vue intérieure",
  13545. HELP_DESKTOP_MORE_INSIDE_B: "Cliquez pour explorer l’intérieur de l’espace.",
  13546. HELP_MOBILE_MORE_INSIDE_B: "Tapez pour explorer l’intérieur de l’espace.",
  13547. HELP_MORE_VR_A: "Mode RV",
  13548. HELP_DESKTOP_MORE_VR_B: "Cliquez pour lancer l’espace en réalité virtuelle.",
  13549. HELP_MOBILE_MORE_VR_B: "Tapez pour lancer l’espace en réalité virtuelle.",
  13550. HELP_MORE_360_A: "Vues 360°",
  13551. HELP_DESKTOP_MORE_360_B: "Cliquez sur vues 360°, dans le carrousel pour voir les scènes extérieures.",
  13552. HELP_MOBILE_MORE_360_B: "Tapez sur vues 360°, dans le carrousel pour voir les scènes extérieures.",
  13553. HELP_MORE_FULLSCREEN_A: "Plein écran",
  13554. HELP_DESKTOP_MORE_FULLSCREEN_B: "Voir 3D Showcase en plein écran.",
  13555. WEBVR_FOR_CARDBOARD: "Pour Google Cardboard",
  13556. WEBVR_FOR_DAYDREAM: "Pour Daydream View",
  13557. WEBVR_ENTER_WEBVR: "ENTRER VR",
  13558. WEBVR_DIFFERENT_HEADSET: "Avez-vous un casque différent?",
  13559. WEBVR_LEARN_MORE: "En savoir plus",
  13560. WEBVR_VIEW_SPACE: "Voir Espace en VR",
  13561. WEBVR_DAYDREAM_VIEW: "Daydream View",
  13562. WEBVR_DAYDREAM_PHONE: "Téléphone compatibles Daydream",
  13563. WEBVR_VIEW_CARDBOARD: "Ou Afficher sur Google Cardboard",
  13564. VR_VIEW_SPACE: "Voir l'Espace en Réalité Virtuelle",
  13565. VR_LEARN_MORE_CAPS: "EN SAVOIR PLUS",
  13566. VR_PREVIOUS_CAPS: "PRÉCÉDENT",
  13567. VR_NEXT_CAPS: "SUIVANT",
  13568. VR_GOT_IT_CAPS: "BIEN COMPRIS",
  13569. VR_SHOW_SUPPORTED: "Taper pour voir l'Espace en VR avec",
  13570. VR_SHOW_UNSUPPORTED: "Désolé mais votre appareil ne répond pas aux critères minimaux pour voir cet Espace en mode VR.",
  13571. VR_SHOW_IOS_1: "Taper pour voir l’Espace en Realité Virtuelle",
  13572. VR_SHOW_IOS_2: "Nécessite l’application port VR et un iPhone compatible pour voir",
  13573. VR_WHAT_YOU_NEED: "Ce dont vous aurez besoin pour...",
  13574. VR_NEED_CARDBOARD: "Ce dont vous aurez besoin avec Google Cardboard",
  13575. VR_NEED_SAMSUNG: "Ce dont vous aurez besoin avec Samsung Gear VR",
  13576. VR_NEED_DAYDREAM: "BESOINS AVANT APPARIEMENT AVEC DAYDREAM VIEW",
  13577. VR_NEED_DAYDREAM_PHONE: "Téléphone compatible avec Daydream",
  13578. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  13579. VR_GOOGLE_DAYDREAM: "Google Daydream",
  13580. VR_APP: "port VR App",
  13581. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  13582. VR_COMPATIBLE_IPHONES_1: "iPhones",
  13583. VR_COMPATIBLE_IPHONES_2: "iPhone 5s et plus récent, avec iOS 9.1 et plus récent",
  13584. VR_COMPATIBLE_IPHONES_3: "iPhones compatibles",
  13585. VR_COMPATIBLE_ANDROID: "Appareils Android compatibles",
  13586. 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",
  13587. VR_ANDROID_DETAIL: 'Écrans 4.5" à 5.5" avec Android 4.4.4 ou plus récent',
  13588. VR_ANDROID_DVICES: "Appareils Android",
  13589. VR_COMPATIBLE_SAMSUNG: "Appareils Samsung Compatibles",
  13590. VR_SAMSUNG_DETAIL: "Galaxy S6 et plus récents",
  13591. VR_APP_FOR_CARDBOARD: "Application port VR pour Google Cardboard",
  13592. VR_APP_FOR_SAMSUNG: "Application port VR pour Gear VR",
  13593. VR_APP_FOR_ANDROID: "Application port VR pour téléphones Android",
  13594. VR_APP_OPEN: "Ouvrir plutôt avec l’application port VR",
  13595. VR_DOWNLOAD_HERE: "Télécharger ici",
  13596. VR_REQUIRE_HEADSET: "Nécessite un casque VR et l'application port VR pour Android afin d'être installé",
  13597. VR_REDIRECT_TO_STORE: "Si l'application n'est pas installée, vous serez rediriger vers l'App store.",
  13598. VR_IMPROPER_EMBED: "L'Espace port n'est pas correctement intégré pour supporter VR dans votre navigateur Web.",
  13599. VR_OPEN_ANDROID_LINK: "Ouvrez ce lien avec votre appareil mobile",
  13600. VR_ANDROID_OPTIONS: "Options disponibles pour casque VR sous",
  13601. SHARE_TO: "Partager sur",
  13602. SHARE_LINK: "Lien direct",
  13603. SHARE_EXPLORE: "Explorer ",
  13604. SHARE_AT: "à",
  13605. SHARE_WITH: "avec",
  13606. SHARE_3D: " en 3D",
  13607. SHARE_COPIED: "Copié!",
  13608. ERROR_BROWSER_SOLUTION: "Installer un nouveau navigateur pour explorer en 3D.",
  13609. ERROR_BROWSER_EXPLANATION: "WebGL a besoin d'un navigateur récent.",
  13610. ERROR_GENERIC_PROBLEM: "Il y eu un problème.",
  13611. ERROR_GENERIC_SOLUTION: "Redémarrer votre navigateur.",
  13612. ERROR_GENERIC_ACTIONS_1: "Si le problème persiste, ",
  13613. ERROR_GENERIC_ACTIONS_2: "installez un navigateur plus récent",
  13614. ERROR_GENERIC_ACTIONS_3: " ou ",
  13615. ERROR_GENERIC_ACTIONS_4: "voir notre guide de dépannage",
  13616. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "Navigateur non-supporté.",
  13617. ERROR_WEBGL_IOS_PROBLEM: "Version iOS non-supportée.",
  13618. ERROR_WEBGL_IOS_SOLUTION: "Mettre à jour avec iOS8 au minimum pour voir l'Espace en 3D.",
  13619. ERROR_WEBGL_IOS_ACTIONS_1: "Tapez ",
  13620. ERROR_WEBGL_IOS_ACTIONS_2: "Paramètres > Général > Mise à jour Software",
  13621. ERROR_WEBGL_SAFARI_PROBLEM: "Activez WegGL pour explorer en 3D.",
  13622. ERROR_WEBGL_SAFARI_ACTIONS_1: "Cliquez ",
  13623. ERROR_WEBGL_SAFARI_ACTIONS_2: "Préferences > Avancés > Voir menu développeur",
  13624. ERROR_WEBGL_SAFARI_ACTIONS_3: "Puis cliquez ",
  13625. ERROR_WEBGL_SAFARI_ACTIONS_4: "Développe > Activé WebGL",
  13626. ERROR_MISSING_URLS_PROBLEM: "Il n'y a pas de panoromas pour ce modèle.",
  13627. ERROR_MISSING_URLS_EXPLANATION: "Ceci est un ancien modèle. Le propriétaire du site a peut-être un nouveau modèle en cours.",
  13628. ERROR_LOADING_FAILED_PROBLEM: "Ce modèle n'est pas disponible.",
  13629. ERROR_LOADING_FAILED_ACTIONS_1: "Si le problème persiste, ",
  13630. ERROR_LOADING_FAILED_ACTIONS_2: "voir notre guide de dépannage",
  13631. ERROR_MAINTENANCE_PROBLEM: "Maintenance en cours.",
  13632. ERROR_MAINTENANCE_SOLUTION: "Revenez dans quelques instants.",
  13633. LINK_TO_LOCATION: "Lien vers l'emplacement",
  13634. MENU_COPY: "Copie",
  13635. LINK_ALERT_COPY: "Utiliser CTRL+CMD C pour copier.",
  13636. ROTATE: "Faire pivoter",
  13637. INSIDE: "Intérieure",
  13638. MOVE: "Se déplacer",
  13639. ZOOM: "Zoom"
  13640. }
  13641. }
  13642. , {}],
  13643. 114: [function(e, t, i) {
  13644. "use strict";
  13645. t.exports = {
  13646. PAGE_TITLE: "",
  13647. LOADING: "読み込み中",
  13648. PRESENTED_BY_CAPS: "PRESENTED BY",
  13649. POWERED_BY: "powered by",
  13650. POWERED_BY_CAPS: "POWERED BY",
  13651. DESKTOP_SHORT_CTA: "クリックしてこの3D Spaceを探索",
  13652. MOBILE_SHORT_CTA: "タップしてこの3D Spaceを探索",
  13653. PRESENTED_BY: "Presented by ",
  13654. MORE: "全て表示 ",
  13655. LESS: "閉じる ",
  13656. TAG_CONTENT: "tag™コンテンツ ",
  13657. SHOW: "表示",
  13658. HIDE: "非表示",
  13659. DOLLHOUSE: "ドールハウス",
  13660. FLOOR_PLAN: "フロアプラン",
  13661. OPEN_HIGHLIGHTS: "ハイライトを開く",
  13662. CLOSE_HIGHLIGHTS: "閉じる",
  13663. PREVIOUS: "前へ",
  13664. PLAY: "再生",
  13665. PAUSE: "一時停止",
  13666. NEXT: "次へ",
  13667. EXPLORE_3D_SPACE: "3DSpaceの探索",
  13668. VIEW_DOLLHOUSE: "ドールハウスの表示",
  13669. SOCIAL_SHARING: "このSpaceを共有する",
  13670. VIEW_IN_VR: "VRで表示",
  13671. VIEW_FULLSCREEN: "フルスクリーン表示",
  13672. EXIT_FULLSCREEN: "フルスクリーン表示を終了",
  13673. ZOOM_IN: "ズームイン",
  13674. ZOOM_OUT: "ズームアウト",
  13675. FLOOR_NAME: "フロア ",
  13676. FLOOR_ALL: "すべて",
  13677. TERMS: "規約",
  13678. PORT_TERMS: "port規約",
  13679. TERMS_OF_USE: "利用規約",
  13680. CLOSE_TERMS: "閉じる",
  13681. TERMS_TEXT_FILE: "terms-jp-JP.html",
  13682. TERMS_FAIL: "規約を取得できませんでした。利用規約を表示するためにインターネットに接続されていることを確認してください。",
  13683. WEBVR_FOR_DAYDREAM: "Daydream View用",
  13684. WEBVR_ENTER_WEBVR: "VRに入る",
  13685. WEBVR_DIFFERENT_HEADSET: "別のヘッドセットをお持ちですか?",
  13686. WEBVR_LEARN_MORE: "もっと詳しく",
  13687. WEBVR_VIEW_SPACE: "VRでSpaceを表示",
  13688. WEBVR_DAYDREAM_VIEW: "Daydream View",
  13689. WEBVR_DAYDREAM_PHONE: "Daydream対応スマホ",
  13690. WEBVR_FOR_CARDBOARD: "Google Cardboard用",
  13691. WEBVR_VIEW_CARDBOARD: "またはGoogle Cardboardで表示",
  13692. VR_VIEW_SPACE: "バーチャルリアリティでSpaceを表示",
  13693. VR_LEARN_MORE_CAPS: "もっと詳しく",
  13694. VR_PREVIOUS_CAPS: "前へ",
  13695. VR_NEXT_CAPS: "次へ",
  13696. VR_GOT_IT_CAPS: "了解",
  13697. VR_SHOW_SUPPORTED: "タップして次を使用してVRでSpaceを表示: ",
  13698. VR_SHOW_UNSUPPORTED: "お使いのデバイスはVRでSpaceを表示する最低要件を満たしていません",
  13699. VR_SHOW_IOS_1: "タップしてVRでSpaceを表示",
  13700. VR_SHOW_IOS_2: "表示するにはport VRアプリと互換性のあるiPhoneが必要です",
  13701. VR_WHAT_YOU_NEED: "必要なもの",
  13702. VR_NEED_CARDBOARD: "Google Cardboardに必要なもの",
  13703. VR_NEED_SAMSUNG: "Samsung Gear VRに必要なもの",
  13704. VR_NEED_DAYDREAM: "事前にDaydream Viewとのペアリングが必要です",
  13705. VR_NEED_DAYDREAM_PHONE: "Daydream対応スマホ",
  13706. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  13707. VR_GOOGLE_DAYDREAM: "Google Daydream",
  13708. VR_APP: "port VRアプリ",
  13709. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  13710. VR_COMPATIBLE_IPHONES_1: "iPhone",
  13711. VR_COMPATIBLE_IPHONES_2: "iOS 9.1以降で動作するiPhone 5s以降のモデル",
  13712. VR_COMPATIBLE_IPHONES_3: "互換性のあるiPhone",
  13713. VR_COMPATIBLE_ANDROID: "互換性のあるAndroidデバイス",
  13714. VR_COMPATIBLE_ANDROID_LONG: "Android OS 4.4.4以降で動作する互換性のあるAndroidデバイスの4.5~5.5インチディスプレイ",
  13715. VR_ANDROID_DETAIL: "Android OS 4.4.4以降で動作する4.5~5.5インチディスプレイ",
  13716. VR_ANDROID_DVICES: "Androidデバイス",
  13717. VR_COMPATIBLE_SAMSUNG: "互換性のあるSamsungデバイス",
  13718. VR_SAMSUNG_DETAIL: "Galaxy S5以降のモデル",
  13719. VR_APP_FOR_CARDBOARD: "Google Cardboard用のport VRアプリ",
  13720. VR_APP_FOR_SAMSUNG: "Gear VR 用のport VRアプリ",
  13721. VR_APP_FOR_ANDROID: "Androidフォン用のport VRアプリ",
  13722. VR_APP_OPEN: "port VRアプリで開く",
  13723. VR_DOWNLOAD_HERE: "ここからダウンロード",
  13724. VR_REQUIRE_HEADSET: "Android 用のVRヘッドセットとport VRアプリ をインストールする必要があります",
  13725. VR_REDIRECT_TO_STORE: "アプリがインストールされていない場合、App Storeにリダイレクトされます",
  13726. VR_IMPROPER_EMBED: "お使いのウェブブラウザでVRがサポートされるようport Spaceが適切に埋め込まれていません。",
  13727. VR_OPEN_ANDROID_LINK: "お使いの携帯電話でリンクを開いてください",
  13728. VR_ANDROID_OPTIONS: "利用可能なVRヘッドセットオプション",
  13729. SHARE_TO: "共有先",
  13730. SHARE_LINK: "ダイレクトリンク",
  13731. SHARE_EXPLORE: "探索",
  13732. SHARE_AT: "場所",
  13733. SHARE_WITH: "使用アプリ",
  13734. SHARE_3D: "3Dで",
  13735. SHARE_COPIED: "コピーされました!",
  13736. ERROR_BROWSER_SOLUTION: "3D探索するには、新しいバージョンのブラウザをインストールしてください",
  13737. ERROR_BROWSER_EXPLANATION: "WebGLにはモダンブラウザが必要です。",
  13738. ERROR_GENERIC_PROBLEM: "問題が発生しました。",
  13739. ERROR_GENERIC_SOLUTION: "ブラウザを再起動してください。",
  13740. ERROR_GENERIC_ACTIONS_1: "問題が解決しない場合は、",
  13741. ERROR_GENERIC_ACTIONS_2: "サポートされているブラウザをインストールしてください",
  13742. ERROR_GENERIC_ACTIONS_3: "または",
  13743. ERROR_GENERIC_ACTIONS_4: "トラブルシューティングガイドを参照してください",
  13744. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "ブラウザがサポートされていません。",
  13745. ERROR_WEBGL_IOS_PROBLEM: "サポートされていないiOSバージョンです。",
  13746. ERROR_WEBGL_IOS_SOLUTION: "3D探索するには、iOS 8以降にアップグレードしてください。",
  13747. ERROR_WEBGL_IOS_ACTIONS_1: "以下の順にタップします:",
  13748. ERROR_WEBGL_IOS_ACTIONS_2: "設定 > 全般 > ソフトウェアの更新",
  13749. ERROR_WEBGL_SAFARI_PROBLEM: "WebGLを有効にして3Dで探索します。",
  13750. ERROR_WEBGL_SAFARI_ACTIONS_1: "以下の順にクリックします:",
  13751. ERROR_WEBGL_SAFARI_ACTIONS_2: "環境設定 > 詳細 > メニューバーに開発メニューを表示",
  13752. ERROR_WEBGL_SAFARI_ACTIONS_3: "その後、以下の順にクリックします:",
  13753. ERROR_WEBGL_SAFARI_ACTIONS_4: "開発 > WebGLを有効にする",
  13754. ERROR_MISSING_URLS_PROBLEM: "このモデルではパノラマを使用できません。",
  13755. ERROR_MISSING_URLS_EXPLANATION: "これは古いモデルです。ウェブサイト所有者が新しいモデルを開発中かもしれません。",
  13756. ERROR_LOADING_FAILED_PROBLEM: "モデルは利用できません。",
  13757. ERROR_LOADING_FAILED_ACTIONS_1: "問題が解決しない場合は、",
  13758. ERROR_LOADING_FAILED_ACTIONS_2: "トラブルシューティングガイドを参照してください",
  13759. ERROR_MAINTENANCE_PROBLEM: "メンテナンスは進行中です。",
  13760. ERROR_MAINTENANCE_SOLUTION: "しばらくしてからやり直し てください。",
  13761. LINK_TO_LOCATION: "ロケーションへのリンク",
  13762. MENU_COPY: "コピー",
  13763. LINK_ALERT_COPY: "コピーするにはCTRL/CMD + Cを使用してください。",
  13764. ROTATE: "回転",
  13765. MOVE: "移動",
  13766. INSIDE: "内側",
  13767. ZOOM: "ズーム",
  13768. HELP: "ヘルプ",
  13769. HELP_NAVIGATION_TAB: "ナビゲーション",
  13770. HELP_MORE_HELP_TAB: "その他のヘルプ",
  13771. HELP_DESKTOP_PANORAMA_1A: "Spaceを見回すには、クリックしてドラッグします。",
  13772. HELP_DESKTOP_PANORAMA_2A: "移動するには、Space全体にあるリングをクリックします。",
  13773. HELP_DESKTOP_PANORAMA_3A: "スクロールホイールを使用してズームイン、ズームアウトします。",
  13774. HELP_DESKTOP_PANORAMA_1B: "または、矢印キーを使用して左右に向きを変えます。",
  13775. HELP_DESKTOP_PANORAMA_2B: "または、矢印キーを使用して前後に向きを変えます。",
  13776. HELP_DESKTOP_PANORAMA_3B: "あるいは、プラス(+)キーまたはマイナス(-)キーを使用して、ズームイン、ズームアウトします。",
  13777. HELP_DESKTOP_360_2A: "内側ビューアイコンをクリックしてSpaceに入ります。",
  13778. HELP_DESKTOP_360_2B: "または、数字キー1を押して内側ビューに入ります。",
  13779. HELP_DESKTOP_DOLLHOUSE_1A: "左クリックと左右、上下のドラッグでドールハウスを回転します。",
  13780. HELP_DESKTOP_DOLLHOUSE_2A: "右クリックと左右、上下のドラッグでドールハウスの画面上の位置を変更します。",
  13781. HELP_DESKTOP_DOLLHOUSE_3A: "スクロールホイールを使用してズームイン、ズームアウトします。",
  13782. HELP_DESKTOP_DOLLHOUSE_1B: "または、矢印キーを使用してドールハウスを回転します。",
  13783. HELP_DESKTOP_FLOORPLAN_1A: "左ボタンを押しながら、上下左右にドラッグしてフロアプランの画面上の位置を変更します。",
  13784. HELP_DESKTOP_FLOORPLAN_2A: "右ボタンを押しながら左右にドラッグして、フロアプランを回転します。",
  13785. HELP_DESKTOP_FLOORPLAN_3A: "スクロールホイールを使用してズームイン、ズームアウトします。",
  13786. HELP_DESKTOP_FLOORPLAN_2B: "または、矢印キーを使用して左右に回転します。",
  13787. HELP_DESKTOP_FLOORPLAN_3B: "または、矢印キーを使用して、ズームイン、ズームアウトします。",
  13788. HELP_MOBILE_PANORAMA_1: "Spaceを見回すには、タッチしてドラッグします。",
  13789. HELP_MOBILE_PANORAMA_2: "移動するには、Space全体にあるリングをタップします。",
  13790. HELP_MOBILE_3: "ピンチジェスチャーを使用してズームイン、ズームアウトします。",
  13791. HELP_MOBILE_360_2: "内側ビューアイコンをタップしてSpaceに入ります。",
  13792. HELP_MOBILE_DOLLHOUSE_1: "タッチして上下左右にドラッグしてドールハウスを回転します。",
  13793. HELP_MOBILE_DOLLHOUSE_2: "タッチして、2本指でドラッグしてドールハウスを配置します。",
  13794. HELP_MOBILE_FLOORPLAN_1: "タッチ&ドラッグしてフロアプランを配置します。",
  13795. HELP_MOBILE_FLOORPLAN_2: "タッチして、2本指でドラッグしてフロアプランを回転します。",
  13796. HELP_MORE_HLR_A: "ハイライト",
  13797. HELP_DESKTOP_MORE_HLR_B: "サムネイル画像を使用してSpaceを移動するために開きます。",
  13798. HELP_MORE_DOLLHOUSE_A: "ドールハウス",
  13799. HELP_DESKTOP_MORE_DOLLHOUSE_B: "クリックして3DでSpace全体のトップダウンビューを表示して回転します。",
  13800. HELP_MOBILE_MORE_DOLLHOUSE_B: "タップして3DでSpace全体のトップダウンビューを表示して回転します。",
  13801. HELP_MORE_FLOORS_A: "フロアセレクター",
  13802. HELP_DESKTOP_MORE_FLOORS_B: "Space内のフロアを切り替えます。",
  13803. HELP_MORE_TAG_A: "tag™ Posts",
  13804. HELP_DESKTOP_MORE_TAG_B: "クリックするか、カーソルを置くとSpace内の機能についての説明が表示されます。",
  13805. HELP_MOBILE_MORE_TAG_B: "タップするとSpace内の機能についての説明が表示されます。",
  13806. HELP_MORE_ZOOM_A: "ズームコントロール",
  13807. HELP_DESKTOP_MORE_ZOOM_B: "これらのコントロールまたはスクロールホイールを使用して、ズームイン、ズームアウトします。",
  13808. HELP_MORE_TOUR_A: "ツアーコントロール",
  13809. HELP_DESKTOP_MORE_TOUR_B: "ガイド付きツアー中に再生、一時停止、前方・後方に移動します。",
  13810. HELP_MORE_INSIDE_A: "内側ビュー",
  13811. HELP_DESKTOP_MORE_INSIDE_B: "クリックしてSpace内を探索します。",
  13812. HELP_MOBILE_MORE_INSIDE_B: "タップしてSpace内を探索します。",
  13813. HELP_MORE_VR_A: "VRモード",
  13814. HELP_DESKTOP_MORE_VR_B: "クリックしてバーチャルリアリティでSpaceを起動します。",
  13815. HELP_MOBILE_MORE_VR_B: "タップしてバーチャルリアリティでSpaceを起動します。",
  13816. HELP_MORE_360_A: "360° Views",
  13817. HELP_DESKTOP_MORE_360_B: "Highlight Reelの360° Viewsをクリックして屋外シーンを表示します。",
  13818. HELP_MOBILE_MORE_360_B: "Highlight Reelの360° Viewsをタップして屋外シーンを表示します。",
  13819. HELP_MORE_FULLSCREEN_A: "フルスクリーン",
  13820. HELP_DESKTOP_MORE_FULLSCREEN_B: "3D Showcaseをフルスクリーン表示にします。",
  13821. CLOSE: "閉じる"
  13822. }
  13823. }
  13824. , {}],
  13825. 115: [function(e, t, i) {
  13826. "use strict";
  13827. t.exports = {
  13828. PAGE_TITLE: "",
  13829. LOADING: "Загрузка",
  13830. PRESENTED_BY_CAPS: "ПРЕДСТАВЛЕНО",
  13831. POWERED_BY: "разработано на платформе ",
  13832. POWERED_BY_CAPS: "РАЗРАБОТАНО НА ПЛАТФОРМЕ",
  13833. DESKTOP_SHORT_CTA: "Нажмите для просмотра.",
  13834. MOBILE_SHORT_CTA: "Нажмите для просмотра.",
  13835. PRESENTED_BY: "Представлено ",
  13836. MORE: "Больше ",
  13837. LESS: "Меньше ",
  13838. TAG_CONTENT: "tag™ Контент",
  13839. SHOW: "Показать",
  13840. HIDE: "Скрыть",
  13841. DOLLHOUSE: "Dollhouse",
  13842. FLOOR_PLAN: "Планировка",
  13843. OPEN_HIGHLIGHTS: "Открыть Фотоколлаж",
  13844. CLOSE_HIGHLIGHTS: "Закрыть",
  13845. PREVIOUS: "Предыдущий",
  13846. PLAY: "Воспроизвести",
  13847. PAUSE: "Пауза",
  13848. NEXT: "Следующий",
  13849. EXPLORE_3D_SPACE: "Просмотреть 3D модель",
  13850. VIEW_DOLLHOUSE: "Посмотреть Dollhouse",
  13851. SOCIAL_SHARING: "Поделиться этой моделью",
  13852. VIEW_IN_VR: "Посмотреть в VR",
  13853. VIEW_FULLSCREEN: "Полный экран",
  13854. EXIT_FULLSCREEN: "Выйти из полноэкранного режима",
  13855. ZOOM_IN: "Увеличить",
  13856. ZOOM_OUT: "Уменьшить",
  13857. FLOOR_NAME: "Этаж ",
  13858. FLOOR_ALL: "Все",
  13859. TERMS: "Условия",
  13860. PORT_TERMS: "Правила пользования",
  13861. TERMS_OF_USE: "Условия использования",
  13862. TERMS_TEXT_FILE: "terms-ru-RU.html",
  13863. CLOSE_TERMS: "Закрыть",
  13864. TERMS_FAIL: "Не удалось загрузить условия использования. Для просмотра условий использования, пожалуйста, убедитесь, что у Вас есть подключение к Интернету.",
  13865. HELP: "Помощь",
  13866. HELP_NAVIGATION_TAB: "Навигация",
  13867. HELP_MORE_HELP_TAB: "Доп. Помощь",
  13868. CLOSE: "Закрыть",
  13869. HELP_DESKTOP_PANORAMA_1A: "Нажмите и перетащите, чтобы осмотреть пространство вокруг.",
  13870. HELP_DESKTOP_PANORAMA_2A: "Для передвижения по модели нажимайте на круги .",
  13871. HELP_DESKTOP_PANORAMA_3A: "Используйте колесо прокрутки для увеличения и уменьшения.",
  13872. HELP_DESKTOP_PANORAMA_1B: "Или используйте клавиши со стрелками для поворота влево и вправо.",
  13873. HELP_DESKTOP_PANORAMA_2B: "Или используйте стрелки для перемещения вперед и назад.",
  13874. HELP_DESKTOP_PANORAMA_3B: "Или используйте клавиши ‘плюс’ и ‘минус’ для увеличения и уменьшения изображения.",
  13875. HELP_DESKTOP_360_2A: "Нажмите на значок ‘Вид Изнутри’, чтобы увидеть внутреннюю панораму.",
  13876. HELP_DESKTOP_360_2B: "или нажмите 1 на клавиатуре, чтобы увидеть внутреннюю панораму.",
  13877. HELP_DESKTOP_DOLLHOUSE_1A: "Нажмите левую кнопку мыши и перетащите влево, вправо, вверх и вниз, чтобы повернуть Dollhouse.",
  13878. HELP_DESKTOP_DOLLHOUSE_2A: "Нажмите правую кнопку мыши и перетащите влево, вправо, вверх и вниз, чтобы изменить позицию Dollhouse на экране.",
  13879. HELP_DESKTOP_DOLLHOUSE_3A: "Используйте колесо прокрутки чтобы увеличить и уменьшить.",
  13880. HELP_DESKTOP_DOLLHOUSE_1B: "Или используйте клавиши со стрелками, чтобы повернуть Dollhouse.",
  13881. HELP_DESKTOP_FLOORPLAN_1A: "Нажмите левую кнопку мыши и перетащите влево, вправо, вверх и вниз, чтобы изменить положение Планировки на экране.",
  13882. HELP_DESKTOP_FLOORPLAN_2A: "Нажмите правую кнопку мыши и перетащите влево или вправо, чтобы повернуть Планировку.",
  13883. HELP_DESKTOP_FLOORPLAN_3A: "Используйте колесо прокрутки чтобы увеличить и уменьшить.",
  13884. HELP_DESKTOP_FLOORPLAN_2B: "Или используйте клавиши со стрелками для поворота влево или вправо.",
  13885. HELP_DESKTOP_FLOORPLAN_3B: "Или используйте стрелки для увеличения и уменьшения.",
  13886. HELP_MOBILE_PANORAMA_1: "Нажмите и перетащите, чтобы осмотреть модель.",
  13887. HELP_MOBILE_PANORAMA_2: "Для передвижения по модели нажимайте на круги.",
  13888. HELP_MOBILE_3: "Используйте движение двумя пальцами в разные стороны, чтобы увеличить и уменьшить.",
  13889. HELP_MOBILE_360_2: "Нажмите на значок ‘Вид Изнутри’, чтобы увидеть внутреннюю панораму.",
  13890. HELP_MOBILE_DOLLHOUSE_1: "Нажмите и перетащите вверх, вниз, влево и вправо, чтобы повернуть Dollhouse.",
  13891. HELP_MOBILE_DOLLHOUSE_2: "Нажмите и перетащите, чтобы расположить Dollhouse.",
  13892. HELP_MOBILE_FLOORPLAN_1: "Нажмите и перетащите, чтобы расположить план здания.",
  13893. HELP_MOBILE_FLOORPLAN_2: "Коснитесь и перетащите двумя пальцами, чтобы повернуть план здания.",
  13894. HELP_MORE_HLR_A: "Фотоколлаж",
  13895. HELP_DESKTOP_MORE_HLR_B: "Откройте для перемещения по модели, используя иконки изображений.",
  13896. HELP_MORE_DOLLHOUSE_A: "Dollhouse",
  13897. HELP_DESKTOP_MORE_DOLLHOUSE_B: "Нажмите и поверните сверху вниз чтобы просмотреть всю 3D модель.",
  13898. HELP_MOBILE_MORE_DOLLHOUSE_B: "Нажмите и поверните сверху вниз чтобы просмотреть всю 3D модель.",
  13899. HELP_MORE_FLOORS_A: "Выбор Этажа",
  13900. HELP_DESKTOP_MORE_FLOORS_B: "Переключение между этажами.",
  13901. HELP_MORE_TAG_A: "tag™ Posts",
  13902. HELP_DESKTOP_MORE_TAG_B: "Нажмите или наведите курсор мыши для получения информации о функциях в Пространстве.",
  13903. HELP_MOBILE_MORE_TAG_B: "Нажмите для получения информации о функциях.",
  13904. HELP_MORE_ZOOM_A: "Масштаб",
  13905. HELP_DESKTOP_MORE_ZOOM_B: "Используйте эти кнопки для увеличения и уменьшения изображения или используйте колесо прокрутки.",
  13906. HELP_MORE_TOUR_A: "Управление Туром",
  13907. HELP_DESKTOP_MORE_TOUR_B: "Используйте кнопки Воспроизвести, Пауза, Вперед и Назад для управления фотоколлажем.",
  13908. HELP_MORE_INSIDE_A: "Вид Изнутри",
  13909. HELP_DESKTOP_MORE_INSIDE_B: "Нажмите, чтобы просмотреть модель изнутри.",
  13910. HELP_MOBILE_MORE_INSIDE_B: "Нажмите, чтобы просмотреть модель изнутри.",
  13911. HELP_MORE_VR_A: "Режим VR",
  13912. HELP_DESKTOP_MORE_VR_B: "Нажмите, чтобы запустить модель в виртуальной реальности.",
  13913. HELP_MOBILE_MORE_VR_B: "Нажмите, чтобы запустить модель в виртуальной реальности.",
  13914. HELP_MORE_360_A: "360° Views",
  13915. HELP_DESKTOP_MORE_360_B: "Нажмите на “360 Views” в фотоколлаже, чтобы просмотреть внешний пейзаж.",
  13916. HELP_MOBILE_MORE_360_B: "Нажмите на “360 Views” в фотоколлаже, чтобы просмотреть внешний пейзаж.",
  13917. HELP_MORE_FULLSCREEN_A: "Полный экран",
  13918. HELP_DESKTOP_MORE_FULLSCREEN_B: "Развернуть 3D Showcase во весь экран.",
  13919. WEBVR_FOR_CARDBOARD: "Для Google Cardboard",
  13920. WEBVR_FOR_DAYDREAM: "Для просмотра в Daydream",
  13921. WEBVR_ENTER_WEBVR: "ВОЙТИ В VR ",
  13922. WEBVR_DIFFERENT_HEADSET: "Есть другой VR-шлем?",
  13923. WEBVR_LEARN_MORE: "Узнать больше",
  13924. WEBVR_VIEW_SPACE: "Запустить модель в VR",
  13925. WEBVR_DAYDREAM_VIEW: "Посмотреть в Daydream",
  13926. WEBVR_DAYDREAM_PHONE: "Daydream-готовый телефон",
  13927. WEBVR_VIEW_CARDBOARD: "Или просмотреть в Google Cardboard",
  13928. VR_WHAT_YOU_NEED: "Что Вам потребуется...",
  13929. VR_NEED_DAYDREAM_PHONE: "Daydream-готовый телефон",
  13930. VR_GOOGLE_DAYDREAM: "Google Daydream",
  13931. VR_APP: "port VR App",
  13932. VR_APP_OPEN: "Или открыть через приложение port VR",
  13933. VR_COMPATIBLE_ANDROID_LONG: 'Совместимые Android устройства с диагональю экрана 4.5"-5.5" дюймов и Android версией 4.4.4, и выше',
  13934. VR_SAMSUNG_DETAIL: "Galaxy S6 и выше",
  13935. VR_APP_FOR_ANDROID: "Приложение port VR для Android",
  13936. VR_NEED_DAYDREAM: "Необходимо для соединением с Daydream",
  13937. VR_VIEW_SPACE: "Запустить модель в VR",
  13938. VR_LEARN_MORE_CAPS: "УЗНАТЬ БОЛЬШЕ",
  13939. VR_PREVIOUS_CAPS: "ПРЕДЫДУЩИЙ",
  13940. VR_NEXT_CAPS: "СЛЕДУЮЩИЙ",
  13941. VR_GOT_IT_CAPS: "ЯСНО",
  13942. VR_SHOW_SUPPORTED: "Нажмите, чтобы просмотреть модель в VR с помощью",
  13943. VR_SHOW_UNSUPPORTED: "Извините, но Ваше устройство не соответствует минимальным требованиям для просмотра модели в VR.",
  13944. VR_SHOW_IOS_1: "Нажмите, чтобы просмотреть модель в VR",
  13945. VR_SHOW_IOS_2: "Для просмотра требуется приложение port VR и совместимый iPhone",
  13946. VR_NEED_CARDBOARD: "Что Вам потребуется для Google Cardboard",
  13947. VR_NEED_SAMSUNG: "Что Вам потребуется для Samsung Gear VR",
  13948. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  13949. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  13950. VR_COMPATIBLE_IPHONES_1: "iPhones",
  13951. VR_COMPATIBLE_IPHONES_2: "iPhone 5s или новее с iOS 9.1 и выше",
  13952. VR_COMPATIBLE_IPHONES_3: "Совместимые модели iPhone",
  13953. VR_COMPATIBLE_ANDROID: "Совместимые Android устройства",
  13954. VR_ANDROID_DETAIL: 'Экран от 4.5" до 5.5" и Android 4.4.4, и выше',
  13955. VR_ANDROID_DVICES: "Android устройства",
  13956. VR_COMPATIBLE_SAMSUNG: "Совместимые Samsung устройства",
  13957. VR_APP_FOR_CARDBOARD: "Приложение port VR для Google Cardboard",
  13958. VR_APP_FOR_SAMSUNG: "Приложение port VR для Gear VR",
  13959. VR_DOWNLOAD_HERE: "Скачать здесь",
  13960. VR_REQUIRE_HEADSET: "Требуется VR-шлем и установленное приложение port VR для Android",
  13961. VR_REDIRECT_TO_STORE: "Если приложение не установлено, Вы будете перенаправлены на страницу магазина приложений.",
  13962. VR_IMPROPER_EMBED: "port модель не встроена должным образом для поддержки VR в вашем веб-браузере.",
  13963. VR_OPEN_ANDROID_LINK: "Откройте ссылку на Вашем мобильном телефоне",
  13964. VR_ANDROID_OPTIONS: "Доступные опции VR-шлемов",
  13965. SHARE_TO: "Поделиться",
  13966. SHARE_LINK: "Прямая ссылка",
  13967. SHARE_EXPLORE: "просмотреть",
  13968. SHARE_AT: "на",
  13969. SHARE_WITH: "с",
  13970. SHARE_3D: "в 3D",
  13971. SHARE_COPIED: "Скопировано!",
  13972. ERROR_BROWSER_SOLUTION: "установите новый браузер, чтобы просмотреть 3D пространство.",
  13973. ERROR_BROWSER_EXPLANATION: "WebGL требует современный браузер.",
  13974. ERROR_GENERIC_PROBLEM: "Ой, что-то пошло не так.",
  13975. ERROR_GENERIC_SOLUTION: "Перезапустите браузер.",
  13976. ERROR_GENERIC_ACTIONS_1: "Если проблема не устранена, ",
  13977. ERROR_GENERIC_ACTIONS_2: "установите поддерживаемый браузер",
  13978. ERROR_GENERIC_ACTIONS_3: " или ",
  13979. ERROR_GENERIC_ACTIONS_4: "смотрите наше руководство по устранению неполадок",
  13980. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "Браузер не поддерживается.",
  13981. ERROR_WEBGL_IOS_PROBLEM: "iOS-версия не поддерживается.",
  13982. ERROR_WEBGL_IOS_SOLUTION: "Обновите до iOS 8 или выше, чтобы просмотреть пространство в 3D.",
  13983. ERROR_WEBGL_IOS_ACTIONS_1: "Нажмите ",
  13984. ERROR_WEBGL_IOS_ACTIONS_2: "Настройки > Общие > Обновление ПО",
  13985. ERROR_WEBGL_SAFARI_PROBLEM: "Включите WebGL для 3D-просмотра.",
  13986. ERROR_WEBGL_SAFARI_ACTIONS_1: "Нажмите ",
  13987. ERROR_WEBGL_SAFARI_ACTIONS_2: "Настойки > Дополнения > Показывать меню “Разработка” в строке меню",
  13988. ERROR_WEBGL_SAFARI_ACTIONS_3: "Затем нажмите ",
  13989. ERROR_WEBGL_SAFARI_ACTIONS_4: "Разработка > Разрешить WebGL",
  13990. ERROR_MISSING_URLS_PROBLEM: "Ой, для этой модели нет панорамы.",
  13991. ERROR_MISSING_URLS_EXPLANATION: "Эта модель устарела. У владельца веб-сайта может быть новая модель.",
  13992. ERROR_LOADING_FAILED_PROBLEM: "Ой, модель недоступна.",
  13993. ERROR_LOADING_FAILED_ACTIONS_1: "Если проблема не устранена, ",
  13994. ERROR_LOADING_FAILED_ACTIONS_2: "посмотрите наше руководство по устранению неполадок",
  13995. ERROR_MAINTENANCE_PROBLEM: "Выполняется техническое обслуживание.",
  13996. ERROR_MAINTENANCE_SOLUTION: "Пожалуйста, попробуйте снова через несколько минут.",
  13997. LINK_TO_LOCATION: "Ссылка на местоположение",
  13998. MENU_COPY: "Копировать",
  13999. LINK_ALERT_COPY: "Для того, чтобы скопировать, пожалуйста, используйте CTRL/CMD + C.",
  14000. ROTATE: "Вращать",
  14001. MOVE: "Передвигаться",
  14002. INSIDE: "Вид изнутри",
  14003. ZOOM: "Масштаб"
  14004. }
  14005. }
  14006. , {}],
  14007. 116: [function(r, e, t) {
  14008. (function(i) {
  14009. "use strict";
  14010. function re(e) {
  14011. console.log("e1:" + e),
  14012. e = Math.round(.4 * e * 100),
  14013. console.log("e2:" + e);
  14014. var t = $(".progressbar");
  14015. t.find(".bar").css("width", e + "%"),
  14016. t.find(".label").css("left", t.width() * e / 100 - 15 + "px"),
  14017. t.find(".perc").text(e + "%")
  14018. }
  14019. $("#gui-loading").fadeIn(200),
  14020. re(.1);
  14021. var e = g_version ? "modeldata.js" : "someData.json";
  14022. $.ajax(g_Prefix + "data/" + window.number + "/" + e + "?" + randomTime().getTime(), {
  14023. dataType: "json"
  14024. }).done(function(e) {
  14025. var t = matcher(e);
  14026. t.files.templates[0] = g_Prefix + e.files.templates[0].replace("{{number}}", window.number),
  14027. t.user = {
  14028. is_authenticated: !1,
  14029. 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"]
  14030. }
  14031. /* t.model.images = [
  14032. {
  14033. "metadata": "{\"camera_position\":{\"x\":0.8559,\"y\":-0.1097,\"z\":0.6656},\"camera_quaternion\":{\"x\":-0.1975,\"y\":-0.0952,\"z\":-0.0193,\"w\":0.9755},\"scan_id\":\"11\",\"zoom\":1}",
  14034. "name": "1",
  14035. "thumbnail_signed_src": "https://super.4dage.com/data/LYW/edit/20201210_175837426.",
  14036. "sid": "20201210_175837426"
  14037. },
  14038. {
  14039. "metadata": "{\"camera_position\":{\"x\":1.1559,\"y\":-0.1083,\"z\":1.9191},\"camera_quaternion\":{\"x\":-0.0396,\"y\":0.1251,\"z\":0.005,\"w\":0.9913},\"scan_id\":\"12\",\"zoom\":1}",
  14040. "name": "2",
  14041. "thumbnail_signed_src": "https://super.4dage.com/data/LYW/edit/20201210_175835333.",
  14042. "sid": "20201210_175835333"
  14043. },
  14044. {
  14045. "name": "区域1 hasmusic",
  14046. "momentTour": "black",
  14047. "musicInfo": {
  14048. "name": "一段音乐.mp3",
  14049. "music": "///super.4dage.com/data/LYW/edit/20210425_152844547.mp3",
  14050. "time": 7818
  14051. },
  14052. "locations": [
  14053. {
  14054. "metadata": "{\"camera_position\":{\"x\":-2.4032,\"y\":-0.1215,\"z\":-0.882},\"camera_quaternion\":{\"x\":-0.0898,\"y\":0.9081,\"z\":0.2552,\"w\":0.3196},\"scan_id\":\"5\",\"zoom\":1}",
  14055. "sid": "20210425_152818526",
  14056. "name": "20210425_152818526",
  14057. "thumbnail_signed_src": "https://super.4dage.com/data/LYW/edit/20210425_152818526."
  14058. }
  14059. ]
  14060. },
  14061. {
  14062. "name": "区域2",
  14063. "momentTour": "black",
  14064. "locations": [
  14065. {
  14066. "metadata": "{\"camera_position\":{\"x\":-1.2063,\"y\":-0.1163,\"z\":0.4791},\"camera_quaternion\":{\"x\":0.0326,\"y\":0.9667,\"z\":0.1605,\"w\":-0.1966},\"scan_id\":\"2\",\"zoom\":1}",
  14067. "sid": "20210425_152857293",
  14068. "name": "20210425_152857293",
  14069. "thumbnail_signed_src": "https://super.4dage.com/data/LYW/edit/20210425_152857293."
  14070. },
  14071. {
  14072. "metadata": "{\"camera_position\":{\"x\":-0.2906,\"y\":-0.1122,\"z\":-0.2226},\"camera_quaternion\":{\"x\":-0.258,\"y\":-0.3481,\"z\":-0.1003,\"w\":0.8956},\"scan_id\":\"1\",\"zoom\":1}",
  14073. "sid": "20210425_152900502",
  14074. "name": "20210425_152900502",
  14075. "thumbnail_signed_src": "https://super.4dage.com/data/LYW/edit/20210425_152900502."
  14076. }
  14077. ]
  14078. },
  14079. {
  14080. "metadata": "{\"camera_position\":{\"x\":-1.2063,\"y\":-0.1163,\"z\":0.4791},\"camera_quaternion\":{\"x\":-0.0023,\"y\":-0.8326,\"z\":-0.0034,\"w\":0.5539},\"scan_id\":\"2\",\"zoom\":1}",
  14081. "sid": "20210425_152929593",
  14082. "name": "5",
  14083. "thumbnail_signed_src": "https://super.4dage.com/data/LYW/edit/20210425_152929593."
  14084. }
  14085. ] */
  14086. try{//处理一下导览数据
  14087. t.model.images = t.model.images.filter(e=>{
  14088. if(!e.locations && !e.thumbnail_signed_src)return; //旧的曾有导览数据是错误的,将它删除
  14089. if(e.locations)e.locations = e.locations.filter(e=>e)
  14090. if(e.locations && e.locations.length == 0)return;
  14091. return e
  14092. })
  14093. }catch(e){console.log(e) }
  14094. window.editTool = new EditTools()
  14095. t.hotIconScale = parseFloat(t.hotIconScale || 1)
  14096. window.DATA = t
  14097. t.model.summary = t.summary
  14098. t.model.name = t.name
  14099. for(let i in t){
  14100. t[i] == "false" && (t[i] = false)
  14101. }
  14102. re(.7),
  14103. function() {
  14104. function y(e) {
  14105. t.update(e)
  14106. }
  14107. function A(e, t) {
  14108. ne.error(t),
  14109. n.error(t),
  14110. N.report(e, "error-" + t)
  14111. }
  14112. function C(e, t, i) {
  14113. try {
  14114. e.start(t)
  14115. } catch (e) {
  14116. throw ne.warn(e.message),
  14117. function(e) {
  14118. var t = O.details();
  14119. t && "Safari" === t.name && 500 < t.version && t.version < 600 ? (n.error("webgl-safari"),
  14120. N.report(e, "error-webgl-safari")) : (n.error("webgl-generic"),
  14121. N.report(e, "error-webgl-generic"))
  14122. }(i.sid),
  14123. e
  14124. }
  14125. }
  14126. function I(e) {
  14127. e.stopPropagation(),
  14128. e.preventDefault()
  14129. }
  14130. window.DATA.hoticon && (g_HotImage = {
  14131. point: window.DATA.hoticon.default || "https://super.4dage.com/images/4dagePoint2.png",
  14132. point2: window.DATA.hoticon.higt || "https://super.4dage.com/images/4dagePoint.png"
  14133. });
  14134. /* window.DATA.backgroundMusic ? (g_bgAudio.src = window.DATA.backgroundMusic,
  14135. $("#volume").show()) : "one" === g_version && (g_bgAudio.src = g_Prefix + "/audio/audio" + window.number + "/background.mp3");
  14136. */
  14137. if (window.DATA.backgroundMusic) {
  14138. if(window.isLocal) g_bgAudio.src = manage.dealURL(window.DATA.backgroundMusic) ;
  14139. else g_bgAudio.src = window.DATA.backgroundMusic
  14140. $("#volume").show();
  14141. }else if (g_version === "one"){
  14142. g_bgAudio.src = g_Prefix+"/audio/"+"audio"+window.number + "/background.mp3";
  14143. //g_bgAudio.src = manage.dealURL(src) ;
  14144. }
  14145. //隐藏公司logo
  14146. window.DATA.loadlogo && showLogo();
  14147. r("./lib/three75-shim"),
  14148. r("./lib/array-polyfill"),
  14149. r("./lib/performance-polyfill"),
  14150. r("./lib/shaders/CopyShader.js"),
  14151. r("./lib/shaders/HorizontalBlurShader.js"),
  14152. r("./lib/shaders/VerticalBlurShader.js"),
  14153. r("./lib/postprocessing/EffectComposer.js"),
  14154. r("./lib/postprocessing/RenderPass.js"),
  14155. r("./lib/postprocessing/MaskPass.js"),
  14156. r("./lib/postprocessing/ShaderPass.js"),
  14157. window.Promise || (window.Promise = r("promise-polyfill"));
  14158. var E = r("three")
  14159. , _ = r("three")
  14160. , b = (r("./util/sentry"),
  14161. r("./player"))
  14162. , w = r("./director")
  14163. , T = r("./controls/CameraControls")
  14164. , x = r("./model/ModelManager")
  14165. , S = r("./DisplayController")
  14166. , M = r("./label/LabelDisplayController")
  14167. , R = r("./enum/Viewmode")
  14168. , e = r("./util/logger")
  14169. , P = r("./showcase")
  14170. , O = r("./util/browser")
  14171. , L = r("./settings")
  14172. , D = r("./gui/gui")
  14173. , n = r("./gui/error")
  14174. , N = r("./analytics")
  14175. , F = r("./util/transitions")
  14176. , B = r("./effects")
  14177. , V = r("./objects/Skybox")
  14178. , k = (r("./util/common"),
  14179. r("./util/PanoramaCollection"),
  14180. r("./util/math"),
  14181. r("./util/showcase"))
  14182. , U = r("./util/camera")
  14183. , H = (r("./objects/Panorama"),
  14184. r("./cameras/PanoramaCamera"),
  14185. r("./preloaders"))
  14186. , z = r("events").EventEmitter
  14187. , G = r("./featureflags")
  14188. , W = (r("./util/lerp"),
  14189. r("./util/ajax"),
  14190. r("./ab"))
  14191. , j = r("./sdk/automation.js")
  14192. , Y = r("./scene/SceneRenderer")
  14193. , q = r("./scene/QuickstartManager")
  14194. , X = r("./tile/QualityManager.js")
  14195. , Z = r("./localization/localize")
  14196. , K = r("./tag/tagManager")
  14197. , Q = r("./tile/TileDownloader")
  14198. , J = r("./tile/PanoRenderer")
  14199. , ee = (r("./enum/PanoSizeClass"),
  14200. r("./enum/PanoramaEvents"),
  14201. r("./enum/SceneRendererEvents"))
  14202. , t = r("./gui/memoryUsage")
  14203. , te = r("./enum/RenderLayers")
  14204. , ie = r("./TimingData")
  14205. , ne = new e(i);
  14206. e.level = L.logLevel,
  14207. e.consoleEnabled = L.console,
  14208. function() {
  14209. var e = k.getModelIDFromQueryString();
  14210. if (!e)
  14211. return A(null, "loading-failed");
  14212. var t = k.parseSidUrl(e)
  14213. , i = O.valueFromHash("play", !1) ? "autoplay" : O.inIframe() ? "click" : "fullpage"
  14214. , n = {
  14215. panoElementsToLoad: 6,
  14216. modelElementsToLoad: 0,
  14217. totalElementsLoaded: 0,
  14218. totalElementsToLoad: 0,
  14219. totalPercentageLoaded: 0,
  14220. progressCallback: null
  14221. }
  14222. , r = document.getElementById("player")
  14223. , o = L.quickstart.enabled
  14224. , a = null
  14225. , s = null
  14226. , l = null
  14227. , c = null
  14228. , h = null
  14229. , u = null
  14230. , d = null
  14231. , p = null
  14232. , f = null
  14233. , g = null
  14234. , m = null
  14235. , v = new ie;
  14236. !function(e) {
  14237. ne.info("Version", "2.25.6-0-gd87e5b1"),
  14238. z.defaultMaxListeners = 1e3,
  14239. function(e) {
  14240. e.addEventListener("dragenter", I, !1),
  14241. e.addEventListener("dragover", I, !1)
  14242. }(e),
  14243. O.valueFromHash("title", !0) || $(document).ready(function() {
  14244. $(".model-title").hide()
  14245. })
  14246. }(r),
  14247. function(e) {
  14248. return G.loadFeatureFlags(e).done(function(e) {
  14249. G.updateDependentSettings(e, L)
  14250. })
  14251. }({
  14252. urlBase: t.urlBase
  14253. }).then(function() {
  14254. return Z.init(),
  14255. function(e, t) {
  14256. var i = P.getModel({
  14257. url: t,
  14258. floors: O.valueFromHash("f", !0),
  14259. autoload: !1
  14260. });
  14261. return $.when(i, y).then(null, function(e) {
  14262. return this
  14263. })
  14264. }(0, e)
  14265. }).then(function(e) {
  14266. return re(.9),
  14267. function(e, t, i, n, r) {
  14268. ne.info("Model data loaded"),
  14269. ne.debug("UUID: " + e.data.job.uuid),
  14270. W.init(G.getFlags()),
  14271. i && N.initKeen({
  14272. token: i,
  14273. appId: n
  14274. }),
  14275. N.initSegment({
  14276. model: e.sid,
  14277. version: "2.25.6-0-gd87e5b1",
  14278. startSource: r.startSource,
  14279. token: t,
  14280. autoplay: r.autoplay,
  14281. quickstart: r.quickstart
  14282. })
  14283. }(g = e, L.appConfig.segment_key, L.appConfig.keen_write_key, L.appConfig.keen_project_id, {
  14284. startSource: i,
  14285. autoplay: L.autoplay,
  14286. quickstart: o
  14287. }),
  14288. g.urls.init()
  14289. }).then(function() {
  14290. return g.loadPanos()
  14291. }).then(function() {
  14292. s = U.getStartCameraOptions(g, g.panos);
  14293. //初始画面
  14294. window.DATA.camera_start && window.DATA.camera_start.thumbImg && function(e) {
  14295. $("<img/>").attr("src", e).on("load", function() {
  14296. $("#gui-thumb").css("backgroundImage", "url(" + e + ")").fadeIn(500),
  14297. $(this).remove()
  14298. $(".shotImg.innerBtn").removeClass('blank').css("background-image", "url(" + e + ")")
  14299. })
  14300. }(window.DATA.camera_start.thumbImg);
  14301. d = function(e) {
  14302. var t = new E.PerspectiveCamera;
  14303. t.layers.enable(te.PANOMARKERS),
  14304. t.layers.enable(te.RETICULE),
  14305. t.layers.enable(te.TAG);
  14306. var o = new E.Scene
  14307. , i = new E.AmbientLight(16777215);
  14308. return o.add(i),
  14309. o.skybox = new V,
  14310. o.add(o.skybox),
  14311. o.plane = new E.Mesh(new E.PlaneBufferGeometry(1e5,1e5),new E.RawShaderMaterial({
  14312. side: E.DoubleSide
  14313. })),
  14314. o.plane.position.y = 0,
  14315. o.plane.rotateX(-Math.PI / 2),
  14316. o.plane.material.visible = !1,
  14317. o.add(o.plane),
  14318. o.updateMatrixWorld(),
  14319. L.showScreenshotLocations && e.data.images.forEach(function(e) {
  14320. if (e.metadata && e.metadata.camera_position) {
  14321. var t = e.metadata.camera_position
  14322. , i = new E.Mesh(new E.BoxGeometry(.3,.3,.3));
  14323. i.position = t.clone(),
  14324. o.add(i);
  14325. var n = e.metadata.camera_quaternion
  14326. , r = new E.Vector3(0,0,-1).applyQuaternion(n);
  14327. o.add(new E.ArrowHelper(r,t.clone(),1,16711680))
  14328. }
  14329. }),
  14330. L.showAxis && (o.add(new E.ArrowHelper(new E.Vector3(0,1,0),new E.Vector3(0,0,0),1,255)),
  14331. o.add(new E.ArrowHelper(new E.Vector3(0,0,1),new E.Vector3(0,0,0),1,16711680)),
  14332. o.add(new E.ArrowHelper(new E.Vector3(1,0,0),new E.Vector3(0,0,0),1,65280))),
  14333. new Y(o,t,B)
  14334. }(g),
  14335. m = function(e, t) {
  14336. var i = e ? 1 : 1e3
  14337. , n = W.tilegen || W.imgopt ? 6 : 2;
  14338. n = O.valueFromHash("tileconc", n);
  14339. var r = new X
  14340. , o = new Q({
  14341. concurrentDownloads: n
  14342. })
  14343. , a = new J
  14344. , s = new x
  14345. , l = new w
  14346. , c = new b(t)
  14347. , h = new T
  14348. , u = new S(i)
  14349. , d = new M
  14350. , p = new K;
  14351. return {
  14352. qualityManager: r,
  14353. panoRenderer: a,
  14354. tileDownloader: o,
  14355. player: c,
  14356. director: l,
  14357. modelManager: s,
  14358. tagManager: p,
  14359. displayController: u,
  14360. labelDisplayController: d,
  14361. controls: h
  14362. }
  14363. }(o, s.mode),
  14364. l = m.controls,
  14365. c = m.player,
  14366. h = m.director,
  14367. u = m.tagManager,
  14368. p = m.tileDownloader,
  14369. f = m.qualityManager,
  14370. m.panoRenderer,
  14371. function(e, t, i, n) {
  14372. var r = i.controls
  14373. , o = i.qualityManager
  14374. , a = i.panoRenderer
  14375. , s = i.tileDownloader
  14376. , l = i.modelManager;
  14377. r.init(n, l),
  14378. j.init(i.director, r, i.player, l, t),
  14379. o.init(l),
  14380. s.init(o),
  14381. a.init(t, s, o),
  14382. l.init(s, a, o),
  14383. l.addModel(e),
  14384. t.addComponent(F)
  14385. }(g, d, m, r),
  14386. c.director = h,
  14387. g.supportsTiles && p.start(),
  14388. !o || s.mode === R.PANORAMA && s.pano || (ne.warn("Tried to quickstart, but failed as we are not starting in inside mode."),
  14389. o = !1);
  14390. var e = null;
  14391. if (o) {
  14392. ne.warn("Quickstart engaged. Hold on to your knickers.");
  14393. var t = l.controls[R.PANORAMA];
  14394. a = new q(f,d.scene,d.camera,t,r),
  14395. C(d, r, g),
  14396. e = a.load(s).then(function() {
  14397. d.addComponent(a),
  14398. d.once(ee.AfterRender, function() {
  14399. ne.warn("First render after quickstart load finished.")
  14400. })
  14401. })
  14402. }
  14403. return window.flyToFirst = function() {
  14404. var e = c.model.panos.get("8d778e19657f433fb9cf8947d823bb70")
  14405. , t = new _.Quaternion(.7099827027821568,-.07708150183830938,.6958985789714591,.07555241737970636)
  14406. , i = new _.Vector3(0,0,-1).applyQuaternion(t).add(e.position);
  14407. c.flyToPano({
  14408. pano: e,
  14409. lookAtPoint: i
  14410. })
  14411. }
  14412. ,
  14413. $.when(e, D.startLoading(g, c, h, L.autoplay, o, v))
  14414. }).then(function() {
  14415. return function(e, t, i, n, r) {
  14416. return r.progressCallback = t,
  14417. N.sessionStart(),
  14418. e.load(n).progress(function(e, t) {
  14419. e.modelElementsToLoad = t[1],
  14420. function(e) {
  14421. e.totalElementsToLoad = e.modelElementsToLoad + e.panoElementsToLoad
  14422. }(e),
  14423. function(e) {
  14424. e.totalElementsLoaded++,
  14425. e.totalPercentageLoaded = e.totalElementsLoaded / e.totalElementsToLoad,
  14426. isNaN(e.totalPercentageLoaded) && (e.totalPercentageLoaded = 0),
  14427. e.totalPercentageLoaded = .4 + .6 * e.totalPercentageLoaded,
  14428. console.log("pro:" + e.totalPercentageLoaded),
  14429. e.progressCallback && e.progressCallback(100 * e.totalPercentageLoaded)
  14430. }(e)
  14431. }
  14432. .bind(this, r))
  14433. }(g, D.onProgress, 0, !o, n)
  14434. }).then(function() {
  14435. s.quickstart = o,
  14436. function(e, t, i, n) {
  14437. var r = i.qualityManager
  14438. , o = i.panoRenderer
  14439. , a = i.tileDownloader
  14440. , s = i.modelManager
  14441. , l = i.player
  14442. , c = i.director
  14443. , h = i.tagManager
  14444. , u = i.displayController
  14445. , d = i.labelDisplayController
  14446. , p = i.controls;
  14447. t.scene.add(e),
  14448. t.qualityManager = r;
  14449. var f = {
  14450. camera: t.camera,
  14451. director: c,
  14452. modelManager: s,
  14453. tileDownloader: a,
  14454. panoRenderer: o,
  14455. qualityManager: r,
  14456. tagManager: h,
  14457. container: n,
  14458. controls: p
  14459. };
  14460. l.init(f),
  14461. l.setScene(t.scene),
  14462. h.init(s, l),
  14463. c.init(l, s),
  14464. u.init(c, l, s, h, n),
  14465. d.init(l, s, n),
  14466. B.bindEvents(l),
  14467. t.addComponent(h),
  14468. t.addComponent(l),
  14469. t.addComponent(o),
  14470. l.sceneRenderer = t
  14471. }(g, d, m, r),
  14472. d.started || C(d, r, g),
  14473. N.modelLoaded(g, c, l, L.autoplay),
  14474. function(e, t, i, n) {
  14475. return ne.info("Starting player in " + i.mode),
  14476. N.report(t.sid, "started-playing", n, i.quickstart),
  14477. e.start(i)
  14478. }(c, g, s, L.autoplay).done(function() {
  14479. h.autoTour()
  14480. }),
  14481. g.supportsTiles || new H(g,c).start();
  14482. o && (d.removeComponent(a),
  14483. a.destroy(),
  14484. s.pano.enter()),
  14485. D.init(g, h, c, l, d, s, N.getSessionId()),
  14486. D.endLoading(g, h, u),
  14487. d.once(ee.AfterRender, function() {
  14488. v.setAppReadyTime();
  14489. var e = v.calcFullLoadingTime();
  14490. ne.warn("Total load time: " + e / 1e3),
  14491. N.loadComplete(e),
  14492. ne.warn("First render after model load finished.");
  14493. editTool.loadDone('data', window.DATA)
  14494. }),
  14495. d.on(ee.MemoryUsageUpdated, y)
  14496. }).fail(A.bind(this, e))
  14497. }()
  14498. }()
  14499. }).fail(e=>{
  14500. alert("缺少someData文件,请检查场景码是否正确。")
  14501. })
  14502. }
  14503. ).call(this, "/js/main.js")
  14504. }
  14505. , {
  14506. "./DisplayController": 1,
  14507. "./TimingData": 2,
  14508. "./ab": 3,
  14509. "./analytics": 4,
  14510. "./cameras/PanoramaCamera": 7,
  14511. "./controls/CameraControls": 9,
  14512. "./director": 15,
  14513. "./effects": 16,
  14514. "./enum/PanoSizeClass": 36,
  14515. "./enum/PanoramaEvents": 37,
  14516. "./enum/RenderLayers": 41,
  14517. "./enum/SceneRendererEvents": 43,
  14518. "./enum/Viewmode": 51,
  14519. "./featureflags": 59,
  14520. "./gui/error": 64,
  14521. "./gui/gui": 65,
  14522. "./gui/memoryUsage": 73,
  14523. "./label/LabelDisplayController": 91,
  14524. "./lib/array-polyfill": 92,
  14525. "./lib/performance-polyfill": 95,
  14526. "./lib/postprocessing/EffectComposer.js": 96,
  14527. "./lib/postprocessing/MaskPass.js": 97,
  14528. "./lib/postprocessing/RenderPass.js": 98,
  14529. "./lib/postprocessing/ShaderPass.js": 99,
  14530. "./lib/shaders/CopyShader.js": 100,
  14531. "./lib/shaders/HorizontalBlurShader.js": 101,
  14532. "./lib/shaders/VerticalBlurShader.js": 102,
  14533. "./lib/three75-shim": 103,
  14534. "./localization/localize": 108,
  14535. "./tag/tagManager": 124,
  14536. "./model/ModelManager": 140,
  14537. "./objects/Panorama": 148,
  14538. "./objects/Skybox": 152,
  14539. "./player": 155,
  14540. "./preloaders": 156,
  14541. "./scene/QuickstartManager": 157,
  14542. "./scene/SceneRenderer": 158,
  14543. "./sdk/automation.js": 164,
  14544. "./settings": 166,
  14545. "./showcase": 168,
  14546. "./tile/PanoRenderer": 169,
  14547. "./tile/QualityManager.js": 170,
  14548. "./tile/TileDownloader": 171,
  14549. "./util/PanoramaCollection": 178,
  14550. "./util/ajax": 181,
  14551. "./util/browser": 182,
  14552. "./util/camera": 183,
  14553. "./util/common": 185,
  14554. "./util/lerp": 188,
  14555. "./util/logger": 189,
  14556. "./util/math": 190,
  14557. "./util/sentry": 192,
  14558. "./util/showcase": 193,
  14559. "./util/transitions": 195,
  14560. events: 202,
  14561. "promise-polyfill": 213,
  14562. three: 217
  14563. }],
  14564. 117: [function(e, t, i) {
  14565. "use strict";
  14566. function n(e) {
  14567. e = e || {},
  14568. r.RawShaderMaterial.call(this, a.extendObject({
  14569. fragmentShader: o.cube.fragmentShader,
  14570. vertexShader: o.cube.vertexShader,
  14571. uniforms: r.UniformsUtils.clone(o.cube.uniforms),
  14572. name: "CubemapMaterial"
  14573. }, e))
  14574. }
  14575. var r = e("three")
  14576. , o = e("../shaders")
  14577. , a = e("../util/common");
  14578. (n.prototype = Object.create(r.RawShaderMaterial.prototype)).constructor = n,
  14579. t.exports = n
  14580. }
  14581. , {
  14582. "../shaders": 167,
  14583. "../util/common": 185,
  14584. three: 217
  14585. }],
  14586. 118: [function(e, t, i) {
  14587. "use strict";
  14588. function n(e) {
  14589. e = e || {},
  14590. r.RawShaderMaterial.call(this, a.extendObject({
  14591. fragmentShader: o.model.fragmentShader,
  14592. vertexShader: o.model.vertexShader,
  14593. uniforms: r.UniformsUtils.clone(o.model.uniforms),
  14594. name: "ModelTextureMaterial"
  14595. }, e))
  14596. }
  14597. var r = e("three")
  14598. , o = e("../shaders")
  14599. , a = e("../util/common");
  14600. ((n.prototype = Object.create(r.RawShaderMaterial.prototype)).constructor = n).prototype.setProjectedPanos = function(e, t, i) {
  14601. i && (this.uniforms.progress.value = 0),
  14602. e.ensureSkyboxReadyForRender(),
  14603. this.uniforms.pano0Map.value = e.getSkyboxTexture(),
  14604. this.uniforms.pano0Position.value.copy(e.position),
  14605. this.uniforms.pano0Matrix.value.copy(e.skyboxMesh.matrixWorld),
  14606. t.ensureSkyboxReadyForRender(),
  14607. this.uniforms.pano1Map.value = t.getSkyboxTexture(),
  14608. this.uniforms.pano1Position.value.copy(t.position),
  14609. this.uniforms.pano1Matrix.value.copy(t.skyboxMesh.matrixWorld)
  14610. }
  14611. ,
  14612. t.exports = n
  14613. }
  14614. , {
  14615. "../shaders": 167,
  14616. "../util/common": 185,
  14617. three: 217
  14618. }],
  14619. 119: [function(m, v, e) {
  14620. (function(e) {
  14621. "use strict";
  14622. function t(e, t, i, n) {
  14623. this.div = null,
  14624. this.body = null,
  14625. this.label = e,
  14626. this.description = t,
  14627. this.parsedDescription = [],
  14628. this.media = i || {
  14629. type: null
  14630. },
  14631. this.loadingSpinner = null,
  14632. this.parser = new r({
  14633. supportLinks: !c.valueFromHash("mls"),
  14634. keepLinkLabels: !0
  14635. }),
  14636. this.state = g.CLOSED,
  14637. this.orientation = "",
  14638. this.initialTransform = "",
  14639. this.hovering = !1,
  14640. this.openTransition = null,
  14641. this.closeTransition = null,
  14642. this.openPromise = null,
  14643. this.closePromise = null,
  14644. this.animationTransition = null,
  14645. this.animationScale = 0
  14646. }
  14647. var r = m("../Parser/DescriptionParser")
  14648. , i = m("../Media/Link")
  14649. , n = m("../Media/Image")
  14650. , o = m("../Media/EmbedlyPlayer")
  14651. , a = m("../Media/EmbedlyEmbed")
  14652. , s = m("../../util/transitions")
  14653. , l = m("../../util/lerp")
  14654. , c = m("../../util/browser")
  14655. , b = m("./BillboardEvent")
  14656. , w = m("../Media/MediaEvent")
  14657. , h = m("../Parser/DescriptionChunkType")
  14658. , u = m("events").EventEmitter
  14659. , d = m("./billboardSettings")
  14660. , T = m("./overlaySettings")
  14661. , p = new (m("../../util/logger"))(e)
  14662. , f = document.getElementById("tag-billboards");
  14663. f.addEventListener("touchend", function(e) {
  14664. f.style.pointerEvents = "none"
  14665. }),
  14666. f.addEventListener("touchcancel", function(e) {
  14667. f.style.pointerEvents = "none"
  14668. });
  14669. var g = {
  14670. CLOSED: "closed",
  14671. OPENING: "opening",
  14672. OPEN: "open",
  14673. CLOSING: "closing",
  14674. ACTIVE: "active"
  14675. };
  14676. (t.prototype = Object.create(u.prototype)).build = function(e) {
  14677. this.parsedDescription = this.parser.parse(this.description);
  14678. var t = document.createElement("div");
  14679. t.className = "tag-container has-hotzone",
  14680. this.div = t,
  14681. this.body = document.createElement("div"),
  14682. this.body.className = "tag-body";
  14683. var i = document.createElement("div");
  14684. i.classList.add("tag-content");
  14685. var n = document.createElement("div");
  14686. n.classList.add("tag-text-content");
  14687. var r = document.createElement("div");
  14688. r.className = "tag-label",
  14689. r.textContent = this.label,
  14690. n.appendChild(r);
  14691. var o = document.createElement("div");
  14692. o.className = "tag-desc",
  14693. n.appendChild(o),
  14694. i.appendChild(n),
  14695. this.body.appendChild(i),
  14696. this.appendDescriptionElements(this.parsedDescription, o),
  14697. this.appendMedia(),
  14698. t.appendChild(this.body),
  14699. f.appendChild(t),
  14700. this.bindEvents(t, this.body)
  14701. }
  14702. ,
  14703. t.prototype.bindEvents = function(i, e) {
  14704. function t(n) {
  14705. return function(e) {
  14706. if (!this.div.classList.contains("overlay")) {
  14707. var t, i = document.getElementById("player");
  14708. try {
  14709. t = new MouseEvent(n,e)
  14710. } catch (i) {
  14711. (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)
  14712. }
  14713. i.dispatchEvent(t)
  14714. }
  14715. }
  14716. }
  14717. e.addEventListener("mousedown", function(e) {
  14718. e.stopPropagation()
  14719. }),
  14720. e.addEventListener("mouseup", function(e) {
  14721. e.stopPropagation()
  14722. }),
  14723. i.addEventListener("touchstart", function(e) {
  14724. f.style.pointerEvents = "auto"
  14725. }),
  14726. i.addEventListener("mousedown", t("mousedown").bind(this)),
  14727. i.addEventListener("mouseup", t("mouseup").bind(this)),
  14728. e.addEventListener("mouseover", function(e) {
  14729. this.state === g.OPEN && i.classList.remove("has-hotzone")
  14730. }
  14731. .bind(this)),
  14732. i.addEventListener("mouseenter", function(e) {
  14733. this.state !== g.CLOSING && (this.hovering = !0,
  14734. this.emit(b.ENTER))
  14735. }
  14736. .bind(this)),
  14737. i.addEventListener("mouseleave", function(e) {
  14738. this.hovering = !1,
  14739. this.emit(b.LEAVE)
  14740. }
  14741. .bind(this)),
  14742. i.addEventListener("gesturestart", function(e) {
  14743. e.preventDefault()
  14744. });
  14745. var n = i.querySelector(".tag-text-content")
  14746. , r = 0;
  14747. n.addEventListener("touchstart", function(e) {
  14748. r = e.changedTouches[0].clientY
  14749. }),
  14750. n.addEventListener("touchmove", function(t) {
  14751. function e(e) {
  14752. e && (0 === e.scrollTop && t.changedTouches[0].clientY > r || e.scrollTop + e.clientHeight - e.scrollHeight == 0 && t.changedTouches[0].clientY < r) && t.preventDefault()
  14753. }
  14754. return i.classList.contains("overlay") ? e(this.querySelector(".tag-desc")) : void e(this)
  14755. }),
  14756. i.addEventListener("touchmove", function(e) {
  14757. 0 == (n.compareDocumentPosition(e.target) & Node.DOCUMENT_POSITION_CONTAINED_BY) && e.preventDefault()
  14758. })
  14759. }
  14760. ,
  14761. t.prototype.appendDescriptionElements = function(e, i) {
  14762. 0 < e.length && this.div.classList.add("has-text"),
  14763. e.forEach(function(e, t) {
  14764. switch (e.type) {
  14765. case h.TEXT:
  14766. i.appendChild(this.createTextElement(e.text));
  14767. break;
  14768. case h.LINK:
  14769. i.appendChild(this.createLinkElement(e.link))
  14770. }
  14771. }
  14772. .bind(this))
  14773. }
  14774. ,
  14775. t.prototype.appendLoadingSpinner = function() {
  14776. this.loadingSpinner = document.createElement("div"),
  14777. this.loadingSpinner.classList.add("loading-spinner");
  14778. var e = document.createElement("div");
  14779. e.classList.add("gui-spinner-icon"),
  14780. this.loadingSpinner.appendChild(e),
  14781. this.body.appendChild(this.loadingSpinner)
  14782. }
  14783. ,
  14784. t.prototype.onMediaLoadFinished = function() {
  14785. this.loadingSpinner && (this.loadingSpinner.parentNode.removeChild(this.loadingSpinner),
  14786. this.applyOrientation(this.orientation),
  14787. this.loadingSpinner = null)
  14788. }
  14789. ,
  14790. t.prototype.appendMedia = function() {
  14791. if (this.media && this.media.type && "error" !== this.media.type && (!c.valueFromHash("mls", 0) || this.media.type === h.IMAGE)) {
  14792. this.appendLoadingSpinner();
  14793. var e = document.createElement("div");
  14794. e.classList.add("tag-media-content");
  14795. var t = document.createElement("i");
  14796. switch (["icon", "icon-close-thin", "close"].forEach(function(e) {
  14797. t.classList.add(e)
  14798. }),
  14799. this.body.appendChild(t),
  14800. this.body.appendChild(e),
  14801. this.media.type) {
  14802. case h.IMAGE:
  14803. e.appendChild(this.createImageElement(this.media, this.body));
  14804. break;
  14805. case h.VIDEO:
  14806. e.appendChild(this.createVideoElement(this.media, this.body));
  14807. break;
  14808. case h.RICH:
  14809. e.appendChild(this.createEmbedElement(this.media, this.body))
  14810. }
  14811. }
  14812. }
  14813. ,
  14814. t.prototype.createTextElement = function(e) {
  14815. var t = document.createElement("span");
  14816. return t.textContent = e,
  14817. t
  14818. }
  14819. ,
  14820. t.prototype.createLinkElement = function(e) {
  14821. var t = new i(e);
  14822. return t.on(w.LINK_CLICK, this.emit.bind(this, w.LINK_CLICK)),
  14823. t.createDomElement()
  14824. }
  14825. ,
  14826. t.prototype.createImageElement = function(t, C) {
  14827. function e() {
  14828. function e() {
  14829. p || (E.classList.remove("view-image"),
  14830. a.classList.add("overlay"),
  14831. t(),
  14832. window.addEventListener("resize", A),
  14833. a.addEventListener("click", i),
  14834. c.addEventListener("click", r),
  14835. o.addEventListener("click", n),
  14836. p = !0,
  14837. _.emit(w.IMAGE_OPENED))
  14838. }
  14839. function t() {
  14840. C.classList.add("show-info"),
  14841. s.classList.remove("collapsible"),
  14842. s.style.height = "";
  14843. var e = parseFloat(getComputedStyle(v).lineHeight)
  14844. , t = g + e
  14845. , i = a.clientWidth - 2 * T.boundaryWidth - m
  14846. , n = a.clientHeight - 2 * T.boundaryHeight - m - t
  14847. , r = n
  14848. , o = r * I.aspect;
  14849. i < o && (r = (o = i) / I.aspect),
  14850. n < r && (o = (r = n) * I.aspect),
  14851. o += m,
  14852. r += m + t,
  14853. C.style.width = o + "px",
  14854. C.style.height = r + "px",
  14855. l.style.paddingTop = e + m + "px",
  14856. 0 < _.description.length && (s.classList.add("collapsible"),
  14857. s.style.height = s.clientHeight + 12 + "px",
  14858. y.style.height = "calc(100% - " + v.clientHeight + "px)")
  14859. }
  14860. function i(e) {
  14861. e.target === a && n()
  14862. }
  14863. function n() {
  14864. p && (p = !1,
  14865. E.classList.add("view-image"),
  14866. a.classList.remove("overlay"),
  14867. s.style.height = "",
  14868. l.style.paddingTop = "",
  14869. C.style.width = "",
  14870. C.style.height = "",
  14871. window.removeEventListener("resize", A),
  14872. a.removeEventListener("click", i),
  14873. c.removeEventListener("click", r),
  14874. o.removeEventListener("click", n),
  14875. _.emit(w.IMAGE_CLOSED),
  14876. _.close(!0))
  14877. }
  14878. function r(e) {
  14879. C.classList.toggle("show-info")
  14880. }
  14881. var a = _.div
  14882. , s = a.getElementsByClassName("tag-content")[0]
  14883. , l = a.getElementsByClassName("tag-media-content")[0]
  14884. , o = C.getElementsByClassName("close")[0]
  14885. , c = s.getElementsByClassName("tag-label")[0];
  14886. a.classList.add("has-image"),
  14887. E.classList.add("view-image"),
  14888. a.classList.add(1 <= I.aspect ? "image-landscape" : "image-portrait"),
  14889. _.applyOrientation(_.orientation);
  14890. 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,
  14891. function() {
  14892. clearInterval(h),
  14893. clearTimeout(u),
  14894. h = setInterval(function() {
  14895. var e = a.clientHeight;
  14896. d !== e && (t(),
  14897. d = e)
  14898. }, 100),
  14899. u = setTimeout(clearInterval.bind(this, h), 1e3)
  14900. }
  14901. );
  14902. I.on(w.IMAGE_OPENING, e),
  14903. _.on(b.ACTIVATE, e),
  14904. _.on(w.IMAGE_CLOSED, I.onClosed.bind(I)),
  14905. _.on(b.CLOSING, n)
  14906. }
  14907. var I = new n
  14908. , E = I.createDomElement();
  14909. this.once(b.OPENED, function() {
  14910. I.load(t.src).then(e).catch(function(e) {
  14911. p.warn("Failed to load image:", t.src),
  14912. p.warn("with error:", e)
  14913. }).then(this.onMediaLoadFinished.bind(this))
  14914. });
  14915. var _ = this;
  14916. return E
  14917. }
  14918. ,
  14919. t.prototype.createVideoElement = function(t, e) {
  14920. var i = new o({
  14921. autoPlay: !0,
  14922. autoResume: !0,
  14923. startMuted: !1,
  14924. loop: !1
  14925. })
  14926. , n = i.createDomElement();
  14927. return this.once(b.OPENED, function() {
  14928. i.load(t.src).then(function() {
  14929. this.div.classList.add("has-video"),
  14930. this.state !== g.OPEN && this.state !== g.ACTIVE || (i.show(),
  14931. i.play()),
  14932. this.on(b.OPENING, i.show.bind(i)),
  14933. this.on(b.OPENED, i.play.bind(i)),
  14934. this.on(b.CLOSING, i.pause.bind(i)),
  14935. this.on(b.CLOSED, i.hide.bind(i))
  14936. }
  14937. .bind(this)).catch(function(e) {
  14938. p.warn("Failed to embed video:", t.src),
  14939. p.warn("with error:", e)
  14940. }).then(this.onMediaLoadFinished.bind(this))
  14941. }
  14942. .bind(this)),
  14943. n
  14944. }
  14945. ,
  14946. t.prototype.createEmbedElement = function(t, e) {
  14947. var i = new a
  14948. , n = i.createDomElement();
  14949. return this.once(b.OPENED, function() {
  14950. i.load(t.src).then(function() {
  14951. this.div.classList.add("has-embed"),
  14952. this.state !== g.OPEN && this.state !== g.ACTIVE || i.show(),
  14953. this.applyOrientation(this.orientation),
  14954. this.on(b.OPENING, i.show.bind(i)),
  14955. this.on(b.CLOSED, i.hide.bind(i))
  14956. }
  14957. .bind(this)).catch(function(e) {
  14958. p.warn("Failed to embed:", t.src),
  14959. p.warn("with error:", e)
  14960. }).then(this.onMediaLoadFinished.bind(this))
  14961. }
  14962. .bind(this)),
  14963. n
  14964. }
  14965. ,
  14966. t.prototype.open = function(e) {
  14967. return this.openPromise = $.Deferred(),
  14968. this.state === g.ACTIVE ? this.openPromise.resolve().promise() : (this.hovering || this.div.classList.add("has-hotzone"),
  14969. this.openTransition ? e && this.setActiveState() : this.openTransition = s.setTimeout(function() {
  14970. this.state !== g.OPEN && (this.emit(b.OPENING),
  14971. e && this.emit(b.ACTIVATING),
  14972. this.state = g.OPENING,
  14973. this.animateOpen(function() {
  14974. e && this.setActiveState(),
  14975. this.openPromise.resolve()
  14976. }
  14977. .bind(this)))
  14978. }
  14979. .bind(this), d.animation.openDelay),
  14980. s.cancel(this.closeTransition),
  14981. this.closePromise && this.closePromise.reject(),
  14982. this.closeTransition = void 0,
  14983. this.openPromise.promise())
  14984. }
  14985. ,
  14986. t.prototype.close = function(e) {
  14987. return this.closePromise = $.Deferred(),
  14988. !e && this.hovering ? this.closePromise.reject().promise() : (this.closeTransition || (this.closeTransition = s.setTimeout(function() {
  14989. this.state !== g.CLOSED && (this.emit(b.CLOSING),
  14990. this.state = g.CLOSING,
  14991. this.animateClose())
  14992. }
  14993. .bind(this), d.animation.closeDelay)),
  14994. s.cancel(this.openTransition),
  14995. this.openPromise && this.openPromise.reject(),
  14996. this.openTransition = void 0,
  14997. this.closePromise.resolve(),
  14998. this.closePromise.promise())
  14999. }
  15000. ,
  15001. t.prototype.setActiveState = function() {
  15002. this.state !== g.CLOSED && (this.state = g.ACTIVE,
  15003. this.emit(b.ACTIVATE),
  15004. this.div.classList.remove("has-hotzone"))
  15005. }
  15006. ,
  15007. t.prototype.animateOpen = function(e) {
  15008. if (this.state === g.OPENING) {
  15009. if (s.cancel(this.animationTransition),
  15010. c.detectSamsungNative())
  15011. return this.boardOrientation = null,
  15012. this.div.style.visibility = "visible",
  15013. this.emit(b.OPENED),
  15014. this.state = g.OPEN,
  15015. void (e && e());
  15016. this.div.style.webkitTransform = "scale(0)",
  15017. this.div.style.transform = "scale(0)",
  15018. this.div.style.visibility = "visible",
  15019. this.animationTransition = s.start(l.property(this, "animationScale", 1), d.animation.openDuration, function() {
  15020. this.emit(b.OPENED),
  15021. this.state = g.OPEN,
  15022. e && e()
  15023. }
  15024. .bind(this))
  15025. }
  15026. }
  15027. ,
  15028. t.prototype.animateClose = function(e) {
  15029. this.state === g.CLOSING && (s.cancel(this.animationTransition),
  15030. this.animationTransition = s.start(l.property(this, "animationScale", 0), d.animation.closeDuration, function() {
  15031. this.emit(b.CLOSED),
  15032. this.state = g.CLOSED,
  15033. this.div.style.visibility = "hidden",
  15034. this.div.classList.contains("has-hotzone") || this.div.classList.add("has-hotzone"),
  15035. e && e()
  15036. }
  15037. .bind(this)))
  15038. }
  15039. ,
  15040. t.prototype.needsUpdate = function() {
  15041. return this.state !== g.CLOSED
  15042. }
  15043. ,
  15044. t.prototype.update = function(e, t) {
  15045. if (this.needsUpdate()) {
  15046. var i = (this.updateOrientation(e),
  15047. this.calcScale(t))
  15048. , n = {
  15049. x: (e.x + 1) * $("#player").width() / 2,
  15050. y: (e.y + 1) * $("#player").height() / 2
  15051. };
  15052. this.div.screenTransform = this.initialTransform + " translate(" + n.x + "px, " + n.y + "px) scale(" + i * this.animationScale + ")",
  15053. this.div.style.webkitTransform = this.div.screenTransform,
  15054. this.div.style.transform = this.div.screenTransform
  15055. }
  15056. }
  15057. ,
  15058. t.prototype.getDimensions = function() {
  15059. return this.div.getBoundingClientRect()
  15060. }
  15061. ,
  15062. t.prototype.calcScale = function(e) {
  15063. return Math.sqrt(e / 40) * d.boardToDiscRatio
  15064. }
  15065. ,
  15066. t.prototype.updateOrientation = function(e) {
  15067. if (this.state !== g.ACTIVE) {
  15068. var t = e.y < -1 / 3 ? 0 : e.y < 1 / 3 ? 1 : 2
  15069. , i = e.x < -1 / 3 ? 0 : e.x < 1 / 3 ? 1 : 2
  15070. , n = "";
  15071. n += 0 == i ? "right" : 2 == i ? "left" : "",
  15072. n += 0 == t ? "-down" : 2 == t ? "-up" : "",
  15073. 1 == i && (n = 0 == t ? "bottom" : 2 == t ? "top" : "",
  15074. 1 == t && (n = $("#player").width() > $("#player").height() ? e.x < 0 ? "right" : "left" : e.y < 0 ? "bottom" : "top")),
  15075. 1 == i && 1 == t && n === this.orientation || this.applyOrientation(n)
  15076. }
  15077. }
  15078. ,
  15079. t.prototype.applyOrientation = function(e) {
  15080. this.div.style.transform = this.div.style.webkitTransform = "",
  15081. this.div.classList.remove("tag-container-" + this.orientation),
  15082. this.div.classList.add("tag-container-" + e);
  15083. var t = window.getComputedStyle(this.div);
  15084. this.initialTransform = t.transform || t.webkitTransform,
  15085. "none" === this.initialTransform && (this.initialTransform = "");
  15086. var i = t.transform.slice(7, -1).split(",")
  15087. , n = -i[4]
  15088. , r = -i[5];
  15089. this.div.style.webkitTransformOrigin = n + "px " + r + "px",
  15090. this.div.style.transformOrigin = n + "px " + r + "px",
  15091. this.orientation = e
  15092. }
  15093. ,
  15094. v.exports = t
  15095. }
  15096. ).call(this, "/js/tag/Billboard/Billboard.js")
  15097. }
  15098. , {
  15099. "../../util/browser": 182,
  15100. "../../util/lerp": 188,
  15101. "../../util/logger": 189,
  15102. "../../util/transitions": 195,
  15103. "../Media/EmbedlyEmbed": 125,
  15104. "../Media/EmbedlyPlayer": 126,
  15105. "../Media/Image": 128,
  15106. "../Media/Link": 129,
  15107. "../Media/MediaEvent": 131,
  15108. "../Parser/DescriptionChunkType": 133,
  15109. "../Parser/DescriptionParser": 134,
  15110. "./BillboardEvent": 120,
  15111. "./billboardSettings": 121,
  15112. "./overlaySettings": 122,
  15113. events: 202
  15114. }],
  15115. 120: [function(e, t, i) {
  15116. "use strict";
  15117. t.exports = Object.freeze({
  15118. ENTER: "billboard.enter",
  15119. LEAVE: "billboard.leave",
  15120. OPENING: "billboard.opening",
  15121. OPENED: "billboard.open",
  15122. CLOSING: "billboard.closing",
  15123. CLOSED: "billboard.closed",
  15124. ACTIVATING: "billboard.activating",
  15125. ACTIVATE: "billboard.activate"
  15126. })
  15127. }
  15128. , {}],
  15129. 121: [function(e, t, i) {
  15130. "use strict";
  15131. t.exports = Object.freeze({
  15132. animation: Object.freeze({
  15133. hoverOnClosing: !1,
  15134. openDelay: 100,
  15135. closeDelay: 50,
  15136. openDuration: 200,
  15137. closeDuration: 100
  15138. }),
  15139. boardToDiscRatio: 1.2
  15140. })
  15141. }
  15142. , {}],
  15143. 122: [function(e, t, i) {
  15144. "use strict";
  15145. t.exports = Object.freeze({
  15146. boundaryWidth: 30,
  15147. boundaryHeight: 0
  15148. })
  15149. }
  15150. , {}],
  15151. hot: [function(e, t, i) {
  15152. "use strict";
  15153. function n(e, t, i) {
  15154. this.sid = e,
  15155. this.position = this.convertValue(t.position, g.Vector3)
  15156. if(t.quaternion){
  15157. this.quaternion = this.convertValue(t.quaternion, g.Quaternion)
  15158. }else{
  15159. this.rotation = new g.Euler().setFromVector3(this.convertValue(t.rotation, g.Vector3 ))
  15160. }
  15161. this.quaternion || (this.quaternion = new THREE.Quaternion().setFromEuler(this.rotation))
  15162. this.isSprite = t.isSprite || 0
  15163. this.actionType = (t.noAction ? 'noAction' : t.actionType ) || "common"
  15164. this.linkType = t.linkType || "common"
  15165. this.link = t.link,
  15166. this.model = i,
  15167. this.size = t.size;
  15168. this.styleImg = [] // 存储热点icon的图片 [{src:...}, {src:...} ] 最多两个,里面是带有src的object, 可以是img,会经常改变
  15169. this.infoAttribute = t.infoAttribute || {};
  15170. this.transformAtPanos = t.transformAtPanos || {}
  15171. for (let i in this.transformAtPanos) {
  15172. this.transformAtPanos[i].pos = new THREE.Vector3().fromArray(this.transformAtPanos[i].pos)
  15173. this.transformAtPanos[i].qua && (this.transformAtPanos[i].qua = new THREE.Quaternion().fromArray(this.transformAtPanos[i].qua))
  15174. }
  15175. this.build()
  15176. this.setFromInfo()
  15177. this.changeTex()
  15178. this.visibleData = t.visiblePanos
  15179. //this.setVisiblePanos(t.visiblePanos );
  15180. }
  15181. var g = e("three")
  15182. , r = e("../shaders")
  15183. , m = e("../settings")
  15184. , v = e("../enum/Viewmode")
  15185. , d = e("../objects/Panorama")
  15186. , o = e("../util/texture")
  15187. , math = e("../util/math")
  15188. , p = new g.Raycaster
  15189. , a = new g.PlaneBufferGeometry(g_HotMeshSize.g_HotMeshWidth,g_HotMeshSize.g_HotMeshHeight,1,1)
  15190. var defaultTex1 = o.load(g_HotImage.point);
  15191. var defaultTex2 = o.load(g_HotImage.point2)
  15192. //dealMap(defaultTex1)
  15193. //dealMap(defaultTex2)
  15194. n.prototype.setFromInfo = function(){ //初始化或恢复
  15195. var info = this.infoAttribute
  15196. this.setTitleElem(info.title)
  15197. this.transformAtPanos = info.transformAtPanos || this.transformAtPanos
  15198. var curPanoTransform = this.transformAtPanos[ getTransformSid()] || {}
  15199. var pos = curPanoTransform.pos || info.position
  15200. pos && this.mesh.position.copy(pos)
  15201. info.position && this.position.copy(info.position) //this.position记录全局position
  15202. var isSprite = info.isSprite != void 0 ? info.isSprite : this.isSprite
  15203. if(!isSprite){
  15204. var qua = curPanoTransform.qua || info.quaternion
  15205. qua && this.mesh.quaternion.copy(qua)
  15206. }
  15207. info.quaternion && this.quaternion.copy(info.quaternion) //this.quaternion记录全局quaternion
  15208. var s = parseFloat(info.hotIconScale || window.DATA.hotIconScale )
  15209. s && this.mesh.scale.set(s, s, s)
  15210. this.isSprite = isSprite
  15211. this.actionType = info.actionType != void 0 ? info.actionType : this.actionType
  15212. this.linkType = info.linkType != void 0 ? info.linkType : this.linkType
  15213. this.initStyleImg()
  15214. }
  15215. n.prototype.changeTex = function(styleImg){
  15216. var u = this.mesh.material.uniforms
  15217. var styleImg = styleImg || this.styleImg
  15218. if(styleImg.length){
  15219. u.texture1.value = o.load(styleImg[0].src);
  15220. u.texture2.value = o.load(styleImg[1]&&styleImg[1].src || styleImg[0].src);
  15221. }else{
  15222. u.texture1.value = defaultTex1;
  15223. u.texture2.value = defaultTex2;
  15224. }
  15225. this.styleImg = styleImg
  15226. }
  15227. n.prototype.initStyleImg = function(){
  15228. var t = this.infoAttribute;
  15229. this.styleImg = []
  15230. t.styleImg = t.styleImg || [];
  15231. t.styleImg.forEach((src)=>{
  15232. //src = src.src || src
  15233. this.styleImg.push({src:manage.dealURL(src)})
  15234. })
  15235. this.changeTex()
  15236. }
  15237. n.prototype.update = function(camera) {
  15238. if(this.isSprite){
  15239. this.mesh.quaternion.copy(camera.quaternion)
  15240. }
  15241. }
  15242. n.prototype.setVisiblePanos = function(visibleData ){
  15243. if(visibleData == "get"){
  15244. this.visiblePanos = player.model.panos.list.map((pano)=>{return pano.id})
  15245. }else if(visibleData){
  15246. this.visiblePanos = visibleData;
  15247. }
  15248. /* this.visiblePanos = [];
  15249. this.model.panos.list.forEach((pano)=>{//考虑到热点可以移动,不好重新设置,还是不根据模型遮挡来初始化了,默认全部可见
  15250. if(visibleData && !visibleData.includes(pano.id))return;
  15251. var isShelter = convertTool.ifIntersectChunks(pano.position, this.position, {model: this.model.colliders});
  15252. if(!isShelter){
  15253. this.visiblePanos.push(pano.id)
  15254. }
  15255. }) */
  15256. }
  15257. n.prototype.build = function() {
  15258. var t = g.UniformsUtils.clone(r.hot.uniforms);
  15259. var e = new g.Mesh(a, new g.ShaderMaterial({
  15260. uniforms: t,
  15261. vertexShader: r.hot.vertexShader,
  15262. fragmentShader: r.hot.fragmentShader,
  15263. transparent: !0
  15264. }))
  15265. e.dynamic = !0, //?
  15266. e.position.copy(this.position);
  15267. e.quaternion.copy(this.quaternion)
  15268. e.name = this.sid,
  15269. e.type = "hotSprite",
  15270. (e.belongHot = this).link && (e.hotLink = this.link),
  15271. this.mesh = e,
  15272. this.model.add(e),
  15273. g_HotMeshes.push(e);
  15274. }
  15275. n.prototype.setTitleElem = function(){
  15276. var root = $("#hot");
  15277. var title = this.infoAttribute.title;
  15278. if(title){
  15279. if(!this.titleElem){
  15280. var elem = $(`<div></div>`)
  15281. root.append(elem);
  15282. this.titleElem = elem;
  15283. }
  15284. this.titleElem.text(title)
  15285. }else{
  15286. if(this.titleElem){
  15287. this.titleElem.remove()
  15288. this.titleElem = null;
  15289. }
  15290. }
  15291. }
  15292. n.prototype.showTitle = function(){
  15293. if(!this.titleElem)return;
  15294. var pos = math.getPos2d(this.position, player.camera, $("#player")[0])
  15295. if(pos.trueSide){//inSight
  15296. this.titleElem.css( { "left" : `${pos.pos.x}px`, "top": `${pos.pos.y}px ` });
  15297. this.titleElem.css("display","block");
  15298. }else{
  15299. this.titleElem.css("display","none");
  15300. }
  15301. }
  15302. n.prototype.hideTitle = function(){
  15303. if(!this.titleElem)return;
  15304. this.titleElem.css("display","none");
  15305. }
  15306. ,
  15307. n.prototype.closestPanoTowardTag = function(e, t) {
  15308. var i = []
  15309. , n = []
  15310. , r = this.mesh.position;
  15311. if (e === v.PANORAMA) {
  15312. var o = t.position.clone().sub(r).normalize();
  15313. n.push(d.scoreFunctions.direction(r, o))
  15314. }
  15315. var a = new g.Vector3;
  15316. i.push(function(e) {
  15317. return Math.abs(e.position.x - r.x) > m.tags.visibility.cameraClearance || Math.abs(e.position.z - r.z) > m.tags.visibility.cameraClearance
  15318. }, function(e) {
  15319. a.copy(r).sub(e.position);
  15320. var t = -g.Math.radToDeg(Math.atan(a.y / Math.sqrt(a.x * a.x + a.z * a.z)))
  15321. , i = m.tags.navigate.tiltTolerance;
  15322. return m.insideLookLimitDown - i < t && t < m.insideLookLimitUp + i
  15323. },
  15324. (pano)=>{ // add
  15325. return player.checkHasNeighbor(pano)
  15326. }
  15327. ),
  15328. n.push(d.scoreFunctions.distanceSquared(this.mesh, -2));
  15329. var s = t.model.panos.sortByScore(i, n);
  15330. if (s && m.tags.navigate.lineOfSight) {
  15331. for (var l = 0; l < s.length; l++) {
  15332. var c = s[l].pano
  15333. , h = c.position.distanceTo(r);
  15334. p.set(c.position, r.clone().sub(c.position).normalize());
  15335. var u = p.intersectObjects(t.model.colliders);
  15336. if (0 === u.length || u[0].distance > h)
  15337. return console.log(l),
  15338. c
  15339. }
  15340. return null
  15341. }
  15342. return s && 0 < s.length && s[0].pano
  15343. }
  15344. var getLink = function(link){
  15345. var src = '';
  15346. var r = link.substring(link.indexOf("html") + 4)
  15347. , o = "en" == manage.number("lang") ? "&lang=" + manage.number("lang") : "";
  15348. -1 == r.indexOf("?") ? src = link + "?time=" + randomTime().getTime() + "&id=" + window.number + o : src = link + "&time=" + randomTime().getTime() + "&id=" + window.number + o
  15349. return src
  15350. }
  15351. n.prototype.examine = function(e, options) {
  15352. options = options || {}
  15353. if(this.actionType == 'noAction')return
  15354. if(this.linkType!="common" && this.infoAttribute.iframe && this.infoAttribute.iframe[0] && !options.dontOpen){
  15355. var src = getLink(this.infoAttribute.iframe[0]);
  15356. if(this.linkType=="jumpLink"){
  15357. var newPage = window.open(src, "_blank" );
  15358. newPage.focus();
  15359. }else if(this.linkType=="iframeDiv"){
  15360. var div = document.createElement("div");
  15361. $("body").append(div);
  15362. div.style.position = 'fixed';
  15363. div.style.width = div.style.height = "100%";
  15364. div.style.left = div.style.top = '0';
  15365. div.style["z-index"] = "999"
  15366. var exit = document.createElement("div");
  15367. exit.style["background-image"] = "url(images/vrOffImg.png)";
  15368. exit.style.position = 'absolute';
  15369. exit.style.width = exit.style.height = "50px";
  15370. exit.style.left = '17px'; exit.style.top = "20px"
  15371. exit.style.cursor = "pointer";
  15372. exit.style["background-repeat"] = "no-repeat";
  15373. exit.style["background-size"] = "25%";
  15374. exit.style["background-position"] = "center center";
  15375. exit.style["background-color"] = "rgba(0, 0, 0, 0.2)";
  15376. exit.style["border-radius"] = "50%";
  15377. exit.style["z-index"] = "3"
  15378. exit.onclick = ()=>{
  15379. $(div).remove()
  15380. if(g_bgAudio && g_bgAudio.pauseByHot){
  15381. manage.switchBgmState(true)
  15382. }
  15383. }
  15384. var myElement = document.createElement("iframe");
  15385. myElement.style.position = 'absolute';
  15386. myElement.style.width = myElement.style.height = "100%";
  15387. myElement.style.left = myElement.style.top = '0';
  15388. myElement.src = src
  15389. div.appendChild(exit);
  15390. div.appendChild(myElement)
  15391. if(g_bgAudio && !g_bgAudio.paused){
  15392. manage.switchBgmState(false);
  15393. g_bgAudio.pauseByHot = true
  15394. }
  15395. if(g_tourAudio)g_tourAudio.pause()
  15396. }
  15397. return;
  15398. }
  15399. if(settings.dontExamHot || this.actionType == 'dontExam'){
  15400. o();
  15401. return;
  15402. }
  15403. if(!player.currentPano)return;
  15404. var i = document.getElementById("popup");
  15405. if (this.link && !options.dontOpen) {
  15406. g_currentHot = this,
  15407. i.style.display = "block",
  15408. i.classList.add("wait");
  15409. var n = document.createElement("iframe");
  15410. if(g_bgAudio && !g_bgAudio.paused){
  15411. manage.switchBgmState(false);
  15412. g_bgAudio.pauseByHot = true
  15413. }
  15414. if(g_tourAudio)g_tourAudio.pause()
  15415. var src = getLink(this.link )
  15416. n.src = src;
  15417. n.id = "id1",
  15418. n.allowTransparency = "true";
  15419. var a = document.getElementById("id1");
  15420. if (void 0 === a || null == a) {
  15421. document.querySelector(".popup-content").appendChild(n);
  15422. var s = !1;
  15423. window.loaddingSuccess = function() {
  15424. s = !0
  15425. }
  15426. ,
  15427. setTimeout(function e() {
  15428. if (s) {
  15429. var t = document.querySelector("#id1").contentWindow.document;
  15430. t.querySelector("video") && (t.querySelector("video").play(),
  15431. !t.querySelector("video").paused && t.querySelector(".playPause") && t.querySelector(".playPause").classList.add("fa-pause")),
  15432. t.querySelector("audio") && t.querySelector("audio").play()
  15433. } else
  15434. setTimeout(e, 300)
  15435. }, 800)
  15436. }
  15437. }
  15438. var l = e.mode
  15439. , c = m.tags.navigate.nearestPano && this.closestPanoTowardTag(l, e.currentPano) || e.currentPano
  15440. , h = this.mesh.position;
  15441. e.flyingToTag = !0;
  15442. var u = function() {
  15443. e.flyingToTag = !1;
  15444. options.dontOpen || this.link && i.classList.remove("wait")
  15445. }
  15446. .bind(this);
  15447. if (l === v.PANORAMA) {
  15448. var d = {
  15449. pano: c,
  15450. lookAtPoint: h,
  15451. duration: options.duration,
  15452. maxDistanceOverride: null,
  15453. skipWarpingCheck: !1,
  15454. aimDuration: options.aimDuration,
  15455. };
  15456. e.flyToPano(d, u)
  15457. } else {
  15458. var p = {
  15459. pano: c
  15460. };
  15461. if (h) {
  15462. var f = (new g.Matrix4).lookAt(c.position, h, new g.Vector3(0,1,0));
  15463. p.quaternion = (new g.Quaternion).setFromRotationMatrix(f)
  15464. }
  15465. p.callback = u,
  15466. p.duration = options.duration || 1500,
  15467. p.mode = v.PANORAMA,
  15468. p.aimDuration = options.aimDuration
  15469. e.flyToNewMode(p)
  15470. }
  15471. }
  15472. ,
  15473. n.prototype.dispose = function(){
  15474. this.mesh.parent.remove(this.mesh);
  15475. var index = g_HotMeshes.indexOf(this.mesh);
  15476. g_HotMeshes.splice(index,1)
  15477. }
  15478. /* n.prototype.conversionArray = function(e) {
  15479. if ("[object Array]" == Object.prototype.toString.call(e))
  15480. return e;
  15481. var t = [];
  15482. for (var i in e)
  15483. t.push(parseFloat(e[i]));
  15484. return t
  15485. } */
  15486. n.prototype.convertValue = function(v ,Type){
  15487. var value;
  15488. if(v instanceof Array){
  15489. v.forEach((v1)=>{v1 = parseFloat(v1)})
  15490. value = new Type().fromArray(v);
  15491. }else{
  15492. for(let i in v){v[i] = parseFloat(v[i])}
  15493. value = new Type().copy(v);
  15494. }
  15495. return value
  15496. }
  15497. ,
  15498. t.exports = n
  15499. }
  15500. , {
  15501. three: 217,
  15502. "../shaders": 167,
  15503. "../enum/Viewmode": 51,
  15504. "../objects/Panorama": 148,
  15505. "../util/texture": 194,
  15506. "../settings": 166,
  15507. "../util/math": 190,
  15508. }],
  15509. 123: [function(M, R, e) {
  15510. (function(e) {
  15511. "use strict";
  15512. function d(e, t, i) {
  15513. var n = i.version || "0";
  15514. "0" !== n && w.info("tag defined using version " + n),
  15515. this.model = e,
  15516. this.sid = t,
  15517. this.color = (new f.Color).set(i.color || o.tagDefault),
  15518. this.hoverColor = o._darken(this.color, .2),
  15519. this.floor = null,
  15520. this.floorIndex = i.floor,
  15521. this.mode = m.PANORAMA,
  15522. i.preferred_camera && i.preferred_camera.mode && (this.mode = i.preferred_camera.mode),
  15523. this.obj3d = null,
  15524. this.disc = null,
  15525. this.materials = {
  15526. disc: null,
  15527. pole: null
  15528. },
  15529. this.position = (new f.Vector3).copy(i.position),
  15530. this.discPosition = (new f.Vector3).copy(i.stem.direction),
  15531. this.discWorldPosition = null,
  15532. this.discScale = .05,
  15533. this.poleEnabled = i.stem.enabled,
  15534. this.billboard = new r(i.label,i.description,i.media,this),
  15535. this.visibleTransition = null,
  15536. this.hoveringDisc = !1
  15537. }
  15538. 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"),
  15539. 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);
  15540. d.prototype = Object.create(b.prototype),
  15541. d.raycaster = new f.Raycaster,
  15542. d.prototype.bindEvents = function() {
  15543. this.billboard.on(_.ENTER, this.setHoverState.bind(this)),
  15544. this.billboard.on(_.LEAVE, this.setFreeState.bind(this))
  15545. }
  15546. ,
  15547. d.prototype.build = function() {
  15548. return this.floor = this.model.floors.get(this.floorIndex) || this.model.floors.first(),
  15549. this.floor && (this.billboard.build(this.model.sid),
  15550. this.obj3d = this.buildObject3D(),
  15551. this.floor.add(this.obj3d)),
  15552. this
  15553. }
  15554. ,
  15555. d.prototype.buildObject3D = function() {
  15556. var e = new f.Object3D;
  15557. e.position.copy(this.position);
  15558. var t = f.UniformsUtils.clone(A.tagDisc.uniforms);
  15559. t.bg.value = x,
  15560. t.mask.value = T,
  15561. t.color.value.copy(this.color),
  15562. this.materials.disc = new f.RawShaderMaterial({
  15563. transparent: !0,
  15564. vertexShader: A.tagDisc.vertexShader,
  15565. fragmentShader: A.tagDisc.fragmentShader,
  15566. uniforms: t
  15567. }),
  15568. this.disc = new f.Mesh(S,this.materials.disc),
  15569. this.disc.layers.set(a.TAG),
  15570. this.disc.position.copy(this.discPosition),
  15571. this.disc.renderOrder = s.tagDisc;
  15572. var i = (this.disc.tag = this).buildPole();
  15573. return i.layers.set(a.TAG),
  15574. i.renderOrder = s.tagStem,
  15575. e.add(i),
  15576. e.layers.set(a.TAG),
  15577. e.add(this.disc)
  15578. }
  15579. ,
  15580. d.prototype.buildPole = function() {
  15581. var e = new f.BufferGeometry
  15582. , t = new Float32Array(6);
  15583. return t[0] = t[1] = t[2] = 0,
  15584. t[3] = this.discPosition.x,
  15585. t[4] = this.discPosition.y,
  15586. t[5] = this.discPosition.z,
  15587. e.addAttribute("position", new f.BufferAttribute(t,3)),
  15588. this.materials.pole = new f.LineBasicMaterial({
  15589. linewidth: g.tags.pole.width,
  15590. color: g.tags.pole.color,
  15591. opacity: 0,
  15592. visible: this.poleEnabled,
  15593. transparent: !0,
  15594. depthWrite: !1
  15595. }),
  15596. new f.Line(e,this.materials.pole)
  15597. }
  15598. ,
  15599. d.prototype.setFreeState = function(e) {
  15600. !e && this.hoveringDisc || this.billboard.close(e).then(function() {
  15601. this.materials.disc.uniforms.color.value = this.color
  15602. }
  15603. .bind(this))
  15604. }
  15605. ,
  15606. d.prototype.setHoverState = function(e) {
  15607. this.billboard.open(e),
  15608. this.materials.disc.uniforms.color.value = this.hoverColor
  15609. }
  15610. ,
  15611. d.prototype.hide = function(e, t) {
  15612. var i = $.Deferred();
  15613. if (0 === this.materials.disc.uniforms.opacity.value && !C.isRunning(this.visibleTransition))
  15614. return i.resolve().promise();
  15615. e = e || 0,
  15616. t = t || 0,
  15617. C.cancel(this.visibleTransition);
  15618. var n, r, o, a = this.materials.disc.uniforms.opacity.value / g.tags.disc.opacity, s = t + e, l = t / s;
  15619. return this.visibleTransition = C.start((n = this,
  15620. r = I.property(n.materials.disc.uniforms.opacity, "value", 0),
  15621. o = I.property(n.materials.pole, "opacity", 0),
  15622. function(e) {
  15623. r(e),
  15624. n.materials.pole && o(e)
  15625. }
  15626. ), s * a, function() {
  15627. i.resolve()
  15628. }, l, E[g.warp.blendEasing]),
  15629. i.promise()
  15630. }
  15631. ,
  15632. d.prototype.show = function(e, t) {
  15633. var i = $.Deferred();
  15634. if (this.materials.disc.uniforms.opacity.value === g.tags.disc.opacity && !C.isRunning(this.visibleTransition))
  15635. return i.resolve().promise();
  15636. e = e || 0,
  15637. t = t || 0,
  15638. C.cancel(this.visibleTransition);
  15639. 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;
  15640. return this.visibleTransition = C.start((n = this,
  15641. r = I.property(n.materials.disc.uniforms.opacity, "value", g.tags.disc.opacity),
  15642. o = I.property(n.materials.pole, "opacity", g.tags.pole.opacity),
  15643. function(e) {
  15644. r(e),
  15645. n.materials.pole && o(e)
  15646. }
  15647. ), s * a, function() {
  15648. i.resolve()
  15649. }, l, E[g.warp.blendEasing]),
  15650. i.promise()
  15651. }
  15652. ,
  15653. d.prototype.closestPanoTowardTag = function(e, t) {
  15654. var i = []
  15655. , n = []
  15656. , r = this.disc.getWorldPosition();
  15657. if (e === m.PANORAMA) {
  15658. var o = t.position.clone().sub(r).normalize();
  15659. i.push(y.filters.isPanoAligned()),
  15660. i.push(y.filters.inPanoDirection(r, o, .5)),
  15661. i.push(y.filters.isNeighbourPanoTo(t)),
  15662. n.push(y.scoreFunctions.direction(r, o))
  15663. }
  15664. var a = new f.Vector3;
  15665. i.push(function(e) {
  15666. return Math.abs(e.position.x - r.x) > g.tags.visibility.cameraClearance || Math.abs(e.position.z - r.z) > g.tags.visibility.cameraClearance
  15667. }, function(e) {
  15668. a.copy(r).sub(e.position);
  15669. var t = -f.Math.radToDeg(Math.atan(a.y / Math.sqrt(a.x * a.x + a.z * a.z)))
  15670. , i = g.tags.navigate.tiltTolerance;
  15671. return g.insideLookLimitDown - i < t && t < g.insideLookLimitUp + i
  15672. }),
  15673. n.push(y.scoreFunctions.distanceSquared(this, -2));
  15674. var s = this.model.panos.sortByScore(i, n);
  15675. if (g.tags.navigate.lineOfSight) {
  15676. for (var l = 0; l < s.length; l++) {
  15677. var c = s[l].pano
  15678. , h = c.position.distanceTo(r);
  15679. if (!g.tags.visibility.anyDistance && h > g.tags.visibility.visibleDistance)
  15680. return null;
  15681. d.raycaster.set(c.position, r.clone().sub(c.position).normalize());
  15682. var u = d.raycaster.intersectObjects(this.model.colliders);
  15683. if (0 === u.length || u[0].distance > h)
  15684. return c
  15685. }
  15686. return null
  15687. }
  15688. return 0 < s.length && s[0].pano
  15689. }
  15690. ,
  15691. d.prototype.examine = function(i) {
  15692. if(!player.currentPano)return;
  15693. var e = i.mode
  15694. , n = g.tags.navigate.nearestPano && this.closestPanoTowardTag(e, i.currentPano) || i.currentPano
  15695. , t = this.disc.getWorldPosition();
  15696. this.billboard.setActiveState();
  15697. var r = function() {
  15698. var e = this.billboard.getDimensions()
  15699. , t = new f.Vector3;
  15700. v.convertScreenPositionToNDC(e.left + e.width / 2, e.top + e.height / 2, t),
  15701. t.unproject(i.camera),
  15702. i.flyToPano({
  15703. pano: n,
  15704. lookAtPoint: t
  15705. })
  15706. }
  15707. .bind(this);
  15708. if (e === m.PANORAMA)
  15709. if (n !== i.currentPano) {
  15710. var o = {
  15711. pano: n,
  15712. lookAtPoint: t,
  15713. duration: null,
  15714. maxDistanceOverride: null,
  15715. skipWarpingCheck: !1
  15716. };
  15717. i.flyToPano(o, r)
  15718. } else
  15719. setTimeout(function() {
  15720. this.billboard.open().then(function() {
  15721. r()
  15722. })
  15723. }
  15724. .bind(this), 0);
  15725. else {
  15726. var a = {
  15727. pano: n
  15728. };
  15729. if (t) {
  15730. var s = (new f.Matrix4).lookAt(n.position, t, new f.Vector3(0,1,0));
  15731. a.quaternion = (new f.Quaternion).setFromRotationMatrix(s)
  15732. }
  15733. a.callback = r,
  15734. a.duration = 1500,
  15735. a.mode = m.PANORAMA,
  15736. i.flyToNewMode(a)
  15737. }
  15738. }
  15739. ,
  15740. d.prototype.update = (n = new f.Vector3,
  15741. function(e, t) {
  15742. this.discWorldPosition = this.disc.getWorldPosition(),
  15743. this.updateDisc(e, t),
  15744. this.billboard.needsUpdate() && (n.copy(this.discWorldPosition).project(t),
  15745. n.z < 1 && (n.y *= -1,
  15746. this.billboard.update(n, this.getDiscRadius(n, t))))
  15747. }
  15748. ),
  15749. d.prototype.updateDisc = (l = new f.Vector3,
  15750. c = new f.Vector3,
  15751. h = new f.Vector3,
  15752. u = new f.Vector3,
  15753. p = new f.Vector3,
  15754. function(e, t) {
  15755. var i = g.tags.visibility
  15756. , n = g.tags.disc.scale
  15757. , r = e === m.DOLLHOUSE || e === m.FLOORPLAN ? g.tags.visibility.visibleDistance : t.position.distanceTo(this.discWorldPosition);
  15758. 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)),
  15759. this.obj3d.visible) {
  15760. this.disc.quaternion.copy(t.quaternion);
  15761. var o = n.maxSize - (n.maxSize - n.minSize) * f.Math.smoothstep(r, n.nearBound, n.farBound);
  15762. l.copy(this.discWorldPosition).project(t),
  15763. c.set($("#player").width() / 2, $("#player").height() / 2, 1).multiply(l),
  15764. h.set(o / 2, 0, 0).add(c),
  15765. u.set(2 / $("#player").width(), 2 / $("#player").height(), 1).multiply(h),
  15766. p.copy(u).unproject(t);
  15767. var a = p.distanceTo(this.discWorldPosition)
  15768. , s = 1 + g.tags.disc.scale.responsiveness / 100 * (d.viewportScale() - 1);
  15769. this.discScale = a * s,
  15770. this.disc.scale.set(this.discScale, this.discScale, this.discScale)
  15771. }
  15772. }
  15773. ),
  15774. d.prototype.getDiscRadius = (i = new f.Vector3,
  15775. function(e, t) {
  15776. return i.set(-this.discScale / 2, 0, 0).applyQuaternion(t.quaternion).add(this.discWorldPosition).project(t),
  15777. Math.abs(e.x - i.x) * $("#player").width()
  15778. }
  15779. ),
  15780. d.prototype.tagVisibleOnCurrentFloor = function(e) {
  15781. return !(e === m.DOLLHOUSE || e === m.FLOORPLAN) || this.model.allFloorsVisible || !this.floor.hidden
  15782. }
  15783. ,
  15784. d.prototype.offScreen = function(e, t) {
  15785. var i = e.getWorldPosition().project(t);
  15786. return !(-1 < i.x && i.x < 1 && -1 < i.y && i.y < 1)
  15787. }
  15788. ,
  15789. d.viewportScale = function() {
  15790. return d.viewportWidth === $("#player").width() && d.viewportHeight === $("#player").height() || (d.viewportWidth = $("#player").width(),
  15791. d.viewportHeight = $("#player").height(),
  15792. d.currentViewportScale = Math.sqrt(Math.min(d.viewportWidth, d.viewportHeight) / g.tags.disc.scale.baseViewportSize)),
  15793. d.currentViewportScale
  15794. }
  15795. ,
  15796. R.exports = d
  15797. }
  15798. ).call(this, "/js/tag/tag.js")
  15799. }
  15800. , {
  15801. "../enum/Colors": 19,
  15802. "../enum/RenderLayers": 41,
  15803. "../enum/RenderOrder": 42,
  15804. "../enum/Viewmode": 51,
  15805. "../objects/Panorama": 148,
  15806. "../settings": 166,
  15807. "../shaders": 167,
  15808. "../util/common": 185,
  15809. "../util/easing": 186,
  15810. "../util/lerp": 188,
  15811. "../util/logger": 189,
  15812. "../util/math": 190,
  15813. "../util/texture": 194,
  15814. "../util/transitions": 195,
  15815. "./Billboard/Billboard": 119,
  15816. "./Billboard/BillboardEvent": 120,
  15817. events: 202,
  15818. three: 217
  15819. }],
  15820. 124: [function(M, R, e) {
  15821. (function(e) {
  15822. "use strict";
  15823. function t() {
  15824. this.tagState = T.IDLE,
  15825. this.intersectTag = null,
  15826. this.hoveredTag = null,
  15827. this.activeTag = null,
  15828. this.tagDiscs = [],
  15829. this.raycaster = new i.Raycaster,
  15830. this.modelManager = null,
  15831. this.player = null,
  15832. this.totaltags = 0,
  15833. this.navigatingViaTag = !1,
  15834. this.enabled = !1
  15835. }
  15836. 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"),
  15837. M("../enum/TagStates")), x = M("events").EventEmitter, S = new n(e);
  15838. r.extend(t, x),
  15839. t.prototype.init = function(e, t) {
  15840. this.modelManager = e,
  15841. this.player = t,
  15842. this.updateModel(),
  15843. this.bindEvents()
  15844. }
  15845. ,
  15846. t.prototype.update = function(e) {
  15847. this.updateTags(this.player.mode, this.player.camera, this.player.currentPano, this.player.flying)
  15848. }
  15849. ,
  15850. t.prototype.updateTags = function(e, t, i, n) {
  15851. for (var r in this.model.tags)
  15852. this.model.tags[r].update(e, t, i, n)
  15853. }
  15854. ,
  15855. t.prototype.updateModel = function() {
  15856. this.model = this.modelManager.getActiveModel(),
  15857. this.gettagsFromModel(),
  15858. this.totaltags = Object.keys(this.model.tags).length
  15859. }
  15860. ,
  15861. t.prototype.gettagsFromModel = function() {
  15862. for (var e in this.tagDiscs = [],
  15863. this.model.tags) {
  15864. var t = this.model.tags[e].disc;
  15865. t && this.tagDiscs.push(t)
  15866. }
  15867. }
  15868. ,
  15869. t.prototype.bindEvents = function() {
  15870. function e() {
  15871. Object.keys(this.model.tags).forEach(function(e) {
  15872. var t = this.model.tags[e];
  15873. t.bindEvents(),
  15874. t.billboard.on(y.LINK_CLICK, function(e) {
  15875. e.type === A.NAVIGATION && this.navigateViaLink(e.url)
  15876. }
  15877. .bind(this)),
  15878. t.billboard.on(y.IMAGE_OPENED, function() {
  15879. this.tagState = T.EXAMINE,
  15880. this.emit(y.IMAGE_OPENED)
  15881. }
  15882. .bind(this)),
  15883. t.billboard.on(v.CLOSING, this.dismissExaminedTag.bind(this))
  15884. }
  15885. .bind(this))
  15886. }
  15887. this.modelManager.on(_.ActiveModelChanged, this.updateModel.bind(this)),
  15888. this.modelManager.on(_.ActiveModelChanged, e.bind(this)),
  15889. this.player.on(w.ModeChanging, this.onPlayerModeChanging.bind(this)),
  15890. this.player.on(w.PanoChosen, this.onPanoChange.bind(this)),
  15891. this.player.on(w.Ready, this.onPlayerReady.bind(this)),
  15892. this.player.on(w.FlyingEnded, this.onPlayerFlyingEnded.bind(this)),
  15893. this.player.on(w.WarpStarted, this.handleWarpStart.bind(this)),
  15894. this.player.on(w.WarpInterrupted, this.handleWarpInterruption.bind(this)),
  15895. e.call(this)
  15896. }
  15897. ,
  15898. t.prototype.navigateViaLink = function(e) {
  15899. var t = a.deserialize(e);
  15900. if (t)
  15901. if (t.mode === C.PANORAMA) {
  15902. try {
  15903. this.player.model.panos.get(t.panoId)
  15904. } catch (e) {
  15905. return void S.warn("Unable to find panorama location", t.panoId)
  15906. }
  15907. this.player.warpToPanoById(t.panoId, t.quaternion, null, null, I.BLACK)
  15908. } else {
  15909. var i = {
  15910. cameraMode: t.mode,
  15911. position: t.position,
  15912. quaternion: t.quaternion,
  15913. scanId: t.panoId,
  15914. orthoZoom: t.zoom,
  15915. floorVisibility: t.floorVisibility,
  15916. thumbUrl: null,
  15917. name: null
  15918. };
  15919. this.player.flyToNewMode({
  15920. mode: t.mode,
  15921. duration: m.warp.outsideTime,
  15922. warpDest: new g(i),
  15923. force: !0
  15924. })
  15925. }
  15926. }
  15927. ,
  15928. t.prototype.handleWarpStart = function(e, t, i, n) {
  15929. this.dismissExaminedTag(),
  15930. t === I.BLACK && (null != n || (n = m.warp.teleportTime),
  15931. e && (i = E.END),
  15932. this.hideShowTagsForBlackoutStyle(i, n))
  15933. }
  15934. ,
  15935. t.prototype.handleWarpInterruption = function(e, t, i) {
  15936. null != i || (i = m.warp.teleportTime),
  15937. this.hideShowTagsForBlackoutStyle(t, i)
  15938. }
  15939. ,
  15940. t.prototype.hideShowTagsForBlackoutStyle = function(e, t) {
  15941. var i = 0
  15942. , n = 0
  15943. , r = t / 2;
  15944. switch (null != e || (e = E.MIDDLE),
  15945. e) {
  15946. case E.END:
  15947. this.hideAlltags(r);
  15948. break;
  15949. case E.BEGINNING:
  15950. this.hideAlltags().done(this.showAlltags.bind(this, r));
  15951. break;
  15952. case E.NONE:
  15953. break;
  15954. case E.MIDDLE:
  15955. n = i = r,
  15956. this.hideAlltags(n),
  15957. setTimeout(function() {
  15958. this.showAlltags(i)
  15959. }
  15960. .bind(this), n);
  15961. break;
  15962. case E.FADEIN:
  15963. setTimeout(function() {
  15964. this.showAlltags(r)
  15965. }
  15966. .bind(this), r)
  15967. }
  15968. }
  15969. ,
  15970. t.prototype.onPlayerModeChanging = function(e, t) {
  15971. t !== C.PANORAMA && this.dismissExaminedTag(),
  15972. t === C.PANORAMA && player.currentPano && !player.currentPano.isAligned() && (t = C.OUTDOOR);
  15973. var i = t !== C.OUTDOOR;
  15974. i !== this.model.tagsShown && (i ? this.showAlltags(m.tags.startup.fadeInDuration) : this.hideAlltags(m.tags.startup.fadeInDuration))
  15975. }
  15976. ,
  15977. t.prototype.onPanoChange = function(e, t) {
  15978. var i = this.navigatingViaTag;
  15979. if (this.navigatingViaTag = !1,
  15980. !i) {
  15981. this.dismissExaminedTag();
  15982. var n = e && !e.isAligned() ? C.OUTDOOR : C.PANORAMA
  15983. , r = t && !t.isAligned() ? C.OUTDOOR : C.PANORAMA;
  15984. n !== r && (r === C.PANORAMA ? this.showAlltags(m.tags.startup.fadeInDuration, null, !0) : this.hideAlltags(m.tags.startup.fadeInDuration))
  15985. }
  15986. }
  15987. ,
  15988. t.prototype.onPlayerReady = function(e, t, i) {
  15989. this.startAlltags(e, t ? i : null)
  15990. }
  15991. ,
  15992. t.prototype.onPlayerFlyingEnded = function(e, t) {
  15993. this.updateClosestTags(e)
  15994. }
  15995. ,
  15996. t.prototype.dismissExaminedTag = function() {
  15997. this.activeTag && this.tagState === T.EXAMINE && this.dismissActiveTag(),
  15998. this.hoveredTag && (this.hoveredTag.setFreeState(!0),
  15999. this.hoveredTag = null)
  16000. }
  16001. ,
  16002. t.prototype.startAlltags = function(e, t) {
  16003. this.model.shouldShowtags = m.tags.enabled,
  16004. this.enabled = !0,
  16005. e || (this.showAlltags(m.tags.startup.fadeInDuration, m.tags.startup.fadeInDelay),
  16006. t && setTimeout(function() {
  16007. this.activateTag(this.model.getTagBySid(t))
  16008. }
  16009. .bind(this), m.tags.startup.fadeInDuration / 2))
  16010. }
  16011. ,
  16012. t.prototype.showAlltags = function(e, t, i) {
  16013. function n() {
  16014. ++o === this.totaltags && (this.model.tagsShown = !0,
  16015. r.resolve())
  16016. }
  16017. var r = $.Deferred();
  16018. if (!i && this.player.mode === C.PANORAMA && this.player.currentPano && !this.player.currentPano.isAligned() || !this.model.shouldShowtags)
  16019. return r.resolve().promise();
  16020. var o = 0;
  16021. for (var a in this.model.tags) {
  16022. this.model.tags[a].show(e, t).done(n.bind(this))
  16023. }
  16024. return r.promise()
  16025. }
  16026. ,
  16027. t.prototype.hideAlltags = function(e, t) {
  16028. function i() {
  16029. ++r === this.totaltags && (this.model.tagsShown = !1,
  16030. n.resolve())
  16031. }
  16032. var n = $.Deferred()
  16033. , r = 0;
  16034. for (var o in this.model.tags) {
  16035. var a = this.model.tags[o];
  16036. a.hide(e, t).done(i.bind(this)),
  16037. a === this.activeTag && this.dismissActiveTag()
  16038. }
  16039. return n.promise()
  16040. }
  16041. ,
  16042. t.prototype.enableHovering = function() {
  16043. this.enabled = !0
  16044. }
  16045. ,
  16046. t.prototype.disableHovering = function() {
  16047. this.enabled = !1
  16048. }
  16049. ,
  16050. t.prototype.activateTag = function(e, t) {
  16051. t = t || T.EXAMINE,
  16052. this.activeTag = e,
  16053. this.activeTag.hoveringDisc = !0,
  16054. this.activeTag.setHoverState(t === T.EXAMINE),
  16055. this.tagState = t,
  16056. this.emit(b.TagActivated, e)
  16057. }
  16058. ,
  16059. t.prototype.dismissActiveTag = function() {
  16060. this.activeTag.hoveringDisc = !1,
  16061. this.activeTag.setFreeState(!0);
  16062. var e = this.activeTag;
  16063. this.activeTag = null,
  16064. this.tagState = T.IDLE,
  16065. this.emit(b.TagDismissed, e)
  16066. }
  16067. ,
  16068. t.prototype.clickedOnTag = function(e) {
  16069. var t = function() {
  16070. this.navigatingViaTag = !0,
  16071. this.activeTag.examine(this.player),
  16072. this.emit(b.TagNavigation, this.activeTag)
  16073. }
  16074. .bind(this);
  16075. return this.tagState !== T.EXAMINE ? (this.activateTag(this.intersectTag, T.EXAMINE),
  16076. this.activeTag = this.intersectTag,
  16077. t(),
  16078. !0) : (this.dismissActiveTag(),
  16079. !1)
  16080. }
  16081. ,
  16082. t.prototype.intersecttag = (s = new i.Vector3,
  16083. l = new i.Vector3,
  16084. c = new i.Vector3,
  16085. function(e, t, i) {
  16086. if (!this.enabled)
  16087. return null;
  16088. var n = null
  16089. , r = this.tagDiscs.filter(function(e) {
  16090. return e.parent.visible
  16091. });
  16092. if (0 < r.length) {
  16093. var o = this.model.floors.reduce(function(e, t) {
  16094. return t.hidden ? e : e.concat(t.collider.children)
  16095. }, r);
  16096. s.set(e.x, e.y, -1).unproject(i),
  16097. l.set(e.x, e.y, 1).unproject(i),
  16098. c.copy(l).sub(s).normalize(),
  16099. this.raycaster.set(s, c);
  16100. var a = this.raycaster.intersectObjects(o);
  16101. 0 < a.length && -1 !== r.indexOf(a[0].object) && (n = a[0].object.tag)
  16102. }
  16103. return this.intersectTag = n,
  16104. t && (this.activeTag && n !== this.activeTag && (this.tagState === T.BROWSE || this.tagState === T.EXAMINE && n) && this.dismissActiveTag(),
  16105. n && n !== this.activeTag && (n.listeners(v.ENTER).length < 1 && (n.billboard.on(v.ENTER, function() {
  16106. this.hoveredTag = n
  16107. }
  16108. .bind(this)),
  16109. n.billboard.on(v.LEAVE, function() {
  16110. this.hoveredTag = null
  16111. }
  16112. .bind(this))),
  16113. this.activateTag(n, T.BROWSE))),
  16114. n
  16115. }
  16116. ),
  16117. t.prototype.rankedtagInDirection = (h = [],
  16118. u = [],
  16119. d = new i.Vector3,
  16120. p = new i.Vector3,
  16121. f = new i.Vector3,
  16122. function(e, t, i, n) {
  16123. for (var r = 0, o = u.length = 0; o < this.closesttags.length; o++) {
  16124. var a = this.closesttags[o];
  16125. p.copy(a.position),
  16126. p.add(a.discPosition),
  16127. d.copy(t),
  16128. d.sub(p).negate(),
  16129. d.normalize();
  16130. var s = d.dot(n);
  16131. if (0 <= s && (f.copy(p),
  16132. f.project(i),
  16133. this.intersecttag(f, !1, i))) {
  16134. if (r >= h.length)
  16135. for (var l = 0; l < 64; l++)
  16136. h.push({
  16137. tag: a,
  16138. dot: s
  16139. });
  16140. var c = h[r];
  16141. c.tag = a,
  16142. c.dot = s,
  16143. c.position = math.projectPositionToCanvas(p, i),
  16144. u.push(c),
  16145. r++
  16146. }
  16147. }
  16148. return u.sort(function(e, t) {
  16149. return e.dot > t.dot ? -1 : e.dot < t.dot ? 1 : 0
  16150. }),
  16151. e < u.length ? u[e].tag : null
  16152. }
  16153. ),
  16154. t.prototype.updateClosestTags = (o = new i.Vector3,
  16155. function(e) {
  16156. this.closesttags || (this.closesttags = []),
  16157. this.closesttags.length = 0;
  16158. var t = this.model.tags;
  16159. if (t)
  16160. for (var i in t)
  16161. if (t.hasOwnProperty(i)) {
  16162. var n = t[i]
  16163. , r = n.position;
  16164. o.copy(e),
  16165. o.sub(r).negate(),
  16166. o.lengthSq() < 30 && this.closesttags.push(n)
  16167. }
  16168. }
  16169. ),
  16170. R.exports = t
  16171. }
  16172. ).call(this, "/js/tag/tagManager.js")
  16173. }
  16174. , {
  16175. "../controls/serializer": 14,
  16176. "../enum/BlackoutStyle": 18,
  16177. "../enum/tagEvents": 32,
  16178. "../enum/ModelManagerEvents": 33,
  16179. "../enum/PlayerEvents": 40,
  16180. "../enum/TagStates": 44,
  16181. "../enum/Viewmode": 51,
  16182. "../enum/WarpStyle": 52,
  16183. "../objects/Snapshot": 153,
  16184. "../settings": 166,
  16185. "../util/common": 185,
  16186. "../util/lerp": 188,
  16187. "../util/logger": 189,
  16188. "./Billboard/BillboardEvent": 120,
  16189. "./Media/LinkType": 130,
  16190. "./Media/MediaEvent": 131,
  16191. events: 202,
  16192. three: 217
  16193. }],
  16194. 125: [function(r, o, e) {
  16195. (function(e) {
  16196. "use strict";
  16197. function t() {
  16198. this.embedWrapper = null,
  16199. this.embedElement = null
  16200. }
  16201. var i = r("../../util/ajax")
  16202. , a = r("./mediaSettings")
  16203. , n = r("../../settings")
  16204. , s = new (r("../../util/logger"))(e);
  16205. t.prototype.createDomElement = function() {
  16206. return this.embedWrapper = document.createElement("div"),
  16207. this.embedWrapper.classList.add("tag-embed"),
  16208. this.embedWrapper.classList.add("hidden"),
  16209. this.embedWrapper
  16210. }
  16211. ,
  16212. t.prototype.load = function(e) {
  16213. var t = "https://api.embedly.com/1/oembed?key=" + n.appConfig.embedly_key + "&url=" + encodeURIComponent(e) + "&maxwidth=" + a.maxEmbedWidth;
  16214. return new Promise(function(r, o) {
  16215. i.get(t).then(function(e) {
  16216. if ((e = JSON.parse(e)).html && -1 === e.html.indexOf("<script")) {
  16217. this.embedWrapper.innerHTML = e.html;
  16218. var t = Math.min(e.width, a.maxEmbedWidth) || a.maxEmbedWidth;
  16219. if (this.embedWrapper.style.width = t + "px",
  16220. e.height) {
  16221. var i = e.height / e.width;
  16222. this.embedWrapper.style.height = t * i + "px"
  16223. }
  16224. this.embedElement = this.embedWrapper.firstChild;
  16225. var n = [];
  16226. try {
  16227. n = [].slice.call(this.embedElement.querySelectorAll("a"))
  16228. } catch (e) {
  16229. s.debug("Error getting `a` elements for embed; was it an iframe?")
  16230. }
  16231. n.forEach(function(e) {
  16232. e.setAttribute("target", "_blank")
  16233. }),
  16234. this.embedElement.classList.add("hidden"),
  16235. this.embedWrapper.classList.remove("hidden"),
  16236. r()
  16237. } else
  16238. o("Not a valid embed")
  16239. }
  16240. .bind(this), function(e) {
  16241. o(e.response)
  16242. })
  16243. }
  16244. .bind(this))
  16245. }
  16246. ,
  16247. t.prototype.show = function() {
  16248. this.embedElement && this.embedElement.classList.remove("hidden")
  16249. }
  16250. ,
  16251. t.prototype.hide = function() {
  16252. this.embedElement && this.embedElement.classList.add("hidden")
  16253. }
  16254. ,
  16255. o.exports = t
  16256. }
  16257. ).call(this, "/js/tag/Media/EmbedlyEmbed.js")
  16258. }
  16259. , {
  16260. "../../settings": 166,
  16261. "../../util/ajax": 181,
  16262. "../../util/logger": 189,
  16263. "./mediaSettings": 132
  16264. }],
  16265. 126: [function(a, s, e) {
  16266. (function(e) {
  16267. "use strict";
  16268. function t(e) {
  16269. r.call(this),
  16270. this.options = e,
  16271. this.playerControls = null,
  16272. this.state = o.NOT_READY
  16273. }
  16274. var i, n = a("../../util/browser"), r = a("./EmbedlyEmbed"), o = (new (a("../../util/logger"))(e),
  16275. Object.freeze({
  16276. NOT_READY: "player.not.ready",
  16277. CUED: "player.cued",
  16278. PLAYING: "player.playing",
  16279. PAUSED: "player.paused"
  16280. }));
  16281. (t.prototype = Object.create(r.prototype)).createDomElement = function() {
  16282. return this.embedWrapper = document.createElement("div"),
  16283. this.embedWrapper.classList.add("tag-video"),
  16284. this.embedWrapper.classList.add("hidden"),
  16285. this.embedWrapper
  16286. }
  16287. ,
  16288. t.prototype.load = function(e) {
  16289. var t = function() {
  16290. function e(e) {
  16291. this.playerState = e
  16292. }
  16293. this.playerControls = new playerjs.Player(this.embedElement),
  16294. this.playerControls.on("ready", function(e) {
  16295. this.playerState = o.CUED,
  16296. this.options.startMuted && this.playerControls.mute()
  16297. }
  16298. .bind(this)),
  16299. this.playerControls.on("play", e.bind(this, o.PLAYING)),
  16300. this.playerControls.on("pause", e.bind(this, o.PAUSED)),
  16301. this.playerControls.on("ended", function(e) {
  16302. this.playerControls.setCurrentTime(0),
  16303. this.options.loop ? this.playerControls.play() : this.playerControls.pause()
  16304. }
  16305. .bind(this))
  16306. }
  16307. .bind(this);
  16308. return r.prototype.load.call(this, e).then(t.bind(this))
  16309. }
  16310. ,
  16311. t.prototype.play = (i = n.isMobile(),
  16312. function() {
  16313. this.playerState !== o.NOT_READY && this.playerControls && !i && (this.state === o.CUED && this.options.autoPlay || this.options.autoResume) && this.playerControls.play()
  16314. }
  16315. ),
  16316. t.prototype.pause = function() {
  16317. this.playerState !== o.NOT_READY && this.playerControls && this.playerControls.pause()
  16318. }
  16319. ,
  16320. s.exports = t
  16321. }
  16322. ).call(this, "/js/tag/Media/EmbedlyPlayer.js")
  16323. }
  16324. , {
  16325. "../../util/browser": 182,
  16326. "../../util/logger": 189,
  16327. "./EmbedlyEmbed": 125
  16328. }],
  16329. 127: [function(t, i, e) {
  16330. (function(e) {
  16331. "use strict";
  16332. var r = t("../../util/ajax")
  16333. , o = new (t("./mediaSettings"),
  16334. t("../../util/logger"))(e)
  16335. , a = Promise.resolve();
  16336. i.exports.enqueue = function(i) {
  16337. function n() {}
  16338. return a = new Promise(function(e, t) {
  16339. a.catch(n).then(function() {
  16340. (o.debug("requesting file from embedly:", i.href),
  16341. r.get(i.href, {
  16342. responseType: i.responseType
  16343. }).then(function(e) {
  16344. return o.debug("requesting file finished:", i.href),
  16345. e
  16346. })).then(e, t)
  16347. })
  16348. }
  16349. )
  16350. }
  16351. }
  16352. ).call(this, "/js/tag/Media/EmbedlyQueue.js")
  16353. }
  16354. , {
  16355. "../../util/ajax": 181,
  16356. "../../util/logger": 189,
  16357. "./mediaSettings": 132
  16358. }],
  16359. 128: [function(s, l, e) {
  16360. (function(e) {
  16361. "use strict";
  16362. function t() {
  16363. this.imageWrapper = null,
  16364. this.width = 0,
  16365. this.height = 0,
  16366. this.aspect = 1
  16367. }
  16368. var i = s("./MediaEvent")
  16369. , n = s("./EmbedlyQueue")
  16370. , r = s("events").EventEmitter
  16371. , o = s("../../util/logger")
  16372. , a = s("../../settings");
  16373. new o(e),
  16374. (t.prototype = Object.create(r.prototype)).createDomElement = function() {
  16375. return this.imageWrapper = document.createElement("div"),
  16376. this.imageWrapper.classList.add("tag-image"),
  16377. this.imageWrapper.classList.add("hidden"),
  16378. this.imageWrapper.addEventListener("click", function(e) {
  16379. e.stopPropagation(),
  16380. this.emit(i.IMAGE_OPENING),
  16381. this.imageWrapper.style.pointerEvents = "none"
  16382. }
  16383. .bind(this)),
  16384. this.imageWrapper
  16385. }
  16386. ,
  16387. t.prototype.onClosed = function() {
  16388. this.imageWrapper.style.pointerEvents = "auto"
  16389. }
  16390. ,
  16391. t.prototype.load = function(e) {
  16392. var t = Math.max(window.screen.height, window.screen.width)
  16393. , i = "https://i.embed.ly/1/display/resize?key=" + a.appConfig.embedly_key + "&url=" + encodeURIComponent(e) + "&width=" + t + "&height=" + t;
  16394. return new Promise(function(o, e) {
  16395. n.enqueue({
  16396. href: i,
  16397. responseType: "arraybuffer"
  16398. }).then(function(e) {
  16399. var t = new Uint8Array(e)
  16400. , i = new Blob([t])
  16401. , n = new window.Image;
  16402. n.addEventListener("load", function(e) {
  16403. var t = e.target;
  16404. this.width = t.naturalWidth,
  16405. this.height = t.naturalHeight,
  16406. this.aspect = this.width / this.height;
  16407. var i = e.target.src;
  16408. this.imageWrapper.style.backgroundImage = 'url("' + i + '")',
  16409. this.imageWrapper.style.width = this.width + "px",
  16410. this.imageWrapper.style.height = this.height + "px",
  16411. this.imageWrapper.classList.remove("hidden"),
  16412. o()
  16413. }
  16414. .bind(this));
  16415. var r = URL.createObjectURL(i);
  16416. n.src = r
  16417. }
  16418. .bind(this), e)
  16419. }
  16420. .bind(this))
  16421. }
  16422. ,
  16423. l.exports = t
  16424. }
  16425. ).call(this, "/js/tag/Media/Image.js")
  16426. }
  16427. , {
  16428. "../../settings": 166,
  16429. "../../util/logger": 189,
  16430. "./EmbedlyQueue": 127,
  16431. "./MediaEvent": 131,
  16432. events: 202
  16433. }],
  16434. 129: [function(e, t, i) {
  16435. "use strict";
  16436. function n(e) {
  16437. this.label = e.label,
  16438. this.href = e.url,
  16439. this.type = this.updateLinkForType(),
  16440. this.domElement = null,
  16441. this.id = c++
  16442. }
  16443. var r = e("./LinkType")
  16444. , o = e("./MediaEvent")
  16445. , a = e("../../util/browser")
  16446. , s = e("../../analytics")
  16447. , l = e("events").EventEmitter
  16448. , c = 0;
  16449. (n.prototype = Object.create(l.prototype)).updateLinkForType = function() {
  16450. var e, t = a.valueFromHash("m") || a.valueFromHash("model");
  16451. 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,
  16452. new RegExp("[#&?]start=([^#&?]*)").exec(e)[1]),
  16453. r.NAVIGATION) : (this.href = this.href + "&play=1",
  16454. r.MODEL) : r.EXT_LINK
  16455. }
  16456. ;
  16457. var h = {};
  16458. n.prototype.createDomElement = function() {
  16459. if (this.domElement = document.createElement("a"),
  16460. this.domElement.classList.add("tag-link"),
  16461. this.domElement.textContent = this.label,
  16462. this.type === r.EXT_LINK) {
  16463. this.domElement.textContent += " ";
  16464. var e = document.createElement("i");
  16465. e.classList.add("icon-ext-link"),
  16466. e.title = "Link to external web site",
  16467. this.domElement.appendChild(e)
  16468. }
  16469. return this.domElement.addEventListener("click", function(e) {
  16470. switch (e.stopPropagation(),
  16471. h[this.id] = !0,
  16472. s.trackAlways("click_tag_link", {
  16473. link_type: this.type,
  16474. link_count: c,
  16475. links_clicked: Object.keys(h).length
  16476. }),
  16477. this.type) {
  16478. case r.MODEL:
  16479. window.location.replace(this.href);
  16480. break;
  16481. case r.EXT_LINK:
  16482. window.open(this.href, "_blank")
  16483. }
  16484. this.emit(o.LINK_CLICK, {
  16485. type: this.type,
  16486. url: this.href
  16487. })
  16488. }
  16489. .bind(this)),
  16490. this.domElement
  16491. }
  16492. ,
  16493. t.exports = n
  16494. }
  16495. , {
  16496. "../../analytics": 4,
  16497. "../../util/browser": 182,
  16498. "./LinkType": 130,
  16499. "./MediaEvent": 131,
  16500. events: 202
  16501. }],
  16502. 130: [function(e, t, i) {
  16503. "use strict";
  16504. t.exports = {
  16505. NAVIGATION: "navigation",
  16506. MODEL: "model",
  16507. EXT_LINK: "ext-link"
  16508. }
  16509. }
  16510. , {}],
  16511. 131: [function(e, t, i) {
  16512. "use strict";
  16513. t.exports = Object.freeze({
  16514. LINK_CLICK: "mtmedia.link",
  16515. IMAGE_LOADED: "mtmedia.image.loaded",
  16516. IMAGE_OPENING: "mtmedia.image.opening",
  16517. IMAGE_OPENED: "mtmedia.image.opened",
  16518. IMAGE_CLOSING: "mtmedia.image.closing",
  16519. IMAGE_CLOSED: "mtmedia.image.closed",
  16520. VIDEO_START: "mtmedia.video.start",
  16521. VIDEO_PAUSE: "mtmedia.video.pause",
  16522. VIDEO_ENDED: "mtmedia.video.end"
  16523. })
  16524. }
  16525. , {}],
  16526. 132: [function(e, t, i) {
  16527. "use strict";
  16528. t.exports = Object.freeze({
  16529. maxEmbedWidth: 350,
  16530. defaultAspectRatio: .75
  16531. })
  16532. }
  16533. , {}],
  16534. 133: [function(e, t, i) {
  16535. "use strict";
  16536. t.exports = Object.freeze({
  16537. TEXT: "text",
  16538. LINK: "link",
  16539. IMAGE: "photo",
  16540. VIDEO: "video",
  16541. RICH: "rich"
  16542. })
  16543. }
  16544. , {}],
  16545. 134: [function(e, t, i) {
  16546. "use strict";
  16547. function n(e) {
  16548. this.capabilities = {
  16549. links: {
  16550. enable: e.supportLinks,
  16551. keepLabels: e.keepLinkLabels
  16552. }
  16553. }
  16554. }
  16555. var r = e("./DescriptionChunkType");
  16556. n.prototype.parse = function(e, i) {
  16557. var n = [];
  16558. return e.split("[").map(function(e, t) {
  16559. return 0 === t ? e : "[" + e
  16560. }).forEach(function(e) {
  16561. var t = this.findMarkdown(e);
  16562. if (t) {
  16563. if (-1 !== t.url.indexOf("javascript:"))
  16564. return;
  16565. this.addLinkChunk(n, t, i),
  16566. this.addTextChunk(n, e.slice(t.markdown.length))
  16567. } else
  16568. this.addTextChunk(n, e)
  16569. }
  16570. .bind(this)),
  16571. n
  16572. }
  16573. ,
  16574. n.prototype.findMarkdown = function(e) {
  16575. var t = e.match(/\[([^\]]*)\]\((.*)\)/);
  16576. if (t) {
  16577. for (var i = t[2], n = 1, r = 0; r < i.length && ("(" === i[r] ? n++ : ")" === i[r] && n--,
  16578. 0 !== n); )
  16579. r++;
  16580. var o = i.length - r;
  16581. return {
  16582. markdown: t[0].substring(0, t[0].length - o),
  16583. label: t[1],
  16584. url: t[2].substring(0, r)
  16585. }
  16586. }
  16587. }
  16588. ,
  16589. n.prototype.addTextChunk = function(e, t) {
  16590. 0 !== t.length && e.push({
  16591. type: r.TEXT,
  16592. text: t
  16593. })
  16594. }
  16595. ,
  16596. n.prototype.addLinkChunk = function(e, t) {
  16597. if (this.capabilities.links.enable) {
  16598. var i = {
  16599. label: t.label,
  16600. url: t.url
  16601. };
  16602. -1 === i.url.indexOf("://") && (i.url = "http://" + i.url),
  16603. e.push({
  16604. type: r.LINK,
  16605. link: i
  16606. })
  16607. } else
  16608. this.capabilities.links.keepLabels && this.addTextChunk(e, t.label)
  16609. }
  16610. ,
  16611. t.exports = n
  16612. }
  16613. , {
  16614. "./DescriptionChunkType": 133
  16615. }],
  16616. 135: [function(t, r, e) {
  16617. (function(e) {
  16618. "use strict";
  16619. var i = new (t("../util/logger"))(e)
  16620. , n = {
  16621. parseIdsFromChunkName: function(e, t) {
  16622. t.floorId = n.parseFloor(e),
  16623. t.roomId = n.parseRoom(e)
  16624. },
  16625. parseFloor: function(e) {
  16626. var t = e.match(/_group([0-9]+)/);
  16627. if (!t)
  16628. return 0;
  16629. try {
  16630. return parseInt(t[1], 10)
  16631. } catch (e) {
  16632. return i.warn('Non-int value "' + t[1] + '" for mesh group, defaulting to floor 0'),
  16633. 0
  16634. }
  16635. },
  16636. parseRoom: function(e) {
  16637. var t = e.match(/_sub([0-9]+)/);
  16638. if (!t)
  16639. return -1;
  16640. try {
  16641. return parseInt(t[1], 10)
  16642. } catch (e) {
  16643. return i.warn('Non-int value "' + t[1] + '" for mesh subgroup, defaulting to subgroup 0'),
  16644. 0
  16645. }
  16646. }
  16647. };
  16648. r.exports = n
  16649. }
  16650. ).call(this, "/js/model/Chunks.js")
  16651. }
  16652. , {
  16653. "../util/logger": 189
  16654. }],
  16655. 136: [function(a, c, e) {
  16656. (function(e) {
  16657. "use strict";
  16658. function t(e) {
  16659. r.call(this),
  16660. this.model = e,
  16661. this.exploded = !1
  16662. }
  16663. var i = a("../objects/Floor")
  16664. , n = (a("../settings"),
  16665. a("../util/logger"))
  16666. , s = a("../util/transitions")
  16667. , r = a("../util/IndexedCollection")
  16668. , o = a("../util/common")
  16669. , l = a("../util/easing");
  16670. new n(e),
  16671. o.inherit(t, r),
  16672. t.prototype.add = function(e) {
  16673. r.prototype.add.call(this, e),
  16674. this.model.add(e)
  16675. }
  16676. ,
  16677. t.prototype.getIndex = function(e) {
  16678. return e.floorIndex
  16679. }
  16680. ,
  16681. t.prototype.build = function() {
  16682. this.list.forEach(function(e) {
  16683. e.build()
  16684. })
  16685. }
  16686. ,
  16687. t.prototype.size = function() {
  16688. return this.length
  16689. }
  16690. ,
  16691. t.prototype.sort = function() {
  16692. r.prototype.sort.call(this, function(e, t) {
  16693. return e.floorIndex - t.floorIndex
  16694. })
  16695. }
  16696. ,
  16697. t.prototype.nextFloor = function(e, t) {
  16698. return this.index[e.floorIndex + t] || null
  16699. }
  16700. ,
  16701. t.prototype.getFloorAtPoint = function(e) {
  16702. for (var t = null, i = 1 / 0, n = 0; n < this.list.length; n++) {
  16703. var r = this.list[n]
  16704. , o = r.distanceToPoint(e);
  16705. (!t || o < i) && (i = o,
  16706. t = r)
  16707. }
  16708. return t
  16709. }
  16710. ,
  16711. t.prototype.getOrMakeFloor = function(e) {
  16712. var t = this.index[e];
  16713. return t || (t = new i(this.model,e),
  16714. this.add(t)),
  16715. t
  16716. }
  16717. ,
  16718. t.prototype.hide = function() {
  16719. this.list.forEach(function(e) {
  16720. e.hide()
  16721. })
  16722. }
  16723. ,
  16724. t.prototype.show = function() {
  16725. this.list.forEach(function(e) {
  16726. e.show()
  16727. })
  16728. }
  16729. ,
  16730. t.prototype.names = function() {
  16731. return this.list.reduce(function(e, t) {
  16732. return e.concat(t.name)
  16733. }, [])
  16734. }
  16735. ,
  16736. t.prototype.toggleExplodeHorizontal = function() {
  16737. function i(e, t) {
  16738. a.copy(e.position),
  16739. e.position.x = r[e.floorIndex] * t,
  16740. e.position.y = 1 * e.floorIndex * t,
  16741. a.sub(e.position).multiplyScalar(-1),
  16742. e.panos.forEach(function(e) {
  16743. e.translate(a)
  16744. })
  16745. }
  16746. var n, r = [], o = 0;
  16747. this.list.forEach(function(e, t, i) {
  16748. n = 0 < t ? Math.max(i[t - 1].boundingBox.max.x - e.boundingBox.min.x, e.boundingBox.size().x / 2) : 0,
  16749. o += n,
  16750. r[t] = o
  16751. }),
  16752. r = r.map(function(e) {
  16753. return e - o / 2
  16754. });
  16755. var a = this.list[0].position.clone();
  16756. this.exploded ? this.list.forEach(function(t) {
  16757. s.start(function(e) {
  16758. i(t, 1 - e)
  16759. }, 1500, null, 0, l.easeOutExpo)
  16760. }) : this.list.forEach(function(t) {
  16761. s.start(function(e) {
  16762. i(t, e)
  16763. }, 1500, null, 0, l.easeOutExpo)
  16764. }),
  16765. this.exploded = !this.exploded
  16766. }
  16767. ,
  16768. t.prototype.toggleExplodeVertical = function() {
  16769. function i(e, t) {
  16770. var i = i.copy(e.position);
  16771. e.position.y = (5 * e.floorIndex - n.y / 2) * t,
  16772. i.sub(e.position).multiplyScalar(-1),
  16773. e.panos.forEach(function(e) {
  16774. e.translate(i)
  16775. })
  16776. }
  16777. var n = this.model.size;
  16778. this.list[0].position.clone(),
  16779. this.exploded ? this.list.forEach(function(t) {
  16780. s.start(function(e) {
  16781. i(t, 1 - e)
  16782. }, 1500, null, 0, l.easeOutExpo)
  16783. }) : this.list.forEach(function(t) {
  16784. s.start(function(e) {
  16785. i(t, e)
  16786. }, 1500, null, 0, l.easeOutExpo)
  16787. }),
  16788. this.exploded = !this.exploded
  16789. }
  16790. ,
  16791. c.exports = t
  16792. }
  16793. ).call(this, "/js/model/FloorCollection.js")
  16794. }
  16795. , {
  16796. "../objects/Floor": 146,
  16797. "../settings": 166,
  16798. "../util/IndexedCollection": 175,
  16799. "../util/common": 185,
  16800. "../util/easing": 186,
  16801. "../util/logger": 189,
  16802. "../util/transitions": 195
  16803. }],
  16804. 137: [function(r, o, e) {
  16805. (function(e) {
  16806. "use strict";
  16807. function h() {
  16808. n.call(this)
  16809. }
  16810. var u = r("../settings")
  16811. , t = r("../util/logger")
  16812. , d = r("../enum/Viewmode")
  16813. , p = r("../objects/Snapshot")
  16814. , i = (r("../util/math"),
  16815. r("../util/common"))
  16816. , n = r("../util/IndexedCollection")
  16817. , l = new t(e);
  16818. i.inherit(h, n),
  16819. h.prototype.getImage = function(e) {
  16820. return e && this.index.hasOwnProperty(e) ? this.index[e] : null
  16821. }
  16822. ,
  16823. h.prototype.filterByModesAndReel = function(e, t) {
  16824. for (var i = [], n = 0; n < t.length; n += 1) {
  16825. var r = t[n]
  16826. , o = this.index[r.sid];
  16827. o && i.push(o)
  16828. }
  16829. var a = e[d.DOLLHOUSE]
  16830. , s = e[d.FLOORPLAN];
  16831. (i = i.filter(function(e) {
  16832. if (!e.metadata || void 0 === e.metadata.camera_mode)
  16833. return !0;
  16834. var t;
  16835. try {
  16836. t = d.convertWorkshopModeInt(e.metadata.camera_mode)
  16837. } catch (e) {
  16838. return l.debug(e.message),
  16839. !1
  16840. }
  16841. return t === d.PANORAMA || t === d.FLOORPLAN && s || t === d.DOLLHOUSE && a
  16842. })).length !== this.list.length && l.info("Disallowed " + (this.list.length - i.length) + " highlight images"),
  16843. this.list = i,
  16844. this.reIndex()
  16845. }
  16846. ,
  16847. h.prototype.getHeroLocations = function(panos) {//改 增加二级location
  16848. if (0 === this.list.length)
  16849. return [];
  16850. var locations = [];
  16851. var deal = (n, container)=>{
  16852. var r = n.thumbnail_signed_src,
  16853. o = n.name || "";
  16854. if (n.metadata && void 0 !== n.metadata.camera_quaternion) {
  16855. if (!u.show360Views.enabled && n.metadata.scan_id) {
  16856. var a = panos.get(n.metadata.scan_id);
  16857. if (a && !a.isAligned()) return
  16858. }
  16859. var s = d.convertWorkshopModeInt(n.metadata.camera_mode);
  16860. if (s === d.MESH) return
  16861. if(window.isLocal)var src = manage.dealURL(r)
  16862. else var src = "one" === g_version ? g_Prefix + r + "?" + randomTime().getTime() : r + "?" + randomTime().getTime()
  16863. var l = {
  16864. cameraMode: s,
  16865. position: n.metadata.camera_position,
  16866. quaternion: n.metadata.camera_quaternion,
  16867. zoom: n.metadata.zoom,
  16868. panoId: n.metadata.scan_id,
  16869. orthoZoom: n.metadata.ortho_zoom,
  16870. floorVisibility: void 0 !== n.metadata.floor_visibility ? n.metadata.floor_visibility.slice(0) : [],
  16871. thumbUrl: src,
  16872. name: h.filterImageName(o),
  16873. sid: n.sid
  16874. }
  16875. var item = new p(l);
  16876. item.momentTour = n.momentTour
  16877. item.dontRot = n.dontRot
  16878. item.rotTime = n.rotTime
  16879. container.push(item)
  16880. return item
  16881. }
  16882. }
  16883. this.list.forEach(image=>{
  16884. if(image.images){
  16885. var folder = $.extend({}, image )
  16886. folder.heroLocations = [];
  16887. image.images.list.forEach(child=>{
  16888. deal(child, folder.heroLocations);
  16889. })
  16890. folder.musicInfo = folder.musicInfo || {}
  16891. locations.push(folder)
  16892. delete folder.images;
  16893. delete folder.locations;
  16894. }else{
  16895. var item = deal(image, locations);
  16896. item.musicInfo = image.musicInfo || g_data2.tourAudio[item.sid] || {}//新的music数据统一写在每个info下,如果有musicInfo则覆盖g_data2.tourAudio
  16897. }
  16898. })
  16899. return locations
  16900. }
  16901. ,
  16902. h.prototype.getIndex = function(e) {
  16903. return e.sid
  16904. }
  16905. ,
  16906. h.filterImageName = function(e) {
  16907. return "" === e || e.match(/^[0-9.]+_[0-9.]+$/) ? null : e
  16908. }
  16909. ,
  16910. o.exports = h
  16911. }
  16912. ).call(this, "/js/model/ImageCollection.js")
  16913. }
  16914. , {
  16915. "../enum/Viewmode": 51,
  16916. "../objects/Snapshot": 153,
  16917. "../settings": 166,
  16918. "../util/IndexedCollection": 175,
  16919. "../util/common": 185,
  16920. "../util/logger": 189,
  16921. "../util/math": 190
  16922. }],
  16923. 138: [function(h, u, e) {
  16924. (function(e) {
  16925. "use strict";
  16926. function n() {
  16927. c.call(this)
  16928. }
  16929. var r = h("../label/Label")
  16930. , i = h("../settings")
  16931. , t = h("../util/logger")
  16932. , o = h("../util/math")
  16933. , a = h("../util/ajax")
  16934. , s = h("./RoomCollection")
  16935. , l = h("../util/common")
  16936. , c = h("../util/IndexedCollection");
  16937. new t(e),
  16938. l.inherit(n, c),
  16939. n.prototype.getIndex = function(e) {
  16940. return e.labelId
  16941. }
  16942. ,
  16943. n.prototype.associateWithRooms = function(e) {
  16944. this.forEach(function(t) {
  16945. e.forEach(function(e) {
  16946. e.roomId === t.roomId && (t.room = e)
  16947. })
  16948. })
  16949. }
  16950. ,
  16951. n.prototype.createFromLabelData = function(e) {
  16952. e.forEach(function(e) {
  16953. var t = n.parseRoomIndexFromWorkshopRoomId(e.roomId);
  16954. t = s.generateRoomId(e.floorId, t);
  16955. var i = new r(e.sid,e.position || e.positions[0],e.text,e.floorId,t);
  16956. i.position = o.convertWorkshopVector(i.position),
  16957. this.add(i),
  16958. i.build()
  16959. }
  16960. .bind(this))
  16961. }
  16962. ,
  16963. n.prototype.load = function(e, t) {
  16964. return a.get(e, {
  16965. responseType: "json",
  16966. auth: t ? i.authorizationHeader : null
  16967. }).done(function(e) {
  16968. var t = [];
  16969. for (var i in e) {
  16970. var n = e[i];
  16971. t.push(n)
  16972. }
  16973. this.createFromLabelData(t)
  16974. }
  16975. .bind(this))
  16976. }
  16977. ,
  16978. n.parseRoomIndexFromWorkshopRoomId = function(e) {
  16979. var t = -1;
  16980. if (e) {
  16981. if(typeof e == 'number'){
  16982. t = parseInt(e)
  16983. }else{
  16984. var i = e.split("_");
  16985. t = parseInt(i[0])
  16986. }
  16987. }
  16988. return t
  16989. }
  16990. ,
  16991. u.exports = n
  16992. }
  16993. ).call(this, "/js/model/LabelCollection.js")
  16994. }
  16995. , {
  16996. "../label/Label": 90,
  16997. "../settings": 166,
  16998. "../util/IndexedCollection": 175,
  16999. "../util/ajax": 181,
  17000. "../util/common": 185,
  17001. "../util/logger": 189,
  17002. "../util/math": 190,
  17003. "./RoomCollection": 141
  17004. }],
  17005. 139: [function(P, O, e) {
  17006. (function(e) {
  17007. "use strict";
  17008. function t(e, t) {
  17009. o.Object3D.call(this),
  17010. this.sid = window.number;//t.sid,
  17011. this.data = t,
  17012. this.options = e,
  17013. this.urls = new i(e.urlFiles),
  17014. this.isPublic = void 0 !== t.is_public && t.is_public,
  17015. //创建heroLocations
  17016. this.images = new E(this),
  17017. this.images.extend(t.images),
  17018. this.images.forEach((info)=>{
  17019. if(info.locations){
  17020. info.images = new E(this);
  17021. info.images.extend(info.locations)
  17022. }
  17023. })
  17024. this.heroLocations = []
  17025. //this.heroImage = this.images.getImage(t.icon), //初始画面沒有用到icon
  17026. this.outdoorPanoLocations = [],
  17027. this.floors = new c(this),
  17028. this.floorsEnabled = void 0 === e.floors || e.floors,
  17029. this.changingFloor = !1,
  17030. this.chunks = [],
  17031. this.panos = new g,
  17032. this.colliders = [],
  17033. this.loadPanosPromise = null,
  17034. this.loadMeshTexturesPromise = null,
  17035. this.auxDataPromise = null,
  17036. this.meshTexturesLoaded = !1,
  17037. this.meshTextures = [],
  17038. this.tags = {},
  17039. this.tagsShown = !1,
  17040. this.shouldShowtags = !1,
  17041. this.has360Views = !1,
  17042. this.showingLabels = u.labels.enabled && t.player_options.labels,
  17043. this.supportedModes = {},
  17044. this.supportedModes[s.PANORAMA] = !0,
  17045. this.supportedModes[s.DOLLHOUSE] = !t.player_options || t.player_options.dollhouse && I.valueFromHash("dh", 1),
  17046. this.supportedModes[s.FLOORPLAN] = !t.player_options || t.player_options.floor_plan && I.valueFromHash("dh", 1),
  17047. this.supportedModes[s.TRANSITIONING] = !0,
  17048. this.supportsTiles = this.configureTiling(),
  17049. this.supportsVR = window.DATA.supportsVR || false//!0,
  17050. this.mode = s.DOLLHOUSE,
  17051. this.size = null,
  17052. this.center = null,
  17053. this.boundingBox = new o.Box3,
  17054. this.currentFloor = null,
  17055. this.allFloorsVisible = !0,
  17056. this.projectedPano0 = null,
  17057. this.projectedPano1 = null,
  17058. this.floorsEnabled && t.floors && -1 !== t.floors.indexOf(",") && t.floors.split(",").forEach(function(e, t) {
  17059. this.addFloor(new r(this,t,e.trim()))
  17060. }
  17061. .bind(this)),
  17062. this.waitQueue = [],
  17063. this.on("load", function(e) {
  17064. 0 !== this.waitQueue.length && (this.waitQueue = this.waitQueue.filter(function(e) {
  17065. return !e.isLoadedCallback()
  17066. }),
  17067. 0 === this.waitQueue.length && this.emit("waiting-done"))
  17068. }
  17069. .bind(this)),
  17070. this.setupCustomProperties(),
  17071. this.hots = {}
  17072. }
  17073. var o = P("three")
  17074. , a = P("../util/ajax")
  17075. , i = P("../util/ModelUrls")
  17076. , n = P("../objects/BoundingTextureSkybox")
  17077. , s = P("../enum/Viewmode")
  17078. , l = P("../enum/RenderOrder")
  17079. , r = (P("../enum/AlignmentType"),
  17080. P("../objects/Floor"))
  17081. , c = P("./FloorCollection")
  17082. , h = P("../objects/Chunk")
  17083. , u = (P("../objects/Room"),
  17084. P("../objects/Snapshot"),
  17085. P("../label/Label"),
  17086. P("../util/math"),
  17087. P("../settings"))
  17088. , d = P("../shaders")
  17089. , p = P("../util/logger")
  17090. , f = (P("../tag/tag"),
  17091. P("../tag/tagManager"),
  17092. P("../objects/Panorama"))
  17093. , g = P("../util/PanoramaCollection")
  17094. , m = P("../loaders/ModelLoader")
  17095. , v = P("../loaders/ModelTextureLoader")
  17096. , y = P("../loaders/SweepDataLoader")
  17097. , A = P("../util/transitions")
  17098. , C = (P("../util/easing"),
  17099. P("../util/lerp"),
  17100. P("../util/common"))
  17101. , I = (P("../util/texture"),
  17102. P("./../util/browser"))
  17103. , E = P("./ImageCollection")
  17104. , _ = P("./RoomCollection")
  17105. , b = P("./LabelCollection")
  17106. , w = P("./Chunks")
  17107. , T = P("./../util/showcase")
  17108. , x = P("../exception/BasicException")
  17109. , S = (P("../constants"),
  17110. P("events").EventEmitter)
  17111. , M = P("hot")
  17112. , R = new p(e);
  17113. t.prototype = Object.create(o.Object3D.prototype),
  17114. C.extend(t, S),
  17115. t.prototype.setupCustomProperties = function() {
  17116. var t = u.modelAlpha;
  17117. Object.defineProperty(this, "alpha", {
  17118. get: function() {
  17119. return t
  17120. },
  17121. set: function(e) {
  17122. t = e,
  17123. this.chunks.forEach(function(e) {
  17124. e.material && e.material.uniforms.modelAlpha && (e.material.uniforms.modelAlpha.value = t)
  17125. })
  17126. }
  17127. })
  17128. }
  17129. ,
  17130. t.prototype.configureTiling = function() {
  17131. var e = function() {
  17132. try {
  17133. var e = document.createElement("canvas")
  17134. , t = e.getContext("webgl");
  17135. return (t = t || e.getContext("experimental-webgl")).getParameter(t.MAX_CUBE_MAP_TEXTURE_SIZE)
  17136. } catch (e) {
  17137. return 0
  17138. }
  17139. }();
  17140. if (e < 2048)
  17141. return !1;
  17142. R.warn("Max cube texture size: " + e);
  17143. for (var t = 0; t < u.tiling.tilingFlagNames.length; t++) {
  17144. var i = u.tiling.tilingFlagNames[t];
  17145. if ("1" === I.valueFromHash(i, null))
  17146. return !0;
  17147. if ("0" === I.valueFromHash(i, null))
  17148. return !1
  17149. }
  17150. return !!T.modelDataPromisesTiles(this.data)
  17151. }
  17152. ,
  17153. t.prototype.toggleAlpha = function() {
  17154. this.alpha < 1 ? this.alpha = 1 : this.alpha = 0
  17155. }
  17156. ,
  17157. t.prototype.load = function(e) {
  17158. var t = this.urls.init().then(function() {
  17159. return $.when(this.loadPanos(), this.loadMesh())
  17160. }
  17161. .bind(this));
  17162. return e ? t = t.then(this.loadMeshTextures.bind(this)) : t.then(this.loadMeshTextures.bind(this)),
  17163. this.auxDataPromise = $.when(this.loadhots(), this.loadLabels()),
  17164. $.when(t, this.auxDataPromise).done(this.build.bind(this))
  17165. }
  17166. ,
  17167. t.prototype.loadMesh = function() {
  17168. var n = $.Deferred()
  17169. , r = this;
  17170. return m.load(r.data.job.uuid, r.urls, function(e, t) {
  17171. if (0 === e.length) {
  17172. R.warn("No geometry found for model, loading faux geometry, disabling outside mode"),
  17173. r.supportedModes[s.DOLLHOUSE] = !1,
  17174. r.supportedModes[s.FLOORPLAN] = !1;
  17175. var i = new h({
  17176. geometry: new o.PlaneBufferGeometry(5,5,1,1)
  17177. });
  17178. i.material.visible = !1,
  17179. i.rotateX(-Math.PI / 2),
  17180. i.geometry.computeBoundingBox(),
  17181. e = [i]
  17182. }
  17183. e.forEach(function(e) {
  17184. var t = r.floorsEnabled ? w.parseFloor(e.name) : 0;
  17185. r.addChunk(t, e)
  17186. }),
  17187. r.floors.sort(),
  17188. n.resolve(r)
  17189. }, function(e, t) {
  17190. n.notify(e, t)
  17191. }, function(e) {
  17192. R.error(e),
  17193. n.reject("loading-failed")
  17194. }),
  17195. n.promise()
  17196. }
  17197. ,
  17198. t.prototype.loadMeshTextures = function() {
  17199. return this.loadTexturesPromise || (this.loadTexturesPromise = v.load(this, this.meshTextures).then(function() {
  17200. this.meshTexturesLoaded = !0
  17201. }
  17202. .bind(this))),
  17203. this.loadTexturesPromise
  17204. }
  17205. /* t.prototype.shineHots = function() {
  17206. A.trigger({
  17207. func: function(e) {
  17208. var opa = e <= .5 ? 2 * e : -2 * e + 2
  17209. for(var i in this.hots){
  17210. this.hots[i].mesh.material.uniforms.opac.value = opa;
  17211. }
  17212. }
  17213. .bind(this),
  17214. cycling: !0,
  17215. duration: 3e3,
  17216. name: "hotShine"
  17217. })
  17218. } */
  17219. ,
  17220. /* t.prototype.createHotItem = function(e, t) {
  17221. for (var i = document.createDocumentFragment(), n = Object.keys(e), r = 0; r < n.length; r++) {
  17222. var o = document.createElement("li")
  17223. , a = document.createElement("span");
  17224. a.innerHTML = e[n[r]].title || e[n[r]].infoAttribute && e[n[r]].infoAttribute.title || "热点",
  17225. o.hot = t[n[r]],
  17226. o.appendChild(a),
  17227. i.appendChild(o)
  17228. }
  17229. document.querySelector("#hotListContent ul").appendChild(i),
  17230. console.log(i)
  17231. } */
  17232. t.prototype.createHotItem = function() {
  17233. var docFragment = document.createDocumentFragment();
  17234. this.hotGroup.children.forEach(hot=>{
  17235. if(hot.info.actionType.openHot){
  17236. var li = document.createElement('li');
  17237. var span = document.createElement('span');
  17238. span.innerHTML = hot.info.title || '热点';
  17239. // console.log(span.innerHTML);
  17240. li.hot = hot; // 列表每一项对应一个热点
  17241. li.appendChild(span);
  17242. docFragment.appendChild(li);
  17243. }
  17244. })
  17245. var ul = document.querySelector('#hotListContent ul');
  17246. ul.appendChild(docFragment);
  17247. }
  17248. ,
  17249. /* t.prototype.loadOverlays = function(overlays){
  17250. var overlays = window.data2 && window.data2.overlays
  17251. overlays && overlays.forEach((info)=>{
  17252. new Overlay(info)
  17253. })
  17254. Overlay.load()
  17255. }
  17256. */
  17257. t.prototype.loadhots = function() {
  17258. initHot(this)
  17259. var r = $.Deferred()
  17260. , e = g_Prefix + "data/" + this.sid + "/data2.js?" + randomTime().getTime();
  17261. return a.get(e, {
  17262. responseType: "json",
  17263. auth: this.isPublic ? null : u.authorizationHeader
  17264. }).done(function(e) {
  17265. window.data2 = e;
  17266. editTool.loadDone('data2', e)
  17267. if(!e){
  17268. console.error("data2 is null")
  17269. }else{
  17270. g_data2 = hotMatcher(e)
  17271. this.hotsCount = 0;
  17272. //因为热点保存后在hots里的顺序会被修改,所以使用order来记录顺序,这里要重排序:
  17273. //window.hotData = {}
  17274. /* if(e.hots){
  17275. var sids = Object.keys(e.hots).sort((a,b)=>{return e.hots[a].order - e.hots[b].order});
  17276. sids.forEach((sid)=>{
  17277. this.hotsCount++,
  17278. this.hots[sid] = new M(sid,e.hots[sid] ,this);
  17279. //e.hots[sid].infoAttribute || (e.hots[sid].infoAttribute = {})
  17280. //this.hots[sid].initStyleImg(e.hots[sid].infoAttribute);
  17281. window.hotData[sid] = e.hots[sid];
  17282. })
  17283. }*/
  17284. if(e.hots){
  17285. var sids = Object.keys(e.hots).sort((a,b)=>{return e.hots[a].order - e.hots[b].order});
  17286. sids.forEach((sid)=>{
  17287. e.hots[sid].sid = sid
  17288. new Hot(e.hots[sid], e.hots[sid].version != 'multi' && "byHot" )
  17289. })
  17290. }
  17291. if(e.overlays){
  17292. e.overlays.forEach((info)=>{
  17293. new Hot(info, 'byOverlay')
  17294. })
  17295. }
  17296. this.createHotItem();
  17297. /* if(e.multiOverlays){
  17298. e.multiOverlays.forEach((info)=>{
  17299. new Hot(info)
  17300. })
  17301. }) */
  17302. Hot.startLoad()
  17303. e.weixinDesc && (g_weixinObj.desc = e.weixinDesc)
  17304. }
  17305. r.resolve()
  17306. }
  17307. .bind(this)).fail(function() {
  17308. console.log("没有热点"),
  17309. editTool.loadDone('data2', null)
  17310. r.resolve()
  17311. }),
  17312. r
  17313. }
  17314. ,
  17315. t.prototype.loadPanos = function() {
  17316. if (this.loadPanosPromise)
  17317. return this.loadPanosPromise;
  17318. var e = new y(this);
  17319. return this.loadPanosPromise = e.load().then(function(e) {
  17320. window.panoListOriData = e.map(a=>a.uuid) //包括!enabled的点
  17321. return this.data.sweeps && 0 < Object.keys(this.data.sweeps).length && (e = e.filter(function(e) {
  17322. if(this.data.sweeps[e.uuid])return this.data.sweeps[e.uuid].enabled
  17323. else console.log(e.uuid)
  17324. //return this.data.sototype.loadOverlaysweeps[e.uuid].enabled
  17325. }
  17326. .bind(this))),
  17327. this.panos.extend(e.map(function(e) {
  17328. return new f(this,e.uuid,e,this.supportsTiles)
  17329. }
  17330. .bind(this))),
  17331. this.panos.forEach(function(i) {
  17332. i.neighbourUUIDs && (i.neighbourUUIDs.forEach(function(e) {
  17333. var t = this.panos.get(e);
  17334. t && this.panos.setNeighbour(i, t, !0)
  17335. }
  17336. .bind(this)),
  17337. i.neighbourPanos = this.panos.getNeighbours(i) || this.panos.setNeighbour(i, i, !0))
  17338. }
  17339. .bind(this)),
  17340. 0 === this.panos.length && (R.warn("Model has no panos, turning off inside mode"),
  17341. this.supportedModes[s.PANORAMA] = !1),
  17342. $.when(this)
  17343. }
  17344. .bind(this)),
  17345. this.loadPanosPromise
  17346. }
  17347. ,
  17348. t.prototype.loadHighlightReel = function() {
  17349. var t = $.Deferred()
  17350. , e = this.options.urlBase + "data/" + this.sid + "/active_reel.json";
  17351. return a.get(e, {
  17352. responseType: "json",
  17353. auth: this.isPublic ? null : u.authorizationHeader
  17354. }).done(function(e) {
  17355. e.reel ? (R.info("Got highlight reel with " + e.reel.length + " items"),
  17356. this.images.filterByModesAndReel(this.supportedModes, e.reel)) : R.info("No highlight reel found"),
  17357. t.resolve()
  17358. }
  17359. .bind(this)).fail(function() {
  17360. R.warn("Getting highlight reel failed, no highlights available"),
  17361. t.resolve()
  17362. }),
  17363. t
  17364. }
  17365. ,
  17366. t.prototype.waitForLoad = function(e, t) {
  17367. t() || (this.waitQueue.push({
  17368. object: e,
  17369. isLoadedCallback: t
  17370. }),
  17371. 1 === this.waitQueue.length && this.emit("waiting"))
  17372. }
  17373. ,
  17374. t.prototype.hide = function() {
  17375. this.floors.hide()
  17376. }
  17377. ,
  17378. t.prototype.show = function() {
  17379. this.floors.show()
  17380. }
  17381. ,
  17382. t.prototype.floorNames = function() {
  17383. return this.floors.names()
  17384. }
  17385. ,
  17386. t.prototype.warpDestFloors = function(e, t) {
  17387. if (e && this.floors.length === e.length) {
  17388. var i = e.findIndex(function(e) {
  17389. return e
  17390. }
  17391. .bind(this));
  17392. -1 !== i && this.setFloor(this.floors.list[i], null, t)
  17393. } else
  17394. this.toggleAllFloors(!0)
  17395. }
  17396. ,
  17397. t.prototype.setFloor = function(e, t, i) {
  17398. this.allFloorsVisible && this.emit("allfloors.toggled", !1, this.currentFloor),
  17399. this.allFloorsVisible = !1,
  17400. this._setFloor(e, t, i)
  17401. }
  17402. ,
  17403. t.prototype.toggleAllFloors = function(e) {
  17404. this.allFloorsVisible = void 0 !== e ? e : !this.allFloorsVisible,
  17405. this.emit("allfloors.toggled", this.allFloorsVisible, this.currentFloor),
  17406. this._setFloor(this.currentFloor)
  17407. }
  17408. ,
  17409. t.prototype._setFloor = function(e, t, i) {
  17410. var n;
  17411. if (t = t || this.mode,
  17412. this.emit("floor.changed", e, t, this.currentFloor),
  17413. this.currentFloor = e,
  17414. t === s.PANORAMA) {
  17415. if (this.show(),
  17416. this.shouldShowtags && this.tagsShown)
  17417. for (n in this.tags)
  17418. this.tags[n].show(u.showFloorDuration)
  17419. } else if ((t === s.FLOORPLAN || t === s.DOLLHOUSE) && (this.floors.list.forEach(function(e, t) {
  17420. e.toggle(e === this.currentFloor || this.allFloorsVisible, i || this.allFloorsVisible)
  17421. }
  17422. .bind(this)),
  17423. this.shouldShowtags && this.tagsShown))
  17424. for (n in this.tags) {
  17425. var r = this.tags[n];
  17426. this.allFloorsVisible ? r.show(u.showFloorDuration) : r.floor === this.currentFloor ? r.show(u.showFloorDuration, u.showFloorDelay) : r.hide(u.hideFloorDuration, u.hideFloorDelay)
  17427. }
  17428. var o = this
  17429. , a = e;
  17430. A.start(function() {}, u.showFloorDelay, function() {
  17431. o.floors.forEach(function(t) {
  17432. t.chunks.forEach(function(e) {
  17433. e.renderOrder = t === a ? l.visibleFloor : l.ghostFloor
  17434. })
  17435. })
  17436. }
  17437. .bind(this))
  17438. }
  17439. ,
  17440. t.prototype.toggleExplode = function() {
  17441. this.floors.toggleExplodeHorizontal()
  17442. }
  17443. ,
  17444. t.prototype.toggleExplodeUp = function() {
  17445. this.floors.toggleExplodeVertical()
  17446. }
  17447. ,
  17448. t.prototype.nextFloor = function(e) {
  17449. return this.floors.nextFloor(this.currentFloor, e)
  17450. }
  17451. ,
  17452. t.prototype.addFloor = function(e) {
  17453. this.floors.add(e)
  17454. }
  17455. ,
  17456. t.prototype.getFloorAtPoint = function(e) {
  17457. return this.floors.getFloorAtPoint(e)
  17458. }
  17459. ,
  17460. t.prototype.getTagBySid = function(e) {
  17461. return this.tags[e]
  17462. }
  17463. ,
  17464. t.prototype.addChunk = function(e, t) {
  17465. this.floors.getOrMakeFloor(e).addChunk(t),
  17466. this.chunks.push(t)
  17467. }
  17468. ,
  17469. t.prototype.setMode = function(t) {
  17470. if (!this.supportedModes[t])
  17471. throw new x("Mode not supported for this model: " + t);
  17472. this.mode = t
  17473. this.skybox.material.transparent = t == "panorama" ? false : true //xzw add // 如果skybox透明,会让其中其他mesh 如热点的透明出问题
  17474. this.chunks.forEach(function(e) {
  17475. e.setMode(t)
  17476. })
  17477. }
  17478. ,
  17479. t.prototype.build = function() {
  17480. this.heroLocations = this.images.getHeroLocations(this.panos);
  17481. var e = function() {
  17482. 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()
  17483. }
  17484. .bind(this)();
  17485. for (var t in this.has360Views = u.show360Views.enabled && this.heroLocations.some(function(e) {
  17486. return e.cameraMode === s.PANORAMA && this.panos.get(e.panoId) && !this.panos.get(e.panoId).isAligned()
  17487. }
  17488. .bind(this)) || e,
  17489. null === this.heroImage && R.warn("No hero image defined."),
  17490. this.currentFloor = this.floors.last(),
  17491. this.floors.build(),
  17492. this.colliders = this.floors.reduce(function(e, t) {
  17493. return e.concat(t.collider.children)
  17494. }, []),
  17495. this.panos.forEach(function(e) {
  17496. e.build1(),
  17497. e.on("enter", function() {
  17498. e.floor !== this.currentFloor && this.setFloor(e.floor)
  17499. }
  17500. .bind(this))
  17501. }
  17502. .bind(this)),
  17503. this.panos.forEach(function(e) {
  17504. e.build2()
  17505. }),
  17506. this.floors.forEach(function(e) {
  17507. this.boundingBox.union(e.boundingBox)
  17508. }
  17509. .bind(this)),
  17510. this.size = this.boundingBox.size(),
  17511. this.center = this.boundingBox.center(),
  17512. this.floors.forEach(function(e) {
  17513. R.info("Floor " + e + ": " + e.children.length + " chunks, " + e.panos.length + " panos.")
  17514. }
  17515. .bind(this)),
  17516. this.panos.populate_path_graph(),
  17517. this.skybox = new n(this.boundingBox),
  17518. this.skybox.matrixWorldNeedsUpdate = !0,
  17519. this.add(this.skybox),
  17520. setTimeout(function() {
  17521. //this.hotsCount && this.shineHots()
  17522. Hot.beginShineHot()
  17523. }
  17524. .bind(this), 1300),
  17525. this.tags)
  17526. this.tags[t].build();
  17527. //add-----
  17528. console.log('计算visiblePanos开始,可能需要一段时间')
  17529. for(let i in this.hots){
  17530. this.hots[i].setVisiblePanos(this.hots[i].info.visiblePanos);
  17531. }
  17532. console.log('计算visiblePanos完毕')
  17533. //---------
  17534. return R.debug("Done building model"),
  17535. 0 < f.raycastsDone && (R.warn("raycasts: " + f.raycastsDone),
  17536. R.warn("raycasts skipped: " + f.raycastsSkipped)),
  17537. this.buildRooms(),
  17538. this.labels.associateWithRooms(this.rooms),
  17539. $.when(this)
  17540. }
  17541. ,
  17542. t.prototype.loadLabels = function() {
  17543. this.labels = new b(this);
  17544. var e = $.Deferred();
  17545. window.DATA.showingLabels ? this.showingLabels = true : '';
  17546. if (!this.showingLabels)
  17547. return e.resolve();
  17548. var t = g_Prefix + "data/" + this.sid + "/labels.json";
  17549. return this.labels.load(t, !this.isPublic).done(e.resolve.bind(e)).fail(function() {
  17550. R.warn("Getting labels failed, not displaying labels."),
  17551. e.resolve()
  17552. }),
  17553. e
  17554. }
  17555. ,
  17556. t.prototype.buildRooms = function() {
  17557. this.rooms = new _(this),
  17558. this.rooms.createFromChunks(this.chunks),
  17559. this.rooms.calcRoomBoundaries()
  17560. }
  17561. ,
  17562. t.prototype.updateProjectedPanos = function() {
  17563. this.projectedPano0 && this.projectedPano1 && this.setProjectedPanos(this.projectedPano0, this.projectedPano1, !1)
  17564. }
  17565. ,
  17566. t.prototype.setProjectedPanos = function(t, i, n) {
  17567. null != n || (n = !0),
  17568. n = !!n,
  17569. this.projectedPano0 = t,
  17570. this.projectedPano1 = i,
  17571. this.skybox.material.setProjectedPanos(t, i, n),
  17572. this.chunks.forEach(function(e) {
  17573. e.materialInside.setProjectedPanos(t, i, n)
  17574. })
  17575. }
  17576. ,
  17577. t.prototype.setSide = function(t) {
  17578. this.floors.forEach(function(e) {
  17579. e.collider.material.side = t
  17580. })
  17581. }
  17582. ,
  17583. t.prototype.heroCount = function() {
  17584. return this.heroLocations ? this.heroLocations.length : 0
  17585. }
  17586. ,
  17587. t.prototype.getHeroDescriptorByIndex = function(e=[]) {//改 因增加了二级目录
  17588. if (e[0] < 0)
  17589. return R.warn("Model.getHeroDescriptorByHeroIndex() -> heroIndex is less than 0."),
  17590. null;
  17591. if (this.heroCount() < 1)
  17592. return R.warn("Model.getHeroDescriptorByIndex() -> No hero locations in this model"),
  17593. null;
  17594. var t = this.heroLocations[e[0]];
  17595. if(t.heroLocations && e[1]!=void 0){
  17596. t = t.heroLocations[e[1]];
  17597. }
  17598. return void 0 === t ? (R.warn("Model.getHeroDescriptorByIndex() -> Index " + e + " is not a validindex"),
  17599. null) : t
  17600. }
  17601. ,
  17602. t.prototype.findPanoramicHero = function() {
  17603. for (var e in this.heroLocations)
  17604. if (this.heroLocations[e].cameraMode === s.PANORAMA)
  17605. return this.heroLocations[e];
  17606. return null
  17607. }
  17608. ,
  17609. t.prototype.listImagePanos = function() {
  17610. var i = []
  17611. , n = this;
  17612. return this.images.forEach(function(e) {
  17613. if (e.metadata && e.metadata.scan_id) {
  17614. var t = n.panos.get(e.metadata.scan_id);
  17615. t && (n.supportsTiles || t.isLoaded("high") || i.push(t))
  17616. }
  17617. }),
  17618. i
  17619. }
  17620. ,
  17621. t.prototype.fadePanoMarkers = function(e, t) {
  17622. this.panos.fadeMarkerOpacity(e, t)
  17623. }
  17624. ,
  17625. t.prototype.setSweepVisibility = function(t) {
  17626. this.panos.forEach(function(e) {
  17627. e.marker && (e.marker.visible = t)
  17628. })
  17629. }
  17630. ,
  17631. t.prototype.outsideAllowed = function() {
  17632. return this.supportedModes[s.DOLLHOUSE] && this.supportedModes[s.FLOORPLAN]
  17633. }
  17634. ,
  17635. O.exports = t
  17636. }
  17637. ).call(this, "/js/model/Model.js")
  17638. }
  17639. , {
  17640. "../constants": 8,
  17641. "../enum/AlignmentType": 17,
  17642. "../enum/RenderOrder": 42,
  17643. "../enum/Viewmode": 51,
  17644. "../exception/BasicException": 55,
  17645. "../label/Label": 90,
  17646. "../loaders/ModelLoader": 105,
  17647. "../loaders/ModelTextureLoader": 106,
  17648. "../loaders/SweepDataLoader": 107,
  17649. "../tag/tag": 123,
  17650. "../tag/tagManager": 124,
  17651. "../objects/BoundingTextureSkybox": 143,
  17652. "../objects/Chunk": 144,
  17653. "../objects/Floor": 146,
  17654. "../objects/Panorama": 148,
  17655. "../objects/Room": 150,
  17656. "../objects/Snapshot": 153,
  17657. "../settings": 166,
  17658. "../shaders": 167,
  17659. "../util/ModelUrls": 177,
  17660. "../util/PanoramaCollection": 178,
  17661. "../util/ajax": 181,
  17662. "../util/common": 185,
  17663. "../util/easing": 186,
  17664. "../util/lerp": 188,
  17665. "../util/logger": 189,
  17666. "../util/math": 190,
  17667. "../util/texture": 194,
  17668. "../util/transitions": 195,
  17669. "./../util/browser": 182,
  17670. "./../util/showcase": 193,
  17671. "./Chunks": 135,
  17672. "./FloorCollection": 136,
  17673. "./ImageCollection": 137,
  17674. "./LabelCollection": 138,
  17675. "./RoomCollection": 141,
  17676. events: 202,
  17677. three: 217,
  17678. hot: "hot"
  17679. }],
  17680. 140: [function(e, t, i) {
  17681. "use strict";
  17682. function n() {
  17683. this.modelMap = {},
  17684. this.activeModel = null,
  17685. this.modelCount = 0,
  17686. this.tileDownloader = null,
  17687. this.panoRenderer = null
  17688. }
  17689. var r = (e("three"),
  17690. e("../util/common"))
  17691. , o = e("../exception/BasicException")
  17692. , a = e("../enum/ModelManagerEvents")
  17693. , s = e("../enum/PanoRendererEvents")
  17694. , l = e("events").EventEmitter;
  17695. n.prototype.init = function(e, t, i) {
  17696. this.tileDownloader = e,
  17697. this.panoRenderer = t,
  17698. this.qualityManager = i,
  17699. this.bindEvents()
  17700. }
  17701. ,
  17702. n.prototype.bindEvents = function() {
  17703. this.panoRenderer.on(s.TileRenderSuccess, this.onTileRendered.bind(this))
  17704. }
  17705. ,
  17706. n.prototype.onTileRendered = function(e, t, i, n) {}
  17707. ,
  17708. n.prototype.addModel = function(e) {
  17709. this.modelMap[e.sid] = e,
  17710. 0 === this.modelCount && this.activateModel(e.sid),
  17711. this.modelCount++,
  17712. this.emit(a.ModelAdded)
  17713. }
  17714. ,
  17715. n.prototype.getModel = function(e) {
  17716. return this.modelMap[e]
  17717. }
  17718. ,
  17719. n.prototype.activateModel = function(e) {
  17720. var t = this.modelMap[e];
  17721. if (!t)
  17722. throw new o("Tried to activate invalid model!");
  17723. var i = this.activeModel;
  17724. this.activeModel = t,
  17725. this.tileDownloader.setPanoData(t.panos, t.listImagePanos(), t.sid),
  17726. this.tileDownloader.setUrls(t.urls),
  17727. t.panos.forEach(function(e) {
  17728. e.attachToPanoRenderer(this.panoRenderer),
  17729. e.tileDownloader = this.tileDownloader,
  17730. e.qualityManager = this.qualityManager
  17731. }
  17732. .bind(this)),
  17733. this.emit(a.ActiveModelChanged, {
  17734. oldModel: i,
  17735. model: t
  17736. })
  17737. }
  17738. ,
  17739. n.prototype.getActiveModel = function() {
  17740. return this.activeModel
  17741. }
  17742. ,
  17743. r.extend(n, l),
  17744. t.exports = n
  17745. }
  17746. , {
  17747. "../enum/ModelManagerEvents": 33,
  17748. "../enum/PanoRendererEvents": 35,
  17749. "../exception/BasicException": 55,
  17750. "../util/common": 185,
  17751. events: 202,
  17752. three: 217
  17753. }],
  17754. 141: [function(r, l, e) {
  17755. (function(e) {
  17756. "use strict";
  17757. function o() {
  17758. n.call(this)
  17759. }
  17760. var a = r("../objects/Room")
  17761. , t = (r("../settings"),
  17762. r("../util/logger"))
  17763. , i = (r("../util/transitions"),
  17764. r("../util/easing"),
  17765. r("../util/common"))
  17766. , n = r("../util/IndexedCollection")
  17767. , s = r("./Chunks");
  17768. new t(e),
  17769. i.inherit(o, n),
  17770. o.prototype.getIndex = function(e) {
  17771. return e.roomId
  17772. }
  17773. ,
  17774. o.prototype.calcRoomBoundaries = function() {
  17775. this.forEach(function(e) {
  17776. e.calcBoundaries()
  17777. })
  17778. }
  17779. ,
  17780. o.prototype.createFromChunks = function(e) {
  17781. var n = {
  17782. floorId: -1,
  17783. roomId: -1
  17784. }
  17785. , r = {};
  17786. e.forEach(function(e) {
  17787. s.parseIdsFromChunkName(e.name, n);
  17788. var t = r[n.roomId];
  17789. if (!t) {
  17790. var i = o.generateRoomId(n.floorId, n.roomId);
  17791. t = new a(n.floorId,i),
  17792. this.add(t),
  17793. r[n.roomId] = t
  17794. }
  17795. t.addChunk(e)
  17796. }
  17797. .bind(this)),
  17798. this.calcRoomBoundaries()
  17799. }
  17800. ,
  17801. o.generateRoomId = function(e, t) {
  17802. return e + "_" + t
  17803. }
  17804. ,
  17805. l.exports = o
  17806. }
  17807. ).call(this, "/js/model/RoomCollection.js")
  17808. }
  17809. , {
  17810. "../objects/Room": 150,
  17811. "../settings": 166,
  17812. "../util/IndexedCollection": 175,
  17813. "../util/common": 185,
  17814. "../util/easing": 186,
  17815. "../util/logger": 189,
  17816. "../util/transitions": 195,
  17817. "./Chunks": 135
  17818. }],
  17819. 142: [function(e, t, i) {
  17820. "use strict";
  17821. function n(e, t, i) {
  17822. var n = (e = e.clone().expandByScalar(0.01)).size()
  17823. , r = new o.BoxGeometry(n.x,n.y,n.z);
  17824. r.boundingBox = e,
  17825. o.Mesh.call(this, r, t),
  17826. this.position.copy(e.center()),
  17827. this.frustumCulled = !1,
  17828. i && this.add(new o.WireframeHelper(this))
  17829. }
  17830. var o = e("three");
  17831. (n.prototype = Object.create(o.Mesh.prototype)).constructor = n,
  17832. t.exports = n
  17833. }
  17834. , {
  17835. three: 217
  17836. }],
  17837. 143: [function(l, c, e) {
  17838. (function(e) {
  17839. "use strict";
  17840. function t(e) {
  17841. s.time("Computing a nice bounding cubemap");
  17842. var t = new r({
  17843. side: i.BackSide,
  17844. transparent: !0
  17845. });
  17846. t.uniforms.modelAlpha.value = 0,
  17847. t.uniforms.opacity.value = 1 - o.modelAlpha,
  17848. this.renderOrder = a.boundingSkybox,
  17849. n.call(this, e, t),
  17850. s.timeEnd("Computing a nice bounding cubemap")
  17851. }
  17852. var i = l("three")
  17853. , n = (l("../enum/Viewmode"),
  17854. l("../shaders"),
  17855. l("./BoundingMesh"))
  17856. , r = l("../materials/ModelTextureMaterial")
  17857. , o = l("../settings")
  17858. , a = l("../enum/RenderOrder")
  17859. , s = new (l("../util/logger"))(e);
  17860. (t.prototype = Object.create(n.prototype)).constructor = t,
  17861. c.exports = t
  17862. }
  17863. ).call(this, "/js/objects/BoundingTextureSkybox.js")
  17864. }
  17865. , {
  17866. "../enum/RenderOrder": 42,
  17867. "../enum/Viewmode": 51,
  17868. "../materials/ModelTextureMaterial": 118,
  17869. "../settings": 166,
  17870. "../shaders": 167,
  17871. "../util/logger": 189,
  17872. "./BoundingMesh": 142,
  17873. three: 217
  17874. }],
  17875. 144: [function(e, t, i) {
  17876. "use strict";
  17877. function n(e) {
  17878. this.materialInside = new s({
  17879. side: r.DoubleSide
  17880. });
  17881. var t = r.UniformsUtils.clone(o.modelOutside.uniforms);
  17882. this.materialOutside = new r.RawShaderMaterial({
  17883. fragmentShader: o.modelOutside.fragmentShader,
  17884. vertexShader: o.modelOutside.vertexShader,
  17885. uniforms: t,
  17886. side: r.FrontSide,
  17887. name: "chunkOut"
  17888. }),
  17889. r.Mesh.call(this, e.geometry, this.materialInside),
  17890. this.name = e.name || "",
  17891. this.textureName = e.textureName,
  17892. this.meshUrl = e.meshUrl
  17893. }
  17894. var r = e("three")
  17895. , o = e("../shaders")
  17896. , a = e("../enum/Viewmode")
  17897. , s = e("../materials/ModelTextureMaterial");
  17898. (n.prototype = Object.create(r.Mesh.prototype)).setTextureMap = function(e) {
  17899. this.materialInside.uniforms.map.value = e,
  17900. this.materialOutside.uniforms.map.value = e
  17901. }
  17902. ,
  17903. n.prototype.setMode = function(e) {
  17904. var t = e === a.DOLLHOUSE || e === a.FLOORPLAN ? this.materialOutside : this.materialInside;
  17905. t.side = e === a.PANORAMA ? r.DoubleSide : r.FrontSide,
  17906. t.transparent = this.material.transparent,
  17907. t.uniforms.opacity.value = this.material.uniforms.opacity.value;
  17908. this.material = t
  17909. }
  17910. ,
  17911. t.exports = n
  17912. }
  17913. , {
  17914. "../enum/Viewmode": 51,
  17915. "../materials/ModelTextureMaterial": 118,
  17916. "../shaders": 167,
  17917. three: 217
  17918. }],
  17919. 145: [function(e, t, i) {
  17920. "use strict";
  17921. function n(e) {
  17922. this.chunksize = e || 10,
  17923. this.chunks = {},
  17924. this.boundingBoxes = {},
  17925. this.children = [],
  17926. this.offset = new m.Vector3(0,.5,0),
  17927. this.material = new m.MeshBasicMaterial({
  17928. color: 16777215 * Math.random(),
  17929. side: m.DoubleSide
  17930. })
  17931. }
  17932. var m = e("three");
  17933. e("../enum/Viewmode"),
  17934. n.prototype.add = function(e) {
  17935. var t, i, n, r, o, a, s, l, c, h, u = e.attributes;
  17936. u ? (t = u.position.array,
  17937. i = void 0 !== e.index ? e.index.array : void 0) : (t = e.vertices,
  17938. e.faces);
  17939. var d = new m.Vector3;
  17940. if (i)
  17941. for (n = 0,
  17942. r = i.length; n < r; n += 3) {
  17943. var p = 3 * i[n]
  17944. , f = 3 * i[n + 1]
  17945. , g = 3 * i[n + 2];
  17946. o = (t[p] + t[f] + t[g]) / 3,
  17947. a = (t[1 + p] + t[1 + f] + t[1 + g]) / 3,
  17948. s = (t[2 + p] + t[2 + f] + t[2 + g]) / 3,
  17949. c = (l = Math.floor(o / this.chunksize) + "." + Math.floor(a / this.chunksize) + "." + Math.floor(s / this.chunksize))in this.chunks ? (h = this.chunks[l],
  17950. this.boundingBoxes[l]) : (h = this.chunks[l] = [],
  17951. this.boundingBoxes[l] = new m.Box3),
  17952. 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]),
  17953. c.expandByPoint(d.set(t[p], t[1 + p], t[2 + p])),
  17954. c.expandByPoint(d.set(t[f], t[1 + f], t[2 + f])),
  17955. c.expandByPoint(d.set(t[g], t[1 + g], t[2 + g]))
  17956. }
  17957. else
  17958. for (n = 0,
  17959. r = t.length; n < r; n += 9)
  17960. o = (t[n] + t[n + 3] + t[n + 6]) / 3,
  17961. a = (t[n + 1] + t[n + 4] + t[n + 7]) / 3,
  17962. s = (t[n + 2] + t[n + 5] + t[n + 8]) / 3,
  17963. c = (l = Math.floor(o / this.chunksize) + "." + Math.floor(a / this.chunksize) + "." + Math.floor(s / this.chunksize))in this.chunks ? (h = this.chunks[l],
  17964. this.boundingBoxes[l]) : (h = this.chunks[l] = [],
  17965. this.boundingBoxes[l] = new m.Box3),
  17966. 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]),
  17967. c.expandByPoint(d.set(t[n], t[n + 1], t[n + 2])),
  17968. c.expandByPoint(d.set(t[n + 3], t[n + 4], t[n + 5])),
  17969. c.expandByPoint(d.set(t[n + 6], t[n + 7], t[n + 8]))
  17970. }
  17971. ,
  17972. n.prototype.build = function() {
  17973. var e = new m.Object3D;
  17974. for (var t in e.material = this.material,
  17975. this.chunks) {
  17976. var i = this.chunks[t]
  17977. , n = new m.BufferGeometry;
  17978. n.addAttribute("position", new m.BufferAttribute(new Float32Array(i),3)),
  17979. n.boundingBox = this.boundingBoxes[t];
  17980. var r = new m.Mesh(n,this.material);
  17981. r.material.visible = !1,
  17982. e.add(r),
  17983. this.chunks[t] = []
  17984. }
  17985. return e
  17986. }
  17987. ,
  17988. t.exports = n
  17989. }
  17990. , {
  17991. "../enum/Viewmode": 51,
  17992. three: 217
  17993. }],
  17994. 146: [function(e, t, i) {
  17995. "use strict";
  17996. var n = e("three")
  17997. , r = e("../settings")
  17998. , o = e("../util/common")
  17999. , a = e("../util/lerp")
  18000. , s = e("./ChunkedCollider")
  18001. , l = e("../util/transitions")
  18002. , c = e("../util/easing")
  18003. , h = (e("../objects/Panorama"),
  18004. e("../enum/RenderOrder"));
  18005. e("../localization/localize");
  18006. function u(e, t, i) {
  18007. n.Object3D.call(this),
  18008. this.model = e,
  18009. this.floorIndex = t,
  18010. this.lang = r.languageTag,
  18011. this.name = i || "cn" === r.languageTag ? "Floor " + (t + 1) : "第" + (t + 1) + "层",
  18012. this.panos = [],
  18013. this.chunks = [],
  18014. this.colliderBuilder = new s(3),
  18015. this.collider = null,
  18016. this.center = null,
  18017. this.boundingBox = new n.Box3,
  18018. this.size = null,
  18019. this.hidden = !1,
  18020. this.conservativeBoundingBox = new n.Box3,
  18021. this.debugColor = 16777215 * Math.random(),
  18022. this.transition = null
  18023. }
  18024. (u.prototype = Object.create(n.Object3D.prototype)).enter = function(e) {
  18025. this.model.setFloor(this, e)
  18026. }
  18027. ,
  18028. u.prototype.hide = function(e) {
  18029. if (!this.hidden || this.transition) {
  18030. this.chunks.forEach(function(e) {
  18031. e.material.transparent = !0
  18032. }),
  18033. l.cancel(this.transition);
  18034. var t = e ? 0 : r.hideFloorDuration + r.hideFloorDelay
  18035. , i = e ? 0 : r.hideFloorDelay / t;
  18036. this.transition = l.start(a.allUniforms(this.chunks, "opacity", .08), t, function() {
  18037. this.hidden = !0
  18038. }
  18039. .bind(this), i, c.easeInOutQuad)
  18040. }
  18041. }
  18042. ,
  18043. u.prototype.show = function(e) {
  18044. if (this.hidden || this.transition) {
  18045. this.hidden = !1,
  18046. l.cancel(this.transition);
  18047. var t = e ? r.showFloorDuration : r.showFloorDuration + r.showFloorDelay
  18048. , i = e ? 0 : r.showFloorDelay / t;
  18049. this.transition = l.start(a.allUniforms(this.chunks, "opacity", 1), t, function() {
  18050. this.hidden || this.chunks.forEach(function(e) {
  18051. e.material.transparent = !1
  18052. })
  18053. }
  18054. .bind(this), i, c.easeInOutQuad)
  18055. }
  18056. }
  18057. ,
  18058. u.prototype.toggle = function(e, t) {
  18059. (e = void 0 === e ? this.hidden : e) ? this.show(t) : this.hide(t)
  18060. }
  18061. ,
  18062. u.prototype.containsPoint = function(t) {
  18063. return this.collider.children.some(function(e) {
  18064. return e.geometry.boundingBox || e.geometry.computeBoundingBox(),
  18065. e.geometry.boundingBox.containsPoint(t)
  18066. })
  18067. }
  18068. ,
  18069. u.prototype.distanceToPoint = function(i) {
  18070. var n = null
  18071. , r = 1 / 0;
  18072. return this.collider.children.forEach(function(e) {
  18073. e.geometry.boundingBox || e.geometry.computeBoundingBox();
  18074. var t = e.geometry.boundingBox.distanceToPoint(i);
  18075. (!n || t < r) && (r = t,
  18076. n = e)
  18077. }),
  18078. r
  18079. }
  18080. ,
  18081. u.prototype.addChunk = function(e) {
  18082. e.renderOrder = h.ghostFloor,
  18083. this.add(e),
  18084. this.chunks.push(e),
  18085. this.boundingBox.union(e.geometry.boundingBox),
  18086. this.size = this.boundingBox.size(),
  18087. this.colliderBuilder.add(e.geometry)
  18088. }
  18089. ,
  18090. u.prototype.addPano = function(e) {
  18091. this.panos.push(e),
  18092. this.add(e.skyboxMesh),
  18093. e.marker && this.add(e.marker);
  18094. if(e.neighbourUUIDs.length){//add 有相邻点才算入bound 因为拍摄有bug,会出现floorPosition为000,且position位置很偏的点,它们一般都是不可见点。
  18095. var t = new n.Vector3(1,1,1)
  18096. , i = (new n.Box3).setFromCenterAndSize(e.position, t);
  18097. this.boundingBox.union(i)
  18098. }
  18099. }
  18100. ,
  18101. u.prototype.build = function() {
  18102. this.collider = this.colliderBuilder.build(!0),
  18103. this.add(this.collider),
  18104. this.center = this.boundingBox.center(),
  18105. this.conservativeBoundingBox.copy(this.boundingBox),
  18106. this.conservativeBoundingBox.min.y = o.lowerMedian(this.collider.children.map(function(e) {
  18107. return e.geometry.boundingBox.min.y
  18108. }), 5),
  18109. this.conservativeBoundingBox.max.y = o.lowerMedian(this.collider.children.map(function(e) {
  18110. return e.geometry.boundingBox.max.y
  18111. }), 5),
  18112. this.colliderBuilder = null
  18113. }
  18114. ,
  18115. u.prototype.toShortString = function() {
  18116. return o.nth(this.floorIndex + 1)
  18117. }
  18118. ,
  18119. u.prototype.toString = function() {
  18120. return this.name
  18121. }
  18122. ,
  18123. t.exports = u
  18124. }
  18125. , {
  18126. "../enum/RenderOrder": 42,
  18127. "../localization/localize": 108,
  18128. "./strings-cn-CN": 109,
  18129. "../objects/Panorama": 148,
  18130. "../settings": 166,
  18131. "../util/common": 185,
  18132. "../util/easing": 186,
  18133. "../util/lerp": 188,
  18134. "../util/transitions": 195,
  18135. "./ChunkedCollider": 145,
  18136. three: 217
  18137. }],
  18138. 147: [function(e, t, i) {
  18139. "use strict";
  18140. function n(e) {
  18141. this.player = e,
  18142. this.obj3d = null,
  18143. this.UP = new u.Vector3(0,1,0)
  18144. }
  18145. var u = e("three")
  18146. , d = e("../settings");
  18147. n.prototype.prefs = {
  18148. linewidth: 3,
  18149. height: .07,
  18150. opacity: .45,
  18151. endScale: .05
  18152. },
  18153. n.prototype.discard = function() {
  18154. if (this.obj3d) {
  18155. var e = this.obj3d.parent;
  18156. e && e.remove(this.obj3d)
  18157. }
  18158. this.obj3d = null
  18159. }
  18160. ,
  18161. n.prototype.draw = function() {
  18162. if (this.discard(),
  18163. d.showNeighbors) {
  18164. var e = this.player.currentPano.floor;
  18165. this.obj3d = new u.Object3D;
  18166. var t = this.player.model.panos.getNeighbours(this.player.currentPano)
  18167. , i = this.player.currentPano.floorPosition.clone().sub(this.player.model.position);
  18168. i.y += this.prefs.height;
  18169. var n = .1525
  18170. , r = new u.Matrix4;
  18171. for (var o in t)
  18172. if (t[o]) {
  18173. var a = this.player.model.panos.get(o)
  18174. , s = (a.position.clone().sub(this.player.model.position),
  18175. a.position.clone().sub(a.floorPosition))
  18176. , l = a.floorPosition.clone().sub(this.player.model.position);
  18177. l.y += this.prefs.height;
  18178. var c = new u.Geometry;
  18179. 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)),
  18180. 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)),
  18181. r.identity().setPosition(s),
  18182. c.applyMatrix(r),
  18183. c.vertices.push(new u.Vector3(0,-this.prefs.endScale,0)),
  18184. 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)),
  18185. r.lookAt(l, i, this.UP).setPosition(l),
  18186. c.applyMatrix(r),
  18187. c.vertices.push(l, i);
  18188. var h = new u.Line(c,new u.LineBasicMaterial({
  18189. color: a.debugColor.getHex(),
  18190. transparent: !0,
  18191. opacity: this.prefs.opacity,
  18192. depthWrite: !1,
  18193. name: "sLine" + o,
  18194. linewidth: this.prefs.linewidth
  18195. }));
  18196. this.obj3d.add(h)
  18197. }
  18198. e.add(this.obj3d)
  18199. }
  18200. }
  18201. ,
  18202. n.prototype.update = function() {
  18203. d.showNeighbors && this.obj3d && this.obj3d.updateMatrixWorld()
  18204. }
  18205. ,
  18206. t.exports = n
  18207. }
  18208. , {
  18209. "../settings": 166,
  18210. three: 217
  18211. }],
  18212. 148: [function(S, M, e) {
  18213. (function(e) {
  18214. "use strict";
  18215. function r(e, t, i, n) {
  18216. this.model = e,
  18217. this.id = t,
  18218. this.alignmentType = i.alignmentType || c.ALIGNED,
  18219. this.neighbourUUIDs = i.neighbours,
  18220. this.neighbourPanos = null,
  18221. this.floor = null,
  18222. this.floorIndex = i.floor,
  18223. this.failedLoadingAt = 0,
  18224. this.maxLoadRetries = 4,
  18225. this.origin = i.position.clone(),
  18226. this.position = this.alignmentType === c.UNALIGNED ? new s.Vector3(0,-5,0) : i.position.clone(),
  18227. this.quaternion = i.quaternion.clone(),
  18228. this.skyboxMesh = new s.Mesh(E),
  18229. this.skyboxMesh.position.copy(this.position),
  18230. this.skyboxMesh.quaternion.copy(this.quaternion),
  18231. this.skyboxMesh.name = "skybox",
  18232. this.skyboxMesh.visible = !1,
  18233. this.skyboxMesh.updateMatrix(),
  18234. this.skyboxMesh.updateMatrixWorld(),
  18235. this.marker = null,
  18236. this.showFloorMarker = this.showFloorMarker = !window.DATA.hideFloorMarker,
  18237. this.isAligned() && (this.marker = new s.Mesh(_,new s.MeshBasicMaterial({
  18238. map: b,
  18239. side: s.DoubleSide,
  18240. opacity: 0,
  18241. transparent: !0,
  18242. depthWrite: !1
  18243. })),
  18244. this.marker.visible = this.showFloorMarker,
  18245. this.marker.renderOrder = l.panoMarker,
  18246. this.marker.name = "marker",
  18247. (this.marker.pano = this).marker.layers.set(v.PANOMARKERS),
  18248. this.marker.updateMatrixWorld(),
  18249. a.colorMarkerOnLoad && this.on("load", function() {
  18250. this.marker.material.color.set(65280)
  18251. })),
  18252. this.debugColor = (new s.Color).setHSL(.06 + .53 * Math.random(), .8 + .2 * Math.random(), .5 + .2 * Math.random()),
  18253. this.floorPosition = i.puck ? i.puck.clone() : null,
  18254. this.tiled = n,
  18255. this.tiled ? this.solidSkybox = null : (this.solidSkybox = new s.Texture([null, null, null, null, null, null]),
  18256. this.solidSkybox.flipY = !1,
  18257. a.minimalMemoryMode && (this.solidSkybox.minFilter = s.LinearFilter,
  18258. this.solidSkybox.magFilter = s.LinearFilter,
  18259. this.solidSkybox.generateMipmaps = !1)),
  18260. this.zoomed = !1,
  18261. this.panoRenderer = null,
  18262. this.qualityManager = null,
  18263. this.tileDownloader = null,
  18264. this.tiledPanoRenderTarget = null,
  18265. this.minimumTiledPanoLoaded = !1,
  18266. this.highestPartialTileRenderOpCompleted = 0,
  18267. this.highestFullTileRenderOpCompleted = 0,
  18268. this.shouldRedrawOnBaseLoaded = !1,
  18269. this.lockUntilRenderingComplete = !1,
  18270. a.colorMarkerOnLoad && this.on("load", function() {
  18271. this.marker.material.color.set(65280)
  18272. }),
  18273. (e = new s.TextureLoader).setCrossOrigin(!0);
  18274. var r = e.load("images/texture.jpg");
  18275. if (this.vrMarker = new s.Mesh(new s.OctahedronGeometry(.1,0),new s.MeshLambertMaterial({
  18276. color: 16777215,
  18277. transparent: !0,
  18278. opacity: .75,
  18279. map: r
  18280. })),
  18281. this.vrMarker.boluoType = "vr",
  18282. this.vrMarker.position.z = 1,
  18283. this.vrMarker.enabled = !0,
  18284. this.vrMarker.visible = !1,
  18285. window.vrMarkers = window.vrMarkers || [],
  18286. window.vrMarkers.push(this.vrMarker),
  18287. this.marker && this.marker.add(this.vrMarker),
  18288. a.showAxis && (this.skyboxMesh.add(new s.ArrowHelper(new s.Vector3(0,1,0),new s.Vector3(0,0,0),1,255)),
  18289. this.skyboxMesh.add(new s.ArrowHelper(new s.Vector3(0,0,1),new s.Vector3(0,0,0),1,16711680)),
  18290. this.skyboxMesh.add(new s.ArrowHelper(new s.Vector3(1,0,0),new s.Vector3(0,0,0),1,65280))),
  18291. this.adjustAngleEnable) {
  18292. (i = new s.Quaternion).setFromAxisAngle(new s.Vector3(1,0,0), this.adjustAngleX),
  18293. this.skyboxMesh.quaternion.multiply(i);
  18294. var o = new s.Quaternion;
  18295. o.setFromAxisAngle(new s.Vector3(0,1,0), this.adjustAngleY),
  18296. this.skyboxMesh.quaternion.multiply(o),
  18297. (n = new s.Quaternion).setFromAxisAngle(new s.Vector3(0,0,1), this.adjustAngleZ),
  18298. this.skyboxMesh.quaternion.multiply(n),
  18299. this.skyboxMesh.updateMatrix(),
  18300. this.skyboxMesh.updateMatrixWorld(),
  18301. this.model.updateProjectedPanos()
  18302. }
  18303. }
  18304. var i, t, s = S("three"), n = S("../util/logger"), a = S("../settings"), l = (S("../enum/Viewmode"),
  18305. S("../enum/RenderOrder")), c = S("../enum/AlignmentType"), o = (S("../util/common"),
  18306. S("../util/transitions")), h = S("../util/lerp"), u = S("../util/ajax"), d = S("../util/texture"), p = S("../util/panorama"), f = (S("../enum/TileDownloaderEvents"),
  18307. S("../enum/PanoramaEvents")), g = S("../enum/PanoRendererEvents"), m = S("../enum/PanoSizeClass"), v = S("../enum/RenderLayers"), y = (S("../scene/SceneRenderer"),
  18308. S("../enum/GLCubeFaces"),
  18309. S("../exception/BasicException")), A = S("../tile/TileUtils"), C = S("events").EventEmitter, I = new n(e), E = new s.SphereBufferGeometry(.1), _ = new s.PlaneBufferGeometry(.4,.4,1,1), b = d.load("images/marker-256x256.png");
  18310. (r.prototype = Object.create(C.prototype)).enter = (t = null,
  18311. function() {
  18312. this.setZoomed(!1),
  18313. this.emit("enter", {
  18314. oldPano: t,
  18315. newPano: this
  18316. }),
  18317. t = this
  18318. }
  18319. ),
  18320. r.prototype.exit = function() {
  18321. this.tiled ? (this.clearWaitDeferreds(),
  18322. this.minimumTiledPanoLoaded = !1,
  18323. this.tiledPanoRenderTarget = null,
  18324. this.setZoomed(!1),
  18325. this.panoRenderer.deactivateTiledPano(this),
  18326. this.highestPartialTileRenderOpCompleted = 0,
  18327. this.highestFullTileRenderOpCompleted = 0) : (this.solidSkybox.dispose(),
  18328. this.solidSkybox.loaded = !1,
  18329. this.solidSkybox.version = 0),
  18330. this.emit("exit")
  18331. }
  18332. ,
  18333. r.prototype.hoverOn = function(e) {
  18334. this.marker && (o.start(h.property(this.marker.material, "opacity", a[e].markerOpacityOnHover), 250),
  18335. a.navigation.panoScores & a.navigation.mouseDirection && this.addTextSprite("HIT", 12525854))
  18336. }
  18337. ,
  18338. r.prototype.hoverOff = function(e) {
  18339. this.marker && o.start(h.property(this.marker.material, "opacity", a[e].markerOpacity), 250)
  18340. }
  18341. ,
  18342. r.prototype.build1 = function() {
  18343. this.floor = this.floor || this.model.floors.get(this.floorIndex) || this.raycastToFindFloor() || this.model.getFloorAtPoint(this.position),
  18344. this.floor.addPano(this),
  18345. this.floorPosition = this.floorPosition || this.raycastFloorPosition(),
  18346. this.neighbourPanos = this.neighbourPanos || this.findNeighourPanos(),
  18347. a.colorMarkerByFloor && this.marker && this.marker.material.color.set(this.floor.debugColor)
  18348. this.neighbourUUIDs = this.neighbourUUIDs || [] //add
  18349. }
  18350. ,
  18351. r.prototype.build2 = function() {
  18352. this.floorPosition = this.floorPosition || this.interpolateFloorPosition(),
  18353. this.height = this.position.distanceTo(this.floorPosition),
  18354. this.placeMarker()
  18355. }
  18356. ,
  18357. r.prototype.interpolateFloorPosition = function() {
  18358. var e = this.model.panos.filter(r.filters.isNeighbourPanoTo(this)).filter(function(e) {
  18359. return !!e.floorPosition
  18360. }).sort(function(e, t) {
  18361. return e.position.distanceTo(this.position) - t.position.distanceTo(this.position)
  18362. }
  18363. .bind(this))
  18364. , t = this.position.clone();
  18365. return 2 <= e.length ? t.y = (e[0].floorPosition.y + e[1].floorPosition.y) / 2 : t.add(a.noMeshFloorPositionOffset),
  18366. t
  18367. }
  18368. ,
  18369. r.prototype.raycastFloorPosition = function() {
  18370. I.warn("Performance warning: Raycasting to find floor position");
  18371. var e = new s.Raycaster(this.position,new s.Vector3(0,-1,0)).intersectObjects(this.model.colliders);
  18372. return e.length ? e[0].point : null
  18373. }
  18374. ,
  18375. 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)],
  18376. function() {
  18377. I.warn("Performance warning: Raycasting to find floor index");
  18378. for (var e = 0; e < i.length; e++) {
  18379. var t = new s.Raycaster(this.position.clone(),i[e].clone()).intersectObjects(this.model.colliders);
  18380. if (t.length)
  18381. return t[0].object.parent.parent
  18382. }
  18383. return null
  18384. }
  18385. ),
  18386. r.prototype.placeMarker = function() {
  18387. this.marker && (this.marker.position.copy(this.floorPosition),
  18388. this.marker.position.y += .05,
  18389. this.marker.lookAt(new s.Vector3(0,1,0).add(this.marker.position)))
  18390. }
  18391. ,
  18392. r.prototype.translate = function(e) {
  18393. this.position.add(e),
  18394. this.floorPosition.add(e)
  18395. }
  18396. ,
  18397. r.prototype.findClosestMidtpointPanoTo = function(e) {
  18398. return (new s.Vector3).addVectors(this.position, e.position).divideScalar(2),
  18399. this.model.panos.find([r.filters.notIn([this, e])], [r.sortFunctions.distanceToPoint(point)])
  18400. }
  18401. ,
  18402. r.prototype.attachToPanoRenderer = function(e) {
  18403. this.panoRenderer = e,
  18404. this.panoRenderer.on(g.TileRenderSuccess, this.onTileRendered.bind(this)),
  18405. this.panoRenderer.on(g.PanoRenderComplete, this.onPanoRendered.bind(this)),
  18406. this.panoRenderer.on(g.TileRenderFailure, this.onTileRenderFail.bind(this)),
  18407. this.panoRenderer.on(g.UploadAttemptedForAllTiles, this.onUploadAttemptedForAllTiles.bind(this))
  18408. }
  18409. ;
  18410. var w, T, x = {};
  18411. r.prototype.getWaitDeferred = function(e) {
  18412. var t = x[this.id];
  18413. t || (t = {},
  18414. x[this.id] = t);
  18415. var i = t[e];
  18416. return i || (i = {
  18417. deferred: $.Deferred(),
  18418. active: !1
  18419. },
  18420. t[e] = i),
  18421. i
  18422. }
  18423. ,
  18424. r.prototype.resetWaitDeferred = function(e) {
  18425. var t = this.getWaitDeferred(e);
  18426. t.active = !1,
  18427. t.deferred = $.Deferred()
  18428. }
  18429. ,
  18430. r.prototype.clearWaitDeferreds = function() {
  18431. var e = x[this.id];
  18432. for (var t in e || (e = {},
  18433. x[this.id] = e),
  18434. e)
  18435. if (e.hasOwnProperty(t)) {
  18436. var i = e[t];
  18437. i.active = !1,
  18438. i.deferred = $.Deferred()
  18439. }
  18440. }
  18441. ,
  18442. r.prototype.loadTiledPano = (new s.Vector3,
  18443. w = [],
  18444. T = [],
  18445. function(e, t, i, n, r, o) {
  18446. null != n || (n = !0),
  18447. null != r || (r = !0);
  18448. var a = this.getWaitDeferred(e)
  18449. , s = a.deferred
  18450. , l = null
  18451. , c = null;
  18452. if (i && ("number" == typeof i ? l = i : (l = i.hFov,
  18453. c = i.vFov)),
  18454. !this.isLoaded(e)) {
  18455. if (!a.active) {
  18456. if (a.active = !0,
  18457. i) {
  18458. var h = A.matchingTilesInDirection(this, e, t, l, c);
  18459. w[this.id + ":" + e] = {
  18460. tileCount: 0,
  18461. targetTileCount: h
  18462. },
  18463. I.info("Loading partial pano: " + this.id + " with " + h + " tiles")
  18464. }
  18465. T[this.id] || (T[this.id] = !0,
  18466. this.on(f.LoadComplete, function(e, t) {
  18467. var i = this.getWaitDeferred(e).deferred;
  18468. i && "pending" === i.state() && this.highestPartialTileRenderOpCompleted >= e && (i.resolve(e, t),
  18469. this.resetWaitDeferred(e))
  18470. }
  18471. .bind(this)),
  18472. this.on(f.LoadFailed, function(e) {
  18473. var t = this.getWaitDeferred(e).deferred;
  18474. t && "pending" === t.state() && this.highestPartialTileRenderOpCompleted >= e && (t.reject(e),
  18475. this.resetWaitDeferred(e))
  18476. }
  18477. .bind(this)),
  18478. this.on(f.TileLoaded, function(e, t, i) {
  18479. var n = this.getWaitDeferred(e).deferred;
  18480. if (n && "pending" === n.state()) {
  18481. n.notify(e, t, i);
  18482. var r = w[this.id + ":" + e];
  18483. r && (r.tileCount++,
  18484. r.tileCount === r.targetTileCount && (this.onPanoRendered(this.id, e, i, !0),
  18485. n.resolve(e, i),
  18486. this.resetWaitDeferred(e)))
  18487. }
  18488. }
  18489. .bind(this)))
  18490. }
  18491. this.tileDownloader.clearForceQueue(),
  18492. this.tileDownloader.forceQueueTilesForPano(this, e, t, l, c, o),
  18493. this.tiledPanoRenderTarget = this.panoRenderer.activateTiledPano(this, this.qualityManager.getMaxNavPanoSize(), n),
  18494. this.panoRenderer.renderPanoTiles(this.id, t, r)
  18495. }
  18496. return s.promise()
  18497. }
  18498. ),
  18499. r.prototype.onUploadAttemptedForAllTiles = function(e, t, i) {
  18500. e === this.id && t === this.qualityManager.getPanoSize(m.BASE) && this.shouldRedrawOnBaseLoaded && (this.shouldRedrawOnBaseLoaded = !1,
  18501. this.panoRenderer.resetRenderStatus(this.id, !0, !1),
  18502. this.panoRenderer.renderPanoTiles(this.id, null, !0, !0))
  18503. }
  18504. ,
  18505. r.prototype.onTileRendered = function(e, t, i, n) {
  18506. e === this.id && this.emit(f.TileLoaded, t, i, n)
  18507. }
  18508. ,
  18509. r.prototype.onPanoRendered = function(e, t, i, n) {
  18510. e === this.id && (this.minimumTiledPanoLoaded = !0,
  18511. this.updateSkyboxForZoomLevel(),
  18512. t > this.highestPartialTileRenderOpCompleted && (this.highestPartialTileRenderOpCompleted = t),
  18513. !n && t > this.highestFullTileRenderOpCompleted && (this.highestFullTileRenderOpCompleted = t),
  18514. this.emit("load", t),
  18515. this.model.emit("load", this),
  18516. this.emit(f.LoadComplete, t, i))
  18517. }
  18518. ,
  18519. r.prototype.setZoomed = function(e) {
  18520. this.zoomed = e,
  18521. this.updateSkyboxForZoomLevel()
  18522. }
  18523. ,
  18524. r.prototype.ensureSkyboxReadyForRender = function() {
  18525. this.tiled || (this.solidSkybox.loaded || (this.solidSkybox.needsUpdate = !0),
  18526. this.solidSkybox.loaded = !0)
  18527. }
  18528. ,
  18529. r.prototype.updateSkyboxForZoomLevel = function() {
  18530. this.minimumTiledPanoLoaded && this.model.updateProjectedPanos()
  18531. }
  18532. ,
  18533. r.prototype.getSkyboxTexture = function() {
  18534. return this.tiled ? this.minimumTiledPanoLoaded ? this.zoomed ? this.panoRenderer.zoomRenderTarget.texture : this.tiledPanoRenderTarget.texture : null : this.solidSkybox
  18535. }
  18536. ,
  18537. r.prototype.onTileRenderFail = function(e, t, i) {
  18538. e === this.id && this.emit(f.LoadFailed, t)
  18539. }
  18540. ,
  18541. r.prototype.isLoaded = function(e) {
  18542. if (this.tiled) {
  18543. if (e && "string" == typeof e)
  18544. throw new y("Wrong panoSize given to Panorama.isLoaded(); a tiled pano uses PanoSizeClass");
  18545. return !!this.minimumTiledPanoLoaded && (!e || this.highestPartialTileRenderOpCompleted >= e)
  18546. }
  18547. if (e && "number" == typeof e)
  18548. throw new y("Wrong panoSize given to Panorama.isLoaded(); a non-tiled pano uses high/low.");
  18549. return !!this.solidSkybox.high || e in this.solidSkybox
  18550. }
  18551. ,
  18552. r.prototype.loadCube = function(a) {
  18553. if (this.isLoaded(a))
  18554. return I.info("Skipping load of pano, already loaded"),
  18555. $.when();
  18556. this.emit("loading", a),
  18557. this.model.emit("loading", this);
  18558. var n = p.getCubemapUrls(this.model.urls, this.id, a)
  18559. , e = n.filter(function(e) {
  18560. return !e
  18561. });
  18562. "low" === a && 0 < e.length && (I.info("Pano", this.id, "not available in low res, loading high res right away"),
  18563. a = "high",
  18564. n = p.getCubemapUrls(this.model.urls, this.id, a));
  18565. var t = 0
  18566. , i = [0, 1, 2, 3, 4, 5].map(function(e, t, i) {
  18567. return u.getImage(n[t])
  18568. }
  18569. .bind(this));
  18570. return $.when(i[0], i[1], i[2], i[3], i[4], i[5]).then(function(e, t, i, n, r, o) {
  18571. return this.solidSkybox[a] = [e, t, i, n, r, o],
  18572. "high" !== a && this.solidSkybox.high || (this.solidSkybox.image = this.solidSkybox[a],
  18573. this.solidSkybox.low = null),
  18574. this.solidSkybox.needsUpdate = !0,
  18575. this.emit("load", a),
  18576. this.model.emit("load", this),
  18577. this
  18578. }
  18579. .bind(this), function() {
  18580. I.error("Downloading cubemap for pano", this.id, "failed"),
  18581. this.failedLoadingAt = Date.now()
  18582. }
  18583. .bind(this), function() {
  18584. return $.when(++t, 6)
  18585. })
  18586. }
  18587. ,
  18588. r.raycastsSkipped = 0,
  18589. r.raycastsDone = 0,
  18590. r.prototype.findNeighourPanos = function() {
  18591. return this.model.panos.setNeighbour(this.id, this.id, !1),
  18592. this.model.panos.forEach(function(e) {
  18593. if (e !== this && (!this.model.panos.neighbourMap[this.id] || void 0 === this.model.panos.neighbourMap[this.id][e.id])) {
  18594. var t = this.position.distanceTo(e.position);
  18595. if (t > a.panoramaNeighbourMaxDistance)
  18596. return this.model.panos.setNeighbour(this, e, !1),
  18597. void r.raycastsSkipped++;
  18598. var i = e.position.clone().sub(this.position).normalize()
  18599. , n = new s.Raycaster(this.position,i.clone(),0,t).intersectObjects(this.model.colliders);
  18600. r.raycastsDone++,
  18601. this.model.panos.setNeighbour(this, e, 0 === n.length),
  18602. 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)))
  18603. }
  18604. }
  18605. .bind(this)),
  18606. this.model.panos.neighbourMap[this.id]
  18607. }
  18608. ,
  18609. r.prototype.worldPosition = function() {
  18610. return this.position
  18611. }
  18612. ,
  18613. r.prototype.addTextSprite = function(e, color, parent) {
  18614. this.removeTextSprite();
  18615. var ratio = 16;
  18616. var i = document.createElement("canvas")
  18617. , n = i.getContext("2d");
  18618. i.width = 1024,
  18619. i.height = i.width / ratio;
  18620. n.font = " 30px Arial",
  18621. n.fillStyle = "white";
  18622. var r = n.measureText(e).width;
  18623. n.fillText(e, (i.width - r) / 2, (i.height + 60) / 2);
  18624. var o = new s.Texture(i);
  18625. o.needsUpdate = !0;
  18626. var a = new s.SpriteMaterial({
  18627. map: o,
  18628. color: color || 16428055,
  18629. depthTest:false
  18630. });
  18631. this.text3d = new s.Sprite(a)
  18632. if(parent){
  18633. parent.add(this.text3d)
  18634. }else{
  18635. this.text3d.position.copy(this.skyboxMesh.position)
  18636. this.floor.add(this.text3d)
  18637. }
  18638. var scale = 5
  18639. this.text3d.scale.y = scale/ratio
  18640. this.text3d.scale.x = scale
  18641. }
  18642. ,
  18643. r.prototype.removeTextSprite = function() {
  18644. this.text3d && (this.text3d.parent.remove(this.text3d),
  18645. this.text3d.material.map.dispose(),
  18646. this.text3d = null)
  18647. }
  18648. ,
  18649. r.prototype.isAligned = function() {
  18650. return this.alignmentType === c.ALIGNED
  18651. }
  18652. ,
  18653. r.filters = {
  18654. inDirection: function(t, i, n) {
  18655. return function(e) {
  18656. return e.position.clone().sub(t).normalize().dot(i) > n
  18657. }
  18658. },
  18659. inFloorDirection: function(t, i, n) {
  18660. return function(e) {
  18661. return e.floorPosition.clone().sub(t).normalize().dot(i) > n
  18662. }
  18663. },
  18664. inPanoDirection: function(n, r, o) {
  18665. return o = a.navigation.panoScores ? a.navigation.filterStrictness : o,
  18666. function(e) {
  18667. var t = e.floorPosition.clone().sub(n).normalize()
  18668. , i = e.position.clone().sub(n).normalize();
  18669. return t.dot(r) > o || i.dot(r) > o
  18670. }
  18671. },
  18672. atFloor: function(t) {
  18673. return function(e) {
  18674. return !t || e.floor === t
  18675. }
  18676. },
  18677. not: function(t) {
  18678. return function(e) {
  18679. return e !== t
  18680. }
  18681. },
  18682. notIn: function(t) {
  18683. return function(e) {
  18684. return -1 === t.indexOf(e)
  18685. }
  18686. },
  18687. isLoaded: function() {
  18688. return function(e) {
  18689. return e.isLoaded()
  18690. }
  18691. },
  18692. isNotLoaded: function() {
  18693. return function(e) {
  18694. return !e.isLoaded()
  18695. }
  18696. },
  18697. isCloseEnoughTo: function(t, i) {
  18698. return function(e) {
  18699. return t.distanceTo(e.floorPosition) < i
  18700. }
  18701. },
  18702. hasMinimumHeightDifferenceTo: function(t, i) {
  18703. return function(e) {
  18704. return Math.abs(e.position.y - t.y) > i
  18705. }
  18706. },
  18707. isNotBehindNormal: function(t, i) {
  18708. var n = new s.Vector3;
  18709. return i = i.clone(),
  18710. function(e) {
  18711. return 0 < n.copy(e.position).sub(t).normalize().dot(i)
  18712. }
  18713. },
  18714. isNeighbourPanoTo: function(t) {
  18715. return function(e) {
  18716. return !t || !t.neighbourPanos || !!t.neighbourPanos[e.id]
  18717. }
  18718. },
  18719. isNeighbourOfNeighbourTo: function(n) {
  18720. return function(i) {
  18721. return !!n.neighbourPanos[i.id] || n.neighbourUUIDs.some(function(e) {
  18722. var t = n.model.panos.get(e);
  18723. return !!t && t.neighbourPanos[i.id]
  18724. })
  18725. }
  18726. },
  18727. isNotRecentlyFailed: function(t) {
  18728. return function(e) {
  18729. return Date.now() - e.failedLoadingAt > t
  18730. }
  18731. },
  18732. isOnVisibleFloor: function() {
  18733. return function(e) {
  18734. return !e.floor.hidden
  18735. }
  18736. },
  18737. isPanoAligned: function() {
  18738. return function(e) {
  18739. return e.isAligned()
  18740. }
  18741. }
  18742. },
  18743. r.sortFunctions = {
  18744. distanceToPoint: function(i) {
  18745. return function(e, t) {
  18746. return e.position.distanceTo(i) - t.position.distanceTo(i)
  18747. }
  18748. },
  18749. floorDistanceToPoint: function(i) {
  18750. return function(e, t) {
  18751. return e.floorPosition.distanceTo(i) - t.floorPosition.distanceTo(i)
  18752. }
  18753. },
  18754. choose: function(i) {
  18755. return function(e, t) {
  18756. return i.id === e.id ? -1 : i.id === t.id ? 1 : 0
  18757. }
  18758. }
  18759. },
  18760. r.scoreFunctions = {
  18761. distance: function(t, i) {
  18762. return i = i || a.navigation.distanceFactor,
  18763. function(e) {
  18764. return t ? t.position.distanceTo(e.position) * i : 0
  18765. }
  18766. },
  18767. distanceSquared: function(t, i) {
  18768. return i = i || a.navigation.distanceFactor,
  18769. function(e) {
  18770. return t ? t.position.distanceToSquared(e.position) * i : 0
  18771. }
  18772. },
  18773. direction: function(t, i) {
  18774. return function(e) {
  18775. return e.position.clone().sub(t).normalize().dot(i) * a.navigation.directionFactor
  18776. }
  18777. },
  18778. angle: function(t, i) {
  18779. return function(e) {
  18780. return e.position.clone().sub(t).normalize().angleTo(i) * a.navigation.angleFactor
  18781. }
  18782. },
  18783. inFieldOfView: function(t, i) {
  18784. return function(e) {
  18785. return .75 < e.position.clone().sub(t).normalize().dot(i) ? 10 : -1
  18786. }
  18787. },
  18788. optionality: function(t) {
  18789. return function(e) {
  18790. return e.neighbourUUIDs.filter(function(e) {
  18791. return !(e in t.neighbourUUIDs) && e !== t.id
  18792. }).length * a.navigation.optionalityFactor
  18793. }
  18794. },
  18795. penalizeHeightDifferenceUnder: function(t, i) {
  18796. return function(e) {
  18797. return t.y - e.position.y < i ? -20 : 0
  18798. }
  18799. }
  18800. },
  18801. M.exports = r
  18802. }
  18803. ).call(this, "/js/objects/Panorama.js")
  18804. }
  18805. , {
  18806. "../enum/AlignmentType": 17,
  18807. "../enum/GLCubeFaces": 25,
  18808. "../enum/PanoRendererEvents": 35,
  18809. "../enum/PanoSizeClass": 36,
  18810. "../enum/PanoramaEvents": 37,
  18811. "../enum/RenderLayers": 41,
  18812. "../enum/RenderOrder": 42,
  18813. "../enum/TileDownloaderEvents": 45,
  18814. "../enum/Viewmode": 51,
  18815. "../exception/BasicException": 55,
  18816. "../scene/SceneRenderer": 158,
  18817. "../settings": 166,
  18818. "../tile/TileUtils": 174,
  18819. "../util/ajax": 181,
  18820. "../util/common": 185,
  18821. "../util/lerp": 188,
  18822. "../util/logger": 189,
  18823. "../util/panorama": 191,
  18824. "../util/texture": 194,
  18825. "../util/transitions": 195,
  18826. events: 202,
  18827. three: 217
  18828. }],
  18829. 149: [function(e, t, i) {
  18830. "use strict";
  18831. function n(e) {
  18832. var t = r.UniformsUtils.clone(c.waypoint.uniforms);
  18833. t.map.value = d,
  18834. t.opacity.value = 0,
  18835. t.color.value.set(o.reticuleColor),
  18836. t.showMouseMarker = !window.DATA.hideMouseMarker;
  18837. r.Mesh.call(this, new r.PlaneBufferGeometry(.4,.4,1,1), new r.RawShaderMaterial({
  18838. side: r.DoubleSide,
  18839. depthWrite: !1,
  18840. depthTest: !1,
  18841. transparent: !0,
  18842. vertexShader: c.waypoint.vertexShader,
  18843. fragmentShader: c.waypoint.fragmentShader,
  18844. uniforms: t,
  18845. name: "waypoint",
  18846. opacity: 0,
  18847. visible: t.showMouseMarker
  18848. })),
  18849. this.layers.set(h.RETICULE),
  18850. this.renderOrder = u.reticule,
  18851. this.player = e,
  18852. this.direction = new r.Vector3,
  18853. this.hidden = !0,
  18854. this.mouseLastMoveTime = Date.now()
  18855. }
  18856. var r = e("three")
  18857. , o = e("../settings")
  18858. , a = e("../util/transitions")
  18859. , s = e("../util/texture")
  18860. , l = e("../util/lerp")
  18861. , c = e("../shaders")
  18862. , h = e("../enum/RenderLayers")
  18863. , u = e("../enum/RenderOrder")
  18864. , d = s.load("images/reticule-256x256.png");
  18865. (n.prototype = Object.create(r.Mesh.prototype)).move = function(e, t, i) {
  18866. this.hidden = i,
  18867. this.mouseLastMoveTime = Date.now()
  18868. }
  18869. ,
  18870. n.prototype.hide = function() {
  18871. this.hidden || (this.hidden = !0,
  18872. a.start(l.property(this.material.uniforms.opacity, "value", 0), o.reticuleOpacityTransitionTime))
  18873. }
  18874. ,
  18875. n.prototype.show = function() {
  18876. this.hidden = !1,
  18877. this.material.opacity <= 0 && a.start(l.property(this.material.uniforms.opacity, "value", o[this.player.mode].reticuleOpacity), o.reticuleOpacityTransitionTime)
  18878. }
  18879. ,
  18880. n.prototype.update = function() {
  18881. Date.now() - this.mouseLastMoveTime > o.hideReticuleTimeout && !this.hidden && this.hide()
  18882. }
  18883. ,
  18884. n.prototype.updatePosition = function(e, t) {
  18885. if (!this.hidden) {
  18886. if (!t)
  18887. return this.hide();
  18888. var i = t.point
  18889. , n = e.distanceTo(i)
  18890. , r = 1 + .01 * n;
  18891. n < 1 && (r -= 1 - n),
  18892. this.show(),
  18893. this.scale.set(r, r, r),
  18894. this.direction = this.direction.multiplyScalar(.8),
  18895. this.direction.add(t.face.normal.clone().multiplyScalar(.2)),
  18896. this.position.copy(i).add(t.face.normal.clone().multiplyScalar(.01)),
  18897. this.lookAt(this.position.clone().add(this.direction))
  18898. }
  18899. }
  18900. ,
  18901. n.prototype.writeAstag = function() {
  18902. var e = Math.floor(4294967296 * (1 + Math.random())).toString(16) + Math.floor(16 * (1 + Math.random())).toString(16)
  18903. , t = new Date;
  18904. this.tagCount = void 0 === this.tagCount ? 1 : this.tagCount + 1;
  18905. var i = {
  18906. enabled: !0,
  18907. version: "0",
  18908. created: t.toISOString(),
  18909. created_by: "APITest",
  18910. position: this.position.clone(),
  18911. stem: {
  18912. enabled: o.tags.pole.enabled,
  18913. direction: this.direction.multiplyScalar(o.tags.pole.height)
  18914. },
  18915. label: "tag " + this.tagCount,
  18916. description: "Description " + e,
  18917. floor: function(e) {
  18918. if (e.currentFloor) {
  18919. var t = e.floors.indexOf(e.currentFloor);
  18920. return -1 < t ? t : void 0
  18921. }
  18922. }(this.player.model),
  18923. type: "info",
  18924. metadata: {
  18925. preferred_camera: {
  18926. mode: this.player.mode
  18927. }
  18928. }
  18929. };
  18930. console.log("--------------------------"),
  18931. console.log(JSON.stringify(i));
  18932. var n = this.player.model.addtag(e, i).build();
  18933. n && (n.disc && this.player.tagDiscs.push(n.disc),
  18934. n.visible || n.show(o.tags.startup.fadeInDuration))
  18935. }
  18936. ,
  18937. t.exports = n
  18938. }
  18939. , {
  18940. "../enum/RenderLayers": 41,
  18941. "../enum/RenderOrder": 42,
  18942. "../settings": 166,
  18943. "../shaders": 167,
  18944. "../util/lerp": 188,
  18945. "../util/texture": 194,
  18946. "../util/transitions": 195,
  18947. three: 217
  18948. }],
  18949. 150: [function(e, t, i) {
  18950. "use strict";
  18951. function n(e, t) {
  18952. this.chunks = [],
  18953. this.floorId = e,
  18954. this.roomId = t,
  18955. this.position = new l.Vector3
  18956. }
  18957. var l = e("three");
  18958. n.prototype.addChunk = function(e) {
  18959. this.chunks.push(e)
  18960. }
  18961. ,
  18962. n.prototype.calcBoundaries = function() {
  18963. 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++) {
  18964. var a = this.chunks[o].geometry.attributes.position;
  18965. if (a)
  18966. for (var s = 0; s < a.array.length; s += 3)
  18967. e.set(a.array[s], a.array[s + 1], a.array[s + 2]),
  18968. t.add(e),
  18969. 0 === s ? (i.copy(e),
  18970. n.copy(e)) : (i.max(e),
  18971. n.min(e)),
  18972. r++
  18973. }
  18974. 0 < r ? (t.multiplyScalar(1 / r),
  18975. this.average = t) : this.average = null,
  18976. this.boundsMax = i,
  18977. this.boundsMin = n,
  18978. this.center = new l.Vector3,
  18979. this.center.copy(i).sub(n).multiplyScalar(.5).add(n)
  18980. }
  18981. ,
  18982. t.exports = n
  18983. }
  18984. , {
  18985. three: 217
  18986. }],
  18987. 151: [function(o, v, e) {
  18988. (function(e) {
  18989. "use strict";
  18990. function t(e, t, i) {
  18991. this.obj3d = null,
  18992. this.nodes = [],
  18993. this.colorHull = [],
  18994. this.shortPaths = {},
  18995. this.floorHull = null,
  18996. this.cameraHull = null,
  18997. this.floorPathDistance = 0,
  18998. this.floorCurvePoints = null,
  18999. this.floorCurveColors = null,
  19000. this.camCurvePoints = null,
  19001. this.warpDestHeroLoc = null,
  19002. this.warpDestPano = null,
  19003. this.warpPathPoints = null,
  19004. this.warpPathLengths = [0],
  19005. this.warpLength = 0,
  19006. this.closeWarpDistance = 4,
  19007. this.UP = U.UP.clone(),
  19008. this.longestStep = 0,
  19009. this.upcomingTransType = null,
  19010. this.burnsDir = 1,
  19011. this.prevNextDist = 0,
  19012. this.nextI = 0,
  19013. this.activeTransType = null,
  19014. this.lastTransType = null,
  19015. this.bunnyObj = null,
  19016. this.director = e,
  19017. this.player = t,
  19018. this.playerControls = i,
  19019. this.modelManager = t.modelManager,
  19020. this.updateModel(),
  19021. this.updateDefaultsFromModelData(),
  19022. this.bindEvents(),
  19023. this.warping = !1,
  19024. this.waitingToWarp = !1,
  19025. this.warpInterrupted = !1,
  19026. this.warpInterruptionBlackoutStyle = null,
  19027. this.warpInterruptionTravelTime = null
  19028. }
  19029. 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"),
  19030. o("../util/texture")), U = o("../enum/Vectors"), H = (o("../model/ModelManager"),
  19031. new i(e)), g = o("../enum/PlayerEvents"), z = o("../enum/BlackoutStyle"), r = o("../enum/ModelManagerEvents"), m = o("../constants"), I = {
  19032. 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"),
  19033. pathEnd: n.load("images/End.png"),
  19034. 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==")
  19035. };
  19036. t.prototype.setScene = function(e) {
  19037. this.createCpm(e),
  19038. this.createBunnyObj(e)
  19039. }
  19040. ,
  19041. t.prototype.updateModel = function() {
  19042. this.model = this.modelManager.getActiveModel()
  19043. }
  19044. ,
  19045. t.prototype.bindEvents = function() {
  19046. this.modelManager.on(r.ActiveModelChanged, this.updateModel.bind(this))
  19047. }
  19048. ,
  19049. t.prototype.updateDefaultsFromModelData = function() {
  19050. this.model.data
  19051. }
  19052. ,
  19053. t.prototype.pointPathDistance = function(e) {
  19054. for (var t = 0, i = 1; i < e.length; i += 1)
  19055. t += e[i - 1].distanceTo(e[i]);
  19056. return t
  19057. }
  19058. ,
  19059. t.prototype.pointPathLengths = function(e) {
  19060. for (var t = [0], i = 1; i < e.length; i += 1)
  19061. t.push(t[i - 1] + e[i - 1].distanceTo(e[i]));
  19062. return t
  19063. }
  19064. ,
  19065. t.prototype.interpAlongPath = function(e, t, i) {
  19066. var n, r = new P.Vector3, o = t[t.length - 1];
  19067. if (i < 1) {
  19068. n = i * o;
  19069. for (var a = 1; a < t.length; a += 1)
  19070. if (t[a] > n) {
  19071. var s = (n - t[a - 1]) / (t[a] - t[a - 1]);
  19072. return r.copy(e[a]),
  19073. r.sub(e[a - 1]),
  19074. r.multiplyScalar(s),
  19075. r.add(e[a - 1]),
  19076. r
  19077. }
  19078. } else
  19079. r.copy(e[e.length - 1]);
  19080. return r
  19081. }
  19082. ,
  19083. t.prototype.pathHeight = function() {
  19084. return this.player.mode !== O.FLOORPLAN ? D.path.height : D.path.outsideHeight
  19085. }
  19086. ,
  19087. t.prototype.createBunnyObj = function(e) {
  19088. this.bunnyObj || (this.bunnyObj = new P.AxisHelper(.1),
  19089. this.bunnyObj.visible = D.warp.showBunny),
  19090. this.bunnyObj.parent && this.bunnyObj.parent.remove(bunnyObj),
  19091. e.add(this.bunnyObj)
  19092. }
  19093. ,
  19094. t.prototype.createCpm = function(e) {
  19095. if (!this.currentPanoMarker) {
  19096. var t = this.makeWaypointObj(I.pathEnd, "Current");
  19097. t.material.uniforms.opacity.value = 0,
  19098. this.currentPanoMarker = {
  19099. mesh: t,
  19100. placed: !1
  19101. }
  19102. }
  19103. this.currentPanoMarker.mesh.parent && this.currentPanoMarker.mesh.parent.remove(this.currentPanoMarker.mesh),
  19104. this.placeCpm(),
  19105. this.currentPanoMarker.mesh.parent || e.add(this.currentPanoMarker.mesh)
  19106. }
  19107. ,
  19108. t.prototype.placeCpm = function() {
  19109. if (D.path.mapGuides && this.player.currentPano && this.player.currentPano.isAligned()) {
  19110. var e = this.player.currentPano.floor;
  19111. this.currentPanoMarker.mesh.parent !== this.player.currentPano.floor && (this.currentPanoMarker.mesh.parent && this.currentPanoMarker.mesh.parent.remove(this.currentPanoMarker.mesh),
  19112. e.add(this.currentPanoMarker.mesh)),
  19113. this.currentPanoMarker.mesh.position.copy(this.player.currentPano.floorPosition).sub(e.position),
  19114. this.currentPanoMarker.mesh.position.y += this.pathHeight(),
  19115. this.currentPanoMarker.placed = !0
  19116. } else
  19117. this.popOutCpm()
  19118. }
  19119. ,
  19120. t.prototype.fadeInCpm = function(e) {
  19121. 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)
  19122. }
  19123. ,
  19124. t.prototype.fadeOutCpm = function(e) {
  19125. V.start(F.property(this.currentPanoMarker.mesh.material.uniforms.opacity, "value", 0), e)
  19126. }
  19127. ,
  19128. t.prototype.popInCpm = function() {
  19129. D.path.mapGuides && this.currentPanoMarker.placed && this.fadeInCpm(2)
  19130. }
  19131. ,
  19132. t.prototype.popOutCpm = function() {
  19133. this.fadeOutCpm(2)
  19134. }
  19135. ,
  19136. t.prototype.brushPrefs = {
  19137. linewidth: 7,
  19138. strokeWidth: 15,
  19139. cvSegments: 48,
  19140. paveStep: .1,
  19141. paveWidth: .2,
  19142. lookBlendDist: 3,
  19143. maxTurn: P.Math.degToRad(2)
  19144. },
  19145. t.prototype.panoPathDistance = function(e) {
  19146. var t = this.model.panos;
  19147. if (!e || e.length < 2)
  19148. return 0;
  19149. for (var i = [], n = 0; n < e.length; n += 1)
  19150. i.push(t.get(e[n]).floorPosition);
  19151. return this.pointPathDistance(i)
  19152. }
  19153. ,
  19154. t.prototype.loadTileTexture = function(t) {
  19155. var e = n.load(t, function(e) {
  19156. e.wrapS = P.RepeatWrapping,
  19157. e.wrapT = P.RepeatWrapping,
  19158. e.needsUpdate = !0,
  19159. H.debug('path texture "' + t + '" is ready')
  19160. }, function() {
  19161. H.error('path texture "' + t + '" failed')
  19162. });
  19163. return e.mapping = P.UVMapping,
  19164. e
  19165. }
  19166. ,
  19167. t.prototype.buildWarpDestinationDescriptor = function(e, t, i, n, r, o) {
  19168. return new l({
  19169. cameraMode: n,
  19170. position: e,
  19171. quaternion: t,
  19172. panoId: i,
  19173. orthoZoom: o,
  19174. floorVisibility: r,
  19175. thumbUrl: null,
  19176. name: null
  19177. })
  19178. }
  19179. ,
  19180. t.prototype.buildWarpDestinationDescriptorFromHero = function(e) {
  19181. return this.buildWarpDestinationDescriptor(e.position, e.quaternion, this.getHeroId(e), e.cameraMode, e.floorVisibility, e.orthoZoom)
  19182. }
  19183. ,
  19184. t.prototype.setWarpDestination = function(e) {
  19185. this.warpDestHeroLoc = e
  19186. }
  19187. ,
  19188. t.prototype.setWarpDestinationByHeroIndex = function(e) {
  19189. var t = this.getHeroDescriptorByHeroIndex(e);
  19190. return null !== t && (this.setWarpDestination(t),
  19191. !0)
  19192. }
  19193. ,
  19194. t.prototype.setWarpDestinationByPano = function(e, t) {
  19195. return !!this.model.panos.get(e.id) && this.setWarpDestinationByPanoId(e.id, t)
  19196. }
  19197. ,
  19198. t.prototype.setWarpDestinationByPanoId = function(e, t) {
  19199. var i = this.model.panos.get(e);
  19200. if (i) {
  19201. t = t || new P.Quaternion;
  19202. var n = this.buildWarpDestinationDescriptor(i.position, t, i.id, "panorama", [], -1);
  19203. return this.setWarpDestination(n),
  19204. !0
  19205. }
  19206. return !1
  19207. }
  19208. ,
  19209. t.prototype.getHeroDescriptorByHeroIndex = function(e) {
  19210. var t = this.model.heroCount();
  19211. if (null !== this.warpDestHeroLoc && t < 1)
  19212. return H.info("ShowPath.getHeroDescriptorByHeroIndex() -> Only one hero location is available."),
  19213. this.model.getHeroDescriptorByIndex(0);
  19214. var i = this.model.getHeroDescriptorByIndex(e);
  19215. if (i) {
  19216. var n = i.isPano() ? i.panoId : i.cameraMode;
  19217. H.debug('ShowPath.getHeroDescriptorByHeroIndex() -> New brush/warp destination: "' + n + '" out of ' + t + " choices.")
  19218. }
  19219. return i
  19220. }
  19221. ,
  19222. t.prototype.getHeroDescriptorByPano = function(e) {
  19223. return this.model.panos.get(e.id) ? this.getHeroDescriptorByPanoId(e.id) : null
  19224. }
  19225. ,
  19226. t.prototype.getHeroDescriptorByPanoId = function(e) {
  19227. var t = this.getHeroIndexFromPanoId(e);
  19228. return this.getHeroDescriptorByHeroIndex(t)
  19229. }
  19230. ,
  19231. t.prototype.getHeroIndexFromPanoId = function(e) {
  19232. for (var t = 0; t < this.model.heroLocations.length; t++) {
  19233. var i = this.model.heroLocations[t]
  19234. , n = this.getHeroId(i);
  19235. if (n && n === e)
  19236. return t
  19237. }
  19238. return -1
  19239. }
  19240. ,
  19241. t.prototype.getHeroPano = function(e) {
  19242. if (null === e)
  19243. return H.warn("getHeroPano(): no destination"),
  19244. null;
  19245. var t = this.getHeroId(e)
  19246. , i = this.model.panos.get(t);
  19247. return void 0 === i && (i = null,
  19248. "" !== t && H.debug('unable to find pano "' + t + '"')),
  19249. i
  19250. }
  19251. ,
  19252. t.prototype.getHeroId = function(e) {
  19253. return e.panoId
  19254. }
  19255. ,
  19256. t.prototype.setWarpDestPano = function() {
  19257. return this.warpDestPano = this.getHeroPano(this.warpDestHeroLoc),
  19258. this.warpDestPano
  19259. }
  19260. ,
  19261. t.prototype.brushToWarpPano = function(e, t) {
  19262. if (this.discardPathObject(),
  19263. !this.setWarpDestPano())
  19264. return !1;
  19265. if (this.warpDestHeroLoc.cameraMode !== O.PANORAMA && H.warn("Can only brush from pano to pano"),
  19266. !this.warpDestPano)
  19267. return H.info("No brush"),
  19268. !1;
  19269. if (!this.player.currentPano)
  19270. return H.debug("No current pano, visibility undefined"),
  19271. !1;
  19272. if (!this.warpDestPano)
  19273. return H.info("No wPano, visibility undefined"),
  19274. !1;
  19275. if (!this.warpDestPano.isAligned())
  19276. return H.debug("Cannot brush to unaligned pano"),
  19277. !1;
  19278. var i = (e === L.STD || e === L.WALK) && D.path.mapGuides
  19279. , n = !0;
  19280. if (this.player.currentPano.id === this.warpDestPano.id)
  19281. H.debug("Already at destination pano");
  19282. else {
  19283. this.nodes = this.findShortestPath(this.player.currentPano, this.warpDestPano),
  19284. n = void 0 === this.nodes || null === this.nodes || this.nodes.length < 1,
  19285. this.obj3d = new P.Object3D,
  19286. H.debug('Brushing from "' + this.player.currentPano.id + '" to "' + this.warpDestPano.id + '" (' + (this.nodes ? this.nodes.length : 0) + ")"),
  19287. n ? (H.info('No "walkable" route, using fall-back warp style transition'),
  19288. e = t) : (this.setPathHulls(this.nodes),
  19289. this.setFloorCurves(),
  19290. 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)))),
  19291. this.player.currentPano.floor.add(this.obj3d);
  19292. var r = this.player.mode === O.DOLLHOUSE || this.player.mode === O.FLOORPLAN
  19293. , o = e === L.STD;
  19294. if (!n && (i || o)) {
  19295. if (r) {
  19296. var a = this.makeStartMarker(this.floorHull[0], this.floorCurvePoints);
  19297. this.obj3d.add(a)
  19298. }
  19299. var s = this.makeEndMarker(this.floorHull[this.floorHull.length - 1]);
  19300. this.obj3d.add(s)
  19301. }
  19302. this.appearSlow()
  19303. }
  19304. return this.upcomingTransType = e,
  19305. !n
  19306. }
  19307. ,
  19308. t.prototype.findShortestPath = function(e, t) {
  19309. if (!e || !t)
  19310. return null;
  19311. var i = D.warp.walkExtraPanosDistance
  19312. , n = e.id + ":" + t.id + ":" + i;
  19313. if (this.shortPaths.hasOwnProperty(n))
  19314. return this.shortPaths[n] ? this.shortPaths[n].slice() : null;
  19315. var r = t.id + ":" + e.id + ":" + i;
  19316. if (this.shortPaths.hasOwnProperty(r))
  19317. return this.shortPaths[r] ? this.shortPaths[r].slice().reverse() : null;
  19318. var o = this.model.panos.aStarSearch(e, t);
  19319. return this.model.panos.includeNodesNearPath(o, i),
  19320. this.shortPaths[n] = o ? o.slice() : null,
  19321. o
  19322. }
  19323. ,
  19324. t.prototype.makePathHulls = function(e) {
  19325. var t, i, n, r, o, a = 0, s = [], l = [], c = [], h = this.model.panos;
  19326. r = (t = h.get(e[0])).floor.floorIndex;
  19327. for (var u = 0; u < e.length; u += 1)
  19328. (i = (t = h.get(e[u])).floorPosition.clone().sub(this.model.position)).y += this.pathHeight(),
  19329. s.push(i),
  19330. l.push(t.position.clone()),
  19331. n = t.floor.floorIndex,
  19332. c.push(r < n ? D.path.colorUp : n < r ? D.path.colorDown : D.path.color),
  19333. 0 < u && (a < (o = l[u].distanceTo(l[u - 1])) && (a = o));
  19334. return a > this.longestStep && (this.longestStep = a,
  19335. H.debug("path contains " + a + " meter segment")),
  19336. {
  19337. floor: s,
  19338. camera: l,
  19339. color: c
  19340. }
  19341. }
  19342. ,
  19343. t.prototype.makeFloorCurves = function(e, t, i) {
  19344. var n = this.player.mode === O.PANORAMA ? D.path.waypointIndoorRadius : D.path.waypointRadius
  19345. , r = this.pointPathDistance(e) - 2 * n
  19346. , o = e.slice(0)
  19347. , a = o[1].clone().sub(o[0]);
  19348. a.y = 0,
  19349. a.normalize().multiplyScalar(n),
  19350. o[0] = (new P.Vector3).copy(o[0]).add(a),
  19351. (a = o[o.length - 2].clone().sub(o[o.length - 1])).y = 0,
  19352. a.normalize().multiplyScalar(n),
  19353. o[o.length - 1] = (new P.Vector3).copy(o[o.length - 1]).add(a);
  19354. var s = new P.CatmullRomCurve3(o)
  19355. , l = Math.floor(r / i);
  19356. l = 4 * Math.floor(l / 4),
  19357. l = Math.max(4, l);
  19358. for (var c, h, u = s.getSpacedPoints(l), d = [], p = new P.Vector3, f = 0; f < u.length; f += 1) {
  19359. h = 0,
  19360. c = u[f].distanceTo(e[0]);
  19361. for (var g = 1; g < e.length; g += 1)
  19362. p.copy(u[f]).sub(e[g]),
  19363. p.y *= 4,
  19364. p.length() < c && (h = g);
  19365. d.push(t[h])
  19366. }
  19367. return {
  19368. distance: r,
  19369. points: u,
  19370. colors: d
  19371. }
  19372. }
  19373. ,
  19374. t.prototype.makeCameraCurvePoints = function(e, t) {
  19375. var i = this.pointPathDistance(e);
  19376. return new P.CatmullRomCurve3(e).getSpacedPoints(Math.max(2, Math.floor(i / t)))
  19377. }
  19378. ,
  19379. t.prototype.makeCameraCurveTangents = function(e, t) {
  19380. var i = this.pointPathDistance(e)
  19381. , n = new P.CatmullRomCurve3(e)
  19382. , r = Math.max(2, Math.floor(i / t));
  19383. r = r || 5;
  19384. for (var o = [], a = 0; a <= r; a++)
  19385. o.push(n.getTangentAt(a / r));
  19386. return o
  19387. }
  19388. ,
  19389. t.prototype.setPathHulls = function(e) {
  19390. var t = this.makePathHulls(e);
  19391. this.floorHull = t.floor,
  19392. this.cameraHull = t.camera,
  19393. this.colorHull = t.color
  19394. }
  19395. ,
  19396. t.prototype.setFloorCurves = function() {
  19397. var e = this.makeFloorCurves(this.floorHull, this.colorHull, this.brushPrefs.paveStep);
  19398. this.floorPathDistance = e.distance,
  19399. this.floorCurvePoints = e.points,
  19400. this.floorCurveColors = e.colors
  19401. }
  19402. ,
  19403. t.prototype.setCameraCurvePoints = function() {
  19404. this.camCurvePoints = this.makeCameraCurvePoints(this.cameraHull, D.warp.stepFactor * this.brushPrefs.paveStep)
  19405. }
  19406. ,
  19407. t.prototype.chooseWarpPath = function(e) {
  19408. var t, i, n, r = this.playerControls.cameras[O.PANORAMA];
  19409. if (this.player.currentPano === this.warpDestPano || !e)
  19410. return this.warpPathPoints = null,
  19411. this.warpLength = 0,
  19412. !1;
  19413. this.nodes = this.findShortestPath(this.player.currentPano, this.warpDestPano),
  19414. void 0 === this.nodes || null === this.nodes || this.nodes.length < 1 ? (H.debug("warp path to unreachable node"),
  19415. i = (t = this.warpDestPano.position.clone().sub(r.position)).clone().negate(),
  19416. t.multiplyScalar(.15).add(r.position),
  19417. i.multiplyScalar(.15).add(this.warpDestPano.position),
  19418. t.y = r.position.y,
  19419. i.y = this.warpDestPano.position.y,
  19420. n = new P.CubicBezierCurve3(r.position.clone(),t,i,this.warpDestPano.position.clone()),
  19421. this.warpPathPoints = n.getSpacedPoints(this.brushPrefs.cvSegments)) : (H.debug("follow warp path (path distance was " + this.nodes.length + " nodes, " + this.floorPathDistance + ")"),
  19422. this.setCameraCurvePoints(),
  19423. this.warpPathPoints = this.camCurvePoints.slice(0)),
  19424. this.warpLength = 0,
  19425. this.warpPathLengths = [0];
  19426. 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) {
  19427. o.copy(this.warpPathPoints[c - 1]).sub(this.warpPathPoints[c]);
  19428. var h = o.length();
  19429. o.y *= D.warp.climbEffort;
  19430. var u = o.length() / h;
  19431. if (1 < c) {
  19432. o.setY(0).normalize(),
  19433. a.copy(this.warpPathPoints[c - 2]).sub(this.warpPathPoints[c - 1]).setY(0).normalize();
  19434. var d = Math.min(1, o.dot(a))
  19435. , p = 1 + (D.warp.brakeStrength - 1) * (1 - P.Math.smoothstep(d, l, s));
  19436. u = Math.max(p, u)
  19437. }
  19438. this.warpLength += h * u,
  19439. this.warpPathLengths[c] = this.warpLength
  19440. }
  19441. return !0
  19442. }
  19443. ,
  19444. t.prototype.drawPathRibbon = function(e, t) {
  19445. this.bunnyObj.visible = D.warp.showBunny;
  19446. 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) {
  19447. a.copy(e[s]),
  19448. 0 === s ? a.sub(e[s + 1]) : a.sub(e[s - 1]).negate(),
  19449. a.normalize(),
  19450. n.crossVectors(a, U.UP),
  19451. n.multiplyScalar(i);
  19452. var l = (new P.Vector3).copy(e[s]).add(r);
  19453. l.sub(n),
  19454. o.vertices.push(l),
  19455. (l = (new P.Vector3).copy(e[s]).add(r)).add(n),
  19456. o.vertices.push(l)
  19457. }
  19458. var c, h, u, d = 0;
  19459. for (s = 0; s < e.length - 1; s += 1) {
  19460. var p = 2 * s
  19461. , f = d
  19462. , g = d += e[s + 1].distanceTo(e[s])
  19463. , m = t[s]
  19464. , v = t[s + 1];
  19465. (c = new P.Face3(p,1 + p,2 + p)).vertexColors = [new P.Color(m), new P.Color(m), new P.Color(v)],
  19466. o.faces.push(c),
  19467. o.faceVertexUvs[0].push([new P.Vector2(0,f), new P.Vector2(1,f), new P.Vector2(0,g)]),
  19468. (c = new P.Face3(2 + p,1 + p,3 + p)).vertexColors = [new P.Color(v), new P.Color(m), new P.Color(v)],
  19469. o.faces.push(c),
  19470. o.faceVertexUvs[0].push([new P.Vector2(0,g), new P.Vector2(1,f), new P.Vector2(1,g)])
  19471. }
  19472. o.computeFaceNormals(),
  19473. o.computeVertexNormals(),
  19474. h = this.player.mode === O.PANORAMA ? ((u = P.UniformsUtils.clone(C.ribbon.uniforms)).map.value = I.path,
  19475. u.opacity.value = 0,
  19476. u.color.value.set(D.path.color),
  19477. new P.RawShaderMaterial({
  19478. side: P.DoubleSide,
  19479. depthWrite: !1,
  19480. transparent: !0,
  19481. vertexShader: C.ribbon.vertexShader,
  19482. fragmentShader: C.ribbon.fragmentShader,
  19483. uniforms: u,
  19484. name: "ribbonT",
  19485. opacity: 0
  19486. })) : new P.MeshBasicMaterial({
  19487. color: 16777215,
  19488. side: P.DoubleSide,
  19489. name: "ribbonOut",
  19490. vertexColors: P.VertexColors
  19491. });
  19492. var y = new P.Mesh(o,h);
  19493. return y.name = "ribbon",
  19494. this.player.mode === O.PANORAMA && (y.renderOrder = A.ribbon),
  19495. y
  19496. }
  19497. ,
  19498. t.prototype.drawPathPavement = function(e) {
  19499. for (var t, i = new P.Vector3, n = new P.Geometry, r = new P.Vector3, o = 0; o < e.length; o += 1)
  19500. r.copy(e[o]),
  19501. 0 === o ? r.sub(e[o + 1]).negate() : r.sub(e[o - 1]),
  19502. r.normalize(),
  19503. i.crossVectors(r, U.UP),
  19504. i.multiplyScalar(this.brushPrefs.paveWidth),
  19505. (t = (new P.Vector3).copy(e[o])).sub(i),
  19506. n.vertices.push(t),
  19507. n.vertices.push((new P.Vector3).copy(e[o])),
  19508. (t = (new P.Vector3).copy(e[o])).add(i),
  19509. n.vertices.push(t);
  19510. var a, s, l;
  19511. for (o = 0; o < e.length - 1; o += 1)
  19512. a = 3 * o + 1,
  19513. l = .25 + (s = .25 * o),
  19514. n.faces.push(new P.Face3(a - 1,a,3 + a)),
  19515. n.faceVertexUvs[0].push([new P.Vector2(0,s), new P.Vector2(.5,s), new P.Vector2(.5,l)]),
  19516. n.faces.push(new P.Face3(3 + a,2 + a,a - 1)),
  19517. n.faceVertexUvs[0].push([new P.Vector2(.5,l), new P.Vector2(0,l), new P.Vector2(0,s)]),
  19518. n.faces.push(new P.Face3(3 + a,a,1 + a)),
  19519. n.faceVertexUvs[0].push([new P.Vector2(.5,l), new P.Vector2(.5,s), new P.Vector2(1,s)]),
  19520. n.faces.push(new P.Face3(3 + a,1 + a,4 + a)),
  19521. n.faceVertexUvs[0].push([new P.Vector2(.5,l), new P.Vector2(1,s), new P.Vector2(1,l)]);
  19522. var c = this.player.mode === O.PANORAMA ? new P.MeshBasicMaterial({
  19523. color: D.path.color,
  19524. side: P.DoubleSide,
  19525. transparent: !0,
  19526. depthWrite: !1,
  19527. opacity: 0,
  19528. name: "paveT",
  19529. map: I.path
  19530. }) : new P.MeshBasicMaterial({
  19531. color: D.path.color,
  19532. side: P.DoubleSide,
  19533. transparent: !0,
  19534. depthWrite: !1,
  19535. opacity: 1,
  19536. name: "paveO",
  19537. map: I.path
  19538. });
  19539. return new P.Mesh(n,c)
  19540. }
  19541. ,
  19542. t.prototype.hintPrefs = {
  19543. rad: .18,
  19544. width: .0125,
  19545. depth: .0625,
  19546. setBack: -.04,
  19547. markRad: .25,
  19548. markInnerRad: .16
  19549. },
  19550. t.prototype.makeWaypointObj = function(e, t) {
  19551. var i = new P.Geometry
  19552. , n = this.player.mode === O.PANORAMA ? D.path.waypointIndoorRadius : D.path.waypointRadius
  19553. , r = this.pathHeight();
  19554. 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)),
  19555. i.faces.push(new P.Face3(0,1,2), new P.Face3(2,3,0)),
  19556. i.faceVertexUvs[0].push([new P.Vector2(0,0), new P.Vector2(1,0), new P.Vector2(1,1)]),
  19557. i.faceVertexUvs[0].push([new P.Vector2(1,1), new P.Vector2(0,1), new P.Vector2(0,0)]);
  19558. var o = P.UniformsUtils.clone(C.waypoint.uniforms);
  19559. o.map.value = e,
  19560. o.opacity.value = 0,
  19561. o.color.value.set(D.path.color);
  19562. var a = {
  19563. side: P.DoubleSide,
  19564. depthWrite: !1,
  19565. transparent: !0,
  19566. vertexShader: C.waypoint.vertexShader,
  19567. fragmentShader: C.waypoint.fragmentShader,
  19568. uniforms: o,
  19569. name: "waypoint",
  19570. opacity: 0
  19571. };
  19572. this.player.mode !== O.PANORAMA && (a.depthTest = !1,
  19573. a.name = "wayPtOut");
  19574. var s = new P.RawShaderMaterial(a)
  19575. , l = new P.Mesh(i,s);
  19576. return l.name = t,
  19577. l
  19578. }
  19579. ,
  19580. t.prototype.makeStartMarker = function(e, t) {
  19581. var i = (new P.Vector3).copy(t[1]).sub(t[0]);
  19582. i.y = 0,
  19583. i.normalize();
  19584. var n = Math.acos(i.x)
  19585. , r = this.makeWaypointObj(I.pathStart, "Start");
  19586. return r.rotateOnAxis(new P.Vector3(0,1,0), n),
  19587. r.position.copy(e),
  19588. r
  19589. }
  19590. ,
  19591. t.prototype.makeEndMarker = function(e) {
  19592. var t = this.makeWaypointObj(I.pathEnd, "End")
  19593. , i = this.model.panos.get(this.nodes[0]).floor.floorIndex
  19594. , n = this.model.panos.get(this.nodes[this.nodes.length - 1]).floor.floorIndex;
  19595. return i < n ? t.material.uniforms.color.value.set(D.path.colorUp) : n < i && t.material.uniforms.color.value.set(D.path.colorDown),
  19596. t.position.copy(e),
  19597. t
  19598. }
  19599. ,
  19600. t.prototype.pathClean = function(e) {
  19601. if (e) {
  19602. for (var t in e.children)
  19603. this.pathClean(e.children[t]);
  19604. e.geometry && e.geometry.dispose(),
  19605. e.material && e.material.dispose()
  19606. }
  19607. }
  19608. ,
  19609. t.prototype.discardPathObject = function() {
  19610. if (this.obj3d) {
  19611. var e = this.obj3d.parent;
  19612. e && e.remove(this.obj3d),
  19613. this.pathClean(this.obj3d)
  19614. }
  19615. this.obj3d = null,
  19616. this.popInCpm()
  19617. }
  19618. ,
  19619. t.prototype.discardSlow = function() {
  19620. if (this.obj3d) {
  19621. if (this.player.mode !== O.PANORAMA)
  19622. return void this.discardPathObject();
  19623. for (var e, t = 0, i = function() {
  19624. this.discardPathObject()
  19625. }
  19626. .bind(this), n = 0; n < this.obj3d.children.length; n += 1)
  19627. 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]),
  19628. t += 1,
  19629. i = null);
  19630. 0 === t && this.discardPathObject(),
  19631. this.player.mode !== O.PANORAMA && this.fadeInCpm(D.path.fadeInTime - 3)
  19632. }
  19633. }
  19634. ,
  19635. t.prototype.appearSlow = function() {
  19636. var e;
  19637. this.fadeOutCpm(D.path.fadeInTime);
  19638. for (var t = this.player.mode === O.PANORAMA ? D.path.opacity : 1, i = 0; i < this.obj3d.children.length; i += 1)
  19639. 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]))
  19640. }
  19641. ,
  19642. t.prototype.update = function() {
  19643. this.obj3d && this.obj3d.updateMatrixWorld()
  19644. }
  19645. ,
  19646. t.prototype.calcBurnsAmount = function(e) {
  19647. var n = P.Math.degToRad(D.warp.burnsAngle);
  19648. if (this.player.mode !== O.PANORAMA)
  19649. return this.player.mode === O.DOLLHOUSE ? .02 * this.burnsDir : this.burnsDir;
  19650. var t = this.burnsDir * n;
  19651. if (this.upcomingTransType === L.BLACK)
  19652. return t;
  19653. var i = e;
  19654. if (null === i)
  19655. return H.warn("Transition request for non-highlight"),
  19656. t;
  19657. var r = this.getHeroDescriptorByHeroIndex(i);
  19658. if (null === r)
  19659. return t;
  19660. if (!r.isPano())
  19661. return t;
  19662. function o(e) {
  19663. var t = Math.acos(Math.min(1, e.dot(l)))
  19664. , i = (new P.Vector3).crossVectors(l, e);
  19665. return Math.max(c, Math.min(Math.abs(t), n)) * Math.sign(i.y)
  19666. }
  19667. var a = this.getHeroPano(r)
  19668. , s = this.playerControls.cameras[O.PANORAMA]
  19669. , l = U.FORWARD.clone().applyQuaternion(s.quaternion).setY(0).normalize()
  19670. , c = Math.min(P.Math.degToRad(D.warp.minBurnsAngle), n);
  19671. if (a === this.player.currentPano)
  19672. return o(U.FORWARD.clone().applyQuaternion(r.quaternion).setY(0).normalize());
  19673. var h = this.findShortestPath(this.player.currentPano, a);
  19674. if (null == h || h.length < 1)
  19675. return H.debug("Empty path ahead..."),
  19676. t;
  19677. var u = this.makePathHulls(h)
  19678. , d = new P.CatmullRomCurve3(u.camera)
  19679. , p = Math.min(.1, D.warp.lookAheadDist / d.getLength());
  19680. return o(d.getPointAt(p).clone().sub(s.position).setY(0).normalize())
  19681. }
  19682. ,
  19683. t.prototype.waitNextStep = function(e, t, i) {
  19684. var o = null == i ? D.warp.tourStepDelay : i;
  19685. o = o != void 0? o: (this.lastTransType === L.BLACK ? m.tourStepDelaySlideShow : m.tourStepDelayDefault);
  19686. var a = new P.Euler
  19687. , s = new P.Vector3;
  19688. H.debug("Starting wait: " + (void 0 !== t));
  19689. var currentLocation = this.model.heroLocations[this.director.currentItem[0]]
  19690. var l = currentLocation.dontRot || this.calcBurnsAmount(e)
  19691. , c = function() {
  19692. this.endWarpState(),
  19693. this.player.mode === O.DOLLHOUSE && (this.playerControls.cameras[O.DOLLHOUSE].controls.rotationAcceleration.x = 0),
  19694. t && t()
  19695. }
  19696. .bind(this)
  19697. , n = function(e, t) {
  19698. if (this.warpInterrupted)
  19699. return c(),
  19700. !0;
  19701. var i = t || 1e3 / 60;
  19702. if (D.warp.doBurns && !currentLocation.dontRot )
  19703. if (this.player.mode === O.PANORAMA) {
  19704. var n = this.playerControls.cameras[O.PANORAMA];
  19705. a.setFromQuaternion(n.quaternion, D.warp.eOrder);
  19706. var r = o == 0 ? l : i * l / o;
  19707. r = Math.sign(r) * Math.max(r, 0.0001) //add 如果音频长的话,使旋转可见,否则以为停住了
  19708. a.y += r,
  19709. s.set(0, 0, -1),
  19710. s.applyEuler(a),
  19711. s.add(n.position),
  19712. n.controls.lookAt(s),
  19713. n.controls.lookVector.copy(s),
  19714. n.lookAt(s)
  19715. } else
  19716. this.player.mode === O.DOLLHOUSE ? this.playerControls.controls[O.DOLLHOUSE].rotationAcceleration.x = l : this.playerControls.controls[O.FLOORPLAN].absoluteScale *= .9996
  19717. }
  19718. .bind(this);
  19719. this.startWarpState(),
  19720. V.start(n, o, c, 0, B.easeInOutQuad, "wait");
  19721. }
  19722. ,
  19723. t.prototype.warpToNonPano = function(e) {
  19724. if (this.discardPathObject(),
  19725. this.warpDestHeroLoc.cameraMode === O.DOLLHOUSE || this.warpDestHeroLoc.cameraMode === O.FLOORPLAN) {
  19726. var t = function() {
  19727. e && e()
  19728. }
  19729. .bind(this);
  19730. this.player.flyToNewMode({
  19731. mode: this.warpDestHeroLoc.cameraMode,
  19732. duration: D.warp.outsideTime,
  19733. warpDest: this.warpDestHeroLoc,
  19734. callback: t,
  19735. force: !0
  19736. })
  19737. } else
  19738. H.warn("no warp destination!!!"),
  19739. e && e()
  19740. }
  19741. ,
  19742. t.prototype._resetWarpShaderParams = function(e) {
  19743. this.player.mode === O.PANORAMA && (void 0 !== e.material.uniforms.blackout && (e.material.uniforms.blackout.value = 0),
  19744. void 0 !== e.material.uniforms.modelAlpha && (e.material.uniforms.modelAlpha.value = 0))
  19745. }
  19746. ,
  19747. t.prototype._clearWarpShading = function() {
  19748. for (var e = this.model.chunks, t = 0; t < e.length; t += 1)
  19749. this._resetWarpShaderParams(e[t]),
  19750. e[t].visible = !0;
  19751. this._resetWarpShaderParams(this.model.skybox)
  19752. }
  19753. ,
  19754. t.prototype._warpStopFlying = function() {
  19755. this.activeTransType = null,
  19756. this.placeCpm()
  19757. }
  19758. ,
  19759. t.prototype._wrapupTravelOnlyBits = function() {
  19760. this._warpStopFlying(),
  19761. this.warpPathPoints && (this.player.currentPano.exit(),
  19762. this.warpDestPano.enter(),
  19763. this.player.currentPano = this.warpDestPano),
  19764. this.player.spider.draw(),
  19765. this.placeCpm()
  19766. }
  19767. ,
  19768. t.prototype._wrapupTravel = function(e) {
  19769. this._wrapupTravelOnlyBits(),
  19770. this.warpCameraAim(e)
  19771. }
  19772. ,
  19773. t.prototype._wrapupWarpShading = function(e) {
  19774. this._clearWarpShading(),
  19775. this._wrapupTravel(e)
  19776. }
  19777. ,
  19778. t.prototype.wrapupWarpShadingOnly = function(e, t) {
  19779. t !== z.END && this._clearWarpShading(),
  19780. this._wrapupTravelOnlyBits(),
  19781. this.upcomingTransType = null,
  19782. e && e()
  19783. }
  19784. ,
  19785. t.prototype._warpCameraAim = function(e, t) {
  19786. var i = this.warpDestHeroLoc.quaternion
  19787. , n = this.playerControls.cameras[O.PANORAMA]
  19788. , r = new P.Vector3(0,0,1).applyQuaternion(i).normalize()
  19789. , o = new P.Vector3(0,0,1).applyQuaternion(n.quaternion).normalize().dot(r)
  19790. , a = P.Math.radToDeg(Math.acos(o))
  19791. , s = new P.Euler(0,0,0,D.warp.eOrder).setFromQuaternion(i, D.warp.eOrder)
  19792. , l = (new P.Euler).setFromQuaternion(n.quaternion, D.warp.eOrder)
  19793. , c = new P.Euler(s.x - l.x,s.y - l.y,s.z - l.z,D.warp.eOrder);
  19794. c.y = N.constrainedTurn(c.y),
  19795. this.burnsDir = Math.sign(c.y);
  19796. var h = new P.Euler(0,0,0,D.warp.eOrder)
  19797. , u = new P.Vector3
  19798. , d = function(e, t) {
  19799. return !!this.warpInterrupted || (h.x = l.x + e * c.x,
  19800. h.y = l.y + e * c.y,
  19801. h.z = l.z + e * c.z,
  19802. u.set(0, 0, -1),
  19803. u.applyEuler(h),
  19804. u.add(n.position),
  19805. n.controls.lookAt(u),
  19806. n.controls.lookVector.copy(u),
  19807. void n.lookAt(u))
  19808. }
  19809. .bind(this);
  19810. /* return a > D.warp.minRotation ? (V.start(d, e, t, 0, B[D.warp.movementEasing])
  19811. , (this.warpDestHeroLoc.zoom != this.player.zoomLevel) && //add 原地转向最终方位时
  19812. this.player.smoothZoomFovTo(null, this.warpDestHeroLoc.zoom , e)
  19813. )
  19814. : (H.info("Aim angle only is " + a.toPrecision(3) + " degrees, skipping explicit re-aim"),
  19815. void (t && t())) */
  19816. (this.warpDestHeroLoc.zoom != this.player.zoomLevel) && //add 原地转向最终方位时
  19817. this.player.smoothZoomFovTo(null, this.warpDestHeroLoc.zoom , e)
  19818. return a > D.warp.minRotation ? V.start(d, e, t, 0, B[D.warp.movementEasing])
  19819. : (/* H.info("Aim angle only is " + a.toPrecision(3) + " degrees, skipping explicit re-aim") ,*/
  19820. void (t && t()))
  19821. }
  19822. ,
  19823. t.prototype._warpBendAim = function(e, t, i, n) {
  19824. var r = n || 0
  19825. , o = this.playerControls.cameras[O.PANORAMA]
  19826. , a = new P.Euler(0,0,0,D.warp.eOrder).setFromQuaternion(this.warpDestHeroLoc.quaternion, D.warp.eOrder)
  19827. , s = (new P.Euler).setFromQuaternion(o.quaternion, D.warp.eOrder)
  19828. , l = new P.Euler(a.x - s.x,a.y - s.y,a.z - s.z,D.warp.eOrder);
  19829. l.y = N.constrainedTurn(l.y);
  19830. var c = Math.min(P.Math.degToRad(D.warp.softBendTilt), Math.abs(l.x));
  19831. l.x = c * Math.sign(l.x),
  19832. c = Math.min(P.Math.degToRad(Math.max(0, D.warp.softBendAngle)), c),
  19833. this.burnsDir = Math.sign(l.y),
  19834. c *= Math.sign(l.y),
  19835. l.y = c;
  19836. var h = new P.Euler(0,0,0,D.warp.eOrder)
  19837. , u = new P.Vector3
  19838. , d = function(e, t) {
  19839. if (e < .5)
  19840. h.x = s.x + e * l.x,
  19841. h.y = s.y + e * l.y,
  19842. h.z = s.z + e * l.z;
  19843. else {
  19844. var i = (1 - e) * D.warp.softBendEnd;
  19845. h.x = a.x - i * l.x,
  19846. h.y = a.y - i * l.y,
  19847. h.z = a.z - i * l.z
  19848. }
  19849. u.set(0, 0, -1),
  19850. u.applyEuler(h),
  19851. u.add(o.position),
  19852. o.controls.lookAt(u),
  19853. o.controls.lookVector.copy(u),
  19854. o.lookAt(u)
  19855. }
  19856. .bind(this);
  19857. return V.start(d, t, i, r, B[D.warp.movementEasing])
  19858. }
  19859. ,
  19860. t.prototype._warpStepCameraAim = function(e, t, i) {
  19861. var n = this.playerControls.cameras[O.PANORAMA]
  19862. , r = new P.Euler(0,0,0,D.warp.eOrder).setFromQuaternion(this.warpDestHeroLoc.quaternion, D.warp.eOrder)
  19863. , o = (new P.Euler).setFromQuaternion(n.quaternion, D.warp.eOrder)
  19864. , a = new P.Euler(r.x - o.x,r.y - o.y,r.z - o.z,D.warp.eOrder);
  19865. a.y = N.constrainedTurn(a.y),
  19866. this.burnsDir = Math.sign(a.y);
  19867. var s = new P.Euler(0,0,0,D.warp.eOrder)
  19868. , l = new P.Vector3
  19869. , c = function(e, t) {
  19870. e < .5 ? s.copy(o) : s.copy(r),
  19871. l.set(0, 0, -1),
  19872. l.applyEuler(s),
  19873. l.add(n.position),
  19874. n.controls.lookAt(l),
  19875. n.controls.lookVector.copy(l),
  19876. n.lookAt(l)
  19877. }
  19878. .bind(this);
  19879. return V.start(c, t, i, 0, B[D.warp.movementEasing])
  19880. }
  19881. ,
  19882. t.prototype.setBurnsDir = function() {
  19883. var e = this.playerControls.cameras[O.PANORAMA]
  19884. , t = new P.Euler(0,0,0,D.warp.eOrder).setFromQuaternion(this.warpDestHeroLoc.quaternion, D.warp.eOrder)
  19885. , i = (new P.Euler).setFromQuaternion(e.quaternion, D.warp.eOrder)
  19886. , n = new P.Euler(t.x - i.x,t.y - i.y,t.z - i.z,D.warp.eOrder);
  19887. n.y = N.constrainedTurn(n.y),
  19888. this.burnsDir = Math.sign(n.y)
  19889. }
  19890. ,
  19891. t.prototype.stepWarpPath = function(firstPos, e ) {
  19892. var i = this.playerControls.cameras[O.PANORAMA];
  19893. var n = this.warpPathPoints ? this.warpPathPoints[0] : firstPos
  19894. if (!n){
  19895. return i.position.copy(this.warpDestPano.position),
  19896. !0;
  19897. }
  19898. /* if (!this.warpPathPoints)
  19899. return i.position.copy(this.warpDestPano.position),
  19900. !0;
  19901. var n = this.warpPathPoints[0] */
  19902. var r = this.warpDestPano.position;
  19903. if (null !== this.nodes && this.cameraHull && this.cameraHull.length > 1) {
  19904. var o = new P.Vector3;
  19905. 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),
  19906. i.position.copy(o)
  19907. } else
  19908. e < .5 ? i.position.copy(n) : i.position.copy(r)
  19909. }
  19910. ,
  19911. t.prototype.interruptAndFastForward = function(e, t) {
  19912. this.warping && (this.warpInterrupted = !0,
  19913. this.warpInterruptionBlackoutStyle = e,
  19914. this.warpInterruptionTravelTime = t,
  19915. null !== this.warpInterruptionBlackoutStyle && void 0 !== this.warpInterruptionBlackoutStyle || (this.warpInterruptionBlackoutStyle = z.MIDDLE),
  19916. null !== this.warpInterruptionTravelTime && void 0 !== this.warpInterruptionTravelTime || (this.warpInterruptionTravelTime = D.minWarpTime))
  19917. }
  19918. ,
  19919. t.prototype.warpCameraAim = function(e) {
  19920. var t = D.warp.minWarpTime;
  19921. if (this.upcomingTransType === L.BLACK)
  19922. t = D.warp.teleportTime;
  19923. else {
  19924. var i = this.playerControls.cameras[O.PANORAMA]
  19925. , n = new P.Euler(0,0,0,D.warp.eOrder).setFromQuaternion(this.warpDestHeroLoc.quaternion, D.warp.eOrder)
  19926. , r = (new P.Euler).setFromQuaternion(i.quaternion, D.warp.eOrder)
  19927. , o = new P.Euler(n.x - r.x,n.y - r.y,n.z - r.z,D.warp.eOrder);
  19928. o.y = N.constrainedTurn(o.y);
  19929. var a = 1e3 * Math.abs(o.y) / P.Math.degToRad(D.warp.maxAimPerSec);
  19930. t = Math.max(t, a)
  19931. }
  19932. var s = function() {
  19933. this._warpStopFlying(),
  19934. this.discardSlow(),
  19935. e && e()
  19936. }
  19937. .bind(this);
  19938. this._warpCameraAim(t, s)
  19939. }
  19940. ,
  19941. t.prototype.warpCommonParameters = function(e, t, i, n) {
  19942. this.model.skybox.material.uniforms.blackout.value = n;
  19943. var r = F.uniform(this.model.skybox, "progress", 1)
  19944. , o = F.allUniforms(this.model.chunks, "progress", 1)
  19945. , a = !1
  19946. , s = function() {
  19947. if (this.warpInterrupted)
  19948. return a = !0
  19949. }
  19950. .bind(this)
  19951. , l = function(e, t) {
  19952. return i && a ? !(this.model.skybox.material.uniforms.progress.value = 0) : void r(e, t)
  19953. }
  19954. .bind(this)
  19955. , c = function(e, t) {
  19956. return i && a ? (o(0),
  19957. !0) : void o(e, t)
  19958. }
  19959. .bind(this);
  19960. V.start(s, e, null, t, null, "safeHaltWatch"),
  19961. V.start(l, e, null, t, B[D.warp.blendEasing], "skyboxProgress"),
  19962. V.start(c, e, null, t, B[D.warp.blendEasing], "chunkProgress")
  19963. }
  19964. ,
  19965. t.prototype.warpTravel_STD = function(e) {
  19966. 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),
  19967. 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;
  19968. t += this.warpLength * D.warp.timePerMeter,
  19969. .01 < D.warp.flySpeed && (t = 1e3 * this.warpLength / D.warp.flySpeed);
  19970. function n(e) {
  19971. var t = i;
  19972. return P.Math.smoothstep(e, 0, t) * (1 - P.Math.smoothstep(e, 1 - t, 1))
  19973. }
  19974. var y = !1
  19975. , r = this.warpDestHeroLoc.quaternion
  19976. , o = new P.Vector3(0,0,-1).applyQuaternion(r).normalize()
  19977. , A = this.warpPathPoints[this.warpPathPoints.length - 1].clone().sub(this.warpPathPoints[this.warpPathPoints.length - 2]).normalize()
  19978. , a = A.dot(o)
  19979. , C = P.Math.radToDeg(Math.acos(a))
  19980. , s = function() {
  19981. return m.lookAt(g, l, U.UP),
  19982. u.setFromRotationMatrix(m, D.warp.eOrder),
  19983. p.setFromQuaternion(h.quaternion, D.warp.eOrder),
  19984. v.set(u.x - p.x, u.y - p.y, u.z - p.z, D.warp.eOrder),
  19985. N.constrainedTurn(v.y)
  19986. }
  19987. .bind(this)
  19988. , I = function(e, t) {
  19989. if (this.warpInterrupted)
  19990. return y = !0
  19991. }
  19992. .bind(this)
  19993. , E = function(e, t) {
  19994. return y || !this.warpPathPoints ? (k.blur(0),
  19995. !0) : void k.blur(e)
  19996. }
  19997. .bind(this)
  19998. , _ = F.allUniforms(this.model.chunks, "modelAlpha", 1)
  19999. , b = function(e, t) {
  20000. return y || !this.warpPathPoints ? (_(0),
  20001. !0) : void _(e, t)
  20002. }
  20003. .bind(this)
  20004. , w = function(e, t) {
  20005. if (!this.warpPathPoints)
  20006. return h.position.copy(this.warpDestPano.position),
  20007. !0;
  20008. if (y)
  20009. return !0;
  20010. var i = this.interpAlongPath(this.warpPathPoints, this.warpPathLengths, e);
  20011. h.position.copy(i),
  20012. g = this.interpAlongPath(this.warpPathPoints, this.warpPathLengths, .99 * e)
  20013. }
  20014. .bind(this)
  20015. , T = function(e, t) {
  20016. return this.warpPathPoints ? !!y || void (l = this.interpAlongPath(this.warpPathPoints, this.warpPathLengths, Math.min(e + c, 1))) : (H.debug("Lost bunny."),
  20017. !0)
  20018. }
  20019. .bind(this)
  20020. , x = function(e, t) {
  20021. if (y)
  20022. return H.debug(">>>> Walkthrough interupted at t=" + e),
  20023. !0;
  20024. if (!this.warpPathPoints)
  20025. return !0;
  20026. var i = this.warpLength * e
  20027. , n = P.Math.smoothstep(i, 0, this.brushPrefs.lookBlendDist)
  20028. , r = P.Math.smoothstep(i, this.warpLength - this.brushPrefs.lookBlendDist, this.warpLength);
  20029. D.warp.matchCam && (n *= 1 - r),
  20030. m.lookAt(g, l, U.UP),
  20031. u.setFromRotationMatrix(m, D.warp.eOrder),
  20032. p.setFromQuaternion(h.quaternion, D.warp.eOrder),
  20033. v.set(u.x - p.x, u.y - p.y, u.z - p.z, D.warp.eOrder),
  20034. v.y = N.constrainedTurn(v.y),
  20035. u.x = p.x + n * v.x,
  20036. u.y = p.y + n * v.y,
  20037. u.z = p.z + n * v.z,
  20038. v.set(u.x - f.x, u.y - f.y, u.z - f.z, D.warp.eOrder),
  20039. v.y = N.constrainedTurn(v.y);
  20040. var o = P.Math.degToRad(D.warp.maxTurnPerSec) * t / 1e3;
  20041. v.y = Math.sign(v.y) * Math.min(o, Math.abs(v.y)),
  20042. f.x = f.x + v.x * D.warp.turnFriction,
  20043. f.y = f.y + v.y * D.warp.turnFriction,
  20044. f.z = f.z + v.z * D.warp.turnFriction,
  20045. f.x = Math.max(P.Math.degToRad(D.warp.minDownAngle), f.x);
  20046. var a = l.clone().sub(g).normalize();
  20047. if (C < D.warp.maxAimRotation && 0 < r) {
  20048. var s = 1 - r;
  20049. a.x = a.x * s + r * A.x,
  20050. a.y = a.y * s + r * A.y,
  20051. a.z = a.z * s + r * A.z,
  20052. a.normalize()
  20053. }
  20054. this.bunnyObj.position.copy(h.position).add(a),
  20055. d.set(0, 0, -1).applyEuler(f).normalize(),
  20056. d.multiplyScalar(8),
  20057. d.add(h.position),
  20058. 1 - c < e && D.warp.matchCam || (h.controls.lookAt(d),
  20059. h.controls.lookVector.copy(d),
  20060. h.lookAt(d))
  20061. }
  20062. .bind(this)
  20063. , S = function() {
  20064. y ? (this.discardSlow(),
  20065. this.upcomingTransType = L.BLACK,
  20066. this.warpTravel_BLACK(-.5, this.warpInterruptionTravelTime, z.BEGINNING, e)) : this._wrapupWarpShading(e)
  20067. }
  20068. .bind(this);
  20069. T(0);
  20070. var M = D.warp.motionLeadTime + 1e3 * Math.abs(s()) / P.Math.degToRad(D.warp.maxTurnPerSec)
  20071. , R = M / (t += M);
  20072. this.warpCommonParameters(t, R, !0, z.NONE),
  20073. V.start(I, t, null, 0, null, "_haltWatcher"),
  20074. 0 < D.warp.blur && (k.blurStrength = D.warp.blur,
  20075. V.start(E, t, null, R, n, "blurring")),
  20076. V.start(b, t, null, R, n, "modelAlpha"),
  20077. V.start(w, t, null, R, B[D.warp.blendEasing], "followPath"),
  20078. V.start(T, t, null, R, B[D.warp.blendEasing], "goBunny"),
  20079. V.start(x, t, S, 0, B[D.warp.blendEasing], "lookAtBunny")
  20080. }
  20081. ,
  20082. t.prototype.warpTravel_BLACK = function(e, t, i, n) {
  20083. var r = e || 0;
  20084. null != t || (t = D.warp.teleportTime),
  20085. this.warpCommonParameters(t, r, !1, i),
  20086. this.model.chunks.forEach(function(e) {
  20087. e.material.uniforms.blackout.value = i
  20088. }),
  20089. this._warpBendAim(null, t, null, r);
  20090. //add
  20091. var done = ()=>{
  20092. Hot.updateVisibles([this.player.currentPano]) //更新热点显示
  20093. this.player.transitionPos({type:"beforeFlytopano", pano:this.player.currentPano, dur:100})//add
  20094. //Overlay.updateVisibles([this.player.currentPano])
  20095. }
  20096. var o = function() {
  20097. this.wrapupWarpShadingOnly(n, i)
  20098. done()
  20099. }
  20100. .bind(this);
  20101. var firstPos = this.player.position.clone()//add
  20102. V.start(this.stepWarpPath.bind(this, firstPos), t, o, r, B[D.warp.blendEasing], "stepMotion")
  20103. }
  20104. ,
  20105. t.prototype.flightStepWalk = (a = new P.Vector3,
  20106. s = new P.Vector3,
  20107. function(e, t, i) {
  20108. if (this.warpInterrupted)
  20109. i && i();
  20110. else if (this.activeTransType !== L.WALK)
  20111. this._clearWarpShading(),
  20112. this._warpStopFlying(),
  20113. this.player.spider.draw(),
  20114. this.placeCpm(),
  20115. i && i();
  20116. else if (this.player.currentPano !== e) {
  20117. var n = {
  20118. pano: e,
  20119. lookAtPoint: t,
  20120. duration: null,
  20121. maxDistanceOverride: D.warp.walkMaxDist,
  20122. skipWarpingCheck: !1,
  20123. constantMoveSpeed: !0
  20124. };
  20125. if(e == this.warpDestPano){//到达终点前,放大到终点的zoom
  20126. n.zoomLevel = this.warpDestHeroLoc.zoom
  20127. }
  20128. n.duration = function(e, t) {
  20129. var i = Math.min(this.player.position.distanceTo(e.position), D.transition.flytimeMaxDistanceThreshold) * D.transition.flytimeDistanceMultiplier + D.transition.flyTime;
  20130. s.copy(U.FORWARD),
  20131. this.player.getDirection(s),
  20132. a.copy(t).sub(e.position).normalize();
  20133. var n = a.dot(s)
  20134. , r = Math.acos(n)
  20135. , o = r / i;
  20136. return .001 < o && (i *= o / .001,
  20137. r < 1 && (i *= 1.2)),
  20138. i
  20139. }
  20140. .call(this, e, t),
  20141. this.player.nonInterruptingFlyToPano(n, i)
  20142. } else
  20143. i && i()
  20144. }
  20145. ),
  20146. t.prototype.makeWalkFlightFunc = function(e, t, i) {
  20147. return this.flightStepWalk.bind(this, e, t, i)
  20148. }
  20149. ,
  20150. t.prototype.warpTravel_WALK = (f = [],
  20151. function(e) {
  20152. for (var t = this.player.model.panos, i = null, n = !1, r = f.length = 0; r < this.nodes.length; r++) {
  20153. var o = this.nodes[r]
  20154. , a = t.get(o);
  20155. this.nodes.length,
  20156. n = i && a.position.distanceTo(i.position) < D.warp.walkMinDist,
  20157. i && n || (f.push(o),
  20158. i = a)
  20159. }
  20160. n && 1 < this.nodes.length && (f[f.length - 1] = this.nodes[this.nodes.length - 1]);
  20161. var s = f.length
  20162. , l = t.get(f[s - 1])
  20163. , c = new Array(s + 1);
  20164. c[c.length - 1] = function() {
  20165. e && e()
  20166. }
  20167. .bind(this);
  20168. for (var h = s - 1, u = c.length - 1; 0 < u; u -= 1) {
  20169. var d = f[h];
  20170. l = t.get(d);
  20171. var p = new P.Vector3;
  20172. this.getLookAtForWalkingTourNode(f, h, p),
  20173. c[u - 1] = this.makeWalkFlightFunc(l, p, c[u]),
  20174. h--
  20175. }
  20176. c[0]()
  20177. }
  20178. ),
  20179. t.prototype.getLookAtForWalkingTourNode = (c = new P.Vector3,
  20180. h = new P.Vector3,
  20181. u = new P.Vector3,
  20182. d = new P.Vector3,
  20183. p = new P.Vector3,
  20184. function(e, t, i) {
  20185. var n = e.length;
  20186. if (n <= t)
  20187. return !1;
  20188. var r = 1
  20189. , o = 1;
  20190. h.set(0, 0, 0),
  20191. p.set(0, 0, 0);
  20192. for (var a = null, s = t; s < t + 3 && !(n <= s); s++) {
  20193. if (a = this.player.model.panos.get(e[s]),
  20194. this.getOrientationForWalkingTourNode(e, s, u),
  20195. s === t && c.copy(u),
  20196. d.copy(u),
  20197. t < s) {
  20198. var l = d.dot(c) < .65;
  20199. r *= l ? .2 : .75,
  20200. o *= l ? .2 : .4
  20201. }
  20202. u.multiplyScalar(r),
  20203. h.add(u),
  20204. p.lerp(a.position, o)
  20205. }
  20206. return h.normalize(),
  20207. i.copy(p),
  20208. i.add(h),
  20209. !0
  20210. }
  20211. ),
  20212. t.prototype.getOrientationForWalkingTourNode = function(e, t, i) {
  20213. var n = e.length;
  20214. if (n <= t)
  20215. return !1;
  20216. if (t === n - 1)
  20217. i.copy(U.FORWARD).applyQuaternion(this.warpDestHeroLoc.quaternion);
  20218. else {
  20219. var r = this.player.model.panos.get(e[t])
  20220. , o = this.player.model.panos.get(e[t + 1]);
  20221. i.copy(o.position).sub(r.position)
  20222. }
  20223. return i.normalize(),
  20224. !0
  20225. }
  20226. ,
  20227. t.prototype.warpCameraTravel = function(e, t, i, n) {
  20228. if (this.activeTransType = this.upcomingTransType,
  20229. this.lastTransType = this.activeTransType,
  20230. this.upcomingTransType = null,
  20231. e)
  20232. this.activeTransType === L.BLACK ? this.warpTravel_BLACK(null, i, t, n) : this.activeTransType === L.WALK ? this.warpTravel_WALK(function() {
  20233. this._clearWarpShading(),
  20234. this._warpStopFlying(),
  20235. this.player.spider.draw(),
  20236. this.placeCpm(),
  20237. n && n()
  20238. }
  20239. .bind(this)) : this.warpTravel_STD(n);
  20240. else {
  20241. var r = function() {
  20242. this._wrapupTravel(n)
  20243. }
  20244. .bind(this)
  20245. , o = {
  20246. pano: this.warpDestPano,
  20247. lookAtPoint: null,
  20248. duration: null,
  20249. maxDistanceOverride: null,
  20250. skipWarpingCheck: !1
  20251. };
  20252. this.player.flyToPano(o, r)
  20253. }
  20254. }
  20255. ,
  20256. t.prototype.startWarpState = function() {
  20257. this.warping = !0,
  20258. this.warpInterrupted = !1,
  20259. this.warpInterruptionBlackoutStyle = null,
  20260. this.warpInterruptionTravelTime = null
  20261. }
  20262. ,
  20263. t.prototype.endWarpState = function() {
  20264. this.warping = !1
  20265. }
  20266. ,
  20267. t.prototype.warpToPano = function(e, t, i, n) {
  20268. if (this.warping)
  20269. H.warn("Cannot warp when already warping");
  20270. else {
  20271. if (this.upcomingTransType = e,
  20272. this.activeTransType = null,
  20273. !this.setWarpDestPano())
  20274. return this.upcomingTransType = null,
  20275. void this.warpToNonPano(n);
  20276. if (this.player.mode !== O.PANORAMA)
  20277. return this.upcomingTransType = null,
  20278. this.discardSlow(),
  20279. void this.player.flyToNewMode({
  20280. mode: O.PANORAMA,
  20281. pano: this.warpDestPano,
  20282. duration: D.warp.outsideTime,
  20283. warpDest: this.warpDestHeroLoc,
  20284. callback: n,
  20285. force: !0
  20286. });
  20287. if (!this.warpDestPano)
  20288. return H.warn("no warp destination, callback dropped"),
  20289. void (this.upcomingTransType = null);
  20290. 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)
  20291. , o = this.chooseWarpPath(r);
  20292. if (o && this.upcomingTransType !== L.WALK) {
  20293. var a = function() {
  20294. this.waitingToWarp = !1,
  20295. this.warpToPano(e, t, i, n)
  20296. }
  20297. .bind(this);
  20298. if (this.player.checkAndWaitForPanoLoad(this.warpDestPano, "high", "low", this.player.basePanoSize, a))
  20299. return void (this.waitingToWarp = !0)
  20300. }
  20301. this.player.currentPano || (H.warn("Arrived at a very strange spot!"),
  20302. this.player.currentPano = this.warpDestPano,
  20303. this.placeCpm(),
  20304. this.fadeOutCpm(D.path.fadeOutTime),
  20305. this.player.spider.draw()),
  20306. H.debug("Warping to pano ", this.warpDestPano.position),
  20307. this.upcomingTransType !== L.WALK && this.player.emit(g.PanoChosen, this.player.currentPano, this.warpDestPano),
  20308. this.startWarpState();
  20309. var s = function() {
  20310. this.endWarpState(),
  20311. n && n()
  20312. }
  20313. .bind(this);
  20314. o ? this.warpCameraTravel(r, t, i, s) : this.warpCameraAim(s)
  20315. }
  20316. }
  20317. ,
  20318. v.exports = t
  20319. }
  20320. ).call(this, "/js/objects/ShowPath.js")
  20321. }
  20322. , {
  20323. "../constants": 8,
  20324. "../effects": 16,
  20325. "../enum/BlackoutStyle": 18,
  20326. "../enum/ModelManagerEvents": 33,
  20327. "../enum/PlayerEvents": 40,
  20328. "../enum/RenderOrder": 42,
  20329. "../enum/Vectors": 50,
  20330. "../enum/Viewmode": 51,
  20331. "../enum/WarpStyle": 52,
  20332. "../gui/gui": 65,
  20333. "../model/ModelManager": 140,
  20334. "../objects/Snapshot": 153,
  20335. "../settings": 166,
  20336. "../shaders": 167,
  20337. "../util/easing": 186,
  20338. "../util/lerp": 188,
  20339. "../util/logger": 189,
  20340. "../util/math": 190,
  20341. "../util/texture": 194,
  20342. "../util/transitions": 195,
  20343. three: 217
  20344. }],
  20345. 152: [function(e, t, i) {
  20346. "use strict";
  20347. function n() {
  20348. var e = new r.SphereBufferGeometry(a.skyboxRadius,20,5)
  20349. , t = new r.RawShaderMaterial({
  20350. fragmentShader: o.skysphere.fragmentShader,
  20351. vertexShader: o.skysphere.vertexShader,
  20352. uniforms: r.UniformsUtils.clone(o.skysphere.uniforms),
  20353. side: r.BackSide,
  20354. name: "skysphere"
  20355. });
  20356. t.uniforms.radius.value = e.parameters.radius,
  20357. r.Mesh.call(this, e, t)
  20358. }
  20359. var r = e("three")
  20360. , o = e("../shaders")
  20361. , a = e("../settings");
  20362. (n.prototype = Object.create(r.Mesh.prototype)).constructor = n,
  20363. t.exports = n
  20364. }
  20365. , {
  20366. "../settings": 166,
  20367. "../shaders": 167,
  20368. three: 217
  20369. }],
  20370. 153: [function(r, o, e) {
  20371. (function(e) {
  20372. "use strict";
  20373. function t(e) {
  20374. n.call(this, e),
  20375. this.sid = e.sid,
  20376. this.panoId = e.panoId,
  20377. this.orthoZoom = e.orthoZoom,
  20378. this.floorVisibility = e.floorVisibility,
  20379. this.thumbUrl = e.thumbUrl,
  20380. this.name = e.name,
  20381. this.zoom = e.zoom
  20382. }
  20383. var i = (r("three"),
  20384. r("../util/logger"))
  20385. , n = (r("../settings"),
  20386. r("../enum/Viewmode"),
  20387. r("../util/common"),
  20388. r("../util/transitions"),
  20389. r("../util/lerp"),
  20390. r("../util/ajax"),
  20391. r("../util/texture"),
  20392. r("./View"));
  20393. r("events").EventEmitter,
  20394. new i(e),
  20395. (t.prototype = Object.create(n.prototype)).isPano = function() {
  20396. return this.panoId && "" !== this.panoId && this.panoId != "outside"
  20397. }
  20398. ,
  20399. o.exports = t
  20400. }
  20401. ).call(this, "/js/objects/Snapshot.js")
  20402. }
  20403. , {
  20404. "../enum/Viewmode": 51,
  20405. "../settings": 166,
  20406. "../util/ajax": 181,
  20407. "../util/common": 185,
  20408. "../util/lerp": 188,
  20409. "../util/logger": 189,
  20410. "../util/texture": 194,
  20411. "../util/transitions": 195,
  20412. "./View": 154,
  20413. events: 202,
  20414. three: 217
  20415. }],
  20416. 154: [function(o, a, e) {
  20417. (function(e) {
  20418. "use strict";
  20419. function t(e) {
  20420. e = e || {},
  20421. this.position = new i.Vector3,
  20422. this.quaternion = new i.Quaternion,
  20423. this.update(e)
  20424. }
  20425. var i = o("three")
  20426. , n = o("../util/logger")
  20427. , r = (o("../settings"),
  20428. o("../enum/Viewmode"),
  20429. o("../util/common"),
  20430. o("../util/transitions"),
  20431. o("../util/lerp"),
  20432. o("../util/ajax"),
  20433. o("../util/texture"),
  20434. o("events").EventEmitter);
  20435. new n(e),
  20436. (t.prototype = Object.create(r.prototype)).isValid = function() {
  20437. return !!this.cameraMode
  20438. }
  20439. ,
  20440. t.prototype.update = function(e) {
  20441. return this.cameraMode = e.cameraMode || this.cameraMode,
  20442. this.pano = e.pano || this.pano,
  20443. e.position && this.position.copy(e.position),
  20444. e.quaternion && this.quaternion.copy(e.quaternion),
  20445. this
  20446. }
  20447. ,
  20448. a.exports = t
  20449. }
  20450. ).call(this, "/js/objects/View.js")
  20451. }
  20452. , {
  20453. "../enum/Viewmode": 51,
  20454. "../settings": 166,
  20455. "../util/ajax": 181,
  20456. "../util/common": 185,
  20457. "../util/lerp": 188,
  20458. "../util/logger": 189,
  20459. "../util/texture": 194,
  20460. "../util/transitions": 195,
  20461. events: 202,
  20462. three: 217
  20463. }],
  20464. 155: [function(J, ee, e) {
  20465. (function(e) {
  20466. "use strict";
  20467. function t(e) {
  20468. this.currentPano = null,
  20469. this.nextPano = null,
  20470. this.camera = null,
  20471. this.paused = !1,
  20472. this.flying = !1,
  20473. this.sceneIntersectionPlane = null,
  20474. this.target = new B.Vector3,
  20475. this.mouse = new B.Vector3(1.1,1.1,.5),
  20476. this.mouseAtMouseDown = new B.Vector2,
  20477. this.mouseCouldBeClickToMove = !1,
  20478. this.mouseLastMoveTime = Date.now(),
  20479. this.mouseDown = !1,
  20480. this.mouseDownTimer = null,
  20481. this.couldBeLongTap = !1,
  20482. this.containsMouse = !0,
  20483. this.isTouchEvent = !1,
  20484. this.isPanoHover = !1,
  20485. this.reticule = new n(this),
  20486. this.panoMarkers = [],
  20487. this.spider = new s(this),
  20488. this.quaternion = new B.Quaternion,
  20489. this.position = new B.Vector3(15,10,15),
  20490. this.previousState = null,
  20491. this.lastInsideView = new o,
  20492. this.last360View = new o,
  20493. this.raycaster = new B.Raycaster,
  20494. this.intersect = null,
  20495. this.lastChangeTime = Date.now(),
  20496. this.history = new h,
  20497. this.cameraControls = null,
  20498. this.path = null,
  20499. this.model = null,
  20500. this.domElement = null,
  20501. this.cachedPanoCandidates = null,
  20502. this.basePanoSize = 0,
  20503. this.standardPanoSize = 0,
  20504. this.highPanoSize = 0,
  20505. this.ultraHighPanoSize = 0,
  20506. this.zoomLevel = 1,
  20507. this.zooming = 0,
  20508. this.zoomSpeed = .5,
  20509. this.scrollZoomSpeed = .06,
  20510. this.zoomSpeedAdjust = .05,
  20511. this.defaultZoomIncrement = .2,
  20512. this.baseFov = k.insideFOV,
  20513. this.zoomFov = this.baseFov,
  20514. this.zoomEnabled = !0,
  20515. this.preRenderingEnabled = !1,
  20516. this.setupCustomProperties(e),
  20517. this.zoomStats = new v,
  20518. this.modeTran = 'dollhouse-panorama'
  20519. this.currentCursor = '';
  20520. window.player = this
  20521. }
  20522. var B = J("three")
  20523. , i = J("./util/logger")
  20524. , n = J("./objects/Reticule")
  20525. , a = J("./objects/Panorama")
  20526. , r = J("./objects/ShowPath")
  20527. , o = J("./objects/View")
  20528. , s = (J("./objects/Snapshot"),
  20529. J("./objects/NSpider"))
  20530. , V = J("./enum/Viewmode")
  20531. , T = (J("./enum/TagStates"),
  20532. J("./enum/Vectors"))
  20533. , l = J("./enum/Keys")
  20534. , k = (J("./enum/AlignmentType"),
  20535. J("./settings"))
  20536. , x = J("./util/common")
  20537. , U = (J("./util/browser"),
  20538. J("./util/math"))
  20539. , H = J("./util/lerp")
  20540. , z = J("./util/easing")
  20541. , G = J("./util/transitions")
  20542. , c = J("events").EventEmitter
  20543. , h = (J("./shaders"),
  20544. J("./util/history"))
  20545. , S = (J("./util/camera"),
  20546. J("./model/ModelManager"),
  20547. J("./enum/PathDiscardMode"))
  20548. , M = J("./enum/PathDisplayMode")
  20549. , W = J("./enum/PlayerEvents")
  20550. , u = J("./enum/ControlEvents")
  20551. , d = J("./enum/ModelManagerEvents")
  20552. , R = J("./enum/WarpStyle")
  20553. , P = J("./enum/BlackoutStyle")
  20554. , p = J("./exception/BasicException")
  20555. , f = J("./enum/PanoSizeClass")
  20556. , g = (J("./tile/TileDownloader"),
  20557. J("./tile/TilePrioritizer"))
  20558. , m = (J("./enum/PanoramaEvents"),
  20559. J("./enum/ZoomEvents"))
  20560. , v = J("./util/ZoomStats")
  20561. , y = J("./constants")
  20562. , j = J("./util/common")
  20563. , A = J("./util/cameraLight")
  20564. , C = J("hot")
  20565. , Y = new i(e)
  20566. , q = Object.freeze({
  20567. FlyToPano: G.getUniqueId(),
  20568. FlyToNewMode: G.getUniqueId(),
  20569. FlyToSameMode: G.getUniqueId(),
  20570. FlyToViewFloor: G.getUniqueId(),
  20571. LookTransition: G.getUniqueId(),
  20572. ZoomTransition: G.getUniqueId()
  20573. });
  20574. function I(e) {
  20575. for (var t = e.split(","), i = t[0].match(/:(.*?);/)[1], n = atob(t[1]), r = n.length, o = new Uint8Array(r); r--; )
  20576. o[r] = n.charCodeAt(r);
  20577. return new Blob([o],{
  20578. type: i
  20579. })
  20580. }
  20581. (t.prototype = Object.create(c.prototype)).init = function(e) {
  20582. this.modelManager = e.modelManager,
  20583. this.tileDownloader = e.tileDownloader,
  20584. this.panoRenderer = e.panoRenderer,
  20585. this.qualityManager = e.qualityManager,
  20586. this.domElement = e.container,
  20587. this.camera = e.camera,
  20588. this.tagManager = e.tagManager,
  20589. this.cameraControls = e.controls,
  20590. this.path = new r(e.director,this,e.controls),
  20591. this.basePanoSize = this.qualityManager.getPanoSize(f.BASE),
  20592. this.standardPanoSize = this.qualityManager.getPanoSize(f.STANDARD),
  20593. this.highPanoSize = this.qualityManager.getPanoSize(f.HIGH),
  20594. this.ultraHighPanoSize = this.qualityManager.getPanoSize(f.ULTRAHIGH),
  20595. this.tileDownloader.processPriorityQueue = !1,
  20596. this.tileDownloader.tilePrioritizer = new g(this.qualityManager,this.basePanoSize,this.standardPanoSize,this.highPanoSize,this.ultraHighPanoSize),
  20597. this.bindEvents(e.container),
  20598. this.updateModel()
  20599. }
  20600. ,
  20601. t.prototype.screenShot = function(i) {
  20602. if (!this.flying && !this.flyingToTag) {
  20603. var n = this.sceneRenderer;
  20604. n.updateScreenSize(i)
  20605. this.model.panos.forEach(e=>{
  20606. if(e.marker){
  20607. e.marker.forceHide = e.marker.visible
  20608. e.marker.visible = !1;
  20609. }
  20610. })
  20611. /* for (var e in this.model.hots)
  20612. this.model.hots[e].mesh.visible = !1; */
  20613. player.model.hotGroup.visible = false
  20614. this.reticule.visible = !1,
  20615. this.reticule.forceUnvisible = !0,
  20616. this.path.currentPanoMarker.mesh.visible = !1,
  20617. setTimeout(function() {
  20618. n.renderer.clear(!0, !0, !0),
  20619. n.renderer.render(n.scene, n.camera);
  20620. var e = n.renderer.domElement.toDataURL(i.type, .9);
  20621. i.f && i.f(e)
  20622. n.updateScreenSize({
  20623. resize: !0
  20624. })
  20625. this.reticule.visible = !0
  20626. player.model.hotGroup.visible = true
  20627. this.model.panos.forEach(e=>{
  20628. e.marker && (e.marker.visible = e.marker.forceHide);
  20629. })
  20630. this.path.currentPanoMarker.mesh.visible = !0,
  20631. n.renderer.render(n.scene, n.camera)
  20632. }
  20633. .bind(this), 30)
  20634. }
  20635. }
  20636. ;
  20637. var E, _, b, w, O, L, D, N, F, X, Z, K, Q = J("scaleImg");
  20638. t.prototype.getWrapShot = function() {
  20639. var i = this.getSnapAngleInfo()
  20640. , n = ",{\r\t" + i
  20641. , r = arguments[0];
  20642. this.screenShot({
  20643. width: g_snapShotWidth,
  20644. height: g_snapShotHeight,
  20645. type: "image/jpeg",
  20646. f: function(e) {
  20647. if (r && r.__callback)
  20648. return r.__callback(e, i);
  20649. var t = new Image;
  20650. t.src = e,
  20651. t.onload = function() {
  20652. var e = function(r, i) {
  20653. function n(e, t) {
  20654. var i = o || r
  20655. , n = document.createElement("canvas");
  20656. n.width = i.width,
  20657. n.height = i.height,
  20658. n.getContext("2d").drawImage(i, 0, 0, i.width, i.height),
  20659. o = Q(e, n, t)
  20660. }
  20661. function e() {
  20662. var e = o || r
  20663. , t = I(e.src);
  20664. i.maxWeight && t.size > i.maxWeight && (n(i.maxWeight / t.size, "jpeg"),
  20665. t = I(e.src)),
  20666. (o = o || new Image).base64Src = e.src,
  20667. o.src = window.URL.createObjectURL(t)
  20668. }
  20669. var o, t = Math.max(r.width, r.height);
  20670. return "png" != i.toType && ("jpeg" == i.oldType ? (t > i.maxSize && n(i.maxSize / t, "jpeg"),
  20671. e()) : "png" == i.oldType && i.maxWeight && i.weight > i.maxWeight && (n(t > i.maxSize ? i.maxSize / t : 1, "jpeg"),
  20672. e())),
  20673. o || r
  20674. }(this, {
  20675. maxSize: g_snapShotWidth,
  20676. oldType: "jpeg"
  20677. });
  20678. e.src.replace(function(e) {
  20679. return "image/" + (e = e.toLowerCase().replace(/jpg/i, "jpeg")).match(/png|jpeg|bmp|gif/)[0]
  20680. }("image/jpeg"), "image/octet-stream");
  20681. var t = "snap" + (new Date).getTime();
  20682. !function(e, t) {
  20683. var i = document.createElementNS("http://www.w3.org/1999/xhtml", "a");
  20684. i.href = e,
  20685. i.download = t;
  20686. var n = document.createEvent("MouseEvents");
  20687. n.initMouseEvent("click", !0, !1, window, 0, 0, 0, 0, 0, !1, !1, !1, !1, 0, null),
  20688. i.dispatchEvent(n)
  20689. }(e.src, t + ".jpg"),
  20690. n += ',\r\t"thumbnail_signed_src":"' + t + '.jpg",',
  20691. n += '\r\t"sid":"' + t + '",',
  20692. n += '\r\t"name":"' + t + '"\r}',
  20693. logData(n)
  20694. }
  20695. }
  20696. })
  20697. }
  20698. /* ,
  20699. t.prototype.getSnapAngleInfo = function() {
  20700. var e = {}
  20701. , t = '"metadata":{'
  20702. , i = this.camera.quaternion.clone();
  20703. switch (this.mode) {
  20704. case "panorama":
  20705. e.scan_id = this.currentPano.id,
  20706. t += '"scan_id":"' + this.currentPano.id + '",';
  20707. break;
  20708. case "floorplan":
  20709. e.camera_mode = 1,
  20710. (i = (new B.Quaternion).setFromAxisAngle(new B.Vector3(0,1,0), B.Math.degToRad(90))).multiply(this.camera.quaternion),
  20711. t += '"camera_mode":1,',
  20712. t += '"ortho_zoom":' + U.toPrecision(this.cameraControls.activeControl.currentScale, 4) + ",";
  20713. break;
  20714. case "dollhouse":
  20715. e.camera_mode = 2,
  20716. t += '"camera_mode":2,'
  20717. }
  20718. var n = new B.Quaternion(i.x,i.y,i.z,i.w);
  20719. return n.multiply(new B.Quaternion(Math.sqrt(2) / 2,Math.sqrt(2) / 2,0,0).conjugate()),
  20720. n.x *= -1,
  20721. n.w *= -1,
  20722. e.camera_position = U.toPrecision(this.camera.position.toArray(), 4),
  20723. e.camera_quaternion = U.toPrecision(n.toArray(), 4),
  20724. e.zoom = this.zoomLevel,
  20725. t += '"camera_position":[' + e.camera_position + '],"camera_quaternion":[' + e.camera_quaternion + '], "zoom":' + e.zoom + "}"
  20726. }
  20727. , */
  20728. t.prototype.getSnapAngleInfo = function(){
  20729. var info = {};
  20730. var str = '"metadata":{';
  20731. var q = this.camera.quaternion.clone();
  20732. switch (this.mode) {
  20733. case "panorama":
  20734. info.scan_id = this.currentPano.id;
  20735. str += ('"scan_id":"'+this.currentPano.id+'",');
  20736. break;
  20737. case "floorplan":
  20738. info.camera_mode = 1;
  20739. q = (new B.Quaternion).setFromAxisAngle(new B.Vector3(0,1,0), B.Math.degToRad(90))
  20740. q.multiply(this.camera.quaternion);
  20741. str += ('"camera_mode":1,');
  20742. //str += ('"ortho_zoom":'+m.toPrecision(this.cameraControls.activeControl.currentScale * $("#player").height() / $("#player").width() * D.workshopApsect * 16, 4)+",");
  20743. str += ('"ortho_zoom":'+ U.toPrecision(this.cameraControls.activeControl.currentScale, 4 )+",");
  20744. break;
  20745. case "dollhouse":
  20746. info.camera_mode = 2;
  20747. str += ('"camera_mode":2,');
  20748. break;
  20749. }
  20750. info.camera_position = U.toPrecision(this.camera.position.toArray(),4);
  20751. //console.log(info.camera_position)
  20752. info.camera_quaternion = U.toPrecision(q.toArray(),4);
  20753. /* if(window.screenSta === 'tour'){ // fyz 导览截屏需要做额外的 fyz 对相机截屏的角度进行校对
  20754. var out = new B.Quaternion(q.x, q.y, q.z, q.w)
  20755. out.multiply(new B.Quaternion(Math.sqrt(2) / 2, Math.sqrt(2) / 2, 0, 0).conjugate())
  20756. out.x *= -1;
  20757. out.w *= -1;
  20758. info.camera_quaternion = U.toPrecision(out.toArray(),4);
  20759. }else{
  20760. info.camera_quaternion = U.toPrecision(q.toArray(),4);;
  20761. } */
  20762. info.zoom = this.zoomLevel;
  20763. //console.log(info.camera_quaternion)
  20764. // str += ( '"camera_position":['+ info.camera_position + '],"camera_quaternion":['+info.camera_quaternion+"]}");
  20765. // fyz 扩展编辑页面, 加上导览点缩放值
  20766. str += ( '"camera_position":['+ info.camera_position + '],"camera_quaternion":['+info.camera_quaternion+'], "zoom":' + info.zoom + '}');
  20767. console.log(str)
  20768. return str;
  20769. }
  20770. //------end
  20771. t.prototype.closePopup = function() {
  20772. if (g_currentHot) {
  20773. g_currentHot = null,
  20774. document.getElementById("popup").style.display = "none",
  20775. document.querySelector(".popup-content").removeChild(document.getElementById("id1")),
  20776. $("#popup iframe:last").remove();
  20777. document.getElementById("bgaudio");
  20778. if(g_bgAudio && g_bgAudio.pauseByHot){
  20779. manage.switchBgmState(true)
  20780. }
  20781. return false
  20782. }
  20783. }
  20784. ,
  20785. t.prototype.setupCustomProperties = function(e) {
  20786. var i = e || V.PANORAMA;
  20787. Object.defineProperty(this, "mode", {
  20788. get: function() {
  20789. return i
  20790. },
  20791. set: function(e) {
  20792. var t = i;
  20793. i = e,
  20794. this.onModeUpdated(t, i)
  20795. }
  20796. })
  20797. }
  20798. ,
  20799. t.prototype.isInMode = function() {
  20800. for (var e = 0; e < arguments.length; e++)
  20801. if (this.mode === arguments[e])
  20802. return !0;
  20803. return !1
  20804. }
  20805. ,
  20806. t.prototype.isOutsideMode = function(e) {
  20807. return (e = e || this.mode) === V.DOLLHOUSE || e === V.FLOORPLAN
  20808. }
  20809. ,
  20810. t.prototype.is360View = function(e, t) {
  20811. return e === V.PANORAMA && t && !t.isAligned()
  20812. }
  20813. ,
  20814. t.prototype.setScene = function(e) {
  20815. this.sceneIntersectionPlane = e.plane,
  20816. this.path.setScene(e),
  20817. this.moveReticuleToScene(e)
  20818. }
  20819. ,
  20820. t.prototype.moveReticuleToScene = function(e) {
  20821. this.reticule.parent && this.reticule.parent.remove(this.reticule),
  20822. e.add(this.reticule)
  20823. }
  20824. ,
  20825. t.prototype.updateModel = function() {
  20826. function n(e) {
  20827. var t = this.cameraControls.cameras[V.DOLLHOUSE]
  20828. , i = this.cameraControls.controls[V.DOLLHOUSE]
  20829. , n = t.position.y + (e - i.target.y)
  20830. , r = k.showFloorDuration + k.showFloorDelay;
  20831. G.start(H.property(i.target, "y", e), r, null, k.flydown.movementDelay, z[k.flydown.movementEasing], null, q.FlyToViewFloor),
  20832. G.start(H.property(t.position, "y", n), r, null, k.flydown.movementDelay, z[k.flydown.movementEasing], null, q.FlyToViewFloor)
  20833. }
  20834. this.model = this.modelManager.getActiveModel(),
  20835. this.model.on("floor.changed", function(e, t, i) {
  20836. this.mode === V.DOLLHOUSE && e !== i && n.call(this, e.center.y)
  20837. }
  20838. .bind(this)),
  20839. this.model.on("allfloors.toggled", function(e, t) {
  20840. if (this.mode === V.DOLLHOUSE) {
  20841. var i = e ? this.model.center.y : i = t.center.y;
  20842. n.call(this, i)
  20843. }
  20844. }
  20845. .bind(this)),
  20846. this.on(W.PanoChosen, this.model.setProjectedPanos.bind(this.model));
  20847. var t = this;
  20848. this.model.panos.list.forEach(function(e) {
  20849. e.vrMarker.addEventListener("click", function() {
  20850. t.flyToPano({
  20851. pano: e
  20852. })
  20853. })
  20854. })
  20855. }
  20856. ,
  20857. t.prototype.updateModelDependentData = function() {
  20858. this.cameraControls.setModelForControls(this.model),
  20859. this.getPanoMarkersFromModel(this.model)
  20860. }
  20861. ,
  20862. t.prototype.onModelChanged = function() {
  20863. this.updateModel(),
  20864. this.updateModelDependentData()
  20865. }
  20866. ,
  20867. t.prototype.getPanoMarkersFromModel = function(e) {
  20868. this.panoMarkers = e.panos.list.reduce(function(e, t) {
  20869. return t.marker ? e.concat(t.marker) : e
  20870. }, [])
  20871. }
  20872. ,
  20873. t.prototype.handleControlMove = function(e) {
  20874. this.emit(W.Move, e)
  20875. }
  20876. ,
  20877. t.prototype.handleControlInputStart = function(e) {
  20878. this.emit(W.InputStart, e)
  20879. }
  20880. ,
  20881. t.prototype.onModeUpdated = function(e, t) {
  20882. this.cameraControls.activateControls(t),
  20883. this.emit(W.ModeChanged, e, t)
  20884. }
  20885. ,
  20886. t.prototype.isWarping = function() {
  20887. return this.path.warping
  20888. }
  20889. ,
  20890. t.prototype.isWaitingToWarp = function() {
  20891. return this.path.waitingToWarp
  20892. }
  20893. ,
  20894. t.prototype.getLabelScaleFactor = function() {
  20895. if (this.isOutsideMode()) {
  20896. return Math.sqrt(this.cameraControls.controls[V.FLOORPLAN].currentScale / 10)
  20897. }
  20898. return .5
  20899. }
  20900. ,
  20901. t.prototype.changeMusic = function() {
  20902. if(!this.director.tourIsPlaying) this.director.bgmReplay()
  20903. }
  20904. ,
  20905. t.prototype.bindEvents = function(e) {
  20906. e !== document && e.setAttribute("tabindex", -1),
  20907. e.addEventListener("mousedown", this.onMouseDown.bind(this)),
  20908. e.addEventListener("mousemove", this.onMouseMove.bind(this)),
  20909. e.addEventListener("mouseover", this.onMouseOver.bind(this)),
  20910. e.addEventListener("mouseout", this.onMouseOut.bind(this)),
  20911. e.addEventListener("mouseup", this.onMouseUp.bind(this)),
  20912. this.modelManager.on(d.ActiveModelChanged, this.onModelChanged.bind(this)),
  20913. e.addEventListener("touchstart", this.onTouchStart.bind(this)),
  20914. e.addEventListener("touchmove", this.onTouchMove.bind(this)),
  20915. e.addEventListener("touchend", this.onTouchEnd.bind(this)),
  20916. e.addEventListener("pointerdown", this.onPointerDown.bind(this)),
  20917. e.addEventListener("pointermove", this.onPointerMove.bind(this)),
  20918. e.addEventListener("pointerup", this.onPointerUp.bind(this)),
  20919. document.addEventListener("pointerup", ()=>{//add
  20920. window.transformControls && transformControls.onPointerUp()
  20921. }),
  20922. e.addEventListener("pointerout", this.onPointerOut.bind(this)),
  20923. e.addEventListener("pointercancel", this.onPointerCancel.bind(this)),
  20924. document.addEventListener("keydown", this.onKeyDown.bind(this)),
  20925. this.cameraControls.on(u.Move, this.handleControlMove.bind(this)),
  20926. this.cameraControls.on(u.InputStart, this.handleControlInputStart.bind(this)),
  20927. this.cameraControls.on(u.Pinch, this.handleControlPinch.bind(this)),
  20928. this.cameraControls.on(u.Scroll, this.handleControlScroll.bind(this)),
  20929. window.addEventListener("snapshotBegin", this.getWrapShot.bind(this)),
  20930. window.addEventListener("tourAudioEnded", this.changeMusic.bind(this)),
  20931. window.getSeft && getSeft(this),
  20932. /Android|webOS|iPhone|iPod|BlackBerry/i.test(navigator.userAgent) ? $("#closepop").on("touchstart", this.closePopup.bind(this)) : $("#closepop").on("click", this.closePopup.bind(this))
  20933. }
  20934. ,
  20935. t.prototype.onMouseDown = function(e) {
  20936. e.currentTarget !== document && e.currentTarget.focus(),
  20937. 0 === e.button && (this.handleInputStart.call(this, e.clientX, e.clientY, !1),
  20938. this.updateIntersect())
  20939. }
  20940. ,
  20941. t.prototype.onMouseMove = function(e) {
  20942. this.isTouchEvent = !1,
  20943. this.handleInputMove.call(this, e.clientX, e.clientY, !1)
  20944. }
  20945. ,
  20946. t.prototype.onMouseOver = function(e) {
  20947. this.containsMouse = !0,
  20948. !this.mouseDown || 0 !== e.which && 0 !== e.buttons || (this.mouseDown = !1)
  20949. }
  20950. ,
  20951. t.prototype.onMouseOut = function(e) {
  20952. this.containsMouse = !1
  20953. }
  20954. ,
  20955. t.prototype.onMouseUp = function(e) {
  20956. this.handleInputEnd.call(this, e.clientX, e.clientY, !1)
  20957. }
  20958. ,
  20959. t.prototype.onTouchStart = function(e) {
  20960. if (e.currentTarget !== document && e.currentTarget.focus(),
  20961. !this.mouseDown) {
  20962. this.couldBeLongTap = !0;
  20963. var t = x.average(e.changedTouches, "clientX")
  20964. , i = x.average(e.changedTouches, "clientY");
  20965. this.handleInputStart.call(this, t, i, !0),
  20966. this.mouseDownTimer = setTimeout(function() {
  20967. this.updateIntersect(),
  20968. this.handleInputEnd.call(this, t, i, !0)
  20969. }
  20970. .bind(this), k.input.longTapThreshold)
  20971. }
  20972. }
  20973. ,
  20974. t.prototype.onTouchMove = function(e) {
  20975. var t = x.average(e.changedTouches, "clientX")
  20976. , i = x.average(e.changedTouches, "clientY");
  20977. this.handleInputMove.call(this, t, i, !0)
  20978. }
  20979. ,
  20980. t.prototype.onTouchEnd = function(e) {
  20981. if (clearTimeout(this.mouseDownTimer),
  20982. this.mouseDown) {
  20983. this.couldBeLongTap = !1,
  20984. this.updateIntersect();
  20985. var t = x.average(e.changedTouches, "clientX")
  20986. , i = x.average(e.changedTouches, "clientY");
  20987. this.handleInputEnd.call(this, t, i, !0)
  20988. }
  20989. }
  20990. ,
  20991. t.prototype.onPointerDown = function(e) {
  20992. return e.currentTarget !== document && e.currentTarget.focus(),
  20993. this.mouseDown || "mouse" === e.pointerType ? this.onMouseDown(e) : (this.couldBeLongTap = !0,
  20994. this.handleInputStart.call(this, e.clientX, e.clientY, !0),
  20995. void (this.mouseDownTimer = setTimeout(function() {
  20996. this.updateIntersect(),
  20997. this.handleInputEnd.call(this, e.clientX, e.clientY, !0)
  20998. }
  20999. .bind(this), k.input.longTapThreshold)))
  21000. }
  21001. ,
  21002. t.prototype.onPointerMove = function(e) {
  21003. "mouse" !== e.pointerType ? this.handleInputMove.call(this, e.clientX, e.clientY, !0) : this.onMouseMove(e)
  21004. }
  21005. ,
  21006. t.prototype.onPointerUp = function(e) {
  21007. return this.mouseDown && "mouse" !== e.pointerType ? (clearTimeout(this.mouseDownTimer),
  21008. this.couldBeLongTap = !1,
  21009. this.updateIntersect(),
  21010. void this.handleInputEnd.call(this, e.clientX, e.clientY, !0)) : this.onMouseUp(e)
  21011. }
  21012. ,
  21013. t.prototype.onPointerOut = function(e) {
  21014. this.mouseDown = !1
  21015. }
  21016. ,
  21017. t.prototype.onPointerCancel = function(e) {
  21018. this.mouseDown = !1
  21019. }
  21020. ,
  21021. t.prototype.onKeyDown = function(e) {
  21022. var t = function() {
  21023. this.cameraControls.activeControl && this.cameraControls.activeControl.emit(u.Move, "key")
  21024. }
  21025. .bind(this)
  21026. , i = e.which;
  21027. switch (i) {
  21028. case l.F:
  21029. t(),
  21030. this.changeFloor(-1);
  21031. break;
  21032. case l.R:
  21033. t(),
  21034. this.changeFloor(1)
  21035. }
  21036. if (this.mode === V.PANORAMA)
  21037. switch (i) {
  21038. case l.UPARROW:
  21039. case l.W:
  21040. this.flyLocalDirection(T.FORWARD.clone());
  21041. break;
  21042. case l.DOWNARROW:
  21043. case l.S:
  21044. this.flyLocalDirection(T.BACK.clone());
  21045. break;
  21046. case l.A:
  21047. this.flyLocalDirection(T.LEFT.clone());
  21048. break;
  21049. case l.D:
  21050. this.flyLocalDirection(T.RIGHT.clone())
  21051. }
  21052. }
  21053. ,
  21054. t.prototype.handleScrollPinchZoom = function(e) {
  21055. var t = e
  21056. , i = this.zoomLevel;
  21057. this.zoomBy(t),
  21058. this.currentPano && this.zoomStats.addZoomAction(i, this.zoomLevel, this.currentPano.id)
  21059. }
  21060. ,
  21061. t.prototype.handleControlPinch = function(e) {
  21062. k.zoom.enabled ? this.handleScrollPinchZoom(1 - e) : this.flyLocalDirection(new B.Vector3(0,0,e).normalize())
  21063. }
  21064. ,
  21065. t.prototype.handleControlScroll = function(e) {
  21066. k.zoom.enabled ? (0 < e ? e = 1 + this.scrollZoomSpeed : e < 0 && (e = 1 - this.scrollZoomSpeed),
  21067. 0 !== e && this.handleScrollPinchZoom(e)) : this.flyLocalDirection(new B.Vector3(0,0,-e).normalize())
  21068. }
  21069. ,
  21070. t.prototype.handleInputStart = function(e, t, i) {
  21071. var n = this.handelPadding(e, t);
  21072. e = n.x,
  21073. t = n.y,
  21074. this.isTouchEvent = i,
  21075. U.convertScreenPositionToNDC(e, t, this.mouse),
  21076. U.convertScreenPositionToNDC(e, t, this.mouseAtMouseDown),
  21077. this.mouseCouldBeClickToMove = !0,
  21078. this.mouseDown = !0
  21079. //this.mouseCouldBeClickToMove && window.Hotpoint && (new Hotpoint).state(this, C)
  21080. this.mouseCouldBeClickToMove && editTool.hotpoint.addHot()
  21081. window.transformControls && transformControls.onPointerDown()
  21082. }
  21083. ,
  21084. t.prototype.handelPadding = function(e, t) {
  21085. return this.pad || (this.pad = {
  21086. x: dom.getOffset("left", $("#player")[0]),
  21087. y: dom.getOffset("top", $("#player")[0])
  21088. }),
  21089. {
  21090. x: e - this.pad.x,
  21091. y: t - this.pad.y
  21092. }
  21093. }
  21094. ,
  21095. t.prototype.handleInputMove = function(e, t, i) {
  21096. var n = this.handelPadding(e, t);
  21097. e = n.x,
  21098. t = n.y,
  21099. this.isTouchEvent = i,
  21100. U.convertScreenPositionToNDC(e, t, this.mouse);
  21101. var moveToleranceNDC = (window.transformControls && transformControls.visible) ? 0.0000001 : k.input.moveToleranceNDC
  21102. this.mouseAtMouseDown.distanceTo(this.mouse) > moveToleranceNDC && (this.mouseCouldBeClickToMove = !1,
  21103. this.couldBeLongTap = !1,
  21104. clearTimeout(this.mouseDownTimer)),
  21105. this.mouseLastMoveTime = Date.now(),
  21106. this.reticule.move(e, t, i)
  21107. window.transformControls && transformControls.onPointerMove()
  21108. }
  21109. ,
  21110. t.prototype.handleInputEnd = function(e, t, i) {
  21111. if (this.isTouchEvent = i,
  21112. this.mouseDown = !1,
  21113. this.cameraControls.controls[V.PANORAMA].emit("interaction.direct"),
  21114. !i && this.couldBeLongTap)
  21115. return !0;
  21116. if (this.handleLongTap())
  21117. return !0;
  21118. window.transformControls && transformControls.onPointerUp()
  21119. if (this.mouseCouldBeClickToMove) {
  21120. if (this.flying)
  21121. return this.path.activeTransType === R.WALK && this.emit(W.WarpInterruptedWithFlyTo, this.path.activeTransType),
  21122. !0;
  21123. //add----
  21124. if (this.checkHotClick())
  21125. return !0;
  21126. if (window.VisiSet && VisiSet.setPanoVisible) {//正在设置漫游可行
  21127. this.intersect && this.intersect.object.visible && VisiSet.dealPanoVisible(this.intersect.object.name);
  21128. return;
  21129. }
  21130. if (window.VisiSet && VisiSet.setTagVisible ) {
  21131. VisiSet.tagVsetting && this.intersect && this.intersect.object.visible && VisiSet.dealTagVisible(VisiSet.tagVsetting, this.intersect.object.name);
  21132. return;
  21133. }
  21134. if (window.VisiSet && VisiSet.setPanoLog ) {
  21135. this.intersect && this.intersect.object.visible && VisiSet.dealPanoLogClick( this.intersect.object);
  21136. return;
  21137. }
  21138. if(this.hoveringPlane){
  21139. this.clickOverlay(this.hoveringPlane)
  21140. return;
  21141. }
  21142. if(window.EditOverlay && EditOverlay.objCursorType == "overlay"){
  21143. return EditOverlay.addPlane({intersect:this.intersect});
  21144. }
  21145. /* if(objects.mainDesign && objects.mainDesign.editing && objects.mainDesign.handleClickEnd(this)){//许钟文加
  21146. if(objects.mainDesign.editType == "wallDesign" && this.mode == "panorama") return !0;
  21147. else if(objects.mainDesign.editType == "addOverlay")return !0;
  21148. } */
  21149. //----------
  21150. if (this.cameraControls.activeControl && this.cameraControls.activeControl.emit(u.Move, this.isTouchEvent ? "touch" : "mouse"),
  21151. this.history.invalidate(),
  21152. this.intersect)
  21153. return this.flyToPanoClosestToMouse();
  21154. if (this.mode === V.PANORAMA) {
  21155. var n = this.closestPanoInDirection(this.getMouseDirection());
  21156. return n ? this.flyToPano({
  21157. pano: n
  21158. }) : this.bump(this.getMouseDirection())
  21159. }
  21160. }
  21161. this.intersect && this.closestPano && this.closestPano.hoverOff(this.mode)
  21162. }
  21163. ,
  21164. t.prototype.handleLongTap = function() {
  21165. if (this.couldBeLongTap && (!this.isPanoHover || this.mode !== V.PANORAMA))
  21166. return this.cameraControls.activeControl && this.cameraControls.activeControl.emit(u.LongTap, "touch"),
  21167. !0
  21168. }
  21169. ,
  21170. t.prototype.checktagClick = function() {
  21171. if (this.tagManager.intersectTag) {
  21172. var e = this.isTouchEvent
  21173. , t = this.tagManager.clickedOnTag(e, this);
  21174. return e || t || G.cancelById(q.LookTransition),
  21175. !0
  21176. }
  21177. if (this.tagManager.activeTag)
  21178. return this.tagManager.dismissActiveTag(),
  21179. !1
  21180. }
  21181. ,
  21182. t.prototype.rankedtagInDirection = function(e, t) {
  21183. return this.tagManager.rankedtagInDirection(e, this.position, this.camera, t)
  21184. }
  21185. ,
  21186. t.prototype.start = function(e) {
  21187. $(".toolLeft").removeClass("unable");
  21188. $(".toolTop").removeClass("unable");
  21189. //-------------------
  21190. window.initTransformCtl(B)
  21191. //this.model.loadOverlays()
  21192. //window.EditOverlay && window.EditOverlay.init(B);
  21193. window.VisiSet && VisiSet.init()
  21194. //-------------------
  21195. var t = e.mode
  21196. , i = e.pano
  21197. , n = e.position
  21198. , r = e.quaternion
  21199. , o = e.tag
  21200. , a = e.quickstart
  21201. , s = $.Deferred();
  21202. this.updateModelDependentData(),
  21203. this.updateFromControls(),
  21204. this.findDefaultViews();
  21205. var l = this.is360View(t, i);
  21206. return !this.model.outsideAllowed() || l || a ? this.startInside(i, n, r, o, s) : this.startOutside(e, s),
  21207. s.done(function(e) {
  21208. this.emit(W.Ready, l, e, o)
  21209. }
  21210. .bind(this)),
  21211. s.promise()
  21212. }
  21213. ,
  21214. t.prototype.startOutside = function(e, t) {
  21215. var i = e.mode
  21216. , n = e.pano
  21217. , r = e.position
  21218. , o = e.quaternion
  21219. , a = e.zoom
  21220. , s = e.floorVisibility
  21221. , l = e.tag;
  21222. this.emit(W.StartOutside, k[i].transitionTime),
  21223. this.isOutsideMode(i) ? (this.model.warpDestFloors(s, !0),
  21224. G.cancelById(q.FlyToViewFloor),
  21225. i === V.FLOORPLAN ? this.floorplanMode(r, o, a) : this.dollhouseMode(r, o),
  21226. t.resolve(!1)) : this.startInsideWithFlyin(n, r, o, l, t)
  21227. }
  21228. ,
  21229. t.prototype.startInside = function(e, t, i, n, r) {
  21230. r = r || $.Deferred();
  21231. var o = (this.currentPano = e) && !e.isAligned();
  21232. if (t = o ? e.position : t || e.position,
  21233. i = i || e.quaternion,
  21234. e) {
  21235. var a = this.startInside.bind(this, e, t, i, n, r);
  21236. if (this.checkAndWaitForPanoLoad(e, "high", "low", this.basePanoSize, a))
  21237. return
  21238. }
  21239. //add
  21240. this.transitionPos({type:"beforeFlytopano", pano:this.currentPano, dur:0})
  21241. //this.updateHotVisible()
  21242. //EditOverlay.updatePano()
  21243. editTool.hotpoint.updatePano()
  21244. Hot.updateVisibles([this.currentPano])
  21245. return this.mode = V.PANORAMA,
  21246. e.floor.enter(this.mode),
  21247. this.emit(W.PanoChosen, this.currentPano, this.currentPano),
  21248. this.switchCameraMode(this.mode, i),
  21249. this.emit(W.StartInside, o),
  21250. r.resolve(!0),
  21251. r
  21252. }
  21253. ,
  21254. t.prototype.startInsideWithFlyin = function(i, e, n, t, r) {
  21255. if (r = r || $.Deferred(),
  21256. this.dollhouseMode(),
  21257. !i)
  21258. return Y.warn("Player.startInsideWithFlyin() -> targetPano is invalid."),
  21259. r.resolve(!1),
  21260. r;
  21261. e = e || i.position;
  21262. var o = n || this.cameraControls.activeControl.camera.quaternion
  21263. , a = i.position;
  21264. return this.fitDollhouse(a, e, o),
  21265. setTimeout(function(e) {
  21266. this.cameraControls.activeControl && (this.cameraControls.activeControl.maxDistance = e);
  21267. var t = {
  21268. mode: V.PANORAMA,
  21269. pano: i,
  21270. quaternion: n,
  21271. callback: function() {
  21272. this.emit(W.FlyinFinished),
  21273. r.resolve(!0)
  21274. }
  21275. .bind(this)
  21276. };
  21277. this.flyToNewMode(t)
  21278. }
  21279. .bind(this, this.cameraControls.activeControl.maxDistance), k.startupFlyinDelay),
  21280. r
  21281. }
  21282. ,
  21283. t.prototype.checkAndWaitForPanoLoad = (Z = {},
  21284. K = {},
  21285. function(t, e, i, n, r, o, a, s, l, c) {
  21286. if (function() {
  21287. for (var e in Z)
  21288. if (Z.hasOwnProperty(e) && Z[e] && performance.now() - K[e] < 5e3)
  21289. return !0;
  21290. return !1
  21291. }())
  21292. return !0;
  21293. var h = function(e, t, i) {
  21294. j.delayOneFrame(function() {
  21295. Z[e] = !1,
  21296. r && r(t, i)
  21297. }
  21298. .bind(this))
  21299. }
  21300. .bind(this, t.id)
  21301. , u = function(e, t) {
  21302. j.delayOneFrame(function() {
  21303. Z[e] = !1,
  21304. o && o(t)
  21305. }
  21306. .bind(this))
  21307. }
  21308. .bind(this, t.id);
  21309. try {
  21310. return null != s || (s = !0),
  21311. 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),
  21312. Z[t.id] && (K[t.id] = performance.now()),
  21313. Z[t.id]
  21314. } catch (e) {
  21315. throw Z[t.id] = !1,
  21316. K[t.id] = performance.now() - 5e3,
  21317. e
  21318. }
  21319. }
  21320. ),
  21321. t.prototype.checkAndWaitForWholePanoLoad = function(e, t, i, n, r) {
  21322. if (!e)
  21323. throw new p("Player.checkAndWaitForWholePanoLoad() -> Cannot load texture for null pano.");
  21324. return r && this.model.waitForLoad(e, function() {
  21325. return e.isLoaded(i)
  21326. }),
  21327. !e.isLoaded(t) && (e.loadCube(t).done(n),
  21328. !0)
  21329. }
  21330. ,
  21331. t.prototype.checkAndWaitForTiledPanoLoad = (X = new B.Vector3,
  21332. function(e, t, i, n, r, o, a, s) {
  21333. if (!e)
  21334. throw new p("Player.checkAndWaitForTiledPanoLoad() -> Cannot load texture for null pano.");
  21335. return X.copy(T.FORWARD),
  21336. this.getDirection(X),
  21337. !e.isLoaded(t) && (o && this.model.waitForLoad(e, function() {
  21338. return e.isLoaded(t)
  21339. }),
  21340. e.loadTiledPano(t, X, null, a, s).done(function(e, t) {
  21341. i && i(e, t)
  21342. }
  21343. .bind(this)).fail(function(e) {
  21344. n && n(e)
  21345. }
  21346. .bind(this)).progress(function(e, t, i) {
  21347. r && r(e, t, i)
  21348. }
  21349. .bind(this)),
  21350. !0)
  21351. }
  21352. ),
  21353. t.prototype.switchCameraMode = function(e, t) {
  21354. var i = this.cameraControls.controls[e]
  21355. , n = i.camera;
  21356. switch (e) {
  21357. case V.PANORAMA:
  21358. n.position.copy(this.currentPano.position);
  21359. var r = t ? T.FORWARD.clone().applyQuaternion(t) : this.getDirection().setY(0).normalize();
  21360. i.lookAt(r.add(n.position));
  21361. break;
  21362. case V.DOLLHOUSE:
  21363. var o = this.position.clone();
  21364. this.mode === V.PANORAMA ? o.add(new B.Vector3(0,6,0)).add(this.getDirection().multiplyScalar(-10)) : o.add(T.DOWN.clone().applyQuaternion(this.quaternion).multiplyScalar(6)).setY(6),
  21365. n.position.copy(o),
  21366. i.target.copy(this.target.clone().setY(this.model.center.y));
  21367. break;
  21368. //for多楼层 且 让模型刚好适应屏幕
  21369. /* var box = this.model.boundingBox.clone();
  21370. box.applyMatrix4(this.camera.matrixWorld);//将 boundingbox、也就是模型, 转换到当前相机朝向
  21371. var boxSize = box.size() //其中boxSize.x是模型在当前相机视角下的横向宽度,当飞出后,该宽度要刚好占满窗口宽度
  21372. var fov = A.getHFOVFromVFOV(k.insideFOV, n.aspect, 1); //获得在当前窗口的横向的fov
  21373. var distance = Math.abs(boxSize.x) / 2 / Math.tan(THREE.Math.degToRad(fov / 2))//根据上面获得的参数得到target到相机的距离
  21374. console.log(boxSize.x,distance, boxSize.length() / 2)
  21375. distance += boxSize.length() / 2 //由于此时模型从中心向相机的部分由于近大远小仍超出屏幕,所以将target放在靠近模型靠近相机的这一端,故而再加上box的对角线长度的一半, 虽然本该加上Math.sqrt(boxSize.z*boxSize.z +boxSize.y+boxSize.y)/2,但是这样模型显得比较满
  21376. if(this.mode === V.PANORAMA){
  21377. i.target.copy(this.model.center);
  21378. var vec = this.getDirection().negate().setY(1).normalize()//获得朝向
  21379. }else{
  21380. i.target.copy(this.target.clone().setY(this.model.center.y))
  21381. var vec = T.DOWN.clone().applyQuaternion(this.quaternion).setY(1).normalize()
  21382. }
  21383. vec.multiplyScalar(distance )
  21384. n.position.copy(i.target.clone().add(vec)) */
  21385. break
  21386. case V.FLOORPLAN:
  21387. n.position.copy(this.model.center).setY(k.floorplan.cameraHeight),
  21388. i.target.copy(this.model.center).setY(0),
  21389. i.zoomToContain(this.model.size),
  21390. i.rotateToView(this.model.size, this.getDirection())
  21391. }
  21392. i.update(0)
  21393. }
  21394. ,
  21395. t.prototype.update = (new B.Vector3,
  21396. N = {},
  21397. F = [],
  21398. function(e) {
  21399. this.updatePersistentZooming(e),
  21400. this.updateFromControls(e),
  21401. this.getCurrentNodePanos(F)
  21402. if(this.hasChanged(N)){
  21403. this.lastChangeTime = Date.now(),
  21404. !this.mouseDown && this.containsMouse && this.updateIntersect()
  21405. this.emit(W.ViewChanged)
  21406. //add:
  21407. if (window.VisiSet && (VisiSet.setPanoVisible || VisiSet.setTagVisible || VisiSet.setPanoLog)) VisiSet.updateFootIconSize();
  21408. this.intersectHot && this.intersectHot.showTitle()
  21409. editTool.hotpoint.showTitileSpots && editTool.hotpoint.showTitileSpots.forEach(e=>e.showTitle())
  21410. for(var i in this.model.hots){
  21411. this.model.hots[i].update(this)
  21412. }
  21413. /* if(this.mode == 'panorama')this.model.hotGroup&&this.model.hotGroup.children.forEach(overlay=>{
  21414. overlay.update()
  21415. }) */
  21416. this.mode == "panorama" && window.cad && cad.setSign({ x: this.position.x, y: this.position.z },this.cameraControls.controls.panorama.lon);
  21417. }
  21418. this.model.supportsTiles && (this.updateTileDownloader(F),
  21419. this.updatePanoRenderer(F)),
  21420. this.updatePreRendering(F),
  21421. this.reticule.update(),
  21422. this.path.update(),
  21423. this.spider.update(),
  21424. this.cachedPanoCandidates && k.navigation.panoScores && this.model.panos.showPanoScores(this.cachedPanoCandidates),
  21425. this.updateControlLocks(),
  21426. this.model.supportsTiles && this.updateZoomPano()
  21427. }
  21428. ),
  21429. t.prototype.updatePersistentZooming = function(e) {
  21430. 1 === this.zooming ? this.zoomBy(1 + this.zoomSpeed * e) : -1 === this.zooming && this.zoomBy(1 - this.zoomSpeed * e)
  21431. }
  21432. ,
  21433. t.prototype.updateControlLocks = function() {
  21434. this.currentPano && this.model.supportsTiles && (this.cameraControls.controls[V.PANORAMA].locked = !this.currentPano.highestFullTileRenderOpCompleted && this.currentPano.lockUntilRenderingComplete)
  21435. }
  21436. ,
  21437. t.prototype.updatePanoRenderer = (D = new B.Vector3,
  21438. function(e) {
  21439. var t = this.nextPano || this.currentPano;
  21440. this.panoRenderer.hasQueuedTiles() && t && (D.copy(T.FORWARD),
  21441. this.getDirection(D),
  21442. this.panoRenderer.updateDirection(D))
  21443. }
  21444. ),
  21445. t.prototype.cleanupInactivePanos = (O = [],
  21446. L = [],
  21447. function() {
  21448. O.length = 0,
  21449. O.push(this.currentPano),
  21450. this.nextPano && O.push(this.nextPano);
  21451. for (var e = L.length = 0; e < this.panoRenderer.activePanos.length; e++)
  21452. L.push(this.panoRenderer.activePanos[e]);
  21453. for (var t = 0; t < L.length; t++) {
  21454. for (var i = L[t], n = !0, r = 0; r < O.length; r++)
  21455. i.id === O[r].id && (n = !1);
  21456. n && i.exit()
  21457. }
  21458. }
  21459. ),
  21460. t.prototype.updatePreRendering = (w = {},
  21461. function(e) {
  21462. if (1 === k.tiling.preRenderTourPanos && this.preRenderingEnabled) {
  21463. var t = this.nextPano || this.currentPano;
  21464. if (t && e && 1 < e.length) {
  21465. var i = e.findIndex(function(e) {
  21466. if (e.id === t.id)
  21467. return !0
  21468. });
  21469. if (0 <= i && i + 1 < e.length) {
  21470. var n = e[i + 1];
  21471. n.isLoaded(this.basePanoSize) || w[n.id] || (window.setTimeout(function(e) {
  21472. this.checkAndWaitForPanoLoad(e, "high", "low", this.basePanoSize, null, null, null, !1, !1, !1),
  21473. window.setTimeout(function(e) {
  21474. w[e.id] = !1
  21475. }
  21476. .bind(this, e), k.tiling.panoPreRenderRepeatDelay)
  21477. }
  21478. .bind(this, n), k.tiling.panoPreRenderDelay),
  21479. w[n.id] = !0)
  21480. }
  21481. }
  21482. }
  21483. }
  21484. ),
  21485. t.prototype.enablePreRendering = function() {
  21486. this.preRenderingEnabled = !0
  21487. }
  21488. ,
  21489. t.prototype.disablePreRendering = function() {
  21490. this.preRenderingEnabled = !1,
  21491. this.cleanupInactivePanos()
  21492. }
  21493. ,
  21494. t.prototype.updateTileDownloader = (b = new B.Vector3,
  21495. function(e) {
  21496. var t = this.nextPano || this.currentPano;
  21497. t && (b.copy(T.FORWARD),
  21498. this.getDirection(b),
  21499. this.tileDownloader.tilePrioritizer.updateCriteria(t, this.position, b, 0 < e.length ? e : null),
  21500. this.tileDownloader.processPriorityQueue = !0)
  21501. }
  21502. ),
  21503. t.prototype.updateFromControls = function(e) {
  21504. null != e || (e = 0),
  21505. this.cameraControls.activeControl && (this.cameraControls.activeControl.update(e),
  21506. this.quaternion.copy(this.cameraControls.activeControl.camera.quaternion),
  21507. this.position.copy(this.cameraControls.activeControl.camera.position),
  21508. this.target.copy(this.cameraControls.activeControl.target),
  21509. this.cameraControls.activeControl.camera.updateProjectionMatrix(),
  21510. this.camera.projectionMatrix.copy(this.cameraControls.activeControl.camera.projectionMatrix)),
  21511. this.camera.position.copy(this.position),
  21512. this.camera.quaternion.copy(this.quaternion),
  21513. this.camera.updateMatrix(),
  21514. this.camera.updateMatrixWorld()
  21515. }
  21516. ,
  21517. t.prototype.hasChanged = function(e) {
  21518. if (!this.previousState)
  21519. return this.previousState = {
  21520. allFloorsVisible: this.model.allFloorsVisible,
  21521. position: this.position.clone(),
  21522. quaternion: this.quaternion.clone(),
  21523. mouse: this.mouse.clone(),
  21524. labelScaleFactor: this.getLabelScaleFactor(),
  21525. currentFloor: this.model.currentFloor,
  21526. projectionMatrix: this.camera.projectionMatrix.clone(),
  21527. worldMatrix: this.camera.matrixWorld.clone(),
  21528. mode: this.mode,
  21529. modelPosition: this.model.position.clone(),
  21530. modelCenter: this.model.center.clone(),
  21531. zoomLevel: this.zoomLevel
  21532. },
  21533. !0;
  21534. 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;
  21535. return e.allFloorsVisible = this.model.allFloorsVisible !== this.previousState.allFloorsVisible,
  21536. e.moved = !this.position.equals(this.previousState.position),
  21537. e.rotated = !this.quaternion.equals(this.previousState.quaternion),
  21538. e.mouseMoved = !this.mouse.equals(this.previousState.mouse),
  21539. e.labelScaleFactor = this.getLabelScaleFactor() !== this.previousState.labelScaleFactor,
  21540. e.floorChanged = this.model.currentFloor !== this.previousState.currentFloor,
  21541. e.cameraProjectionChanged = !this.camera.projectionMatrix.equals(this.previousState.projectionMatrix),
  21542. e.cameraWorldMatrixChanged = !this.camera.matrixWorld.equals(this.previousState.worldMatrix),
  21543. e.modeChanged = this.mode !== this.previousState.mode,
  21544. e.modelPositionChanged = !this.model.position.equals(this.previousState.modelPosition),
  21545. e.modelCenterChanged = !this.model.center.equals(this.previousState.modelCenter),
  21546. e.nextPanoActive = null !== this.nextPano,
  21547. e.zoomLevel = this.zoomLevel !== this.previousState.zoomLevel,
  21548. this.previousState.allFloorsVisible = this.model.allFloorsVisible,
  21549. this.previousState.position.copy(this.position),
  21550. this.previousState.quaternion.copy(this.quaternion),
  21551. this.previousState.mouse.copy(this.mouse),
  21552. this.previousState.labelScaleFactor = this.getLabelScaleFactor(),
  21553. this.previousState.currentFloor = this.model.currentFloor,
  21554. this.previousState.projectionMatrix.copy(this.camera.projectionMatrix),
  21555. this.previousState.worldMatrix.copy(this.camera.matrixWorld),
  21556. this.previousState.mode = this.mode,
  21557. this.previousState.modelPosition.copy(this.model.position),
  21558. this.previousState.modelCenter.copy(this.model.center),
  21559. this.previousState.zoomLevel = this.zoomLevel,
  21560. !t
  21561. }
  21562. ,
  21563. t.prototype.updateIntersect = function() {
  21564. var e = this.flying || this.isWarping()
  21565. , t = this.isOutsideMode() && this.cameraControls.controls[this.mode].isEngaged()
  21566. , i = G.getById(q.LookTransition);
  21567. e || t || this.isTouchEvent || i.length && i[0].running;
  21568. {//clear:
  21569. if(this.intersectHot) this.intersectHot.hideTitle()
  21570. this.intersectHot = null
  21571. $("#player").css("cursor", "")
  21572. $(".toolRight .spotList ul li").removeClass("active")
  21573. }
  21574. var deal = ()=>{
  21575. if(this.intersect && this.intersect.object.visible ){
  21576. if("hotSprite" == this.intersect.object.type){
  21577. this.intersectHot = this.intersect.object
  21578. while(!(this.intersectHot instanceof Hot)){
  21579. this.intersectHot = this.intersectHot.parent
  21580. }
  21581. $(`.toolRight .spotList ul li[data-spid=${this.intersectHot.sid}]`).addClass("active")
  21582. this.intersectHot.showTitle()
  21583. }
  21584. }
  21585. }
  21586. if (window.VisiSet && (VisiSet.setPanoVisible || VisiSet.setTagVisible || VisiSet.setPanoLog)) {
  21587. this.intersect = this.getMouseIntersect(null, this.model.hotGroup.children.concat(VisiSet.footIcons||[]) );
  21588. deal()
  21589. if(this.intersect){
  21590. $("#player").css("cursor", "pointer");
  21591. }
  21592. if(this.intersectHot){
  21593. this.intersect = null
  21594. }
  21595. return
  21596. }else if (g_HotStatus) {//加热点
  21597. this.intersect = this.getMouseIntersect(null, this.model.colliders.concat(this.model.skybox));
  21598. if(this.intersect){
  21599. $("#player").css("cursor", "cell")
  21600. }else{
  21601. $("#player").css("cursor", "not-allowed")
  21602. }
  21603. return;
  21604. }else{
  21605. if(this.model.hotGroup){
  21606. if(editTool.atPanel == 'hotpoint'){
  21607. var hots = this.model.hotGroup.children
  21608. }else{
  21609. var hots = this.model.hotGroup.children.filter(e=> e.info.actionType.examine || e.info.actionType.openHot || e.info.actionType.playAndPause)
  21610. }
  21611. this.intersect = this.getMouseIntersect(null, hots.concat(this.model.colliders));
  21612. if(this.intersect){
  21613. deal()
  21614. this.intersectHot && $("#player").css("cursor", "pointer");
  21615. }
  21616. }
  21617. }
  21618. this.intersect = this.getMouseIntersect(),
  21619. this.intersect && this.updateClosestPano(this.intersect),
  21620. this.closestPano || this.closestPanoInDirection(this.getMouseDirection()) ? (this.reticule.updatePosition(this.position, this.intersect),
  21621. k.navigation.panoScores && !k.navigation.mouseDirection && this.closestPanoInDirection(this.getDirection())) : this.reticule.hide()
  21622. }
  21623. ,
  21624. t.prototype.checkHotClick = function() {
  21625. if (this.intersectHot){
  21626. if (window.VisiSet && VisiSet.setTagVisible ) {
  21627. VisiSet.SetOneTagVisible(this.intersectHot); //设置这个热点的可见性
  21628. return;
  21629. }else if(editTool.atPanel == 'hotpoint'){
  21630. if(editTool.hotpoint.editSpot && this.intersectHot != editTool.hotpoint.editSpot){
  21631. var sure = confirm("是否保存当前热点?")
  21632. if(sure){
  21633. editTool.hotpoint.saveHot().then(()=>{
  21634. editTool.hotpoint.editHot(this.intersectHot)
  21635. })
  21636. }else{
  21637. editTool.hotpoint.editHot(this.intersectHot)
  21638. }
  21639. }else{
  21640. editTool.hotpoint.editHot(this.intersectHot)
  21641. }
  21642. }else{
  21643. if(this.intersectHot.texType == "video" && this.intersectHot.info.actionType.playAndPause){
  21644. this.intersectHot.switchPlay(!!this.intersectHot.pausedByUser)
  21645. }
  21646. this.intersectHot.examine()
  21647. }
  21648. return !0
  21649. }
  21650. }
  21651. ,
  21652. t.prototype.getMouseDirection = function(e) {
  21653. e = e || this.mouse;
  21654. var t = new B.Vector3(e.x,e.y,-1).unproject(this.camera);
  21655. return new B.Vector3(e.x,e.y,1).unproject(this.camera).sub(t).normalize()
  21656. }
  21657. ,
  21658. t.prototype.hoverOverlay = function(mesh){
  21659. if(!mesh){
  21660. this.hoveringPlane = null;
  21661. $("#player").css("cursor",this.currentCursor || "" );
  21662. }else{
  21663. var overlay = mesh.parent;
  21664. $("#player").css("cursor","pointer");
  21665. this.hoveringPlane = overlay;
  21666. return true;
  21667. }
  21668. },
  21669. t.prototype.clickOverlay = function(overlay){
  21670. if(this.openOverlay && !overlay)return;
  21671. var plane = overlay.plane;
  21672. if(overlay.texType == "video"){
  21673. overlay.switchPlay(!!overlay.pausedByUser)
  21674. }
  21675. if(window.EditOverlay && EditOverlay.editing){
  21676. if(EditOverlay.editPlane && overlay != EditOverlay.editPlane){
  21677. var sure = confirm("是否保存当前展览?")
  21678. if(sure){
  21679. $("#overlayProp button.submit").click()
  21680. }else{
  21681. EditOverlay.closeOverlayPanel('cancel')
  21682. }
  21683. }
  21684. EditOverlay.beginEdit(overlay);
  21685. return;
  21686. }
  21687. },
  21688. t.prototype.getMouseIntersect = function(e, t1) {
  21689. e = e || this.mouse.clone()
  21690. var t = t1 || this.model.floors.reduce(function(e, t) {
  21691. return t.hidden ? e : e.concat(t.collider.children)
  21692. }, this.mode === V.PANORAMA ? this.panoMarkers : []),
  21693. t = t.slice(0)
  21694. i = new B.Vector3(e.x,e.y,-1).unproject(this.camera);
  21695. this.raycaster.set(i, this.getMouseDirection(e));
  21696. var n = this.raycaster.intersectObjects(t , true );//add true
  21697. var o = n[0];
  21698. if(o){
  21699. o.face && (o.normal = o.face.normal.applyQuaternion(o.object.quaternion),
  21700. this.position.clone().sub(o.point).dot(o.normal) < 0 && o.normal.negate(),
  21701. this.currentPano ? o.onFloor = o.point.y < this.position.y - .5 * this.currentPano.height : o.onFloor = o.point.y < this.position.y - .5,
  21702. o.horizontal = .8 < o.normal.y);
  21703. return o
  21704. }
  21705. }
  21706. ,
  21707. t.prototype.updateClosestPano = function(e) {
  21708. var t = [a.filters.isPanoAligned()];
  21709. if (this.mode === V.PANORAMA) {
  21710. if (!this.currentPano)
  21711. return;
  21712. t.push(a.filters.not(this.currentPano)),
  21713. t.push(a.filters.inFloorDirection(this.currentPano.floorPosition, this.getDirection(), .25)),
  21714. t.push(a.filters.isNeighbourPanoTo(this.currentPano)),
  21715. t.push(a.filters.isCloseEnoughTo(e.point, k.panoFloorClickRadius)),
  21716. t.push(a.filters.isNotBehindNormal(e.point, e.normal))
  21717. } else{
  21718. t.push((pano)=>{ // add
  21719. return this.checkHasNeighbor(pano)
  21720. })
  21721. t.push(a.filters.isOnVisibleFloor()),
  21722. this.mode !== V.FLOORPLAN && t.push(a.filters.inDirection(this.position, this.getDirection(), .25));
  21723. }
  21724. var i = this.model.panos.find(t, [a.sortFunctions.floorDistanceToPoint(e.point)]);
  21725. i !== this.closestPano ? (i && (this.isPanoHover = !0),
  21726. this.emit(W.ClosestPanoChanging, this.closestPano, i, this.mode),
  21727. this.closestPano = i) : this.isPanoHover = !1
  21728. }
  21729. ,
  21730. t.prototype.dollhouseMode = function(e, t) {
  21731. this.emit(W.ModeChanging, this.mode, V.DOLLHOUSE),
  21732. this.mode = V.DOLLHOUSE,
  21733. this.cameraControls.controls[V.DOLLHOUSE].reset();
  21734. var i = new B.Vector3(this.model.center.x,0,this.model.center.z)
  21735. , n = new B.Vector3(15,10,15);
  21736. if (e && t) {
  21737. var r = T.FORWARD.clone().applyQuaternion(t)
  21738. , o = this.model.center.clone().sub(e).dot(r);
  21739. 0 < o ? (i = r.clone().multiplyScalar(o).add(e),
  21740. n.copy(e)) : Y.warn("Tried to initiate dollhouse mode that wasn't looking at the model", e, t)
  21741. }
  21742. this.cameraControls.controls[V.DOLLHOUSE].resetRanges(0, !0),
  21743. this.cameraControls.controls[V.DOLLHOUSE].target.copy(i),
  21744. this.cameraControls.cameras[V.DOLLHOUSE].position.copy(n),
  21745. this.updateFromControls(),
  21746. this.model.alpha = 1,
  21747. this.model.skybox.material.uniforms.opacity.value = 0
  21748. }
  21749. ,
  21750. t.prototype.insideMode = function(e, t) {
  21751. var i = $.Deferred()
  21752. , n = t || null;
  21753. if (this.mode !== V.PANORAMA && this.mode !== V.TRANSITIONING) {
  21754. var r = [a.filters.isPanoAligned()];
  21755. this.model.currentFloor && r.push(a.filters.atFloor(this.model.currentFloor)),
  21756. e = e || this.currentPano || this.model.panos.find(r, [a.sortFunctions.distanceToPoint(this.cameraControls.activeControl.target)]),
  21757. this.flyToNewMode({
  21758. mode: V.PANORAMA,
  21759. pano: e,
  21760. callback: n
  21761. }).done(i.resolve.bind(i)).fail(i.reject.bind(i))
  21762. } else {
  21763. var o = this.mode === V.PANORAMA ? "Already in panorama mode" : "Cannot change mode during mode transition";
  21764. i.reject(o)
  21765. }
  21766. return i.promise()
  21767. }
  21768. ,
  21769. t.prototype.fitDollhouse = function(e, t, i) {
  21770. var maxY = this.model.boundingBox.max.y;//add
  21771. var n = T.FORWARD.clone().applyQuaternion(i);
  21772. i = n.clone().add(e);
  21773. this.cameraControls.activeControl.target.copy(i),
  21774. this.cameraControls.activeControl.camera.position.set(0, maxY * 2.4, 0).add(e).add(n.multiplyScalar(-10))
  21775. }
  21776. ,
  21777. t.prototype.floorplanMode = function(e, t, i) {
  21778. this.mode = V.FLOORPLAN;
  21779. var n = this.cameraControls.controls[V.FLOORPLAN];
  21780. n.reset();
  21781. var r = e || this.model.center;
  21782. if (n.target.copy(r).setY(0),
  21783. n.camera.position.copy(r).setY(k.floorplan.cameraHeight),
  21784. i ? (n.currentScale = i / ($("#player").width() / $("#player").height()),
  21785. n.absoluteScale = n.currentScale) : n.zoomToContain(this.model.size),
  21786. t) {
  21787. var o = T.LEFT.clone().applyQuaternion(t);
  21788. n.rotateLeft(-Math.atan2(o.x, o.z))
  21789. } else
  21790. n.rotateToView(this.model.size, this.getDirection());
  21791. n.update(0)
  21792. }
  21793. ,
  21794. t.prototype.nonInterruptingFlyToPano = function(e, t) {
  21795. return e.skipWarpingCheck = !0,
  21796. this.flyToPano(e, t)
  21797. }
  21798. ,
  21799. t.prototype.updateMarkerVisi = function() {//加
  21800. if(this.mode != "panorama")return;
  21801. this.model.panos.list.forEach((pano)=>{
  21802. if(!pano.marker)return;
  21803. pano.marker.material.visible = !!pano.neighbourPanos[this.currentPano.id];
  21804. })
  21805. }
  21806. ,
  21807. /* t.prototype.updateHotVisible = function(pano){
  21808. if (window.VisiSet && (VisiSet.setPanoVisible || VisiSet.setPanoLog))return
  21809. var hots = this.model.hots;
  21810. pano = pano || this.currentPano;
  21811. for (var index in hots){
  21812. var visible;
  21813. if(this.mode != "panorama"){
  21814. visible = true;
  21815. }else{
  21816. //hots[index].mesh.material.depthTest = false;
  21817. visible = !hots[index].visiblePanos || hots[index].visiblePanos.indexOf(pano.id) > -1
  21818. }
  21819. hots[index].mesh.visible = visible;
  21820. }
  21821. }
  21822. */
  21823. t.prototype.flyToPano = function(e, t) {
  21824. var i, n = e.pano, aim = e.lookAtPoint, aimQua = e.quaternion,//ADD
  21825. o = e.duration, a = e.aimDuration, s = e.maxDistanceOverride,
  21826. l = e.skipWarpingCheck, c = e.constantMoveSpeed, h = null, u = null
  21827. if (aim){
  21828. var m = (new B.Matrix4).lookAt(n.position, aim, T.UP)
  21829. aimQua = (new B.Quaternion).setFromRotationMatrix(m)
  21830. }
  21831. else aimQua = aimQua
  21832. var zoomLevel = e.zoomLevel || 1 //add
  21833. if(this.flying) return t && t(e)
  21834. if (window.specialScene && specialScene.special().specifySpot && specialScene.special().specifySpot(n),
  21835. this.isWarping() && !l && (this.path.activeTransType === R.BLACK || this.path.activeTransType === R.STD))
  21836. return Y.warn("Player.flyToPano() -> Cannot fly when warping"),
  21837. t && t(),
  21838. !1;
  21839. this.updateLastView()
  21840. if (this.mode !== V.PANORAMA)
  21841. return void this.flyToNewMode({
  21842. mode: V.PANORAMA,
  21843. pano: n,
  21844. duration: o,
  21845. quaternion: aimQua,
  21846. callback: t
  21847. });
  21848. if (!n || (h = x.deepExtend(e), u = function() {
  21849. j.delayOneFrame(function() {
  21850. this.flyToPano(h, t)
  21851. }.bind(this))
  21852. }.bind(this),
  21853. !this.checkAndWaitForPanoLoad(n, "high", "low", this.basePanoSize, u))) {
  21854. var d = function(e) {
  21855. t && t(e)
  21856. }
  21857. .bind(this);
  21858. this.currentPano || (this.currentPano = n,
  21859. this.path.placeCpm(),
  21860. this.path.fadeOutCpm(k.path.fadeOutTime),
  21861. this.spider.draw());
  21862. var p = o;
  21863. if ("number" != typeof o) {
  21864. var f = s || k.transition.flytimeMaxDistanceThreshold;
  21865. p = Math.min(this.currentPano.position.distanceTo(n.position), f) * k.transition.flytimeDistanceMultiplier + k.transition.flyTime
  21866. }
  21867. if (.01 < k.transition.flySpeed && (p = 1e3 * this.currentPano.position.distanceTo(n.position) / k.transition.flySpeed),
  21868. zoomLevel !== this.zoomLevel)
  21869. switch (k.zoom.transitionStyle) {
  21870. case 1:
  21871. this.smoothZoomFovTo(null, zoomLevel, zoomLevel == 1 ? p / 2 : p); //改
  21872. break;
  21873. case 2:
  21874. return h = x.deepExtend(e),
  21875. u = this.flyToPano.bind(this, h, t),
  21876. void this.smoothZoomFovTo(null, zoomLevel, k.zoom.restoreTime * (this.zoomLevel - 1), u)
  21877. }
  21878. if (aimQua) {
  21879. G.cancelById(q.LookTransition),
  21880. p *= k.transition.aimSlowFactor;
  21881. var g = this.cameraControls.activeControl.camera.quaternion.clone()
  21882. , y = g.clone()
  21883. , A = new B.Vector3;
  21884. if (n === this.currentPano) {
  21885. var C = T.FORWARD.clone().applyQuaternion(g)
  21886. , I = T.FORWARD.clone().applyQuaternion(aimQua)
  21887. , E = C.angleTo(I);
  21888. return null != a || (a = 1 * Math.sqrt(E) / k.tags.navigate.rotateSpeedFactor * 1e3),
  21889. void G.start(function(e) {
  21890. y.copy(g),
  21891. H.quaternion(y, aimQua)(e),
  21892. A.copy(T.FORWARD).applyQuaternion(y).add(this.cameraControls.activeControl.camera.position),
  21893. this.cameraControls.activeControl.lookAt(A)
  21894. }
  21895. .bind(this), a, d, 0, z[k.transition.movementEasing], null, q.LookTransition)
  21896. }
  21897. }
  21898. if (n === this.currentPano )
  21899. return void d();
  21900. this.flying = !0;
  21901. var _ = this.position.clone()
  21902. , b = this.currentPano;
  21903. Y.debug("Flying to pano ", n.position);
  21904. this.emit(W.PanoChosen, this.currentPano, n);
  21905. this.emit(W.FlyingStarted, n.position, _, n, b);
  21906. //this.updateHotVisible(n); //更新热点显示
  21907. this.transitionPos({type:"beforeFlytopano", pano:n, dur:p})//add
  21908. Hot.updateVisibles([this.currentPano, n])
  21909. aimQua && G.start(function(e) {
  21910. y.copy(g),
  21911. H.quaternion(y, aimQua)(e),
  21912. A.copy(T.FORWARD).applyQuaternion(y).add(this.cameraControls.activeControl.camera.position),
  21913. this.cameraControls.activeControl.lookAt(A)
  21914. }
  21915. .bind(this), p, null, 0, z[k.transition.movementEasing], null, q.LookTransition);
  21916. var w = c ? null : z[k.transition.movementEasing];
  21917. this.nextPano = n;
  21918. G.start(H.uniform(this.model.skybox, "progress", 1), p, null, 0, z[k.transition.blendEasing], "skyFly", q.FlyToPano),
  21919. G.start(H.allUniforms(this.model.chunks, "progress", 1), p, null, 0, z[k.transition.blendEasing], "chunkFly", q.FlyToPano),
  21920. G.start(H.vector(this.cameraControls.cameras[V.PANORAMA].position, n.position), p, function(e) {
  21921. this.flying = !1,
  21922. this.currentPano !== n && this.currentPano.exit(),
  21923. n.enter(),
  21924. this.currentPano = n,
  21925. this.nextPano = null,
  21926. this.path.placeCpm(),
  21927. this.path.fadeOutCpm(k.path.fadeOutTime),
  21928. this.spider.draw(),
  21929. this.emit(W.FlyingEnded, n.position, _, n, b),
  21930. this.updateMarkerVisi();//add
  21931. d(e)
  21932. if(this.mode == "panorama" ){
  21933. //EditOverlay.updatePano()
  21934. editTool.hotpoint.updatePano()
  21935. Hot.updateVisibles([this.currentPano])
  21936. }
  21937. }
  21938. .bind(this), 0, w, "camFly", q.FlyToPano)
  21939. }
  21940. }
  21941. ,
  21942. window._transitionPosId = 9999
  21943. t.prototype.transitionPos = function(o={}) {//渐变overlay和热点的位置
  21944. G.cancelById(_transitionPosId)
  21945. var begin = function(object, pos, qua, scale){
  21946. if(pos){
  21947. if(!same(object.position, pos, 0.01)){
  21948. G.start(H.vector(object.position, pos), o.dur, (e)=>{
  21949. },0, z[k.transition.movementEasing], "transitionPos", _transitionPosId)
  21950. }
  21951. if(qua && !same(object.quaternion, qua, 1e-6)){
  21952. G.start(H.quaternion(object.quaternion, qua), o.dur, (e)=>{
  21953. },0, z[k.transition.movementEasing], "transitionPos", _transitionPosId)
  21954. }
  21955. if(scale && !same(object.scale, scale, 0.001)){
  21956. G.start(H.vector(object.scale, scale), o.dur, (e)=>{
  21957. },0, z[k.transition.movementEasing], "transitionPos", _transitionPosId)
  21958. }
  21959. }
  21960. }
  21961. var same = function(vec1, vec2, diff){
  21962. var s = Math.abs(vec1.x-vec2.x) < diff && Math.abs(vec1.y-vec2.y) < diff && Math.abs(vec1.z-vec2.z) < diff
  21963. if(s && vec1.w) s = Math.abs(vec1.w-vec2.w) < diff
  21964. return s
  21965. }
  21966. var sid = o.pano != void 0 ? o.pano.id : "outside";
  21967. /* this.model.hotGroup.children.forEach(overlay=>{
  21968. var panoData = overlay.transformAtPanos[sid]
  21969. var useCustom = !panoData
  21970. //if(overlay.usingTransformData || !useCustom){
  21971. var pos = useCustom ? overlay.posCustom : panoData.pos;
  21972. var qua = useCustom ? overlay.quaCustom : panoData.qua;
  21973. var scale = useCustom ? overlay.getScaleBySize(overlay.widthCustom, overlay.heightCustom) :
  21974. overlay.getScaleBySize(panoData.width , panoData.height)
  21975. scale = new THREE.Vector3(scale.x, scale.y, overlay.scale.z)
  21976. begin(overlay, pos, qua, scale )
  21977. //}
  21978. overlay.usingTransformData = !useCustom
  21979. }) */
  21980. for(let i in this.model.hots){//是否判断visible?
  21981. var hot = this.model.hots[i];
  21982. var panoData = hot.info.transformAtPanos[sid];
  21983. var useCustom = !panoData
  21984. //if(hot.usingTransformData || !useCustom){
  21985. var pos = useCustom ? hot.info.position : panoData.pos;
  21986. //var qua = hot.isSprite ? null : (useCustom ? hot.quaternion : panoData.qua);
  21987. begin(hot, pos/* , qua */ )
  21988. //}
  21989. //hot.usingTransformData = !useCustom;
  21990. }
  21991. }
  21992. window._tranOutsideFocus = 4399
  21993. t.prototype.focusPoint = function(o={}){//当在外时,聚焦相机到这一点
  21994. console.log("focusPoint")
  21995. if(this.mode == "floorplan"){
  21996. var modelSize = o.modelSize || new THREE.Vector3(8,8,8);//可视范围
  21997. var control = player.cameraControls.controls.floorplan;
  21998. var absoluteScale = control.getDefaultAbsoluteScale(modelSize)
  21999. var currentScale = control.absoluteScale;
  22000. var currentTarget = control.target.clone()
  22001. G.cancelById(window._tranOutsideFocus, true);
  22002. G.start(function(progress){
  22003. control.absoluteScale = absoluteScale*progress + currentScale*(1-progress);
  22004. control.target = o.aim.clone().multiplyScalar(progress).add(currentTarget.clone().multiplyScalar(1-progress))
  22005. control.camera.position.copy(control.target.clone().add(control.offset)) //维持角度
  22006. }.bind(this) , o.dur || 600, null/* cancelFuc */, 0, z[k.transition.movementEasing], "outsideFocus", window._tranOutsideFocus, null/* cancelFuc */);
  22007. }else if(player.mode == "dollhouse"){
  22008. var control = player.cameraControls.controls.dollhouse;
  22009. var radius = o.radius || 8;
  22010. var currentTarget = control.target.clone()
  22011. var dir = control.offset.clone().normalize()
  22012. var currentRadius = control.offset.length();
  22013. G.cancelById(window._tranOutsideFocus, true);
  22014. G.start(function(progress){
  22015. control.target = o.aim.clone().multiplyScalar(progress).add(currentTarget.clone().multiplyScalar(1-progress))
  22016. let radius_ = radius*progress+currentRadius*(1-progress)
  22017. control.camera.position.copy(control.target.clone().add(dir.clone().multiplyScalar(radius_)))
  22018. }.bind(this) , o.dur || 600, null/* cancelFuc */, 0, z[k.transition.movementEasing], "outsideFocus", window._tranOutsideFocus, null/* cancelFuc */);
  22019. }else if(this.mode == 'panorama'){
  22020. this.flyToPano({
  22021. lookAtPoint: o.aim.clone() ,
  22022. pano: this.currentPano,
  22023. aimDuration: o.dur || 600
  22024. })
  22025. }
  22026. }
  22027. t.prototype.fastForwardActivePanoFlight = function(e) {
  22028. e = e || k.transition.fastForwardFactor / 10 * 4 + 1,
  22029. G.adjustSpeed(q.FlyToPano, e),
  22030. G.adjustSpeed(q.LookTransition, e)
  22031. }
  22032. ,
  22033. t.prototype.flyToPanoClosestToMouse = function() {
  22034. if (50 < Date.now() - this.mouseLastMoveTime && (this.intersect = this.getMouseIntersect(),
  22035. this.intersect && this.updateClosestPano(this.intersect)),
  22036. this.closestPano)
  22037. return this.flyToPano({
  22038. pano: this.closestPano
  22039. });
  22040. var e = this.getMouseDirection();
  22041. this.flyDirection(e) || this.flyToPano({
  22042. pano: this.currentPano
  22043. })
  22044. }
  22045. ,
  22046. t.prototype.flyLocalDirection = function(e) {
  22047. var t = this.getDirection(e)
  22048. , i = 1 === e.z ? .4 : .75
  22049. , n = 1 === Math.abs(e.x);
  22050. return this.flyDirection(t, i, n)
  22051. }
  22052. ,
  22053. t.prototype.flyDirection = function(e, t, i) {
  22054. this.closePopup();
  22055. var n = $.Deferred();
  22056. this.history.invalidate();
  22057. var r = this.closestPanoInDirection(e, t, i);
  22058. return r ? this.flyToPano({
  22059. pano: r
  22060. }, n.resolve.bind(n, !0)) : (this.bump(e),
  22061. n.resolve(!1)),
  22062. n.promise()
  22063. }
  22064. ,
  22065. t.prototype.closestPanoInDirection = function(e, t, i) {
  22066. return this.rankedPanoInDirection(0, e, t, i)
  22067. }
  22068. ,
  22069. t.prototype.rankedPanoInDirection = (_ = {
  22070. pano: null,
  22071. candidates: []
  22072. },
  22073. function(e, t, i, n) {
  22074. e = e || 0,
  22075. i = void 0 !== i ? i : .75;
  22076. var r = n ? "angle" : "direction";
  22077. return this.model.panos.findRankedByScore(e, [a.filters.isPanoAligned(), a.filters.inPanoDirection(this.position, t, i), a.filters.isNeighbourPanoTo(this.currentPano), a.filters.not(this.currentPano)], [a.scoreFunctions.distanceSquared(this.currentPano), a.scoreFunctions[r](this.position, t)], _),
  22078. this.cachedPanoCandidates = _.candidates,
  22079. _.pano
  22080. }
  22081. ),
  22082. t.prototype.bump = function(e) {
  22083. if (this.mode === V.PANORAMA && !this.flying && !this.isWarping()) {
  22084. var t, i, n, r = k.transition, o = (r.flytimeMaxDistanceThreshold * r.flytimeDistanceMultiplier + r.flyTime) / 8, a = this.camera.getWorldDirection().dot(e);
  22085. if (.5 < Math.abs(a))
  22086. t = function() {
  22087. G.start(H.property(this.cameraControls.cameras[V.PANORAMA], "zoom", 0 < a ? 1.04 : .96), o, i, 0, z.easeInOutSine, "bumpZStart")
  22088. }
  22089. .bind(this),
  22090. i = function() {
  22091. G.start(H.property(this.cameraControls.cameras[V.PANORAMA], "zoom", 1), 5 * o, n, 0, z.easeInOutSine, "bumpZRelax")
  22092. }
  22093. .bind(this);
  22094. else {
  22095. var s = this.camera.position.clone()
  22096. , l = e.clone();
  22097. this.raycaster.set(s, l);
  22098. var c = this.model.floors.reduce(function(e, t) {
  22099. return e.concat(t.collider.children)
  22100. }, [])
  22101. , h = this.raycaster.intersectObjects(c)
  22102. , u = 0 < h.length ? h[0].distance / 25 : .04
  22103. , d = s.clone().add(l.multiplyScalar(u));
  22104. t = function() {
  22105. G.start(H.vector(this.cameraControls.cameras[V.PANORAMA].position, d), o, i, 0, z.easeInOutSine, "bumpTStart")
  22106. }
  22107. .bind(this),
  22108. i = function() {
  22109. G.start(H.vector(this.cameraControls.cameras[V.PANORAMA].position, s), 5 * o, n, 0, z.easeInOutSine, "bumpTRelax")
  22110. }
  22111. .bind(this)
  22112. }
  22113. n = function() {
  22114. this.flying = !1
  22115. }
  22116. .bind(this),
  22117. this.flying = !0,
  22118. t()
  22119. }
  22120. }
  22121. ,
  22122. t.prototype.changeFloor = function(e) {
  22123. if (!this.is360View(this.mode, this.currentPano))
  22124. if (this.mode === V.PANORAMA) {
  22125. var t = this.history.reversePano(e);
  22126. t && t.isAligned() ? this.flyToPano({
  22127. pano: t
  22128. }) : this.changeFloorByScore(e)
  22129. } else
  22130. this.model.setFloor(this.model.nextFloor(e) || this.model.currentFloor)
  22131. }
  22132. ,
  22133. t.prototype.changeFloorByScore = (E = {
  22134. pano: null,
  22135. candidates: []
  22136. },
  22137. function(e) {
  22138. var t = this.model.nextFloor(e);
  22139. 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),
  22140. void (E.pano ? (this.cachedPanoCandidates = E.candidates,
  22141. this.history.push(e, this.currentPano),
  22142. this.flyToPano({
  22143. pano: E.pano
  22144. })) : Y.warn("No pano found on selected floor, not moving there."))) : void Y.debug("player.changeFloor(" + e + "): no such floor")
  22145. }
  22146. ),
  22147. t.prototype.gotoFloor = function(e) {
  22148. var t = e - this.model.currentFloor.floorIndex;
  22149. this.changeFloor(t)
  22150. }
  22151. ,
  22152. t.prototype.getDirection = function(e) {
  22153. return (e = e || (new B.Vector3).copy(T.FORWARD)).applyQuaternion(this.camera.quaternion)
  22154. }
  22155. ,
  22156. t.prototype.flyToSameMode = function(e, t, i, n, r) {
  22157. if (r = r || $.Deferred(),
  22158. this.mode === V.TRANSITIONING)
  22159. return Y.warn("should not be transitioning here"),
  22160. n && n(!1),
  22161. r.reject().promise();
  22162. var o = i || !1
  22163. , a = i ? i.position : this.position
  22164. , s = this.position.clone()
  22165. , l = this.currentPano;
  22166. if (Y.debug("New pose in mode " + this.mode),
  22167. !e || (retryCallback = function() {
  22168. j.delayOneFrame(function() {
  22169. this.flyToSameMode(e, t, i, n, r)
  22170. }
  22171. .bind(this))
  22172. }
  22173. .bind(this),
  22174. !this.checkAndWaitForPanoLoad(e, "high", "low", this.basePanoSize, retryCallback))) {
  22175. var c = function() {
  22176. this.emit(W.FlyingEnded, a, s, e, l),
  22177. n && n(!0)
  22178. }
  22179. .bind(this)
  22180. , h = k[this.mode]
  22181. , u = void 0 !== t ? t : h.transitionTime
  22182. , d = new B.Vector3
  22183. , p = new B.Vector3;
  22184. if (this.emit(W.FlyingStarted, a, s, e, l),
  22185. this.mode === V.PANORAMA)
  22186. Y.warn("we should not be here for panorama views");
  22187. else if (this.mode === V.DOLLHOUSE)
  22188. if (o) {
  22189. var f = new B.Vector3(0,1,0);
  22190. this.cameraControls.controls[V.DOLLHOUSE].resetRanges(1, !0),
  22191. this.model.warpDestFloors(i.floorVisibility),
  22192. p.copy(i.position);
  22193. var g = new B.Vector3(0,0,-1).applyQuaternion(i.quaternion)
  22194. , m = new B.Raycaster(p.clone(),g.clone(),0,1 / 0).intersectObjects(this.model.colliders)
  22195. , v = 3;
  22196. m.length ? (d.copy(m[0].point),
  22197. v = .75 * p.distanceTo(d)) : (d.copy(g).multiplyScalar(3).add(p),
  22198. Y.debug("Tried to restore dollhouse mode that did not intersect...", i.position, i.quaternion));
  22199. var y = (new B.Matrix4).lookAt(p, d, f)
  22200. , A = (new B.Euler).setFromRotationMatrix(y, k.warp.eOrder)
  22201. , C = d.distanceTo(p)
  22202. , I = (new B.Matrix4).lookAt(this.cameraControls.cameras[V.DOLLHOUSE].position, this.cameraControls.controls[V.DOLLHOUSE].target, f)
  22203. , E = (new B.Euler).setFromRotationMatrix(I, k.warp.eOrder)
  22204. , _ = this.cameraControls.cameras[V.DOLLHOUSE].position.distanceTo(this.cameraControls.controls[V.DOLLHOUSE].target);
  22205. this.cameraControls.controls[V.DOLLHOUSE].resetRanges(Math.min(_, v), !0);
  22206. var b = new B.Euler(A.x - E.x,A.y - E.y,A.z - E.z,k.warp.eOrder);
  22207. b.y = b.y > Math.PI ? b.y -= 2 * Math.PI : b.y < -Math.PI ? b.y += 2 * Math.PI : b.y,
  22208. this.path.burnsDir = Math.sign(b.y);
  22209. var w = new B.Euler(0,0,0,k.warp.eOrder)
  22210. , T = new B.Vector3;
  22211. G.start(H.vector(this.cameraControls.controls[V.DOLLHOUSE].target, d), u, null, k.flydown.movementDelay, z[k.flydown.movementEasing], null, q.FlyToSameMode),
  22212. G.start(function(e, t) {
  22213. w.x = E.x + e * b.x,
  22214. w.y = E.y + e * b.y,
  22215. w.z = E.z + e * b.z;
  22216. var i = _ + e * (C - _);
  22217. T.set(0, 0, i).applyEuler(w).add(this.cameraControls.controls[V.DOLLHOUSE].target),
  22218. this.cameraControls.cameras[V.DOLLHOUSE].position.copy(T).add(this.model.position)
  22219. }
  22220. .bind(this), u, null, k.flydown.movementDelay, z[k.flydown.movementEasing], null, q.FlyToSameMode),
  22221. G.start(function(e, t) {
  22222. this.cameraControls.controls[V.DOLLHOUSE].update(),
  22223. this.quaternion.copy(this.cameraControls.cameras[V.DOLLHOUSE].quaternion),
  22224. this.position.copy(this.cameraControls.cameras[V.DOLLHOUSE].position)
  22225. }
  22226. .bind(this), u, null, k.flydown.movementDelay, z[k.flydown.movementEasing], null, q.FlyToSameMode)
  22227. } else
  22228. Y.warn("invalid warp destination in flyToSameMode()? ignore it then");
  22229. else if (this.path.placeCpm(),
  22230. this.path.fadeInCpm(k.path.fadeInTime),
  22231. i) {
  22232. this.model.warpDestFloors(i.floorVisibility);
  22233. var x = this.cameraControls.cameras[V.FLOORPLAN]
  22234. , S = this.cameraControls.controls[V.FLOORPLAN]
  22235. , M = S.target.clone()
  22236. , R = i.position.clone().sub(M)
  22237. , P = x.position.clone().sub(S.target).length()
  22238. , O = new B.Vector3(-1,0,0).applyQuaternion(i.quaternion).normalize()
  22239. , L = Math.atan2(S.offset.x, S.offset.z)
  22240. , D = Math.atan2(O.x, O.z)
  22241. , N = S.absoluteScale
  22242. , F = U.convertWorkshopOrthoZoom(i.orthoZoom);
  22243. G.start(function(e, t) {
  22244. S.target.copy(R).multiplyScalar(e).add(M);
  22245. var i = L + (D - L) * e;
  22246. S.offset.x = P * Math.sin(i),
  22247. S.offset.z = P * Math.cos(i),
  22248. x.position.copy(S.target).add(S.offset),
  22249. S.absoluteScale = N + e * (F - N),
  22250. S.update(),
  22251. this.quaternion.copy(x.quaternion),
  22252. this.position.copy(x.position),
  22253. this.target.copy(S.target),
  22254. this.camera.projectionMatrix.copy(x.projectionMatrix)
  22255. }
  22256. .bind(this), u, null, 0, z[k.flydown.movementEasing], null, q.FlyToSameMode)
  22257. } else
  22258. Y.info("flyToSameMode() funny floorplan view? skipping");
  22259. return G.setTimeout(function(e) {
  22260. this.mode = e,
  22261. c(),
  22262. r.resolve(!0)
  22263. }
  22264. .bind(this, this.mode), u, q.FlyToSameMode),
  22265. this.mode = V.TRANSITIONING,
  22266. r.promise()
  22267. }
  22268. }
  22269. ,
  22270. t.prototype.flyToNewMode = function(e, t) {
  22271. var i = (e = e || {}).mode
  22272. , n = e.pano
  22273. , r = e.duration
  22274. , o = e.warpDest
  22275. , a = e.callback
  22276. , s = e.force
  22277. , l = e.quaternion;
  22278. if (t = t || $.Deferred(),
  22279. this.isWarping())
  22280. return Y.warn("Player.flyToNewMode() -> Cannot fly when warping"),
  22281. a && a(!1),
  22282. t.reject("Cannot change mode during tour transition").promise();
  22283. if (this.mode === V.TRANSITIONING)
  22284. return a && a(!1),
  22285. t.reject("Cannot change mode during mode transition").promise();
  22286. if (i === this.mode)
  22287. return s ? (this.flyToSameMode(n, r, o, a).done(t.resolve.bind(t)).fail(t.reject.bind(t)),
  22288. t.promise()) : (a && a(!1),
  22289. t.reject("Already in " + i + " mode").promise());
  22290. var c = o || !1;
  22291. Y.debug("Switching mode to " + i);
  22292. var h = function() {
  22293. j.delayOneFrame(function() {
  22294. this.flyToNewMode(e, t)
  22295. }
  22296. .bind(this))
  22297. }
  22298. .bind(this);
  22299. if (n && this.checkAndWaitForPanoLoad(n, "low", "low", this.basePanoSize, h))
  22300. return t.promise();
  22301. if (!this.model.meshTexturesLoaded && this.isOutsideMode(i))
  22302. return Y.info("Waiting for model textures to be loaded before going out to dollhouse"),
  22303. this.model.waitForLoad(this.model, function() {
  22304. return this.model.meshTexturesLoaded
  22305. }
  22306. .bind(this)),
  22307. this.model.loadMeshTextures().done(h),
  22308. t.promise();
  22309. this.history.invalidate(),
  22310. this.updateLastView();
  22311. var u = this.mode
  22312. , d = this.cameraControls.cameras[i];
  22313. e = x.deepExtend({}, k[i], k[u + "-" + i]);
  22314. var p = void 0 !== r ? r : e.transitionTime;
  22315. this.emit(W.ModeChanging, u, i, n),
  22316. n && (this.currentPano = n),
  22317. this.switchCameraMode(i, l),
  22318. G.cancelById(q.LookTransition);
  22319. var f = (new B.Vector3).copy(this.position);
  22320. this.modeTran = this.mode + "-" + i;
  22321. if(this.mode == "floorplan" && window.VisiSet && (VisiSet.setPanoVisible || VisiSet.setTagVisible || VisiSet.setPanoLog)){
  22322. VisiSet.finishSetPanoVisible()
  22323. VisiSet.finishSetTagVisible()
  22324. VisiSet.finishSetPanoLog()
  22325. }
  22326. if(editTool.atPanel == "screen"){
  22327. if(this.mode == "panorama") $(".confirmSnap").addClass("unable")
  22328. else if(i == "panorama") $(".confirmSnap").removeClass("unable")
  22329. }
  22330. if(i == "panorama"){
  22331. this.transitionPos({type:"beforeFlyIn", pano:n, dur:p})//add
  22332. }else{
  22333. this.transitionPos({type:"beforeFlyOut", dur:p/2})//add
  22334. }
  22335. if (i === V.PANORAMA)
  22336. this.emit(W.PanoChosen, n, n),
  22337. setTimeout(function() {
  22338. n.floor.enter(i)
  22339. }
  22340. .bind(this), p / 2),
  22341. this.path.fadeOutCpm(k.path.fadeOutTime);
  22342. else if (i === V.DOLLHOUSE) {
  22343. if (c && (this.model.stayPut = !0),
  22344. o ? (this.cameraControls.controls[V.DOLLHOUSE].resetRanges(1, !0),
  22345. this.model.warpDestFloors(o.floorVisibility)) : this.model.toggleAllFloors(!0),
  22346. this.path.placeCpm(),
  22347. this.path.fadeInCpm(k.path.fadeInTime),
  22348. c) {
  22349. var g = new B.Vector3(this.model.center.x,0,this.model.center.z);
  22350. f.set(15, 10, 15);
  22351. var m = new B.Vector3(0,0,-1).applyQuaternion(o.quaternion)
  22352. , v = new B.Raycaster(o.position.clone(),m.clone(),0,1 / 0).intersectObjects([this.sceneIntersectionPlane]);
  22353. v.length ? (g.copy(v[0].point),
  22354. f.copy(o.position),
  22355. 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),
  22356. this.cameraControls.controls[V.DOLLHOUSE].resetRanges(3, !0)),
  22357. this.cameraControls.controls[V.DOLLHOUSE].target.copy(g),
  22358. f.add(this.model.position),
  22359. d.position.copy(f),
  22360. this.cameraControls.controls[V.DOLLHOUSE].update()
  22361. }
  22362. } else if (this.path.placeCpm(),
  22363. this.path.fadeInCpm(k.path.fadeInTime),
  22364. o) {
  22365. this.model.warpDestFloors(o.floorVisibility);
  22366. var y = this.cameraControls.cameras[V.FLOORPLAN]
  22367. , A = this.cameraControls.controls[V.FLOORPLAN]
  22368. , C = y.position.clone().sub(A.target)
  22369. , I = new B.Vector3(-1,0,0).applyQuaternion(o.quaternion).normalize()
  22370. , E = Math.atan2(I.x, I.z);
  22371. A.target.copy(o.position);
  22372. var _ = C.length();
  22373. A.offset.x = _ * Math.sin(E),
  22374. A.offset.y = 0,
  22375. A.offset.z = _ * Math.cos(E),
  22376. y.position.copy(A.target).add(A.offset),
  22377. A.target.clone().sub(d.position),
  22378. d.quaternion.copy(o.quaternion),
  22379. A.currentScale = U.convertWorkshopOrthoZoom(o.orthoZoom),
  22380. A.absoluteScale = A.currentScale,
  22381. A.update()
  22382. } else
  22383. this.model.currentFloor.enter(i);
  22384. var b = this.currentPano
  22385. , w = this.position.clone();
  22386. return this.emit(W.FlyingStarted, f, w, n, this.currentPano),
  22387. this.flying = !0,
  22388. this.isOutsideMode(i) && this.is360View(u, b) ? (c || i !== V.DOLLHOUSE || (d.position.set(15, 10, 15),
  22389. d.controls.target.set(this.model.center.x, 0, this.model.center.z),
  22390. d.controls.update()),
  22391. e.blackoutStyle = P.FADEIN,
  22392. p = k.show360Views.transitionTime,
  22393. this.fade360View(p, d, e)) : this.isOutsideMode(u) && this.is360View(i, n) ? (c && this.switchCameraMode(i, c.quaternion),
  22394. this.mode = i,
  22395. this.path && this.path.popOutCpm(),
  22396. e.blackoutStyle = P.END,
  22397. p = k.show360Views.transitionTime,
  22398. this.fade360View(p, d, e)) : (G.start(H.property(this.model, "alpha", e.modelAlpha, null), p * e.modelAlphaLength, null, e.modelAlphaDelay, null, q.FlyToNewMode),
  22399. G.start(H.vector(this.position, d.position), p, null, k.flydown.movementDelay, z[k.flydown.movementEasing], null, q.FlyToNewMode),
  22400. G.start(H.quaternion(this.quaternion, d.quaternion), p * e.rotationDuration, null, e.rotationDelay, z[k.flydown.rotationEasing], null, q.FlyToNewMode),
  22401. G.start(H.matrix4(this.camera.projectionMatrix, d.projectionMatrix), p * e.cameraMatrixDuration, null, e.cameraMatrixDelay, e.cameraMatrixEase, null, q.FlyToNewMode),
  22402. G.start(H.uniform(this.model.skybox, "opacity", e.skyboxOpacity), p * e.skyboxOpacityLength, null, e.skyboxOpacityDelay, null, q.FlyToNewMode),
  22403. G.start(H.property(this.reticule.material.uniforms.opacity, "value", 0), p, null, q.FlyToNewMode)),
  22404. G.setTimeout(function() {
  22405. this.flying = !1,
  22406. u === V.PANORAMA && i !== V.PANORAMA ? this.currentPano.exit() : u !== V.PANORAMA && i === V.PANORAMA && (this.currentPano !== b && b.exit(),
  22407. this.currentPano.enter(),
  22408. this.path.placeCpm(),
  22409. this.path.fadeOutCpm(k.path.fadeOutTime),
  22410. this.spider.draw()),
  22411. u === V.DOLLHOUSE && this.cameraControls.controls[V.DOLLHOUSE].resetRanges(),
  22412. this.mode = i,
  22413. this.emit(W.FlyingEnded, f, w, this.currentPano, b)
  22414. if (this.afterCModeFuc) {
  22415. //手动加的函数
  22416. var cf = this.afterCModeFuc;
  22417. this.afterCModeFuc = null;//因为可能在执行afterCModeFuc时需要再添加afterCModeFuc所以要置空的话提前
  22418. cf();
  22419. }
  22420. this.updateMarkerVisi();//add
  22421. //(this.mode == u.PANORAMA) && this.updateHotVisible()//add
  22422. if(this.mode == "panorama" ){
  22423. //EditOverlay.updatePano()
  22424. editTool.hotpoint.updatePano()
  22425. }
  22426. //this.mode == u.PANORAMA && this.transitionPos({type:"flyDone", this.currentPano})//add
  22427. if(this.mode == V.PANORAMA){
  22428. Hot.updateVisibles([this.currentPano])
  22429. }else{
  22430. Hot.updateVisibles(true)
  22431. this.model.hotGroup.children.forEach(overlay=>{
  22432. if(overlay.animateInfo){
  22433. GifTexDeal.start(overlay.animation)
  22434. }
  22435. })
  22436. }
  22437. c && u !== V.PANORAMA && i === V.PANORAMA ? this.startWarp(M.Retain, S.Retain, R.BLACK, null, null, a) : (a && a(),
  22438. t.resolve())
  22439. }
  22440. .bind(this), p, q.FlyToNewMode),
  22441. this.mode = V.TRANSITIONING,
  22442. //EditOverlay.updatePano(),//add
  22443. editTool.hotpoint.updatePano(),//add
  22444. //u == "panorama" && this.updateHotVisible(),
  22445. t.promise()
  22446. }
  22447. ,
  22448. t.prototype.fade360View = function(e, t, i) {
  22449. this.tagManager.hideShowTagsForBlackoutStyle(i.blackoutStyle, e),
  22450. $(this.domElement).fadeOut(.5 * e, function() {
  22451. this.model.skybox.material.uniforms.opacity.value = i.skyboxOpacity,
  22452. this.model.alpha = i.modelAlpha,
  22453. this.position.copy(t.position),
  22454. this.quaternion.copy(t.quaternion),
  22455. this.camera.projectionMatrix.copy(t.projectionMatrix),
  22456. $(this.domElement).fadeIn(.5 * e)
  22457. }
  22458. .bind(this))
  22459. }
  22460. ,
  22461. t.prototype.findDefaultViews = function() {
  22462. this.findDefaultView(this.lastInsideView, !0),
  22463. this.findDefaultView(this.last360View, !1)
  22464. }
  22465. ,
  22466. t.prototype.findDefaultView = function(e, i) {
  22467. var t, n = this.model.heroLocations, r = this.model.panos, o = n.findIndex(function(e) {
  22468. if (e.cameraMode !== V.PANORAMA)
  22469. return !1;
  22470. var t = r.get(e.panoId);
  22471. return t && t.isAligned() === i
  22472. });
  22473. 0 <= o ? (t = r.get(n[o].panoId),
  22474. e.update({
  22475. cameraMode: V.PANORAMA,
  22476. pano: t,
  22477. position: n[o].position,
  22478. quaternion: n[o].quaternion
  22479. })) : 0 <= (o = r.list.findIndex(function(e) {
  22480. return e.isAligned() === i
  22481. })) ? (t = r.list[o],
  22482. e.update({
  22483. cameraMode: V.PANORAMA,
  22484. pano: t,
  22485. position: t.position
  22486. })) : Y.warn("There are no", i ? "inside" : "360º", "views in this model")
  22487. }
  22488. ,
  22489. t.prototype.updateLastView = function() {
  22490. this.mode === V.PANORAMA && (this.currentPano.isAligned() ? this.lastInsideView : this.last360View).update({
  22491. pano: this.currentPano,
  22492. position: this.position,
  22493. quaternion: this.quaternion
  22494. })
  22495. }
  22496. ,
  22497. t.prototype.goToLastView = function(e, t) {
  22498. var i = $.Deferred()
  22499. , n = i.resolve.bind(i)
  22500. , r = i.reject.bind(i)
  22501. , o = e ? this.lastInsideView : this.last360View;
  22502. return this.isInMode(V.PANORAMA) && this.currentPano.isAligned() !== e && this.updateLastView(),
  22503. this.isInMode(V.PANORAMA) ? (this.path && this.path.popOutCpm(),
  22504. this.fadeToView(e, o, k.show360Views.transitionTime, t).done(n).fail(r)) : this.isOutsideMode() && this.flyToNewMode({
  22505. mode: o.cameraMode,
  22506. pano: o.pano,
  22507. quaternion: o.quaternion,
  22508. callback: t
  22509. }).done(n).fail(r),
  22510. i.promise()
  22511. }
  22512. ,
  22513. t.prototype.fadeToView = function(e, t, i, n) {
  22514. var r = $.Deferred()
  22515. , o = r.resolve.bind(r)
  22516. , a = r.reject.bind(r);
  22517. if (!t.isValid() || t.cameraMode === V.PANORAMA && !t.pano)
  22518. return Y.warn("Tried to fade to an illegal view", t.cameraMode),
  22519. a("Cannot go to illegal view"),
  22520. r.promise();
  22521. var s = (k[t.cameraMode],
  22522. function() {
  22523. $(this.domElement).fadeIn(.5 * i),
  22524. n && n(),
  22525. o()
  22526. }
  22527. .bind(this))
  22528. , l = e ? P.FADEIN : P.END;
  22529. return this.tagManager.hideShowTagsForBlackoutStyle(l, i),
  22530. $(this.domElement).fadeOut(.5 * i, function() {
  22531. this.model.fadePanoMarkers(e ? k.panorama.markerOpacity : 0),
  22532. t.cameraMode === V.PANORAMA ? this.flyToPano({
  22533. pano: t.pano,
  22534. lookAtPoint: T.FORWARD.clone().applyQuaternion(t.quaternion).add(t.pano.position),
  22535. duration: 0
  22536. }, s) : this.flyToNewMode({
  22537. mode: t.cameraMode,
  22538. quaternion: t.quaternion,
  22539. duration: 0,
  22540. callback: s
  22541. })
  22542. }
  22543. .bind(this)),
  22544. r.promise()
  22545. }
  22546. ,
  22547. t.prototype.startWarp = function(e, t, i, n, r, o) {
  22548. if (this.cameraControls.activeControl && (this.cameraControls.activeControl.enabled = !1),
  22549. this.flying)
  22550. return Y.warn("Player.startWarp() -> Cannot warp when flying"),
  22551. o && o(),
  22552. !1;
  22553. null != e || (e = M.Show),
  22554. this.history.invalidate(),
  22555. e !== M.Retain ? this.path.brushToWarpPano(i, R.BLACK) || (i = R.BLACK) : i = this.path.upcomingTransType;
  22556. var a = this.path.warpDestPano && !this.path.warpDestPano.isAligned();
  22557. return this.emit(W.WarpStarted, a, i, n, r),
  22558. n = n || P.MIDDLE,
  22559. this.path.warpToPano(i, n, r, function() {
  22560. t === S.Slow ? this.path.discardSlow() : t === S.Standard && this.path.discardPathObject(),
  22561. this.emit(W.WarpEnded, i),
  22562. this.cameraControls.activeControl && (this.cameraControls.activeControl.enabled = !0),
  22563. o && o()
  22564. }
  22565. .bind(this)),
  22566. e === M.Hide && this.path.discardPathObject(),
  22567. !0
  22568. }
  22569. ,
  22570. t.prototype.warpToPanoById = function(e, t, i, n, r, o, a, s) {
  22571. return this.path.setWarpDestinationByPanoId(e, t) ? this.startWarp(i, n, r, o, a, s) : (Y.warn("Player.warpToPanoById() -> Could not setWarpDestinationByPanoId()"),
  22572. s && s(),
  22573. !1)
  22574. }
  22575. ,
  22576. t.prototype.warpToPanoByHeroIndex = function(e, t, i, n, r, o, a) {
  22577. return this.path.setWarpDestinationByHeroIndex(e) ? this.startWarp(t, i, n, r, o, a) : (Y.warn("Player.warpToPanoByHeroIndex() -> Could not setWarpDestinationByHeroIndex()"),
  22578. a && a(),
  22579. !1)
  22580. }
  22581. ,
  22582. t.prototype.warpToPano = function(e, t, i, n, r, o, a, s) {
  22583. return this.warpToPanoById(e.id, t, i, n, r, o, a, s)
  22584. }
  22585. ,
  22586. t.prototype.warpToNonPanoByHeroIndex = function(e, t) {
  22587. return this.path.setWarpDestinationByHeroIndex(e) ? (this.path.warpToNonPano(t),
  22588. !0) : (Y.warn("Player.warpToNonPanoByHeroIndex() -> Could not setWarpDestinationByHeroIndex()"),
  22589. t && t(),
  22590. !1)
  22591. }
  22592. ,
  22593. t.prototype.aimTourCamera = function(e, t, i, n) {
  22594. return Y.debug("player.aimTourCamera(" + e + ") calling warpToPanoByHeroIndex(" + e + ")"),
  22595. this.warpToPanoByHeroIndex(e, t, i, null, null, null, n)
  22596. }
  22597. ,
  22598. t.prototype.showPathToHeroLocation = function(e) {
  22599. this.path.setWarpDestinationByHeroIndex(e) && this.path.brushToWarpPano(R.STD, R.BLACK)
  22600. }
  22601. ,
  22602. t.prototype.tourInterlude = function(e, t) {
  22603. this.history.invalidate(),
  22604. this.path.discardSlow();
  22605. var currentLocation = this.model.heroLocations[this.director.currentItem[0]]
  22606. var rotTime
  22607. if(currentLocation.rotTime == void 0 || currentLocation.rotTime == ''){
  22608. var restChildCount = currentLocation.heroLocations ? (currentLocation.heroLocations.length-this.director.currentItem[1]-1) : 0
  22609. var current = g_tourAudio ? 1e3 * g_tourAudio.currentTime : 0
  22610. rotTime = currentLocation && currentLocation.musicInfo.music ? currentLocation.musicInfo.time - current : 2e3;
  22611. if(restChildCount){//如果当前folder中还有剩下的item,平分一下时间
  22612. var timeEachItem = 2000;//假设每个item飞的时间
  22613. var rotTime = (rotTime-timeEachItem*restChildCount) / (restChildCount+1);
  22614. }
  22615. rotTime = Math.max(0, rotTime)
  22616. console.log("rotTime "+rotTime +" at item "+this.director.currentItem + ",musicCurrentTime:"+current)
  22617. }else{
  22618. rotTime = currentLocation.rotTime * 1000
  22619. console.log("rotTime "+rotTime +" at item "+this.director.currentItem)
  22620. }
  22621. this.path.waitNextStep(e, function() {//等待音乐播放一段时间再下一步,此时镜头会缓慢旋转
  22622. t && t()
  22623. }
  22624. .bind(this), rotTime)
  22625. }
  22626. ,
  22627. t.prototype.stopInterlude = function() {
  22628. this.interruptAndFastForward(null, 0)
  22629. }
  22630. ,
  22631. t.prototype.interruptAndFastForward = function(e, t) {
  22632. this.isWarping() && this.emit(W.WarpInterrupted, this.path.activeTransType, e, t),
  22633. this.flying && this.emit(W.FlyingInterrupted),
  22634. this.path.interruptAndFastForward(e, t)
  22635. }
  22636. ,
  22637. t.prototype.setSize = function(e, t) {
  22638. var i = e / t;
  22639. this.baseFov = A.clampVFOV(k.insideFOV, k.insideFOVMax, e, t);
  22640. var n = A.getHFOVFromVFOV(k.insideFOV, e, t);
  22641. for (var r in n > k.insideFOVMax ? this.baseFov = A.getVFOVFromHFOV(k.insideFOVMax, e, t) : this.baseFov = k.insideFOV,
  22642. this.cameraControls.cameras) {
  22643. var o = this.cameraControls.cameras[r];
  22644. o.fov = this.baseFov * (1 / this.zoomLevel),
  22645. o.updateAspect(i)
  22646. }
  22647. }
  22648. ,
  22649. t.prototype.toJSON = function() {
  22650. var e = {};
  22651. return this.cameraControls.activeControl && ((e = this.cameraControls.activeControl.toJSON()).camera_mode = V.toInt(this.mode),
  22652. this.isOutsideMode() ? this.model.allFloorsVisible ? e.floor_visibility = [] : e.floor_visibility = this.model.floors.list.map(function(e) {
  22653. return e.hidden ? 0 : 1
  22654. }) : V.PANORAMA && (e.scan_id = this.currentPano.id)),
  22655. e
  22656. }
  22657. ,
  22658. t.prototype.getCurrentNodePanos = function(e) {
  22659. if (this.model.panos.map,
  22660. e.length = 0,
  22661. this.path.nodes)
  22662. for (var t = 0; t < this.path.nodes.length; t++) {
  22663. var i = this.path.nodes[t];
  22664. e.push(this.model.panos.get(i))
  22665. }
  22666. }
  22667. ,
  22668. t.prototype.zoomIncrementally = function(e) {
  22669. var t = this.zoomLevel;
  22670. this.zoomTo(this.zoomLevel + e),
  22671. t !== this.zoomLevel && this.currentPano && this.zoomStats.addZoomAction(t, this.zoomLevel, this.currentPano.id)
  22672. }
  22673. ,
  22674. t.prototype.zoomInIncrementally = function(e) {
  22675. e = e || this.defaultZoomIncrement,
  22676. this.zoomIncrementally(e)
  22677. }
  22678. ,
  22679. t.prototype.zoomOutIncrementally = function(e) {
  22680. e = e || -this.defaultZoomIncrement,
  22681. this.zoomIncrementally(e)
  22682. }
  22683. ,
  22684. t.prototype.zoomBy = function(e) {
  22685. this.zoomTo(this.zoomLevel * e)
  22686. }
  22687. ,
  22688. t.prototype.zoomIn = function() {
  22689. this.zoomBy(1 + this.zoomSpeed)
  22690. }
  22691. ,
  22692. t.prototype.zoomOut = function() {
  22693. this.zoomBy(1 - this.zoomSpeed)
  22694. }
  22695. ,
  22696. t.prototype.zoomTo = function(e, t) {
  22697. if ((t || k.zoom.enabled && this.mode === V.PANORAMA && this.zoomEnabled) && (e < k.zoom.min && (e = k.zoom.min),
  22698. e > k.zoom.max && (e = k.zoom.max),
  22699. e > this.zoomLevel ? (this.emit(m.ZoomIn),
  22700. e === k.zoom.max && this.emit(m.ZoomMax)) : e < this.zoomLevel && (this.emit(m.ZoomOut),
  22701. e === k.zoom.min && this.emit(m.ZoomMin)),
  22702. this.cameraControls.activeControl)) {
  22703. var i = this.cameraControls.activeControl.camera;
  22704. this.zoomLevel = e,
  22705. i.fov = this.baseFov * (1 / this.zoomLevel),
  22706. i.updateProjectionMatrix(),
  22707. this.zoomFov = i.fov
  22708. }
  22709. }
  22710. ,
  22711. t.prototype.increaseZoomSpeed = function() {
  22712. this.zoomSpeed = this.clampZoomSpeed(this.zoomSpeed + this.zoomSpeedAdjust)
  22713. }
  22714. ,
  22715. t.prototype.decreaseZoomSpeed = function() {
  22716. this.zoomSpeed = this.clampZoomSpeed(this.zoomSpeed - this.zoomSpeedAdjust)
  22717. }
  22718. ,
  22719. t.prototype.clampZoomSpeed = function(e) {
  22720. return e < 0 ? 0 : e
  22721. }
  22722. ,
  22723. t.prototype.activatePersistentZooming = function(e) {
  22724. this.zooming = e ? 1 : -1
  22725. }
  22726. ,
  22727. t.prototype.deactivatePersistentZooming = function() {
  22728. this.zooming = 0
  22729. }
  22730. ,
  22731. t.prototype.zoomDefault = function() {
  22732. this.zoomTo(1, !0)
  22733. }
  22734. window.fovTranId = 333;//add
  22735. t.prototype.smoothZoomToDefault = function(e, t) {
  22736. G.cancelById(window.fovTranId)
  22737. var i, n = this.zoomLevel, r = function(e) {
  22738. 1 < e && (e = 1),
  22739. i = n * (1 - e) + e,
  22740. this.zoomTo(i, !0)
  22741. }
  22742. .bind(this), o = function() {
  22743. this.zoomDefault(),
  22744. t && window.setTimeout(t, 50)
  22745. }
  22746. .bind(this);
  22747. G.start(r, e, o, null, 0, z[k.transition.blendEasing], null, window.fovTranId)
  22748. }
  22749. ,
  22750. t.prototype.smoothZoomFovTo = function (fov, zoomLevel, dur, callback) {//add
  22751. G.cancelById(window.fovTranId)
  22752. var i,
  22753. n = this.zoomLevel,
  22754. aimLevel = zoomLevel || this.baseFov / fov
  22755. if (n == aimLevel) return
  22756. var fun = function (e) {
  22757. e > 1 && (e = 1), (i = n * (1 - e) + e * aimLevel), this.zoomTo(i, !0)
  22758. }.bind(this)
  22759. G.start(fun, dur, callback, null, 0, z[k.transition.easeInCubic], null, window.fovTranId)
  22760. }
  22761. ,
  22762. t.prototype.updateZoomPano = function() {
  22763. if (!this.panoRenderer.zoomPanoRenderingDisabled && this.mode === V.PANORAMA) {
  22764. var e = this.currentPano;
  22765. if (e) {
  22766. var t = this.zoomLevel > k.zoom.activationThreshold
  22767. , i = (this.flying && this.nextPano && this.nextPano !== this.currentPano || this.isWarping(),
  22768. t);
  22769. this.tileDownloader.tilePrioritizer.setZoomingActive(i),
  22770. this.panoRenderer.setZoomingActive(i, e, !0);
  22771. var n = function(e, t) {
  22772. this.panoRenderer.resetRenderStatus(e.id, !1, !0, this.qualityManager.getMaxNavPanoSize()),
  22773. this.panoRenderer.clearAllQueuedUploadsForPano(e.id),
  22774. this.panoRenderer.renderPanoTiles(e.id, null, !1, !1),
  22775. e.setZoomed(t)
  22776. }
  22777. .bind(this);
  22778. i && !e.zoomed ? (n(e, !0),
  22779. this.panoRenderer.enableUltraHighQualityMode(function() {
  22780. this.qualityManager.useUltraHighResolutionPanos && !k.zoom.overridemax && (k.zoom.max = y.ultraHighQualityMaxZoom),
  22781. i && n(e, !0)
  22782. }
  22783. .bind(this))) : !t && e.zoomed && n(e, !1)
  22784. }
  22785. }
  22786. },
  22787. //--------
  22788. t.prototype.flyToMode = function(mode, f1){ //飞到某个模式后再执行f1函数
  22789. var f2;
  22790. if (this.mode == mode) {
  22791. f1 && f1()
  22792. } else {
  22793. f2 = f1;
  22794. if (this.mode == "transitioning" && this.modeTran.split('-')[1] != mode) {//正飞向其他模式,就要先飞完再飞进来然后执行
  22795. this.afterCModeFuc = function() {
  22796. this.afterCModeFuc = f2
  22797. this.flyToNewMode({mode:mode, pano: mode == "panorama" && this.currentPano });
  22798. }.bind(this)
  22799. } else {
  22800. this.afterCModeFuc = f2;//飞入后执行
  22801. try{ //在场景刚开始加载 control还没建好时这句可能会报错所以用try。 不用callback而用 afterCModeFuc也是这个原因,因为会有别的函数可以飞入然后执行它
  22802. this.flyToNewMode({mode:mode, pano: mode == "panorama" && this.currentPano});
  22803. }catch(e){}
  22804. }
  22805. }
  22806. }
  22807. ,
  22808. t.prototype.checkHasNeighbor = function(pano){//add
  22809. for(var i in pano.neighbourPanos ){
  22810. if(i == pano.id)continue;
  22811. if(pano.neighbourPanos[i]){
  22812. return true;
  22813. }
  22814. }
  22815. }
  22816. ,
  22817. ee.exports = t
  22818. }
  22819. ).call(this, "/js/player.js")
  22820. }
  22821. , {
  22822. "./constants": 8,
  22823. "./enum/AlignmentType": 17,
  22824. "./enum/BlackoutStyle": 18,
  22825. "./enum/ControlEvents": 21,
  22826. "./enum/Keys": 30,
  22827. "./enum/ModelManagerEvents": 33,
  22828. "./enum/PanoSizeClass": 36,
  22829. "./enum/PanoramaEvents": 37,
  22830. "./enum/PathDiscardMode": 38,
  22831. "./enum/PathDisplayMode": 39,
  22832. "./enum/PlayerEvents": 40,
  22833. "./enum/TagStates": 44,
  22834. "./enum/Vectors": 50,
  22835. "./enum/Viewmode": 51,
  22836. "./enum/WarpStyle": 52,
  22837. "./enum/ZoomEvents": 53,
  22838. "./exception/BasicException": 55,
  22839. "./model/ModelManager": 140,
  22840. "./objects/NSpider": 147,
  22841. "./objects/Panorama": 148,
  22842. "./objects/Reticule": 149,
  22843. "./objects/ShowPath": 151,
  22844. "./objects/Snapshot": 153,
  22845. "./objects/View": 154,
  22846. "./settings": 166,
  22847. "./shaders": 167,
  22848. "./tile/TileDownloader": 171,
  22849. "./tile/TilePrioritizer": 172,
  22850. "./util/ZoomStats": 179,
  22851. "./util/browser": 182,
  22852. "./util/camera": 183,
  22853. "./util/cameraLight": 184,
  22854. "./util/common": 185,
  22855. "./util/easing": 186,
  22856. "./util/history": 187,
  22857. "./util/lerp": 188,
  22858. "./util/logger": 189,
  22859. "./util/math": 190,
  22860. "./util/transitions": 195,
  22861. hot: "hot",
  22862. scaleImg: "scaleImg",
  22863. events: 202,
  22864. three: 217
  22865. }],
  22866. scaleImg: [function(e, t) {
  22867. var i = t;
  22868. (function() {
  22869. function e(e, t, i, n) {
  22870. function r() {
  22871. (U = "object" == typeof i ? i : t.src || n ? s : document.createElement("canvas")).width = d,
  22872. U.height = p,
  22873. H = U.getContext("2d")
  22874. }
  22875. function o(e) {
  22876. if (e) {
  22877. var t, i = H.getImageData(0, 0, d, p), n = i.data;
  22878. for (t = 0; t < ie; t += 4)
  22879. n[t] = e[t] * ne | 0,
  22880. n[t + 1] = e[t + 1] * ne | 0,
  22881. n[t + 2] = e[t + 2] * ne | 0,
  22882. n[t + 3] = e[t + 3] * ne | 0;
  22883. return delete e,
  22884. i
  22885. }
  22886. return H.getImageData(0, 0, d, p)
  22887. }
  22888. function a(e, t, i, n, r) {
  22889. return .5 * (n - t + (2 * t - 5 * i + 4 * n - r + (3 * (i - n) + r - t) * e) * e) * e + i
  22890. }
  22891. var s, l;
  22892. if (t || (t = e.input,
  22893. i = e.output,
  22894. n = e.inputRemovable,
  22895. e.scale && (e = e.scale)),
  22896. t.src)
  22897. if (s = document.createElement("canvas"),
  22898. null != t.naturalWidth)
  22899. s.width = t.naturalWidth,
  22900. s.height = t.naturalHeight;
  22901. else if (null != t.runtimeStyle) {
  22902. var c = t.runtimeStyle
  22903. , h = c.width
  22904. , u = c.height;
  22905. c.width = "auto",
  22906. c.height = "auto",
  22907. s.width = t.width,
  22908. s.height = t.height,
  22909. c.width = h,
  22910. c.height = u
  22911. } else {
  22912. h = t.width,
  22913. u = t.height;
  22914. t.removeAttribute && (t.removeAttribute("width"),
  22915. t.removeAttribute("height")),
  22916. s.width = t.width,
  22917. s.height = t.height,
  22918. t.width = h,
  22919. t.height = u
  22920. }
  22921. else
  22922. s = t;
  22923. l = s.getContext("2d"),
  22924. t.src && l.drawImage(t, 0, 0);
  22925. var d, p, f = s.width, g = s.height, m = l.getImageData(0, 0, f, g).data;
  22926. if (!f || !g)
  22927. return !1;
  22928. (t.src || n) && s.clearRect(0, 0, f, g),
  22929. p = "object" == typeof e ? e.width ? (d = e.width + .5 | 0,
  22930. e.height + .5 | 0) : (d = f * e.scaleX + .5 | 0,
  22931. g * e.scaleY + .5 | 0) : (d = e * f + .5 | 0,
  22932. e * g + .5 | 0);
  22933. 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;
  22934. if (1 < re || 1 < oe)
  22935. for (r(),
  22936. G = (z = o()).data,
  22937. C = 0; C < p; C++)
  22938. for (V = (y = C / oe) - (w = 0 | y),
  22939. j = w * $,
  22940. W = w < 1 ? j : j - $,
  22941. w < g - 2 ? (Y = j + $,
  22942. q = (2 + w) * $) : Y = q = g - 2 < w ? j : j + $,
  22943. A = 0; A < d; A++,
  22944. te += 4)
  22945. Z = (b = 0 | (v = A / re)) << 2,
  22946. b < f - 2 ? (K = Z + 4,
  22947. Q = Z + 8) : K = Q = f - 2 < b ? Z : Z + 4,
  22948. 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,
  22949. ++Z,
  22950. ++K,
  22951. ++Q,
  22952. 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,
  22953. ++Z,
  22954. ++K,
  22955. ++Q,
  22956. 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,
  22957. ++Z,
  22958. ++K,
  22959. ++Q,
  22960. 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,
  22961. G[te] = 0 <= D ? D < 256 ? D : 255 : 0,
  22962. G[te + 1] = 0 <= F ? F < 256 ? F : 255 : 0,
  22963. G[te + 2] = 0 <= B ? B < 256 ? B : 255 : 0,
  22964. G[te + 3] = 0 <= N ? N < 256 ? N : 255 : 0;
  22965. else {
  22966. if (le.Float32Array)
  22967. L = new Float32Array(ie);
  22968. else
  22969. for (L = [],
  22970. te = 0; te < ie; ++te)
  22971. L[te] = 0;
  22972. for (y = 0; y < g; y++)
  22973. for (I = (_ = 0 | (C = y * oe)) * J,
  22974. (O = !!((_ - (C + oe | 0)) * (g - 1 - y)) << 1) && (M = 1 + _ - C,
  22975. R = C + oe - _ - 1),
  22976. v = 0; v < f; v++,
  22977. ee += 4)
  22978. switch (A = v * re,
  22979. E = 0 | A,
  22980. te = I + (E << 2),
  22981. P = !!((E - (A + re | 0)) * (f - 1 - v)),
  22982. P && (x = 1 + E - A,
  22983. S = A + re - E - 1),
  22984. D = m[ee],
  22985. F = m[ee + 1],
  22986. B = m[ee + 2],
  22987. N = m[ee + 3],
  22988. P + O) {
  22989. case 0:
  22990. L[te] += D * ae,
  22991. L[te + 1] += F * ae,
  22992. L[te + 2] += B * ae,
  22993. L[te + 3] += N * ae;
  22994. break;
  22995. case 1:
  22996. T = x * oe,
  22997. L[te] += D * T,
  22998. L[te + 1] += F * T,
  22999. L[te + 2] += B * T,
  23000. L[te + 3] += N * T,
  23001. T = S * oe,
  23002. L[te + 4] += D * T,
  23003. L[te + 5] += F * T,
  23004. L[te + 6] += B * T,
  23005. L[te + 7] += N * T;
  23006. break;
  23007. case 2:
  23008. T = re * M,
  23009. L[te] += D * T,
  23010. L[te + 1] += F * T,
  23011. L[te + 2] += B * T,
  23012. L[te + 3] += N * T,
  23013. T = re * R,
  23014. L[te += J] += D * T,
  23015. L[te + 1] += F * T,
  23016. L[te + 2] += B * T,
  23017. L[te + 3] += N * T;
  23018. break;
  23019. default:
  23020. T = x * M,
  23021. L[te] += D * T,
  23022. L[te + 1] += F * T,
  23023. L[te + 2] += B * T,
  23024. L[te + 3] += N * T,
  23025. T = S * M,
  23026. L[te + 4] += D * T,
  23027. L[te + 5] += F * T,
  23028. L[te + 6] += B * T,
  23029. L[te + 7] += N * T,
  23030. T = x * R,
  23031. L[te += J] += D * T,
  23032. L[te + 1] += F * T,
  23033. L[te + 2] += B * T,
  23034. L[te + 3] += N * T,
  23035. T = S * R,
  23036. L[te + 4] += D * T,
  23037. L[te + 5] += F * T,
  23038. L[te + 6] += B * T,
  23039. L[te + 7] += N * T
  23040. }
  23041. delete m,
  23042. r(),
  23043. z = o(L)
  23044. }
  23045. if (H.putImageData(z, 0, 0),
  23046. "string" == typeof i) {
  23047. var se;
  23048. if ("png" === i || "jpeg" === i)
  23049. return (se = n && t.src ? t : new Image).width = d,
  23050. se.height = p,
  23051. se.src = U.toDataURL("image/" + i, .85),
  23052. se;
  23053. if ("png-src" === i || "jpeg-src" === i)
  23054. return U.toDataURL("image/" + i.split("-")[0], .85)
  23055. }
  23056. return U
  23057. }
  23058. var le = this;
  23059. "undefined" != typeof exports ? ("undefined" != typeof module && module.exports && (exports = module.exports = e),
  23060. exports.scale = e) : c = e
  23061. }
  23062. ).call(this),
  23063. i.exports = c
  23064. }
  23065. , {}],
  23066. 156: [function(i, n, e) {
  23067. (function(e) {
  23068. "use strict";
  23069. function t(e, t) {
  23070. this.model = e,
  23071. this.panos = e.panos,
  23072. this.player = t,
  23073. this.imagePanos = this.listImagePanos(),
  23074. this.retryMinimumTime = 1e4
  23075. }
  23076. var r = (i("three"),
  23077. i("./enum/Viewmode"))
  23078. , o = (i("./settings"),
  23079. i("./objects/Panorama"))
  23080. , a = new (i("./util/logger"))(e);
  23081. t.prototype.start = function() {
  23082. this.loadNextPano(function(e) {
  23083. e ? this.start() : (a.debug("No suitable pano loaded, waiting a little while before looking again"),
  23084. setTimeout(function() {
  23085. this.start()
  23086. }
  23087. .bind(this), 1e3))
  23088. }
  23089. .bind(this))
  23090. }
  23091. ,
  23092. t.prototype.validLoadTarget = function(e) {
  23093. return e && !e.isLoaded("high") && Date.now() - e.failedLoadingAt > this.retryMinimumTime
  23094. }
  23095. ,
  23096. t.prototype.listImagePanos = function() {
  23097. var i = []
  23098. , n = this;
  23099. return this.model.images.forEach(function(e) {
  23100. if (e.metadata && e.metadata.scan_id) {
  23101. var t = n.model.panos.get(e.metadata.scan_id);
  23102. t && !t.isLoaded("high") && i.push(t)
  23103. }
  23104. }),
  23105. i
  23106. }
  23107. ,
  23108. t.prototype.nextNotLoadedImage = function() {
  23109. for (; 0 < this.imagePanos.length; ) {
  23110. var e = this.imagePanos[0];
  23111. if (!e.isLoaded("high"))
  23112. return e;
  23113. this.imagePanos.shift()
  23114. }
  23115. return null
  23116. }
  23117. ,
  23118. t.prototype.loadNextPano = function(e) {
  23119. var t, i, n = this.model.waitQueue.filter(function(e) {
  23120. return e.object instanceof o
  23121. });
  23122. 0 < n.length ? (t = n[0].object,
  23123. a.debug("Overrode pano selection: Flying to an unloaded pano " + t.id)) : this.validLoadTarget(this.player.currentPano) ? (t = this.player.currentPano,
  23124. a.debug("Overrode pano selection: Currently at an unloaded pano " + t.id)) : this.validLoadTarget(this.player.closestPano) ? (t = this.player.closestPano,
  23125. a.debug("Overrode pano selection: Hovering over an unloaded pano " + t.id)) : this.validLoadTarget(this.nextNotLoadedImage()) ? (i = "high",
  23126. t = this.imagePanos[0],
  23127. 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),
  23128. t ? (i = i || t.isLoaded("low") ? "high" : "low",
  23129. a.debug("Preloading " + i + "-res pano " + t.id),
  23130. t.loadCube(i).done(e).fail(function() {
  23131. a.warn("Failed preloading pano", t.id, ", marking it as failed and forgetting it for a while"),
  23132. e()
  23133. })) : e && e(null)
  23134. }
  23135. ,
  23136. n.exports = t
  23137. }
  23138. ).call(this, "/js/preloaders.js")
  23139. }
  23140. , {
  23141. "./enum/Viewmode": 51,
  23142. "./objects/Panorama": 148,
  23143. "./settings": 166,
  23144. "./util/logger": 189,
  23145. three: 217
  23146. }],
  23147. 157: [function(a, s, e) {
  23148. (function(e) {
  23149. "use strict";
  23150. function t(e, t, i, n, r) {
  23151. this.qualityManager = e,
  23152. this.scene = t,
  23153. this.camera = i,
  23154. this.container = r,
  23155. this.controls = n,
  23156. this.controls.enabled = !0,
  23157. this.controls.locked = !0,
  23158. this.quickstartCamera = n.camera,
  23159. this.quickstartCamera.fov = d.clampVFOV(o.insideFOV, o.insideFOVMax, $("#player").width(), $("#player").height()),
  23160. this.skybox = null
  23161. }
  23162. var i = a("three")
  23163. , n = a("../util/logger")
  23164. , o = a("../constants")
  23165. , h = (a("../util/transitions"),
  23166. a("../util/lerp"),
  23167. a("../util/easing"),
  23168. a("../enum/Vectors"))
  23169. , u = a("../enum/PanoSizeClass")
  23170. , r = (a("../materials/ModelTextureMaterial"),
  23171. a("../materials/CubemapMaterial"))
  23172. , d = (a("../cameras/PanoramaCamera"),
  23173. a("../controls/PanoramaControls"),
  23174. a("../tile/TileUtils"),
  23175. a("../util/camera"),
  23176. a("../util/cameraLight"))
  23177. , p = (a("../util/browser"),
  23178. a("../settings"),
  23179. a("../gui/helpManager"),
  23180. new n(e));
  23181. t.prototype.load = function(e) {
  23182. e.pano.shouldRedrawOnBaseLoaded = !0;
  23183. var t, i, n = this, r = h.FORWARD.clone().applyQuaternion(e.quaternion), o = r.clone().negate();
  23184. this.controls.lookAt(r.add(this.quickstartCamera.position));
  23185. var a = this.qualityManager.getPanoSize(u.BASE)
  23186. , s = this.qualityManager.getPanoSize(u.STANDARD);
  23187. if (e.pano.tiled) {
  23188. p.warn("Loading startPano, TILED", e.pano.id);
  23189. var l = d.getHFOVForCamera(this.quickstartCamera, $("#player").width(), $("#player").height())
  23190. , c = this.quickstartCamera.fov;
  23191. p.warn("Quickstart loading tiles in frustum: [horizontal FOV: " + l + ", vertical FOV: " + c + "]"),
  23192. t = e.pano.loadTiledPano(s, r, {
  23193. hFov: l,
  23194. vFov: c
  23195. }, !1, !1, !0),
  23196. i = e.pano.loadTiledPano(a, o, null, !1, !1, !0)
  23197. } else
  23198. p.warn("Loading startPano", e.pano.id),
  23199. t = e.pano.loadCube("high");
  23200. return $.when(t).then(function() {
  23201. n.init(e.pano, e.quaternion),
  23202. e.pano.tiled ? i.done(function() {
  23203. e.pano.lockUntilRenderingComplete = !1,
  23204. this.controls.locked = !1
  23205. }
  23206. .bind(this)) : this.controls.locked = !1
  23207. }
  23208. .bind(this))
  23209. }
  23210. ,
  23211. t.prototype.init = function(e, t) {
  23212. p.info("Quickstart done loading, adding scene objects"),
  23213. e.lockUntilRenderingComplete = !0,
  23214. this.skybox = new i.Mesh(new i.CubeGeometry(1,1,1),new r({
  23215. side: i.BackSide
  23216. })),
  23217. this.skybox.material.uniforms.map.value = e.getSkyboxTexture(),
  23218. this.skybox.quaternion.copy(e.quaternion),
  23219. this.scene.add(this.skybox),
  23220. $(this.container).show()
  23221. }
  23222. ,
  23223. t.prototype.update = function(e) {
  23224. this.controls.update(e),
  23225. this.camera.copy(this.quickstartCamera)
  23226. }
  23227. ,
  23228. t.prototype.setSize = function(e, t) {
  23229. this.quickstartCamera.updateAspect(e / t)
  23230. }
  23231. ,
  23232. t.prototype.destroy = function() {
  23233. this.scene.remove(this.skybox)
  23234. }
  23235. ,
  23236. s.exports = t
  23237. }
  23238. ).call(this, "/js/scene/QuickstartManager.js")
  23239. }
  23240. , {
  23241. "../cameras/PanoramaCamera": 7,
  23242. "../constants": 8,
  23243. "../controls/PanoramaControls": 13,
  23244. "../enum/PanoSizeClass": 36,
  23245. "../enum/Vectors": 50,
  23246. "../gui/helpManager": 68,
  23247. "../materials/CubemapMaterial": 117,
  23248. "../materials/ModelTextureMaterial": 118,
  23249. "../settings": 166,
  23250. "../tile/TileUtils": 174,
  23251. "../util/browser": 182,
  23252. "../util/camera": 183,
  23253. "../util/cameraLight": 184,
  23254. "../util/easing": 186,
  23255. "../util/lerp": 188,
  23256. "../util/logger": 189,
  23257. "../util/transitions": 195,
  23258. three: 217
  23259. }],
  23260. 158: [function(e, t, i) {
  23261. "use strict";
  23262. function h(e, t, i) {
  23263. this.scene = e,
  23264. this.camera = t,
  23265. this.renderer = null,
  23266. this.effects = i,
  23267. this.animateCallback = null,
  23268. this.composer = null,
  23269. this.qualityManager = null,
  23270. e.renderWidth = 0,
  23271. e.renderHeight = 0,
  23272. this.updateClock = new M.Clock,
  23273. this.components = [],
  23274. this.updateListeners = [],
  23275. this.resizeListeners = [],
  23276. this.forceUpdateSize = !1,
  23277. this.started = !1,
  23278. this.textures = {},
  23279. this.suspendedObjects = []
  23280. }
  23281. 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;
  23282. window.requestAnimationFrame = window.requestAnimationFrame || window.webkitRequestAnimationFrame,
  23283. (h.prototype = Object.create(p.prototype)).addComponent = function(e) {
  23284. this.components.push(e),
  23285. e.update && this.updateListeners.push(e),
  23286. e.setSize && (this.resizeListeners.push(e),
  23287. this.forceUpdateSize = !0)
  23288. }
  23289. ,
  23290. h.prototype.removeComponent = function(t) {
  23291. function e(e) {
  23292. return e !== t
  23293. }
  23294. this.components = this.components.filter(e),
  23295. this.updateListeners = this.updateListeners.filter(e),
  23296. this.resizeListeners = this.resizeListeners.filter(e)
  23297. }
  23298. ,
  23299. h.prototype.start = function(e) {
  23300. if (this.started)
  23301. throw new l("Can't start SceneRenderer, already started");
  23302. this.createContext(e),
  23303. //u.isMobile() && this.boluoVrInit(),
  23304. this.initComposer(),
  23305. this.started = !0,
  23306. (b = b.bind(this))()
  23307. }
  23308. ,
  23309. h.prototype.createContext = function(e) {
  23310. try {
  23311. this.renderer = new M.WebGLRenderer({antialias: !u.isMobile()}),
  23312. this.renderer.autoClear = !0,
  23313. this.renderer.setPixelRatio(window.devicePixelRatio ? window.devicePixelRatio : 1),
  23314. this.renderer.setSize($("#player").width(), $("#player").height(), !1),
  23315. this.emit(r.ContextCreated)
  23316. } catch (e) {
  23317. throw new c("Unable to create a WebGL rendering context")
  23318. }
  23319. d.profiling.enabled && this.overrideTextures(),
  23320. e.appendChild(this.renderer.domElement)
  23321. }
  23322. ,
  23323. h.prototype.overrideTextures = function() {
  23324. var d = this.renderer.context
  23325. , t = 0
  23326. , i = d.createTexture;
  23327. d.createTexture = function() {
  23328. var e = i.call(d);
  23329. return e.id = t++,
  23330. this.textures[e.id] = e
  23331. }
  23332. .bind(this);
  23333. var p = d.texImage2D;
  23334. d.texImage2D = function(e, t, i, n, r, o, a, s, l) {
  23335. var c, h = this.getTextureTypeFromTarget(d, e);
  23336. c = h === f.TextureCube ? d.getParameter(d.TEXTURE_BINDING_CUBE_MAP) : d.getParameter(d.TEXTURE_BINDING_2D),
  23337. void 0 !== a ? p.call(d, e, t, i, n, r, o, a, s, l) : (a = n,
  23338. s = r,
  23339. n = (l = o).naturalWidth,
  23340. r = l.naturalHeight,
  23341. p.call(d, e, t, i, a, s, l));
  23342. var u = this.textures[c.id];
  23343. u.width = h === f.TextureCube ? 6 * n : n,
  23344. u.height = r
  23345. }
  23346. .bind(this);
  23347. var n = d.deleteTexture;
  23348. d.deleteTexture = function(e) {
  23349. delete this.textures[e.id],
  23350. n.call(d, e)
  23351. }
  23352. .bind(this)
  23353. }
  23354. ,
  23355. h.prototype.updateTextureMemory = (n = null,
  23356. function() {
  23357. var e = 0;
  23358. for (var t in this.textures) {
  23359. var i = this.textures[t];
  23360. i.width && i.height && (e += i.width * i.height * 4)
  23361. }
  23362. e !== n && this.emit(r.MemoryUsageUpdated, e),
  23363. n = e
  23364. }
  23365. ),
  23366. h.prototype.getTextureTypeFromTarget = function(e, t) {
  23367. switch (t) {
  23368. case e.TEXTURE_CUBE_MAP_POSITIVE_X:
  23369. case e.TEXTURE_CUBE_MAP_NEGATIVE_X:
  23370. case e.TEXTURE_CUBE_MAP_POSITIVE_Y:
  23371. case e.TEXTURE_CUBE_MAP_NEGATIVE_Y:
  23372. case e.TEXTURE_CUBE_MAP_POSITIVE_Z:
  23373. case e.TEXTURE_CUBE_MAP_NEGATIVE_Z:
  23374. return f.TextureCube;
  23375. case e.TEXTURE_2D:
  23376. return f.Texture2D;
  23377. default:
  23378. return null
  23379. }
  23380. }
  23381. ,
  23382. h.prototype.initComposer = function() {
  23383. this.composer = new M.EffectComposer(this.renderer),
  23384. this.composer.addPass(new M.RenderPass(this.scene,this.camera)),
  23385. this.composer.addPass(this.effects.hblurPass),
  23386. this.composer.addPass(this.effects.vblurPass)
  23387. }
  23388. ,
  23389. h.prototype.setSize = function(e, t, i) {
  23390. this.renderWidth = e,
  23391. this.renderHeight = t,
  23392. this.effects.aspect = e / t,
  23393. this.renderer.setSize(e, t, !1, i),
  23394. this.composer.setSize(e, t);
  23395. for (var n = 0; n < this.resizeListeners.length; n++)
  23396. this.resizeListeners[n].setSize(e, t)
  23397. }
  23398. ,
  23399. h.prototype.render = function() {
  23400. 0 < this.effects.currentBlur ? this.composer.render() : this.renderer.render(this.scene, this.camera)
  23401. }
  23402. ,
  23403. h.prototype.boluoVrInit = function() {
  23404. console.log("boluoVrInit"),
  23405. this.isHuawei5X = u.detectHUAWEI5X(),
  23406. this.oldRenderer = this.renderer,
  23407. this.newRenderer = new this.vrRenderer(this.renderer,this,this.camera),
  23408. window.panoCamera = this.camera;
  23409. var i = this;
  23410. window._vrEnabled = !1,
  23411. Object.defineProperty(window, "vrEnabled", {
  23412. get: function() {
  23413. return window._vrEnabled
  23414. },
  23415. set: function(e) {
  23416. (e = !!e) ? (i.renderer = i.newRenderer,
  23417. window.vrMarkers.forEach(function(e) {
  23418. e.visible = !0
  23419. })) : (i.renderer = i.oldRenderer,
  23420. window.vrMarkers.forEach(function(e) {
  23421. e.visible = !1
  23422. })),
  23423. i.cursor.visible = e,
  23424. i.setSize($("#player").width(), $("#player").height()),
  23425. window._vrEnabled = e,
  23426. setTimeout(function() {
  23427. console.log(player.cameraControls.activeControl.camera.fov)
  23428. }, 500)
  23429. }
  23430. }),
  23431. this.createCursor(.5, !1, 1, 16777215, 0);
  23432. var e = {
  23433. setSize: function(e, t) {
  23434. i.camera.aspect = e / t
  23435. }
  23436. };
  23437. this.resizeListeners.push(e),
  23438. this.vrLoadingInit()
  23439. }
  23440. ,
  23441. h.prototype.vrLoadingInit = function() {
  23442. var e = new (e = function(camera) {
  23443. var t = this
  23444. , e = new M.RingGeometry(1.3,1.5,32,32,0,1.2 * Math.PI)
  23445. , i = new M.MeshBasicMaterial({
  23446. color: 4967932,
  23447. side: M.DoubleSide
  23448. })
  23449. , n = new M.Mesh(e,i);
  23450. (this.mesh = n).position.z = -2,
  23451. n.scale.set(.08, .08, .08),
  23452. n.visible = !1,
  23453. //window.player.camera.add(n),
  23454. camera.add(n),
  23455. t.enabled = !1,
  23456. this.update = function(e) {
  23457. 1 == t.enabled && (n.rotation.z += 15 * e)
  23458. }
  23459. }
  23460. )(this.camera);
  23461. window.Loading = e,
  23462. this.updateListeners.push(e)
  23463. }
  23464. ,
  23465. h.prototype.createCursor = function(e, t, i, n, r) {
  23466. var o, a = new M.SpriteMaterial({
  23467. opacity: i,
  23468. color: n,
  23469. transparent: t,
  23470. map: this.boluoGetTexture("images/cursor.png"),
  23471. needsUpdate: !0,
  23472. side: M.DoubleSide
  23473. });
  23474. a.map.offset = new M.Vector2(1 / 17 * r,0),
  23475. a.map.repeat = new M.Vector2(1 / 17,1),
  23476. a.depthTest = !1,
  23477. a.blending = M.AdditiveBlending,
  23478. (o = new M.Sprite(a)).scale.set(.3, .3, .3),
  23479. o.position.z = -2,
  23480. o.visible = !1,
  23481. o.name = "cursor",
  23482. this.camera.add(o),
  23483. this.scene.add(this.camera),
  23484. this.cursor = o;
  23485. var s = new this.CursorAnimation(this.scene,o,this.camera);
  23486. this.cursor.triggerTargetEvent = s.triggerTargetEvent,
  23487. this.updateListeners.push(s)
  23488. }
  23489. ,
  23490. h.prototype.CursorAnimation = function(e, t, o) {
  23491. this.cursor = t,
  23492. this.raycaster = new M.Raycaster,
  23493. this.targetEventObj = {},
  23494. this.type = 1,
  23495. this.tweenFlag = !0;
  23496. var s = this;
  23497. this.target = o,
  23498. console.log(o.uuid),
  23499. this.euler = new M.Euler,
  23500. this.q0 = new M.Quaternion,
  23501. this.q1 = new M.Quaternion(-Math.sqrt(.5),0,0,Math.sqrt(.5)),
  23502. this.zee = new M.Vector3(0,0,1),
  23503. this.alpha = -1e3,
  23504. this.beta = -1e3,
  23505. this.gamma = -1e3,
  23506. this.orient = M.Math.degToRad(window.orientation || 0),
  23507. window.addEventListener("orientationchange", function() {
  23508. s.orient = M.Math.degToRad(window.orientation || 0)
  23509. }),
  23510. window.addEventListener("deviceorientation", function(e) {
  23511. var t = M.Math.degToRad(e.alpha)
  23512. , i = M.Math.degToRad(e.beta)
  23513. , n = M.Math.degToRad(e.gamma);
  23514. if (this.isHuawei5X ? (-1e3 === s.alpha && (s.alpha = t),
  23515. -1e3 === s.beta && (s.beta = i),
  23516. -1e3 === s.gamma && (s.gamma = n),
  23517. .06 < Math.abs(t - s.alpha) && (s.alpha = t),
  23518. .006 < Math.abs(i - s.beta) && (s.beta = i),
  23519. .006 < Math.abs(n - s.gamma) && (s.gamma = n)) : (s.alpha = t,
  23520. s.beta = i,
  23521. s.gamma = n),
  23522. h.vrDebug) {
  23523. $("#info-device-orientation").css("display", "block");
  23524. var r = "";
  23525. r += "alpha=(" + s.alpha + ")<BR/>",
  23526. r += "beta=(" + s.beta + ")<BR/>",
  23527. r += "gamma=" + s.gamma + "<BR/>",
  23528. document.getElementById("info-device-orientation").innerHTML = r
  23529. }
  23530. }),
  23531. this.setObjectQuaternion = function(e, t, i, n, r) {
  23532. s.euler.set(i, t, -n, "YXZ"),
  23533. e.setFromEuler(s.euler),
  23534. e.multiply(s.q1),
  23535. e.multiply(s.q0.setFromAxisAngle(s.zee, -r)),
  23536. o.updateMatrixWorld()
  23537. }
  23538. ,
  23539. parent !== window && window.addEventListener("message", function(e) {
  23540. var t, i, n, r, o = JSON.parse(e.data), a = -1 !== window.navigator.userAgent.indexOf("KIW-TL00H");
  23541. o && o.alpha && o.beta && o.gamma && (t = a,
  23542. i = M.Math.degToRad(o.alpha),
  23543. n = M.Math.degToRad(o.beta),
  23544. r = M.Math.degToRad(o.gamma),
  23545. t ? (-1e3 === s.alpha && (s.alpha = i),
  23546. -1e3 === s.beta && (s.beta = n),
  23547. -1e3 === s.gamma && (s.gamma = r),
  23548. .06 < Math.abs(i - s.alpha) && (s.alpha = i),
  23549. .006 < Math.abs(n - s.beta) && (s.beta = n),
  23550. .006 < Math.abs(r - s.gamma) && (s.gamma = r)) : (s.alpha = i,
  23551. s.beta = n,
  23552. s.gamma = r))
  23553. }),
  23554. this.update = function(e) {
  23555. TWEEN.update(),
  23556. window.vrEnabled && (this.setObjectQuaternion(this.target.quaternion, this.alpha, this.beta, this.gamma, this.orient),
  23557. this.triggerTargetEvent())
  23558. }
  23559. ,
  23560. this.triggerTargetEvent = function() {
  23561. var e = this.choseObj()
  23562. , t = e ? e.object : void 0;
  23563. (this.targetEventObj.currentObj = t) !== this.targetEventObj.lastObj && (t && this.autoCursorPosition(e),
  23564. 1 === this.type ? (this.cursorAnimate && this.cursorAnimate.stop(),
  23565. t && t.enabled && this.startAnimate(function() {
  23566. this.clickCallback(t)
  23567. }
  23568. .bind(this))) : this.type,
  23569. this.targetEventObj.lastObj = t)
  23570. }
  23571. ,
  23572. this.choseObj = function() {
  23573. this.raycaster.setFromCamera({
  23574. x: 0,
  23575. y: 0
  23576. }, o);
  23577. var e = (this.raycaster.ray,
  23578. window.vrMarkers)
  23579. , t = this.raycaster.intersectObjects(e);
  23580. if (0 < t.length)
  23581. return t[0]
  23582. }
  23583. ,
  23584. this.clickCallback = function(e) {
  23585. this.runTHREEAction(e, "onclick")
  23586. }
  23587. ,
  23588. this.runTHREEAction = function(e, t) {
  23589. switch (t) {
  23590. case "onclick":
  23591. e._listeners && e._listeners.click && e._listeners.click.forEach(function(e) {
  23592. e()
  23593. });
  23594. break;
  23595. case "onhover":
  23596. e._listeners && e._listeners.hover && e._listeners.hover.forEach(function(e) {
  23597. e()
  23598. });
  23599. break;
  23600. case "onout":
  23601. e._listeners && e._listeners.out && e._listeners.out.forEach(function(e) {
  23602. e()
  23603. })
  23604. }
  23605. }
  23606. ,
  23607. this.startAnimate = function(e) {
  23608. this.tweenFlag && this.initAnimation(e)
  23609. }
  23610. ,
  23611. this.initAnimation = function(e) {
  23612. var t = this
  23613. , i = this.cursor.material.map.offset;
  23614. t.tweenFlag = !1,
  23615. this.cursorAnimate = new TWEEN.Tween(i).to({
  23616. x: 1
  23617. }, 1e3).onStart(function() {
  23618. t.tweenFlag = !1
  23619. }).onStop(function() {
  23620. t.tweenFlag = !0,
  23621. this.x = 0,
  23622. i.x = 0
  23623. }).onUpdate(function() {}).onComplete(function() {
  23624. e(),
  23625. i.x = 0,
  23626. setTimeout(function() {
  23627. t.tweenFlag = !0
  23628. }, 1500)
  23629. }),
  23630. this.cursorAnimate.easing(function(e) {
  23631. return Math.floor(17 * e) / 17
  23632. }),
  23633. this.cursorAnimate.start()
  23634. }
  23635. ,
  23636. this.autoCursorPosition = function(e) {
  23637. this.cursor.scale.set(.3, .3, .3)
  23638. }
  23639. }
  23640. ,
  23641. h.prototype.vrRenderer = function(a, i, e) {
  23642. var s = new i.vrCamera(e);
  23643. s.bananaAspect = .8,
  23644. this.width,
  23645. this.height;
  23646. i = this;
  23647. this.setSize = function(e, t) {
  23648. a.setSize.call(this, e, t),
  23649. i.width = e,
  23650. i.height = t
  23651. }
  23652. ,
  23653. this.render = function(e, t, i, n) {
  23654. var r, o;
  23655. if (window.cameraQua = t.quaternion.clone(),
  23656. t.__RESS__SKIP__STEREO__)
  23657. return a.render(e, t, i, n);
  23658. if ("PerspectiveCamera" === t.type)
  23659. r = s.cameraL,
  23660. o = s.cameraR,
  23661. e.updateMatrixWorld(),
  23662. null === t.parent && t.updateMatrixWorld(),
  23663. s.vrCameraUpdate(t);
  23664. else {
  23665. if ("OrthographicCamera" !== t.type)
  23666. return DEBUG && console.error("Unsupported renderer: ", t.type);
  23667. r = o = t
  23668. }
  23669. a.setScissorTest(!0),
  23670. a.setScissor(0, 0, this.width / 2, this.height),
  23671. a.setViewport(0, 0, this.width / 2, this.height),
  23672. a.render.call(this, e, r, i, n),
  23673. a.setScissor(this.width / 2, 0, this.width / 2, this.height),
  23674. a.setViewport(this.width / 2, 0, this.width / 2, this.height),
  23675. a.render.call(this, e, o, i, n),
  23676. a.setScissorTest(!1)
  23677. }
  23678. ,
  23679. this.__proto__ = {
  23680. __proto__: a
  23681. }
  23682. }
  23683. ,
  23684. h.prototype.vrCamera = function(e) {
  23685. this.type = "StereoCamera",
  23686. this._aspect = 1,
  23687. this._overlap = .064,
  23688. this.cameraL = new M.PerspectiveCamera,
  23689. this.cameraL.layers.enable(1),
  23690. this.cameraL.matrixAutoUpdate = !1,
  23691. this.cameraR = new M.PerspectiveCamera,
  23692. this.cameraR.layers.enable(2),
  23693. this.cameraR.matrixAutoUpdate = !1,
  23694. this.eyeRight = new M.Matrix4,
  23695. this.eyeLeft = new M.Matrix4,
  23696. this.vrCameraNeedsUpdate = !0,
  23697. window.vrCameraL = this.cameraL,
  23698. Object.defineProperty(this, "bananaAspect", {
  23699. get: function() {
  23700. return this._aspect
  23701. },
  23702. set: function(e) {
  23703. this._aspect !== e && (this.vrCameraNeedsUpdate = !0),
  23704. this._aspect = e
  23705. }
  23706. }),
  23707. Object.defineProperty(this, "overlap", {
  23708. get: function() {
  23709. return this._overlap
  23710. },
  23711. set: function(e) {
  23712. this._overlap !== e && (this.vrCameraNeedsUpdate = !0),
  23713. this._overlap = e
  23714. }
  23715. }),
  23716. this.vrCameraUpdate = function(e) {
  23717. if (this.vrCameraNeedsUpdate = !0,
  23718. this.vrCameraNeedsUpdate = this.vrCameraNeedsUpdate || this.bananaFov !== e.fov || this.bananaReal_aspect !== e.aspect * this.bananaAspect || this.bananaNear !== e.near || this.bananaFar !== e.far,
  23719. this.vrCameraNeedsUpdate) {
  23720. this.vrCameraNeedsUpdate = !1,
  23721. console.debug("vrCameraUpdate"),
  23722. this.bananaFocus = e.focus,
  23723. this.bananaFov = e.fov,
  23724. this.bananaReal_aspect = e.aspect * this.bananaAspect,
  23725. this.bananaNear = e.near,
  23726. this.bananaFar = e.far,
  23727. console.debug(e.aspect),
  23728. this.bananaFocus = 10;
  23729. 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);
  23730. this.eyeLeft.elements[12] = -r,
  23731. this.eyeRight.elements[12] = r,
  23732. t = -a * this.bananaReal_aspect + o,
  23733. i = a * this.bananaReal_aspect + o,
  23734. n.elements[0] = 2 * this.bananaNear / (i - t),
  23735. n.elements[8] = (i + t) / (i - t),
  23736. this.cameraL.projectionMatrix.copy(n),
  23737. t = -a * this.bananaReal_aspect - o,
  23738. i = a * this.bananaReal_aspect - o,
  23739. n.elements[0] = 2 * this.bananaNear / (i - t),
  23740. n.elements[8] = (i + t) / (i - t),
  23741. this.cameraR.projectionMatrix.copy(n)
  23742. }
  23743. this.cameraL.matrixWorld.copy(e.matrixWorld).multiply(this.eyeLeft),
  23744. this.cameraR.matrixWorld.copy(e.matrixWorld).multiply(this.eyeRight)
  23745. }
  23746. }
  23747. ,
  23748. h.prototype.boluoGetTexture = function(e) {
  23749. var t = new M.TextureLoader;
  23750. return t.crossOrigin = "anonymous",
  23751. t.load(e)
  23752. }
  23753. ,
  23754. h.prototype.updateScreenSize = function(e) {
  23755. var t, i, n, r = !1;
  23756. e && !e.resize && null != e.width && null != e.height ? (i = e.width,
  23757. n = e.height,
  23758. r = !0,
  23759. t = 1) : (i = $("#player").width(),
  23760. n = $("#player").height(),
  23761. e && e.resize && (o = this.renderWidth,
  23762. a = this.renderHeight),
  23763. i === o && n === a && !this.forceUpdateSize || (o = i,
  23764. a = n,
  23765. r = !0,
  23766. t = window.devicePixelRatio)),
  23767. r && (this.setSize(i, n, t),
  23768. this.forceUpdateSize = !1)
  23769. }
  23770. ,
  23771. h.prototype.updateComponents = function() {
  23772. for (var e = Math.min(1, this.updateClock.getDelta()), t = 0; t < this.updateListeners.length; t++)
  23773. this.updateListeners[t].update(e)
  23774. }
  23775. ,
  23776. h.prototype.suspend = function() {
  23777. this.started = !1,
  23778. this.suspendedObjects = this.scene.children.map(function(e) {
  23779. return this.scene.remove(e),
  23780. e
  23781. }
  23782. .bind(this)),
  23783. this.render()
  23784. }
  23785. ,
  23786. h.prototype.resume = function() {
  23787. this.suspendedObjects.forEach(function(e) {
  23788. this.scene.add(e)
  23789. }
  23790. .bind(this)),
  23791. this.suspendedObjects = [],
  23792. this.started = !0,
  23793. b()
  23794. }
  23795. ;
  23796. var g, m, v, y, A, C, I, P, O, L, D, N, F, E, _, b = function() {
  23797. this.started && (window.requestAnimationFrame(b),
  23798. this.updateScreenSize(),
  23799. this.updateComponents(),
  23800. this.updateTextureMemory(),
  23801. this.render(),
  23802. this.emit(r.AfterRender))
  23803. };
  23804. h.prototype.getImageData = (E = document.createElement("canvas"),
  23805. _ = E.getContext("2d"),
  23806. function(e, t, i) {
  23807. return E.width === t && E.height === i || (E.width = t,
  23808. E.height = i),
  23809. _.drawImage(e, 0, 0, t, i),
  23810. _.getImageData(0, 0, t, i)
  23811. }
  23812. ),
  23813. h.prototype.initSizedTexture2D = function(e, t, i) {
  23814. var n = this.renderer
  23815. , r = n.context
  23816. , o = n.state
  23817. , a = new M.Texture(null);
  23818. !(a.flipY = !1) !== i && (i = !1),
  23819. a.generateMipmaps = i;
  23820. var s = n.paramThreeToGL(a.format)
  23821. , l = n.paramThreeToGL(a.type)
  23822. , c = n.properties.get(a)
  23823. , h = r.createTexture();
  23824. o.bindTexture(r.TEXTURE_2D, h),
  23825. r.pixelStorei(r.UNPACK_FLIP_Y_WEBGL, a.flipY),
  23826. r.texImage2D(r.TEXTURE_2D, 0, s, e, e, 0, s, l, null),
  23827. a.wrapS = t,
  23828. a.wrapT = t;
  23829. var u = n.paramThreeToGL(t);
  23830. return r.texParameteri(r.TEXTURE_2D, r.TEXTURE_WRAP_S, u),
  23831. r.texParameteri(r.TEXTURE_2D, r.TEXTURE_WRAP_T, u),
  23832. i ? (a.magFilter = M.LinearFilter,
  23833. a.minFilter = M.LinearMipMapLinearFilter,
  23834. r.texParameteri(r.TEXTURE_2D, r.TEXTURE_MAG_FILTER, r.LINEAR),
  23835. r.texParameteri(r.TEXTURE_2D, r.TEXTURE_MIN_FILTER, r.LINEAR_MIPMAP_NEAREST),
  23836. r.generateMipmap(r.TEXTURE_2D)) : (a.magFilter = M.LinearFilter,
  23837. a.minFilter = M.LinearFilter,
  23838. r.texParameteri(r.TEXTURE_2D, r.TEXTURE_MAG_FILTER, r.LINEAR),
  23839. r.texParameteri(r.TEXTURE_2D, r.TEXTURE_MIN_FILTER, r.LINEAR)),
  23840. o.bindTexture(r.TEXTURE_2D, null),
  23841. c.__webglTexture = h,
  23842. a
  23843. }
  23844. ,
  23845. h.prototype.initSizedCubeMap = function(e, t) {
  23846. var i = this.renderer
  23847. , n = i.context
  23848. , r = i.state
  23849. , o = new M.CubeTexture([null, null, null, null, null, null]);
  23850. o.flipY = !1,
  23851. o.generateMipmaps = t;
  23852. var a = i.paramThreeToGL(o.format)
  23853. , s = i.paramThreeToGL(o.type)
  23854. , l = i.properties.get(o)
  23855. , c = n.createTexture();
  23856. r.bindTexture(n.TEXTURE_CUBE_MAP, c),
  23857. n.pixelStorei(n.UNPACK_FLIP_Y_WEBGL, o.flipY);
  23858. for (var h = 0; h < 6; h++)
  23859. n.texImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X + h, 0, a, e, e, 0, a, s, null);
  23860. return t ? (o.magFilter = M.LinearFilter,
  23861. o.minFilter = M.LinearMipMapLinearFilter,
  23862. n.texParameteri(n.TEXTURE_CUBE_MAP, n.TEXTURE_MAG_FILTER, n.LINEAR),
  23863. n.texParameteri(n.TEXTURE_CUBE_MAP, n.TEXTURE_MIN_FILTER, n.LINEAR_MIPMAP_LINEAR),
  23864. n.texParameteri(n.TEXTURE_CUBE_MAP, n.GENERATE_MIPMAP, n.TRUE),
  23865. n.generateMipmap(n.TEXTURE_CUBE_MAP)) : (o.magFilter = M.LinearFilter,
  23866. o.minFilter = M.LinearFilter,
  23867. n.texParameteri(n.TEXTURE_CUBE_MAP, n.TEXTURE_MAG_FILTER, n.LINEAR),
  23868. n.texParameteri(n.TEXTURE_CUBE_MAP, n.TEXTURE_MIN_FILTER, n.LINEAR)),
  23869. r.bindTexture(n.TEXTURE_CUBE_MAP, null),
  23870. l.__image__webglTextureCube = c,
  23871. o
  23872. }
  23873. ,
  23874. h.prototype.deallocateCubeTexture = function(e) {
  23875. var t = this.renderer
  23876. , i = t.context
  23877. , n = t.properties.get(e);
  23878. i.deleteTexture(n.__image__webglTextureCube)
  23879. }
  23880. ,
  23881. h.prototype.uploadTexture2D = function(e, t, i, n, r, o) {
  23882. var a = this.renderer
  23883. , s = a.context
  23884. , l = a.state
  23885. , c = a.properties.get(t);
  23886. l.bindTexture(s.TEXTURE_2D, c.__webglTexture),
  23887. s.pixelStorei(s.UNPACK_FLIP_Y_WEBGL, t.flipY),
  23888. s.pixelStorei(s.UNPACK_PREMULTIPLY_ALPHA_WEBGL, t.premultiplyAlpha),
  23889. s.pixelStorei(s.UNPACK_ALIGNMENT, t.unpackAlignment),
  23890. s.texParameteri(s.TEXTURE_2D, s.TEXTURE_WRAP_S, a.paramThreeToGL(t.wrapS)),
  23891. s.texParameteri(s.TEXTURE_2D, s.TEXTURE_WRAP_T, a.paramThreeToGL(t.wrapT)),
  23892. s.texParameteri(s.TEXTURE_2D, s.TEXTURE_MAG_FILTER, a.paramThreeToGL(t.magFilter)),
  23893. s.texParameteri(s.TEXTURE_2D, s.TEXTURE_MIN_FILTER, a.paramThreeToGL(t.minFilter)),
  23894. s.texSubImage2D(s.TEXTURE_2D, 0, i, n, s.RGBA, s.UNSIGNED_BYTE, e),
  23895. t.generateMipmaps && s.generateMipmap(s.TEXTURE_2D),
  23896. l.bindTexture(s.TEXTURE_2D, null)
  23897. }
  23898. ,
  23899. h.prototype.uploadTexture3D = function(e, t, i, n, r, o, a) {
  23900. var s = this.renderer
  23901. , l = s.context
  23902. , c = s.state
  23903. , h = s.properties.get(t);
  23904. c.bindTexture(l.TEXTURE_CUBE_MAP, h.__image__webglTextureCube),
  23905. l.pixelStorei(l.UNPACK_FLIP_Y_WEBGL, t.flipY),
  23906. l.texSubImage2D(r, 0, i, n, l.RGBA, l.UNSIGNED_BYTE, e),
  23907. t.generateMipmaps && l.generateMipmap(l.TEXTURE_CUBE_MAP),
  23908. c.bindTexture(l.TEXTURE_CUBE_MAP, null)
  23909. }
  23910. ,
  23911. h.prototype.rebuildMipMaps2D = function(e) {
  23912. var t = this.renderer
  23913. , i = t.context
  23914. , n = t.state;
  23915. t.properties.get(e),
  23916. i.generateMipmap(i.TEXTURE_2D),
  23917. n.bindTexture(i.TEXTURE_2D, null)
  23918. }
  23919. ,
  23920. h.prototype.rebuildMipMaps3D = function(e) {
  23921. var t = this.renderer
  23922. , i = t.context
  23923. , n = t.state
  23924. , r = t.properties.get(e);
  23925. n.bindTexture(i.TEXTURE_CUBE_MAP, r.__image__webglTextureCube),
  23926. i.generateMipmap(i.TEXTURE_CUBE_MAP),
  23927. n.bindTexture(i.TEXTURE_CUBE_MAP, null)
  23928. }
  23929. ,
  23930. h.prototype.renderToCubeMap = (P = !1,
  23931. F = N = D = L = O = null,
  23932. function(e, t, i, n, r, o, a, s, l, c, h, u, d, p, f, g) {
  23933. this.renderer.context,
  23934. P || ((L = new M.OrthographicCamera(-.5,.5,.5,-.5,-200,200)).position.z = 150,
  23935. (O = new M.Scene).add(L),
  23936. D = new M.ShaderMaterial({
  23937. uniforms: {
  23938. tDiffuse: {
  23939. type: "t",
  23940. value: null
  23941. },
  23942. alpha: {
  23943. type: "f",
  23944. value: 1
  23945. }
  23946. },
  23947. vertexShader: R.basicTextured.vertexShader,
  23948. fragmentShader: R.basicTextured.fragmentShader,
  23949. depthWrite: !1,
  23950. depthTest: !1,
  23951. side: M.DoubleSide
  23952. }),
  23953. N = new M.PlaneBufferGeometry(1,1),
  23954. (F = new M.Mesh(N,D)).position.z = 0,
  23955. O.add(F),
  23956. P = !0);
  23957. var m = N.getAttribute("uv");
  23958. m.setDynamic(!0),
  23959. m.needsUpdate = !0;
  23960. var v = m.array
  23961. , y = r / i
  23962. , A = o / n
  23963. , C = a / i
  23964. , I = s / n;
  23965. v[0] = y,
  23966. v[1] = A + I,
  23967. v[2] = y + C,
  23968. v[3] = A + I,
  23969. v[4] = y,
  23970. v[5] = A,
  23971. v[6] = y + C,
  23972. v[7] = A;
  23973. var E = N.getAttribute("position");
  23974. E.setDynamic(!0),
  23975. E.needsUpdate = !0;
  23976. var _ = E.array
  23977. , b = l / t.width - .5
  23978. , w = c / t.height - .5
  23979. , T = h / t.width
  23980. , x = u / t.height;
  23981. _[0] = b,
  23982. _[1] = w + x,
  23983. _[3] = b + T,
  23984. _[4] = w + x,
  23985. _[6] = b,
  23986. _[7] = w,
  23987. _[9] = b + T,
  23988. _[10] = w,
  23989. this.renderer.properties.get(e),
  23990. D.uniforms.tDiffuse.value = e,
  23991. D.blending = p || M.NoBlending,
  23992. D.transparent = !!f,
  23993. null != g || (g = 1),
  23994. D.uniforms.alpha.value = g,
  23995. D.needUpdate = !0,
  23996. t.activeCubeFace = d,
  23997. t.viewport.set(0, 0, t.width, t.height);
  23998. var S = this.renderer.autoClear;
  23999. this.renderer.autoClear = !1,
  24000. this.renderer.render(O, L, t, !1),
  24001. this.renderer.autoClear = S
  24002. }
  24003. ),
  24004. h.prototype.copyCubeMap = (g = !1,
  24005. C = A = y = v = m = null,
  24006. I = new M.Euler,
  24007. new M.Vector3,
  24008. function(e, t, i, n, r, o, a, s, l) {
  24009. this.renderer,
  24010. g || ((v = new M.OrthographicCamera(-1,1,1,-1,0,200)).position.set(0, 0, 0),
  24011. (m = new M.Scene).add(v),
  24012. y = new M.ShaderMaterial({
  24013. uniforms: {
  24014. tDiffuse: {
  24015. type: "t",
  24016. value: null
  24017. },
  24018. alpha: {
  24019. type: "f",
  24020. value: 1
  24021. }
  24022. },
  24023. vertexShader: R.copyCubeMap.vertexShader,
  24024. fragmentShader: R.copyCubeMap.fragmentShader,
  24025. depthWrite: !1,
  24026. depthTest: !1,
  24027. side: M.DoubleSide
  24028. }),
  24029. A = new M.BoxGeometry(2,2,2),
  24030. C = new M.Mesh(A,y),
  24031. m.add(C),
  24032. g = !0);
  24033. for (var c = 0; c < 6; c++)
  24034. h.getCubeOrientationForCubeFace(c, I),
  24035. C.rotation.copy(I),
  24036. C.matrixWorldNeedsUpdate = !0,
  24037. C.updateMatrixWorld(),
  24038. y.uniforms.tDiffuse.value = e,
  24039. y.blending = a || M.NoBlending,
  24040. y.transparent = !!s,
  24041. null != l || (l = 1),
  24042. y.uniforms.alpha.value = l,
  24043. y.needUpdate = !0,
  24044. t.activeCubeFace = c,
  24045. t.viewport.set(0, 0, r, o),
  24046. this.renderer.render(m, v, t, !1)
  24047. }
  24048. ),
  24049. h.getLookAtForCubeFace = function(e, t) {
  24050. switch (e) {
  24051. case s.GL_TEXTURE_CUBE_MAP_POSITIVE_X:
  24052. t.set(1, 0, 0);
  24053. break;
  24054. case s.GL_TEXTURE_CUBE_MAP_NEGATIVE_X:
  24055. t.set(-1, 0, 0);
  24056. break;
  24057. case s.GL_TEXTURE_CUBE_MAP_POSITIVE_Y:
  24058. t.set(0, 1, 0);
  24059. break;
  24060. case s.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y:
  24061. t.set(0, -1, 0);
  24062. break;
  24063. case s.GL_TEXTURE_CUBE_MAP_POSITIVE_Z:
  24064. t.set(0, 0, 1);
  24065. break;
  24066. case s.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z:
  24067. t.set(0, 0, -1)
  24068. }
  24069. }
  24070. ,
  24071. h.getCubeOrientationForCubeFace = function(e, t) {
  24072. switch (e) {
  24073. case s.GL_TEXTURE_CUBE_MAP_POSITIVE_X:
  24074. t.set(0, -Math.PI / 2, 0);
  24075. break;
  24076. case s.GL_TEXTURE_CUBE_MAP_NEGATIVE_X:
  24077. t.set(0, Math.PI / 2, 0);
  24078. break;
  24079. case s.GL_TEXTURE_CUBE_MAP_POSITIVE_Y:
  24080. t.set(Math.PI / 2, Math.PI, 0);
  24081. break;
  24082. case s.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y:
  24083. t.set(-Math.PI / 2, Math.PI, 0);
  24084. break;
  24085. case s.GL_TEXTURE_CUBE_MAP_POSITIVE_Z:
  24086. t.set(0, -Math.PI, 0);
  24087. break;
  24088. case s.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z:
  24089. t.set(0, 0, 0)
  24090. }
  24091. }
  24092. ,
  24093. t.exports = h
  24094. }
  24095. , {
  24096. "../enum/GLCubeFaces": 25,
  24097. "../enum/GLTextureType": 26,
  24098. "../enum/SceneRendererEvents": 43,
  24099. "../exception/BasicException": 55,
  24100. "../exception/RendererCreationException": 57,
  24101. "../settings": 166,
  24102. "../shaders": 167,
  24103. "../util/browser": 182,
  24104. events: 202,
  24105. three: 217
  24106. }],
  24107. 159: [function(e, t, i) {
  24108. "use strict";
  24109. function n(e) {
  24110. this.messenger = new a(e),
  24111. this.clientKey = null
  24112. }
  24113. var o = e("../util/ajax")
  24114. , r = e("./PostMessageType")
  24115. , a = e("./postmessage")
  24116. , s = e("./VersionInfo")
  24117. , l = e("events").EventEmitter
  24118. , c = window.location.origin + "/api/v1/user/";
  24119. (n.prototype = Object.create(l.prototype)).bindEvents = function() {
  24120. this.messenger.on(r.ACTION, this.onMessageReceived.bind(this))
  24121. }
  24122. ,
  24123. n.prototype.waitForConnection = function() {
  24124. return new Promise(function(t, i) {
  24125. this.messenger.on(r.CONNECT, function(e) {
  24126. this.onConnectionReceived(e).then(t.bind(this, e.sdkVersion), i.bind())
  24127. }
  24128. .bind(this))
  24129. }
  24130. .bind(this))
  24131. }
  24132. ,
  24133. n.prototype.onConnectionReceived = function(i) {
  24134. return this.messenger.setTarget(i.source, i.origin),
  24135. this.verifyConnection(i).then(function(e, t) {
  24136. this.messenger.send({
  24137. type: r.ACCEPT,
  24138. toId: i.fromId,
  24139. warning: t
  24140. }),
  24141. this.clientKey = e,
  24142. this.messenger.removeAllListeners(r.CONNECT),
  24143. this.bindEvents()
  24144. }
  24145. .bind(this), function(e) {
  24146. this.messenger.send({
  24147. type: r.REJECT,
  24148. toId: i.fromId,
  24149. reason: e
  24150. }),
  24151. this.messenger.setTarget()
  24152. }
  24153. .bind(this))
  24154. }
  24155. ,
  24156. n.prototype.verifyConnection = function(r) {
  24157. return new Promise(function(e, t) {
  24158. var i;
  24159. if (s.isDeprecated(r.sdkVersion))
  24160. i = "这个版本正在被弃用";
  24161. else if (!s.isSupported(r.sdkVersion))
  24162. return t("不支持此版本的SDK");
  24163. var n = {
  24164. cache: !1,
  24165. headers: {
  24166. "X-port-Application-Key": r.applicationKey,
  24167. "X-port-Referrer": r.origin
  24168. }
  24169. };
  24170. o.get(c, n).done(e.bind(this, r.applicationKey, i)).fail(t.bind(this, "key/referrer mismatch"))
  24171. }
  24172. )
  24173. }
  24174. ,
  24175. n.prototype.onMessageReceived = function(t) {
  24176. if (this.validateClientApplicationKey(t.applicationKey)) {
  24177. var i = this;
  24178. t.onDone = function(e) {
  24179. e.toId = t.fromId,
  24180. e.uid = t.uid,
  24181. e.type = r.RESPONSE,
  24182. i.messenger.send(e)
  24183. }
  24184. ,
  24185. this.emit(r.ACTION, t)
  24186. }
  24187. }
  24188. ,
  24189. n.prototype.validateClientApplicationKey = function(e) {
  24190. return this.clientKey === e
  24191. }
  24192. ,
  24193. n.prototype.sendEvent = function(e, t) {
  24194. this.messenger.send({
  24195. type: r.EVENT,
  24196. eventType: e,
  24197. eventData: t
  24198. })
  24199. }
  24200. ,
  24201. t.exports = n
  24202. }
  24203. , {
  24204. "../util/ajax": 181,
  24205. "./PostMessageType": 160,
  24206. "./VersionInfo": 163,
  24207. "./postmessage": 165,
  24208. events: 202
  24209. }],
  24210. 160: [function(e, t, i) {
  24211. "use strict";
  24212. t.exports = Object.freeze({
  24213. CONNECT: "postmessage.connect",
  24214. ACCEPT: "postmessage.accept",
  24215. REJECT: "postmessage.reject",
  24216. ACTION: "postmessage.action",
  24217. RESPONSE: "postmessage.response",
  24218. EVENT: "postmessage.event"
  24219. })
  24220. }
  24221. , {}],
  24222. 161: [function(e, t, i) {
  24223. "use strict";
  24224. t.exports = Object.freeze({
  24225. MOVE: "sdk.move",
  24226. ENTER_PANO: "sdk.enterpano",
  24227. MODEL_LOADED: "sdk.modelloaded"
  24228. })
  24229. }
  24230. , {}],
  24231. 162: [function(e, t, i) {
  24232. "use strict";
  24233. t.exports = Object.freeze({
  24234. FLY: "transition.fly",
  24235. FADEOUT: "transition.fade",
  24236. INSTANT: "transition.instant"
  24237. })
  24238. }
  24239. , {}],
  24240. 163: [function(e, t, i) {
  24241. "use strict";
  24242. t.exports = {
  24243. current: "1.0",
  24244. supported: ["1.0"],
  24245. deprecated: [],
  24246. isSupported: function(e) {
  24247. return -1 !== this.supported.indexOf(e)
  24248. },
  24249. isDeprecated: function(e) {
  24250. return -1 !== this.deprecated.indexOf(e)
  24251. },
  24252. isValid: function(e) {
  24253. return this.isSupported(e) || this.isDeprecated(e)
  24254. }
  24255. }
  24256. }
  24257. , {}],
  24258. 164: [function(q, X, e) {
  24259. (function(e) {
  24260. "use strict";
  24261. function r(e, t, i) {
  24262. e = e && e.toLowerCase().trim();
  24263. var n = new C.UP.clone
  24264. , r = Math.PI / 3
  24265. , o = Math.PI / 2;
  24266. switch (e) {
  24267. case "left":
  24268. i.copy(t),
  24269. i.applyAxisAngle(n, o);
  24270. break;
  24271. case "right":
  24272. i.copy(t),
  24273. i.applyAxisAngle(n, -o);
  24274. break;
  24275. case "forwardleft":
  24276. i.copy(t),
  24277. i.applyAxisAngle(n, r);
  24278. break;
  24279. case "forwardright":
  24280. i.copy(t),
  24281. i.applyAxisAngle(n, -r);
  24282. break;
  24283. case "forward":
  24284. default:
  24285. i.copy(t)
  24286. }
  24287. return i
  24288. }
  24289. function o(e, t) {
  24290. if (e) {
  24291. var i = {
  24292. pano: e,
  24293. lookAtPoint: null,
  24294. duration: null,
  24295. maxDistanceOverride: null,
  24296. skipWarpingCheck: !1
  24297. };
  24298. this.player.flyToPano(i, function() {
  24299. t && t({
  24300. success: !0,
  24301. message: "Transition complete."
  24302. })
  24303. })
  24304. } else
  24305. M.warn("Showcase -> clickPanoObject: Unable to find pano."),
  24306. t && t({
  24307. success: !1,
  24308. error: "Unable to find pano."
  24309. })
  24310. }
  24311. function a(e, t) {
  24312. t.copy(C.FORWARD),
  24313. e.getDirection(t)
  24314. }
  24315. function c(i) {
  24316. return {
  24317. panos: i.panos.list.map(function(e) {
  24318. var t = y.getCubemapUrls(i.urls, e.id, "high")[A.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z];
  24319. return {
  24320. uuid: e.id,
  24321. aligned: e.alignmentType === g.ALIGNED,
  24322. neighbourUUIDs: e.neighbourUUIDs.slice(),
  24323. position: function(e) {
  24324. return e.alignmentType !== g.ALIGNED ? null : {
  24325. x: e.position.x,
  24326. y: e.position.y,
  24327. z: e.position.z
  24328. }
  24329. }(e),
  24330. rotation: function(e) {
  24331. var t = (new h.Euler).setFromQuaternion(e.quaternion, "YXZ");
  24332. return {
  24333. x: h.Math.radToDeg(t._x),
  24334. y: h.Math.radToDeg(t._y),
  24335. z: h.Math.radToDeg(t._z)
  24336. }
  24337. }(e),
  24338. thumbnail: t
  24339. }
  24340. })
  24341. }
  24342. }
  24343. 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"),
  24344. q("../enum/PlayerEvents")), b = q("../sdk/SdkEvents"), w = (C = q("../enum/Vectors"),
  24345. q("../enum/ControlEvents")), T = q("../enum/RenderLayers"), x = (q("../constants"),
  24346. q("../settings")), S = q("../lib/jpeg_encoder"), M = new n(e), R = (N.active = !1,
  24347. N.angle = 0,
  24348. N.angleTravelled = 0,
  24349. N.playerDirection = new h.Vector3,
  24350. N.lastFacingDirection = new h.Vector3,
  24351. N.onDone = null,
  24352. N.player = null,
  24353. N.start = function(e, t, i, n) {
  24354. N.active = !0,
  24355. e && t && (t = 0),
  24356. N.angle = e || t,
  24357. N.xAngle = e,
  24358. N.yAngle = t,
  24359. N.angleTravelled = 0,
  24360. N.playerDirection.copy(i.mode === I.FLOORPLAN ? C.UP : C.FORWARD),
  24361. i.getDirection(N.playerDirection),
  24362. N.lastFacingDirection.copy(N.playerDirection),
  24363. N.projectVectors(),
  24364. N.onDone = n,
  24365. N.player = i,
  24366. N()
  24367. }
  24368. ,
  24369. N.projectVectors = function() {
  24370. N.xAngle && (N.playerDirection.projectOnPlane(C.UP),
  24371. N.lastFacingDirection.projectOnPlane(C.UP))
  24372. }
  24373. ,
  24374. N), P = (i = new h.Vector3,
  24375. function(e) {
  24376. e ? (i.copy(e.position),
  24377. i.add(e.discPosition),
  24378. s.projectPositionToCanvas(i, this.player.camera, i),
  24379. this.click(i.x, i.y)) : M.warn("Showcase -> clicktagObject: Unable to find tag.")
  24380. }
  24381. ), O = (l = new h.Vector3,
  24382. function(e) {
  24383. var t = this.player.getDirection();
  24384. l.copy(t);
  24385. var i = l.y;
  24386. l.y = 0,
  24387. l.normalize();
  24388. var n = h.Math.radToDeg(l.angleTo(t)) * (i < 0 ? -1 : 1);
  24389. if (this.player.mode !== I.DOLLHOUSE && this.player.mode !== I.PANORAMA)
  24390. return 0 !== e && M.warn("Cannot rotate in y direction when in " + this.player.mode + " mode"),
  24391. 0;
  24392. this.player.mode === I.DOLLHOUSE && (n = -n);
  24393. var r = function() {
  24394. return this.player.mode === I.PANORAMA ? x.insideLookLimitUp : this.player.mode === I.DOLLHOUSE ? 90 - h.Math.radToDeg(x.dollhouseDefault.minPolarAngle) : null
  24395. }
  24396. .call(this) - .1
  24397. , o = function() {
  24398. return this.player.mode === I.PANORAMA ? x.insideLookLimitDown : this.player.mode === I.DOLLHOUSE ? 90 - h.Math.radToDeg(x.dollhouseDefault.maxPolarAngle) : null
  24399. }
  24400. .call(this) + .1
  24401. , a = n + e;
  24402. r < a ? a = r : a < o && (a = o);
  24403. var s = a - n;
  24404. return 0 < e && s < .01 && (s = 0),
  24405. e < 0 && -.01 < s && (s = 0),
  24406. s
  24407. }
  24408. ), L = (t = new h.Euler,
  24409. function(e) {
  24410. return t.setFromQuaternion(e.quaternion, "YXZ"),
  24411. {
  24412. position: {
  24413. x: e.position.x,
  24414. y: e.position.y,
  24415. z: e.position.z
  24416. },
  24417. rotation: {
  24418. x: h.Math.radToDeg(t.x),
  24419. y: h.Math.radToDeg(t.y),
  24420. z: 0
  24421. },
  24422. pano: e.currentPano ? e.currentPano.id : null,
  24423. mode: e.mode
  24424. }
  24425. }
  24426. ), D = null;
  24427. function N() {
  24428. N.playerDirection.copy(N.player.mode === I.FLOORPLAN ? C.UP : C.FORWARD),
  24429. N.player.getDirection(N.playerDirection),
  24430. N.projectVectors();
  24431. var e = N.playerDirection.angleTo(N.lastFacingDirection);
  24432. (N.angleTravelled += Math.abs(e)) >= Math.abs(N.angle) ? (N.active = !1,
  24433. N.onDone && (0,
  24434. N.onDone)()) : (N.lastFacingDirection.copy(N.playerDirection),
  24435. window.setTimeout(N, 4))
  24436. }
  24437. X.exports = {
  24438. init: function(e, t, i, n, r) {
  24439. Y.init(e, t, i, r),
  24440. D = new Promise(function(e, t) {
  24441. i.on(_.Ready, function() {
  24442. e()
  24443. })
  24444. }
  24445. .bind(this));
  24446. var o = new u(window)
  24447. , a = o.waitForConnection();
  24448. a.then(function(e) {
  24449. o.on(f.ACTION, Y.onMessageReceive.bind(Y))
  24450. });
  24451. var s, l = (s = Date.now(),
  24452. function() {
  24453. if (!(Date.now() - s < 100)) {
  24454. var e = L(i);
  24455. o.sendEvent(b.MOVE, {
  24456. state: e
  24457. }),
  24458. s = Date.now()
  24459. }
  24460. }
  24461. );
  24462. i.on(_.Move, l),
  24463. i.on(_.ViewChanged, l),
  24464. n.on(p.ActiveModelChanged, function(e) {
  24465. function t(e) {
  24466. var t, i = e.newPano.id;
  24467. e.oldPano && (t = e.oldPano.id),
  24468. i !== t && o.sendEvent(b.ENTER_PANO, {
  24469. oldPano: t,
  24470. newPano: i
  24471. })
  24472. }
  24473. var i = e.model
  24474. , n = e.oldModel;
  24475. Y.model = i,
  24476. a.then(function() {
  24477. o.sendEvent(b.MODEL_LOADED, {
  24478. metadata: c(i)
  24479. })
  24480. }),
  24481. n && n.panos.forEach(function(e) {
  24482. e.removeEventListener("enter", t)
  24483. }),
  24484. i.panos.forEach(function(e) {
  24485. e.on("enter", t)
  24486. })
  24487. })
  24488. }
  24489. };
  24490. var F, B, V, k, U, H, z, G, W, j, Y = {
  24491. director: null,
  24492. player: null,
  24493. controls: null,
  24494. sceneRenderer: null,
  24495. model: null,
  24496. init: function(e, t, i, n) {
  24497. this.director = e,
  24498. this.player = i,
  24499. this.controls = t,
  24500. this.sceneRenderer = n
  24501. },
  24502. handleToObject: {},
  24503. objectToHandle: {},
  24504. handleCount: 0,
  24505. onMessageReceive: function(e) {
  24506. if (e) {
  24507. var t = e.targetFunction
  24508. , i = e.params
  24509. , n = e.onDone;
  24510. t && this[t] && this[t](i, n)
  24511. }
  24512. },
  24513. waitForInit: function(e, t) {
  24514. D.then(t.bind({
  24515. success: !0,
  24516. message: "Init complete."
  24517. }))
  24518. },
  24519. moveToPano: (W = new h.Euler(0,0,0,"YXZ"),
  24520. j = new h.Quaternion,
  24521. function(e, t) {
  24522. var i = e.pano
  24523. , n = e.rotation
  24524. , r = e.transition;
  24525. if (!this.model)
  24526. return t({
  24527. success: !1,
  24528. error: "The model has not been loaded yet"
  24529. });
  24530. var o = this.model.panos.get(i);
  24531. if (!o)
  24532. return t({
  24533. success: !1,
  24534. error: i + " does not exist in this model"
  24535. });
  24536. if (!n)
  24537. return t({
  24538. sucess: !1,
  24539. erorr: n + " is not a valid rotation"
  24540. });
  24541. W.set(h.Math.degToRad(n.x || 0), h.Math.degToRad(n.y || 0), h.Math.degToRad(n.z || 0), "YXZ"),
  24542. console.log(n.z);
  24543. var a = {
  24544. success: !0,
  24545. message: i
  24546. };
  24547. if (r === v.FADEOUT)
  24548. j.setFromEuler(W),
  24549. this.player.warpToPano(o, j, null, null, E.BLACK, null, null, t.bind(this, a));
  24550. else {
  24551. var s, l;
  24552. r === v.INSTANT && (l = s = 0);
  24553. var c = C.FORWARD.clone().applyEuler(W).add(o.position);
  24554. this.player.flyToPano({
  24555. pano: o,
  24556. lookAtPoint: c,
  24557. duration: s,
  24558. aimDuration: l
  24559. }, t.bind(this, a))
  24560. }
  24561. }
  24562. ),
  24563. moveInDirection: function(e, t) {
  24564. var i = e.direction;
  24565. return void 0 === m[i] ? (M.warn("Showcase -> moveInDirection: Cannot move in invalid direction."),
  24566. void (t && t({
  24567. success: !1,
  24568. error: "Invalid direction."
  24569. }))) : void this.player.flyLocalDirection(C[i].clone()).then(function(e) {
  24570. t(e ? {
  24571. success: !0,
  24572. message: "moved " + i
  24573. } : {
  24574. success: !1,
  24575. error: "Cannot move in direction: " + i
  24576. })
  24577. })
  24578. },
  24579. getPose: function(e, t) {
  24580. return this.player.camera.position,
  24581. (new h.Euler).setFromQuaternion(this.player.camera.quaternion, "YXZ"),
  24582. t({
  24583. success: !0,
  24584. message: L(this.player)
  24585. })
  24586. },
  24587. takeScreenShot: (z = new h.PerspectiveCamera,
  24588. G = new h.WebGLRenderTarget,
  24589. function(e, t) {
  24590. if (!e.resolution)
  24591. return t({
  24592. success: !1,
  24593. error: "An invalid resolution was specified"
  24594. });
  24595. if (-1 === e.resolution.width || -1 === e.resolution.height) {
  24596. var i = this.sceneRenderer.renderer.getSize();
  24597. e.resolution.width = i.width,
  24598. e.resolution.height = i.height
  24599. }
  24600. z.layers.set(T.DEFAULT),
  24601. e.visibleObjects && (e.visibleObjects.showtags && z.layers.enable(T.TAG),
  24602. e.visibleObjects.showPucks && z.layers.enable(T.PANOMARKERS),
  24603. e.visibleObjects.showReticule && z.layers.enable(T.RETICULE));
  24604. var n = e.resolution.width
  24605. , r = e.resolution.height
  24606. , o = n / r;
  24607. z.position.copy(this.sceneRenderer.camera.position),
  24608. z.quaternion.copy(this.sceneRenderer.camera.quaternion),
  24609. z.projectionMatrix.copy(this.player.camera.projectionMatrix),
  24610. z.projectionMatrix.elements[0] = this.player.camera.projectionMatrix.elements[5] / o,
  24611. G.setSize(n, r),
  24612. this.sceneRenderer.renderer.render(this.sceneRenderer.scene, z, G);
  24613. var a = new Uint8Array(n * r * 4);
  24614. this.sceneRenderer.renderer.readRenderTargetPixels(G, 0, 0, n, r, a);
  24615. var s = S.encode({
  24616. data: a,
  24617. width: n,
  24618. height: r,
  24619. heading: 180,
  24620. pitch: 0
  24621. }, {
  24622. quality: 75,
  24623. flipY: !0
  24624. });
  24625. t({
  24626. success: !0,
  24627. message: "data:image/jpg;base64," + d.uint8ToBase64(s.data)
  24628. })
  24629. }
  24630. ),
  24631. findRankedPano: (U = new h.Vector3,
  24632. H = new h.Vector3,
  24633. function(e, t) {
  24634. a(this.player, H),
  24635. r(t, H, U);
  24636. var i = this.player.rankedPanoInDirection(e, U);
  24637. if (i) {
  24638. var n = this.objectToHandle[i.id];
  24639. return n || (this.objectToHandle[i.id] = n = this.handleCount++,
  24640. this.handleToObject[n] = i),
  24641. n
  24642. }
  24643. return M.warn("Showcase -> findRankedPano: Unable to find nearby pano."),
  24644. -1
  24645. }
  24646. ),
  24647. findRankedtag: (V = new h.Vector3,
  24648. k = new h.Vector3,
  24649. function(e, t) {
  24650. a(this.player, k),
  24651. r(t, k, V);
  24652. var i = this.player.rankedtagInDirection(e, V);
  24653. if (i) {
  24654. var n = this.objectToHandle[i.sid];
  24655. return n || (this.objectToHandle[i.sid] = n = this.handleCount++,
  24656. this.handleToObject[n] = i),
  24657. n
  24658. }
  24659. return M.warn("Showcase -> findRankedtag: Unable to find nearby tag."),
  24660. -1
  24661. }
  24662. ),
  24663. clickNearesttag: function(e) {
  24664. this.clickRankedtag(0, e)
  24665. },
  24666. clickRankedtag: function(e, t) {
  24667. var i = function(e, t) {
  24668. var i = this.findRankedtag(e, t);
  24669. return 0 <= i ? this.handleToObject[i] : (M.warn("Showcase -> findRankedtagObject: Unable to find nearby tag."),
  24670. null)
  24671. }
  24672. .call(this, e, t);
  24673. i && P.call(this, i)
  24674. },
  24675. clickNearestPano: function(e, t) {
  24676. this.clickRankedPano(0, e, t)
  24677. },
  24678. clickRankedPano: function(e, t, i) {
  24679. var n = function(e, t) {
  24680. var i = this.findRankedPano(e, t);
  24681. return 0 <= i ? this.handleToObject[i] : (M.warn("Showcase -> findRankedPanoObject: Unable to find nearby pano."),
  24682. null)
  24683. }
  24684. .call(this, e, t);
  24685. n ? o.call(this, n, i) : i(null)
  24686. },
  24687. clickPano: function(e, t) {
  24688. var i = this.handleTable[e];
  24689. i ? o.call(this, i, t) : t(null)
  24690. },
  24691. rotateDirection: function(e, t) {
  24692. var i = e.direction
  24693. , n = e.angle;
  24694. if (!R.active) {
  24695. var r = 0
  24696. , o = 0
  24697. , a = 0
  24698. , s = 0;
  24699. if (!n || isNaN(n))
  24700. return M.warn("Showcase -> rotateDirection: Invalid rotation angle."),
  24701. void (t && t({
  24702. success: !1,
  24703. error: "Invalid rotation angle."
  24704. }));
  24705. if (this.player.mode === I.TRANSITIONING)
  24706. return M.warn("Automation -> rotateDirection: Cannot rotate while transitioning"),
  24707. void (t && t({
  24708. success: !1,
  24709. error: "Cannot rotate while transitioning"
  24710. }));
  24711. if (i === m.RIGHT || i === m.LEFT)
  24712. i === m.RIGHT && (n = -n),
  24713. r = 0 < n ? -1 : 1,
  24714. a = n;
  24715. else {
  24716. if (i !== m.UP && i !== m.DOWN)
  24717. return M.warn("Showcase -> rotateDirection: Invalid direction for rotation: " + i),
  24718. void (t && t({
  24719. success: !1,
  24720. error: "Invalid direction for rotation."
  24721. }));
  24722. if (this.player.mode === I.FLOORPLAN)
  24723. return M.warn("Showcase -> rotateDirection: Cannot rotate " + i + " in floorplan mode"),
  24724. void (t && t({
  24725. success: !1,
  24726. error: "Cannot rotate " + i + " in floorplan mode"
  24727. }));
  24728. if (i === m.DOWN && (n = -n),
  24729. 0 === (n = O.call(this, n)))
  24730. return M.warn("Showcase -> rotateDirection: Already at maximum rotation in direction: " + i),
  24731. void (t && t({
  24732. success: !1,
  24733. error: "Already at maximum rotation in direction: " + i
  24734. }));
  24735. o = 0 < n ? 1 : -1,
  24736. s = n
  24737. }
  24738. var l = n;
  24739. n = h.Math.degToRad(n),
  24740. a = h.Math.degToRad(a),
  24741. s = h.Math.degToRad(s);
  24742. var c = this.controls.activeControl;
  24743. c.startRotating(r, o),
  24744. R.start(a, s, this.player, function() {
  24745. c.stopRotating(!0),
  24746. t && t({
  24747. success: !0,
  24748. message: "Rotated " + l.toFixed(2) + "° in direction: " + e.direction
  24749. })
  24750. })
  24751. }
  24752. },
  24753. rotate: (F = new h.Vector3,
  24754. B = new h.Vector3,
  24755. function(e, t) {
  24756. var i = e.xAngle
  24757. , n = e.yAngle;
  24758. if (!R.active) {
  24759. if (i = i || 0,
  24760. n = n || 0,
  24761. isNaN(i) || isNaN(n))
  24762. return M.warn("Showcase -> rotate: Invalid rotation angle."),
  24763. void (t && t({
  24764. success: !1,
  24765. error: "Invalid rotation angle."
  24766. }));
  24767. if (this.player.mode === I.TRANSITIONING)
  24768. return M.warn("Automation -> rotate: Cannot rotate while transitioning"),
  24769. void (t && t({
  24770. success: !1,
  24771. error: "Cannot rotate while transitioning"
  24772. }));
  24773. Math.abs(i) < .01 && (i = 0),
  24774. Math.abs(n) < .01 && (n = 0);
  24775. var r = n;
  24776. n = O.call(this, n);
  24777. var o = 0 < r ? "UP" : "DOWN";
  24778. if (!(i = -i) && r && !n)
  24779. return M.warn("Showcase -> rotate: Already at maximum rotation in direction: " + o),
  24780. void (t && t({
  24781. success: !1,
  24782. error: "Already at maximum rotation in direction: " + o
  24783. }));
  24784. n < r && M.warn("Showcase -> rotate: Reached maximum rotation in direction: " + o);
  24785. var a = n;
  24786. n = h.Math.degToRad(n),
  24787. i = h.Math.degToRad(i),
  24788. F.copy(this.player.mode === I.FLOORPLAN ? C.UP : C.FORWARD),
  24789. this.player.getDirection(F),
  24790. B.copy(F).applyAxisAngle(C.UP, i),
  24791. B.applyAxisAngle(C.RIGHT, n);
  24792. var s = (F.angleTo(B),
  24793. 0 < i ? -1 : i < 0 ? 1 : 0)
  24794. , l = 0 < n ? 1 : n < 0 ? -1 : 0;
  24795. Math.abs(i) > Math.abs(n) ? l *= Math.abs(n / i) : Math.abs(n) > Math.abs(i) && (s *= Math.abs(i / n));
  24796. var c = this.controls.activeControl;
  24797. c.startRotating(s, l),
  24798. R.start(i, n, this.player, function() {
  24799. c.stopRotating(!0),
  24800. t && t({
  24801. success: !0,
  24802. message: "Rotated " + e.xAngle.toFixed(2) + "° horizontally, " + a.toFixed(2) + "° vertically"
  24803. })
  24804. })
  24805. }
  24806. }
  24807. ),
  24808. panCamera: function(e, i) {
  24809. function t(e) {
  24810. switch (r.removeAllListeners(w.AutoPanComplete),
  24811. r.removeAllListeners(w.AutoPanInterrupt),
  24812. r.removeAllListeners(w.AutoPanClamped),
  24813. e) {
  24814. case w.AutoPanInterrupt:
  24815. i({
  24816. success: !0,
  24817. message: "Camera panning interrupted."
  24818. });
  24819. break;
  24820. case w.AutoPanClamped:
  24821. if (r.autoPanPosition.x !== n.x || r.autoPanPosition.z !== n.z) {
  24822. if (Math.abs(this.player.position.x - r.autoPanPosition.x) < .01 && Math.abs(this.player.position.z - r.autoPanPosition.z) < .01)
  24823. return void i({
  24824. success: !1,
  24825. error: "Already at edge of current model bounds."
  24826. });
  24827. var t = "The view point is outside the bounds for the current model. ";
  24828. t += "The view point was clamped to " + o(r.target.x, r.target.z),
  24829. console.warn(t)
  24830. }
  24831. case w.AutoPanComplete:
  24832. i({
  24833. success: !0,
  24834. message: "Panned camera to position " + o(r.autoPanPosition.x, r.autoPanPosition.z)
  24835. })
  24836. }
  24837. }
  24838. if (this.player.mode !== I.DOLLHOUSE && this.player.mode !== I.FLOORPLAN)
  24839. return i({
  24840. success: !1,
  24841. error: "Camera panning is not available in the current mode: " + this.player.mode
  24842. });
  24843. var n = e.position
  24844. , r = this.player.control;
  24845. r.setAutoPanPosition(n.x, n.z),
  24846. r.autoPan = !0;
  24847. var o = function(e, t) {
  24848. return "(" + e.toFixed(2) + ", " + t.toFixed(2) + ")"
  24849. };
  24850. r.on(w.AutoPanComplete, t.bind(this, w.AutoPanComplete)),
  24851. r.on(w.AutoPanInterrupt, t.bind(this, w.AutoPanInterrupt)),
  24852. r.on(w.AutoPanClamped, t.bind(this, w.AutoPanClamped))
  24853. },
  24854. click: function(e, t) {
  24855. var i = e.x
  24856. , n = e.y;
  24857. !0 === e.percentage && (i = i / 100 * $("#player").width(),
  24858. n = n / 100 * $("#player").height()),
  24859. this.player.handleInputStart(i, n),
  24860. this.player.updateIntersect(),
  24861. this.player.handleInputEnd(i, n)
  24862. },
  24863. mouseOver: function(e, t) {
  24864. var i = e.x
  24865. , n = e.y;
  24866. !0 === e.percentage && (i = i / 100 * $("#player").width(),
  24867. n = n / 100 * $("#player").height()),
  24868. this.player.handleInputMove(i, n),
  24869. this.player.updateIntersect()
  24870. },
  24871. moveToMode: function(e, t) {
  24872. function i(e) {
  24873. t(e ? {
  24874. success: !1,
  24875. error: "Failed to load new mode: " + e
  24876. } : {
  24877. success: !0,
  24878. message: "Moved to new mode: " + n
  24879. })
  24880. }
  24881. var n = e.mode;
  24882. n === I.PANORAMA || n === I.DOLLHOUSE || n === I.FLOORPLAN ? this.director.changeMode(n).then(function() {
  24883. i()
  24884. }, function(e) {
  24885. i(e)
  24886. }) : t({
  24887. success: !1,
  24888. error: "Invalid mode selection"
  24889. })
  24890. }
  24891. }
  24892. }
  24893. ).call(this, "/js/sdk/automation.js")
  24894. }
  24895. , {
  24896. "../constants": 8,
  24897. "../enum/AlignmentType": 17,
  24898. "../enum/ControlEvents": 21,
  24899. "../enum/Direction": 22,
  24900. "../enum/GLCubeFaces": 25,
  24901. "../enum/Keys": 30,
  24902. "../enum/ModelManagerEvents": 33,
  24903. "../enum/PlayerEvents": 40,
  24904. "../enum/RenderLayers": 41,
  24905. "../enum/Vectors": 50,
  24906. "../enum/Viewmode": 51,
  24907. "../enum/WarpStyle": 52,
  24908. "../lib/jpeg_encoder": 94,
  24909. "../sdk/SdkEvents": 161,
  24910. "../settings": 166,
  24911. "../util/common": 185,
  24912. "../util/logger": 189,
  24913. "../util/math": 190,
  24914. "../util/panorama": 191,
  24915. "./ApiHost": 159,
  24916. "./PostMessageType": 160,
  24917. "./TransitionStyles": 162,
  24918. three: 217
  24919. }],
  24920. 165: [function(e, t, i) {
  24921. "use strict";
  24922. function n(e) {
  24923. this.sourceWindow = e,
  24924. this.targetWindow = null,
  24925. this.targetOrigin = null,
  24926. this.id = Math.floor(1e5 * Math.random()),
  24927. this.bindEvents()
  24928. }
  24929. var r = e("./PostMessageType")
  24930. , o = e("events").EventEmitter;
  24931. (n.prototype = Object.create(o.prototype)).bindEvents = function() {
  24932. this.sourceWindow.addEventListener("message", this.onPostmessageReceived.bind(this))
  24933. }
  24934. ,
  24935. n.prototype.setTarget = function(e, t) {
  24936. this.targetWindow = e,
  24937. this.targetOrigin = t
  24938. }
  24939. ,
  24940. n.prototype.onPostmessageReceived = function(e) {
  24941. var t = e.origin || e.originalEvent.origin
  24942. , i = e.source;
  24943. switch (e.data.type) {
  24944. case r.CONNECT:
  24945. break;
  24946. case r.RESPONSE:
  24947. if (this.id !== e.data.toId)
  24948. return;
  24949. default:
  24950. if (!this.validateMessageOrigin(t))
  24951. return
  24952. }
  24953. var n = e.data;
  24954. n.source = i,
  24955. n.origin = t,
  24956. n.timestamp = Date.now(),
  24957. this.emit(e.data.type, n)
  24958. }
  24959. ,
  24960. n.prototype.validateMessageOrigin = function(e) {
  24961. return "*" === this.targetOrigin || e === this.targetOrigin
  24962. }
  24963. ,
  24964. n.prototype.send = function(e) {
  24965. this.targetWindow && this.targetOrigin && (e.fromId = this.id,
  24966. this.targetWindow.postMessage(e, this.targetOrigin))
  24967. }
  24968. ,
  24969. t.exports = n
  24970. }
  24971. , {
  24972. "./PostMessageType": 160,
  24973. events: 202
  24974. }],
  24975. 166: [function(e, t, i) {
  24976. "use strict";
  24977. var n = e("three")
  24978. , r = e("./util/browser")
  24979. , o = e("./enum/Viewmode")
  24980. , a = e("./enum/VROption")
  24981. , s = e("./enum/Colors")
  24982. , l = e("./enum/WarpStyle")
  24983. , c = e("./util/easing")
  24984. , h = e("./util/common")
  24985. , u = e("./util/showcase")
  24986. , d = e("./constants")
  24987. , p = {
  24988. debug: !1,
  24989. version: "2.25.6-0-gd87e5b1",
  24990. languageTag: r.valueFromHash("lang", null),
  24991. pageTitle: "四维虚拟漫游",
  24992. authorizationHeader: u.getAuthorizationHeader(),
  24993. autoplay: r.valueFromHash("play", !1) || !r.inIframe(),
  24994. logLevel: r.valueFromHash("log", 2),
  24995. skyboxRadius: 2500,
  24996. modelBoundsPadding: 5,
  24997. showNeighbors: !1,
  24998. brand: r.valueFromHash("brand", !0),
  24999. showHighlights: r.valueFromHash("hhl", !0) && r.valueFromHash("hr", 1),
  25000. startHighlights: r.valueFromHash("hl", -1),
  25001. specialEdition: r.valueFromHash("bn", 0),
  25002. useWheel: r.valueFromHash("wh", !0),
  25003. crossOrigin: "anonymous",
  25004. fancierTransition: !1,
  25005. wireframe: !1,
  25006. skyboxWireframe: !1,
  25007. modelAlpha: 1,
  25008. highlightPanoSelection: !1,
  25009. showSweeps: !0,
  25010. showSkyboxes: !1,
  25011. showMesh: !0,
  25012. showFloors: !1,
  25013. showFloorDuration: 300,
  25014. showFloorDelay: 300,
  25015. hideFloorDuration: 300,
  25016. hideFloorDelay: 0,
  25017. reticuleOpacityTransitionTime: 250,
  25018. reticuleColor: window.DATA.mouseMarkerColor || s.newBlue,
  25019. markerOpacityTransitionTime: 500,
  25020. guiAnimationSpeed: 250,
  25021. highlightAnimationDuration: 500,
  25022. modelComponentLoadSpinnerDelay: 150,
  25023. captureErrors: !1,
  25024. maxMobileTextures: 6,
  25025. minimalMemoryMode: r.valueFromHash("m3", r.isMobile()),
  25026. startupFlyinDelay: 3e3,
  25027. dollhouseDefault: {
  25028. minDistance: 1,//15, //编辑页面给近一些
  25029. maxDistance: 50,
  25030. minPolarAngle: n.Math.degToRad(10),
  25031. maxPolarAngle: n.Math.degToRad(90)
  25032. },
  25033. hideReticuleTimeout: 1e3,
  25034. analytics: {
  25035. inactivityThreshold: 30,
  25036. sessionTrackingRate: .15,
  25037. maxTrackedErrors: 20,
  25038. sessionDurationPingFrequency: 10,
  25039. sessionDurationTimeout: 15
  25040. },
  25041. flydown: {
  25042. movementEasing: "easeInOutQuad",
  25043. movementDelay: .001,
  25044. rotationEasing: "easeInOutQuad",
  25045. rotationDelay: .5,
  25046. modelTextureDelay: .75,
  25047. skyboxDelay: .75
  25048. },
  25049. transition: {
  25050. flySpeed: .001,
  25051. flyTime: 750,
  25052. flytimeMaxDistanceThreshold: 5,
  25053. flytimeDistanceMultiplier: 150,
  25054. aimTime: 1500,
  25055. aimSlowFactor: 1.5,
  25056. blur: .8,
  25057. movementEasing: "easeInOutQuad",
  25058. blendEasing: "easeInOutQuad",
  25059. fastForwardFactor: 3
  25060. },
  25061. show360Views: {
  25062. enabled: !0,
  25063. transitionTime: 1e3
  25064. },
  25065. quickstart: {
  25066. enabled: 1 === r.valueFromHash("qust", 0) || 1 === r.valueFromHash("qs", 0),
  25067. animation: 1400,
  25068. showTextDelay: 500,
  25069. fadeOutDelay: 3e3,
  25070. fovChange: 10
  25071. },
  25072. appConfig: {
  25073. webvr_version: null,
  25074. segment_key: null,
  25075. embedly_key: null,
  25076. branch_key: null,
  25077. keen_write_key: null,
  25078. keen_project_id: null
  25079. },
  25080. vr: {
  25081. enabled: !0,
  25082. allowWebVR: !1,
  25083. option: r.valueFromHash("vr", a.CONTEXTUAL)
  25084. },
  25085. share: {
  25086. enabled: !r.valueFromHash("mls", 0) && r.valueFromHash("brand", !0)
  25087. },
  25088. input: {
  25089. longTapThreshold: 200,
  25090. moveToleranceNDC: .08,
  25091. touchMoveThreshold: 25
  25092. },
  25093. help: {
  25094. modalStayDuration: 600
  25095. },
  25096. immersive: {
  25097. timeToShowAgain: 1250,
  25098. uiStayDuration: 600
  25099. },
  25100. tourInteraction: {
  25101. disabled: "0" === r.valueFromHash("tourcta", null),
  25102. showPauseButton: 1e3,
  25103. showModal: 1500,
  25104. allowNextClick: 200,
  25105. largeModal: "1" === r.valueFromHash("tourcta", null),
  25106. smallModal: "2" === r.valueFromHash("tourcta", null)
  25107. },
  25108. labels: {
  25109. enabled: !1,
  25110. hideUntilStart: !0,
  25111. fadeInDuration: 250,
  25112. fadeInDelay: 250,
  25113. fadeOutDuration: 250,
  25114. fadeOutDelay: 0,
  25115. zoomHideThreshhold: {
  25116. mobile: r.isSmallScreen() ? .45 : .6,
  25117. desktop: 2
  25118. },
  25119. zoomTruncateThreshhold: {
  25120. mobile: r.isSmallScreen() ? .35 : .45,
  25121. desktop: .85
  25122. },
  25123. minLengthForTruncate: 16,
  25124. truncateLength: 12,
  25125. truncateSuffix: "..."
  25126. },
  25127. tags: {
  25128. enabled: r.valueFromHash("mt", 1),
  25129. startup: {
  25130. hideUntilStart: !0,
  25131. fadeInDuration: 500,
  25132. fadeInDelay: 100
  25133. },
  25134. visibility: {
  25135. anyDistance: !0,
  25136. visibleDistance: 8,
  25137. cameraClearance: .1,
  25138. alphaTestLevel: .05,
  25139. hideViaFloor: !0,
  25140. hideOffScreenDisc: !1,
  25141. hideOffScreenObject: !1
  25142. },
  25143. disc: {
  25144. opacity: 1,
  25145. disabledOpacity: .5,
  25146. scale: {
  25147. nearBound: 1.5,
  25148. farBound: 4.8,
  25149. linkFarBound: !1,
  25150. linkPercent: 40,
  25151. maxSize: 80,
  25152. minSize: 40,
  25153. baseViewportSize: 800,
  25154. responsiveness: 100
  25155. }
  25156. },
  25157. pole: {
  25158. enabled: !0,
  25159. height: .5,
  25160. width: 2,
  25161. opacity: .5,
  25162. color: "white"
  25163. },
  25164. navigate: {
  25165. nearestPano: !0,
  25166. lineOfSight: !0,
  25167. reactivate: !0,
  25168. aimAt: "disc",
  25169. tiltTolerance: 25,
  25170. rotateSpeedFactor: .6
  25171. }
  25172. },
  25173. path: {
  25174. color: window.DATA.floorMarkerColor || s.newBlue,
  25175. colorUp: s._desat(s.newBlue, .5),
  25176. colorDown: s._darken(s.newBlue, .35),
  25177. opacity: .5,
  25178. style: "ribbon",
  25179. height: .025,
  25180. ribbonWidth: .24,
  25181. outsideHeight: .5,
  25182. waypointRadius: .5,
  25183. waypointIndoorRadius: .24,
  25184. waypointPulse: 1e3,
  25185. typ: l.BLACK,
  25186. meshFree: r.valueFromHash("mf", 1),
  25187. mapGuides: r.valueFromHash("guides", !0),
  25188. fadeInTime: 400,
  25189. fadeOutTime: 300
  25190. },
  25191. warp: {
  25192. nearPanoDist: .1,
  25193. matchCam: !1,
  25194. blur: .33,
  25195. fastTime: 1500,
  25196. teleportTime: 1500,
  25197. outsideTime: 2e3,
  25198. lookAheadMax: .3,
  25199. lookAheadDist: 2.5,
  25200. softPushDist: .37,
  25201. softPushEnd: .3,
  25202. softBendAngle: 8,
  25203. softBendTilt: 4,
  25204. softBendEnd: .3,
  25205. doBurns: !0,
  25206. burnsAngle: 8,
  25207. minBurnsAngle: 35,
  25208. minDownAngle: -35,
  25209. maxTurnPerSec: 280,
  25210. maxAimPerSec: 35,
  25211. minRotation: 12,
  25212. maxAimRotation: 33.2,
  25213. turnFriction: .2,
  25214. flySpeed: .01,
  25215. minWarpTime: 1200,
  25216. warpInterruptionRedirectTime: 500,
  25217. tourStepDelay: r.valueFromHash("st", 0),
  25218. walkDelay: 0,
  25219. walkMaxDist: 50,
  25220. walkMinDist: .8,
  25221. walkSlideShowThreshhold: 3e3,
  25222. walkExtraPanosDistance: .4,
  25223. timePerMeter: 1200,
  25224. motionLeadTime: 5e3,
  25225. movementEasing: "easeInOutQuad",
  25226. blendEasing: "easeInOutQuad",
  25227. showBunny: !1,
  25228. loop: r.valueFromHash("lp", !1),
  25229. auto: r.valueFromHash("ts", -1),
  25230. eOrder: "YXZ",
  25231. stepFactor: .25,
  25232. brakeStrength: 2,
  25233. minBrakeAngle: .1,
  25234. maxBrakeAngle: 1.8,
  25235. climbEffort: 4
  25236. },
  25237. rotationFriction: .05,
  25238. rotationAccelerationInside: 4.5,
  25239. rotationAccelerationOutside: .15,
  25240. rotationAfterMoveMultiplier: 40,
  25241. rotationAfterMoveHistoryCount: 5,
  25242. panFriction: .09,
  25243. panAccelerationOutside: 60,
  25244. onload: r.valueFromHash("onload", o.PANORAMA),
  25245. zoomNearLimit: .1,
  25246. zoomFarLimit: 50,
  25247. navigation: {
  25248. panoScores: !1,
  25249. mouseDirection: !0,
  25250. filterStrictness: .75,
  25251. angleFactor: -30,
  25252. directionFactor: 10,
  25253. distanceFactor: -1,
  25254. optionalityFactor: 3
  25255. },
  25256. sdkInit: !1,
  25257. secretPanelWord: [38, 38, 40, 40, 37, 39, 37, 39, 66, 65],
  25258. console: r.valueFromHash("console", !1),
  25259. noMeshFloorPositionOffset: new n.Vector3(0,-1.2,0),
  25260. panoramaNeighbourMaxDistance: 5,
  25261. panoFloorClickRadius: .35,
  25262. showScreenshotLocations: !1,
  25263. showAxis: !1,
  25264. showNeighbourRaycasts: !1,
  25265. colorMarkerOnLoad: !1,
  25266. colorMarkerByFloor: !1,
  25267. tiling: {
  25268. panoPreRenderRepeatDelay: 2500,
  25269. panoPreRenderDelay: 500,
  25270. preRenderTourPanos: r.valueFromHash("tileprerender", 0),
  25271. tilingFlagNames: ["usetiles", "tiles"],
  25272. maxNavPanoQuality: r.valueFromHash("maxtileq", null),
  25273. maxZoomPanoQuality: r.valueFromHash("maxztileq", null),
  25274. overlayStyle: r.valueFromHash("tileoverlay", 0),
  25275. uploadIntervalDelay: r.valueFromHash("tileupdelay", 10),
  25276. initialIntervalDelay: r.valueFromHash("itiledelay", 0),
  25277. maxNonBaseUploadsPerFrame: r.valueFromHash("maxnbtpf", 2),
  25278. maxBaseUploadsPerFrame: r.valueFromHash("maxbtpf", 6),
  25279. customCompression: r.valueFromHash("tilecustcomp", 0),
  25280. mobileHighQualityOverride: 1,
  25281. allowUltraHighResolution: !0
  25282. },
  25283. zoom: {
  25284. enabled: !0,
  25285. forceOff: r.valueFromHash("nozoom", 0),
  25286. overridemax: r.valueFromHash("maxzoom", null),
  25287. overridemin: r.valueFromHash("minzoom", null),
  25288. max: d.highQualityMaxZoom,
  25289. min: 1,
  25290. transitionStyle: r.valueFromHash("zoomtrans", 1),
  25291. activationThreshold: 1.1,
  25292. restoreTime: 500
  25293. },
  25294. profiling: {
  25295. enabled: r.valueFromHash("mem", !1)
  25296. }
  25297. };
  25298. (p = h.deepExtend(p, d, {
  25299. insideFOV: r.valueFromHash("fov", d.insideFOV),
  25300. insideFOVMax: r.valueFromHash("fovmax", d.insideFOVMax),
  25301. panorama: {
  25302. transitionTime: 1e3,
  25303. modelAlpha: 0,
  25304. modelAlphaDelay: p.flydown.modelTextureDelay,
  25305. modelAlphaLength: 1,
  25306. skyboxOpacity: 1,
  25307. skyboxOpacityDelay: p.flydown.skyboxDelay,
  25308. skyboxOpacityLength: .9,
  25309. fovLength: 1,
  25310. fovDelay: 0,
  25311. cameraMatrixDuration: .8,
  25312. cameraMatrixDelay: 0,
  25313. cameraMatrixEase: c.easeInCubic,
  25314. reticuleOpacity: 1,
  25315. markerOpacity: .3,
  25316. markerOpacityOnHover: 1
  25317. },
  25318. dollhouse: {
  25319. transitionTime: 1e3,
  25320. modelAlpha: 1,
  25321. modelAlphaDelay: 0,
  25322. modelAlphaLength: 1 - p.flydown.modelTextureDelay,
  25323. skyboxOpacity: 0,
  25324. skyboxOpacityDelay: 0,
  25325. skyboxOpacityLength: 1 - p.flydown.skyboxDelay,
  25326. fovLength: 1,
  25327. fovDelay: 0,
  25328. cameraMatrixDuration: .8,
  25329. cameraMatrixDelay: .3,
  25330. cameraMatrixEase: c.easeInCubic,
  25331. reticuleOpacity: 1,
  25332. markerOpacity: 0,
  25333. markerOpacityOnHover: 0
  25334. },
  25335. floorplan: {
  25336. transitionTime: 1e3,
  25337. modelAlpha: 1,
  25338. modelAlphaDelay: 0,
  25339. modelAlphaLength: 1 - p.flydown.modelTextureDelay,
  25340. skyboxOpacity: 0,
  25341. skyboxOpacityDelay: 0,
  25342. skyboxOpacityLength: 1 - p.flydown.skyboxDelay,
  25343. fovLength: 1,
  25344. fovDelay: 0,
  25345. cameraMatrixDuration: .5,
  25346. cameraMatrixDelay: 0,
  25347. cameraMatrixEase: c.easeOutCubic,
  25348. reticuleOpacity: 1,
  25349. markerOpacity: 0,
  25350. markerOpacityOnHover: 0,
  25351. cameraHeight: 50
  25352. },
  25353. transitioning: {
  25354. reticuleOpacity: 0,
  25355. markerOpacity: .3,
  25356. markerOpacityOnHover: 1
  25357. },
  25358. "floorplan-dollhouse": {
  25359. rotationDelay: 0,
  25360. rotationDuration: 1
  25361. },
  25362. "floorplan-panorama": {
  25363. rotationDelay: .5,
  25364. rotationDuration: 1
  25365. },
  25366. "dollhouse-panorama": {
  25367. rotationDelay: .5,
  25368. rotationDuration: 1
  25369. },
  25370. "dollhouse-floorplan": {
  25371. rotationDelay: 0,
  25372. rotationDuration: 1,
  25373. cameraMatrixDuration: 1.05,
  25374. cameraMatrixDelay: .5
  25375. },
  25376. "panorama-dollhouse": {
  25377. rotationDelay: 0,
  25378. rotationDuration: .5
  25379. },
  25380. "panorama-floorplan": {
  25381. transitionTime: 1500,
  25382. rotationDelay: 0,
  25383. rotationDuration: .5
  25384. }
  25385. })).path.meshFree && (p.path.typ = l.WALK),
  25386. p.zoom.max = p.zoom.overridemax || p.zoom.max,
  25387. p.zoom.min = p.zoom.overridemin || p.zoom.min,
  25388. window._settings = t.exports = p
  25389. }
  25390. , {
  25391. "./constants": 8,
  25392. "./enum/Colors": 19,
  25393. "./enum/VROption": 47,
  25394. "./enum/Viewmode": 51,
  25395. "./enum/WarpStyle": 52,
  25396. "./util/browser": 182,
  25397. "./util/common": 185,
  25398. "./util/easing": 186,
  25399. "./util/showcase": 193,
  25400. three: 217
  25401. }],
  25402. 167: [function(e, t, i) {
  25403. "use strict";
  25404. var n = e("three")
  25405. , r = e("./settings")
  25406. , 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"
  25407. , a = "precision highp float;\nprecision highp int;\n\nuniform mat4 viewMatrix;\nuniform vec3 cameraPosition;\n";
  25408. t.exports = {
  25409. basicTextured: {
  25410. uniforms: {
  25411. tDiffuse: {
  25412. type: "t",
  25413. value: null
  25414. },
  25415. alpha: {
  25416. type: "f",
  25417. value: 1
  25418. }
  25419. },
  25420. vertexShader: "varying vec2 vUv;\nvoid main() {\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n}",
  25421. 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}"
  25422. },
  25423. copyCubeMap: {
  25424. uniforms: {
  25425. tDiffuse: {
  25426. type: "t",
  25427. value: null
  25428. },
  25429. alpha: {
  25430. type: "f",
  25431. value: 1
  25432. }
  25433. },
  25434. 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}",
  25435. 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}"
  25436. },
  25437. cube: {
  25438. uniforms: {
  25439. map: {
  25440. type: "t",
  25441. value: null
  25442. },
  25443. opacity: {
  25444. type: "f",
  25445. value: 1
  25446. }
  25447. },
  25448. vertexShader: o + "varying vec3 vWorldPosition;\n\nvoid main() {\n vWorldPosition = position;\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}\n",
  25449. 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"
  25450. },
  25451. model: {
  25452. uniforms: {
  25453. map: {
  25454. type: "t",
  25455. value: null
  25456. },
  25457. modelAlpha: {
  25458. type: "f",
  25459. value: r.modelAlpha
  25460. },
  25461. opacity: {
  25462. type: "f",
  25463. value: 1
  25464. },
  25465. progress: {
  25466. type: "f",
  25467. value: 0
  25468. },
  25469. blackout: {
  25470. type: "i",
  25471. value: 0
  25472. },
  25473. pano0Map: {
  25474. type: "t",
  25475. value: null
  25476. },
  25477. pano0Position: {
  25478. type: "v3",
  25479. value: new n.Vector3
  25480. },
  25481. pano0Matrix: {
  25482. type: "m4",
  25483. value: new n.Matrix4
  25484. },
  25485. pano1Map: {
  25486. type: "t",
  25487. value: null
  25488. },
  25489. pano1Position: {
  25490. type: "v3",
  25491. value: new n.Vector3
  25492. },
  25493. pano1Matrix: {
  25494. type: "m4",
  25495. value: new n.Matrix4
  25496. }
  25497. },
  25498. 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",
  25499. 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"
  25500. },
  25501. hot: {
  25502. uniforms: {
  25503. color: {
  25504. type: "c",
  25505. value: new n.Color(16720384)
  25506. },
  25507. opac: {
  25508. type: "f",
  25509. value: 0
  25510. },
  25511. texture1: {
  25512. type: "t",
  25513. value: null
  25514. },
  25515. texture2: {
  25516. type: "t",
  25517. value: null
  25518. }
  25519. },
  25520. vertexShader: "varying vec2 vUv;\n\nvoid main() {\n\n vUv = uv ;\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\n}\n",
  25521. 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"
  25522. },
  25523. modelOutside: {
  25524. uniforms: {
  25525. map: {
  25526. type: "t",
  25527. value: null
  25528. },
  25529. opacity: {
  25530. type: "f",
  25531. value: 1
  25532. }
  25533. },
  25534. vertexShader: o + "varying vec2 vUv;\n\nvoid main() {\n\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\n}\n",
  25535. 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"
  25536. },
  25537. ribbon: {
  25538. uniforms: {
  25539. map: {
  25540. type: "t",
  25541. value: null
  25542. },
  25543. opacity: {
  25544. type: "f",
  25545. value: 1
  25546. },
  25547. color: {
  25548. type: "c",
  25549. value: new n.Color(r.path.color)
  25550. }
  25551. },
  25552. 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",
  25553. 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"
  25554. },
  25555. waypoint: {
  25556. uniforms: {
  25557. map: {
  25558. type: "t",
  25559. value: null
  25560. },
  25561. opacity: {
  25562. type: "f",
  25563. value: 1
  25564. },
  25565. pulse: {
  25566. type: "f",
  25567. value: 1
  25568. },
  25569. nearFade: {
  25570. type: "v2",
  25571. value: new n.Vector2(2 * r.insideNear,2 * r.path.waypointIndoorRadius)
  25572. },
  25573. color: {
  25574. type: "c",
  25575. value: new n.Color(r.reticuleColor)
  25576. }
  25577. },
  25578. 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",
  25579. 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"
  25580. },
  25581. modelDebug: {
  25582. uniforms: {
  25583. map: {
  25584. type: "t",
  25585. value: null
  25586. },
  25587. modelAlpha: {
  25588. type: "f",
  25589. value: r.modelAlpha
  25590. },
  25591. depthmapRatio: {
  25592. type: "f",
  25593. value: 0
  25594. },
  25595. opacity: {
  25596. type: "f",
  25597. value: 1
  25598. },
  25599. progress: {
  25600. type: "f",
  25601. value: 0
  25602. },
  25603. considerOcclusion: {
  25604. type: "i",
  25605. value: r.fancierTransition
  25606. },
  25607. highlightPanoSelection: {
  25608. type: "i",
  25609. value: 0
  25610. },
  25611. useThirdPano: {
  25612. type: "i",
  25613. value: r.useThirdPano
  25614. },
  25615. pano0Map: {
  25616. type: "t",
  25617. value: null
  25618. },
  25619. pano0Depth: {
  25620. type: "t",
  25621. value: null
  25622. },
  25623. pano0Position: {
  25624. type: "v3",
  25625. value: new n.Vector3
  25626. },
  25627. pano0Matrix: {
  25628. type: "m4",
  25629. value: new n.Matrix4
  25630. },
  25631. pano0Weight: {
  25632. type: "f",
  25633. value: r.transition.pano0Weight
  25634. },
  25635. pano1Map: {
  25636. type: "t",
  25637. value: null
  25638. },
  25639. pano1Depth: {
  25640. type: "t",
  25641. value: null
  25642. },
  25643. pano1Position: {
  25644. type: "v3",
  25645. value: new n.Vector3
  25646. },
  25647. pano1Matrix: {
  25648. type: "m4",
  25649. value: new n.Matrix4
  25650. },
  25651. pano1Weight: {
  25652. type: "f",
  25653. value: r.transition.pano1Weight
  25654. },
  25655. pano2Map: {
  25656. type: "t",
  25657. value: null
  25658. },
  25659. pano2Depth: {
  25660. type: "t",
  25661. value: null
  25662. },
  25663. pano2Position: {
  25664. type: "v3",
  25665. value: new n.Vector3
  25666. },
  25667. pano2Matrix: {
  25668. type: "m4",
  25669. value: new n.Matrix4
  25670. },
  25671. pano2Weight: {
  25672. type: "f",
  25673. value: r.transition.pano2Weight
  25674. }
  25675. },
  25676. 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",
  25677. 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"
  25678. },
  25679. customDepth: {
  25680. uniforms: {
  25681. panoPosition: {
  25682. type: "v3",
  25683. value: new n.Vector3
  25684. }
  25685. },
  25686. 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",
  25687. 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"
  25688. },
  25689. skysphere: {
  25690. uniforms: {
  25691. radius: {
  25692. type: "f",
  25693. value: 0
  25694. }
  25695. },
  25696. 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",
  25697. 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"
  25698. },
  25699. tagDisc: {
  25700. uniforms: {
  25701. opacity: {
  25702. type: "f",
  25703. value: 0
  25704. },
  25705. color: {
  25706. type: "c",
  25707. value: new n.Color
  25708. },
  25709. bg: {
  25710. type: "t",
  25711. value: null
  25712. },
  25713. mask: {
  25714. type: "t",
  25715. value: null
  25716. }
  25717. },
  25718. vertexShader: o + "varying vec2 vUv;\nvoid main() {\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n}",
  25719. 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"
  25720. }
  25721. }
  25722. window.shaders = t.exports;
  25723. }
  25724. , {
  25725. "./settings": 166,
  25726. three: 217
  25727. }],
  25728. 168: [function(E, _, e) {
  25729. (function(e) {
  25730. "use strict";
  25731. var t = E("three")
  25732. , i = (E("url"),
  25733. E("./util/ajax"))
  25734. , n = E("./settings")
  25735. , r = E("./util/logger")
  25736. , o = E("./util/math")
  25737. , a = E("./util/showcase")
  25738. , s = E("./objects/Panorama")
  25739. , l = new r(e)
  25740. , c = E("./model/Model")
  25741. , h = E("./shaders")
  25742. , u = E("./util/transitions")
  25743. , d = E("./objects/Chunk")
  25744. , p = E("./objects/Reticule")
  25745. , f = E("./objects/Skybox")
  25746. , g = E("./objects/Floor")
  25747. , m = E("./cameras/DollhouseCamera")
  25748. , v = E("./cameras/FloorplanCamera")
  25749. , y = E("./cameras/PanoramaCamera")
  25750. , A = E("./controls/DollhouseControls")
  25751. , C = E("./controls/FloorplanControls")
  25752. , I = E("./controls/PanoramaControls");
  25753. t.ImageUtils.crossOrigin = n.crossOrigin,
  25754. _.exports = {
  25755. shaders: h,
  25756. transitions: u,
  25757. Model: c,
  25758. Chunk: d,
  25759. Floor: g,
  25760. Skybox: f,
  25761. Reticule: p,
  25762. Panorama: s,
  25763. DollhouseCamera: m,
  25764. FloorplanCamera: v,
  25765. PanoramaCamera: y,
  25766. DollhouseControls: A,
  25767. FloorplanControls: C,
  25768. PanoramaControls: I,
  25769. getModel: function(e) {
  25770. if (!e.url)
  25771. throw 'getModel(): missing parameter "url"';
  25772. e.autoload = void 0 === e.autoload || e.autoload;
  25773. var t = a.parseSidUrl(e.url);
  25774. e.urlBase = t.urlBase,
  25775. e.urlModel = t.urlModel,
  25776. e.urlFiles = t.urlFiles;
  25777. var i = this._getPlatformError();
  25778. return i ? $.Deferred().reject(i).promise() : (this.options = e,
  25779. this._loadModel().then(this._buildModel.bind(this)))
  25780. },
  25781. _getPlatformError: function() {
  25782. 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"
  25783. },
  25784. _loadModel: function() {
  25785. return i.get(this.options.urlModel, {
  25786. responseType: "json",
  25787. prefetchFrom: "model",
  25788. auth: a.getAuthorizationHeader()
  25789. }).then(null, function() {
  25790. return l.warn("Model loading failed at initial metadata load"),
  25791. "loading-failed"
  25792. })
  25793. },
  25794. _buildModel: function(e) {
  25795. e = a.normalizeModeldata(e, o);
  25796. var t = new c(this.options,e);
  25797. return this.options.autoload ? t.load(!0) : $.when(t)
  25798. }
  25799. }
  25800. }
  25801. ).call(this, "/js/showcase.js")
  25802. }
  25803. , {
  25804. "./cameras/DollhouseCamera": 5,
  25805. "./cameras/FloorplanCamera": 6,
  25806. "./cameras/PanoramaCamera": 7,
  25807. "./controls/DollhouseControls": 10,
  25808. "./controls/FloorplanControls": 11,
  25809. "./controls/PanoramaControls": 13,
  25810. "./model/Model": 139,
  25811. "./objects/Chunk": 144,
  25812. "./objects/Floor": 146,
  25813. "./objects/Panorama": 148,
  25814. "./objects/Reticule": 149,
  25815. "./objects/Skybox": 152,
  25816. "./settings": 166,
  25817. "./shaders": 167,
  25818. "./util/ajax": 181,
  25819. "./util/logger": 189,
  25820. "./util/math": 190,
  25821. "./util/showcase": 193,
  25822. "./util/transitions": 195,
  25823. three: 217,
  25824. url: 208
  25825. }],
  25826. 169: [function(e, t, i) {
  25827. "use strict";
  25828. function l(e) {
  25829. var t = {
  25830. renderTarget: null,
  25831. inUse: !1,
  25832. size: -1,
  25833. pano: null
  25834. };
  25835. return t.inUse = !0,
  25836. t.size = e,
  25837. function(e) {
  25838. O.push(e)
  25839. }(t),
  25840. t
  25841. }
  25842. function c(e) {
  25843. for (var t = 0; t < O.length; t++) {
  25844. var i = O[t];
  25845. if (i.renderTarget === e)
  25846. return !(i.inUse = !1)
  25847. }
  25848. return !1
  25849. }
  25850. function n() {
  25851. this.tileDirectory = {},
  25852. this.activeRenderTargetDescriptors = {},
  25853. this.activePanos = [],
  25854. this.panoLODDescriptors = {},
  25855. this.panoDescriptors = {},
  25856. this.tileTrees = {},
  25857. this.sceneRenderer = null,
  25858. this.tileDownloader = null,
  25859. this.forceQueue = [],
  25860. this.uploadQueues = {},
  25861. this.uploadInterval = null,
  25862. this.uploadIntervalCancelled = !1,
  25863. this.usingTileOverlay = !1,
  25864. this.overlayTilesLoaded = !1,
  25865. this.overlayTileBase = null,
  25866. this.overlayTilesBasic = {},
  25867. this.overlayTilesEnhanced = {},
  25868. this.zoomRenderTarget = null,
  25869. this.zoomPano = null,
  25870. this.zoomingActive = !1,
  25871. this.zoomPanoId = null,
  25872. this.zoomPanoRenderingDisabled = !1,
  25873. this.direction = new _.Vector3,
  25874. this.initTime = -1,
  25875. this.maxBaseUploadsPerFrame = R,
  25876. this.maxNonBaseUploadsPerFrame = M
  25877. }
  25878. 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"),
  25879. e("../enum/PanoRendererEvents")), f = e("../enum/SceneRendererEvents"), g = e("../enum/TileDownloaderEvents"), m = e("../enum/Vectors"), v = (e("../enum/GLCubeFaces"),
  25880. e("../objects/Panorama"),
  25881. e("./TileTree")), y = (e("./TileDownloader"),
  25882. e("./TilePrioritizer")), A = e("./TileUtils"), C = (p = e("../enum/PanoSizeClass"),
  25883. e("../util/browser"),
  25884. 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 = {
  25885. Base: 0,
  25886. Remaining: 1
  25887. }, O = [];
  25888. function L(e) {
  25889. var t = e.shift();
  25890. return t.uploadQueued = !1,
  25891. t
  25892. }
  25893. (n.prototype = Object.create(w.prototype)).init = function(e, t, i) {
  25894. this.sceneRenderer = e,
  25895. this.tileDownloader = t,
  25896. this.qualityManager = i,
  25897. this.bindEvents(),
  25898. this.sceneRenderer.on(f.ContextCreated, this.loadOverlayTiles.bind(this)),
  25899. this.initTime = performance.now()
  25900. }
  25901. ,
  25902. n.prototype.getActivePanoTextures = function(e) {
  25903. e = e || [];
  25904. for (var t = 0; t < O.length; t++) {
  25905. var i = O[t];
  25906. i.renderTarget && i.renderTarget.texture && e.push(i.renderTarget.texture)
  25907. }
  25908. }
  25909. ,
  25910. n.prototype.hasQueuedTiles = function() {
  25911. var e = this.peekNextFromUploadQueue();
  25912. return null != e
  25913. }
  25914. ,
  25915. n.prototype.getActiveRenderTargetDescriptor = function(e) {
  25916. return this.activeRenderTargetDescriptors[e]
  25917. }
  25918. ,
  25919. n.prototype.setActiveRenderTargetDescriptor = function(e, t) {
  25920. this.activeRenderTargetDescriptors[e] = t
  25921. }
  25922. ,
  25923. n.prototype.loadOverlayTiles = function() {
  25924. if (0 !== d.tiling.overlayStyle) {
  25925. var n = 0
  25926. , e = function(e, t, i) {
  25927. e = t ? e[t] = this.sceneRenderer.initSizedTexture2D(A.TILE_SIZE, _.ClampToEdgeWrapping) : this.overlayTileBase = this.sceneRenderer.initSizedTexture2D(A.TILE_SIZE, _.ClampToEdgeWrapping),
  25928. this.sceneRenderer.uploadTexture2D(i, e, 0, 0, A.TILE_SIZE, A.TILE_SIZE),
  25929. ++n === r.length && (this.overlayTilesLoaded = !0)
  25930. }
  25931. .bind(this)
  25932. , 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)]];
  25933. r.forEach(function(e) {
  25934. this.tileDownloader.loadImage(e[0], 0, e[1])
  25935. }
  25936. .bind(this)),
  25937. this.usingTileOverlay = !0
  25938. } else
  25939. this.usingTileOverlay = !1
  25940. }
  25941. ,
  25942. n.prototype.bindEvents = function() {
  25943. this.tileDownloader.on(g.TileDownloadSuccess, this.onTileDownloaded.bind(this))
  25944. }
  25945. ,
  25946. n.prototype.setupZoomRenderTarget = function() {
  25947. if (this.qualityManager.getMaxZoomPanoSize() >= this.qualityManager.getMaxNavPanoSize()) {
  25948. if (this.zoomRenderTarget && this.zoomRenderTarget.width === this.qualityManager.getMaxZoomPanoSize())
  25949. return;
  25950. var e = this.zoomRenderTarget;
  25951. if (this.zoomRenderTarget = this.initTiledPano(this.qualityManager.getMaxZoomPanoSize(), !1),
  25952. e) {
  25953. var t = e.width
  25954. , i = this.zoomRenderTarget.width;
  25955. this.sceneRenderer.copyCubeMap(e.texture, this.zoomRenderTarget, t, t, i, i),
  25956. e.texture.dispose(),
  25957. e.texture.loaded = !1,
  25958. e.texture.version = 0,
  25959. this.sceneRenderer.deallocateCubeTexture(e.texture),
  25960. e.texture = null
  25961. }
  25962. this.zoomPanoRenderingDisabled = !1
  25963. } else
  25964. this.zoomPanoRenderingDisabled = !0
  25965. }
  25966. ,
  25967. n.prototype.enableUltraHighQualityMode = function(t) {
  25968. if (!this.qualityManager.ultraHighQualityModeEnabled()) {
  25969. var e = this.qualityManager.getPanoSize(p.ULTRAHIGH);
  25970. this.tileDownloader.testDownload(e, A.TILE_SIZE, function(e) {
  25971. e && (this.qualityManager.enableUltraHighQualityMode(),
  25972. this.setupZoomRenderTarget(),
  25973. t())
  25974. }
  25975. .bind(this))
  25976. }
  25977. }
  25978. ,
  25979. n.prototype.activateTiledPano = function(e, t, i) {
  25980. i && this.clearAllQueuedUploads();
  25981. for (var n = 0; n < A.FACES_PER_PANO; n++)
  25982. this.initTileTree(e.id, n, this.qualityManager.getMaxPossiblePanoSize());
  25983. this.linkAllTilesAndNodes(e);
  25984. var r = this.getActiveRenderTargetDescriptor(e.id)
  25985. , o = t;
  25986. if (o > this.qualityManager.getMaxNavPanoSize() && (o = this.qualityManager.getMaxNavPanoSize()),
  25987. !r || o !== r.size) {
  25988. if (r && c(r.renderTarget),
  25989. !(r = function(e) {
  25990. for (var t = 0; t < O.length; t++) {
  25991. var i = O[t];
  25992. if (!i.inUse && i.size === e)
  25993. return i.inUse = !0,
  25994. i
  25995. }
  25996. return null
  25997. }(o))) {
  25998. var a = this.initTiledPano(o, !1);
  25999. (r = l(a.width)).renderTarget = a
  26000. }
  26001. r.pano = e,
  26002. this.resetPanoDescriptor(e.id),
  26003. this.resetPanoLODDescriptors(e.id),
  26004. this.resetRenderStatus(e.id, !0, !0)
  26005. }
  26006. this.setActiveRenderTargetDescriptor(e.id, r);
  26007. var s = i ? 0 : 1;
  26008. return this.updateActivePanos(e, s),
  26009. r.renderTarget
  26010. }
  26011. ,
  26012. n.prototype.deactivateTiledPano = function(e) {
  26013. var t = this.getActiveRenderTargetDescriptor(e.id);
  26014. this.isRenderTargetDescriptorValid(t) && c(t.renderTarget),
  26015. this.setActiveRenderTargetDescriptor(e.id, null);
  26016. var i = this.getUploadQueueForPano(e.id);
  26017. this.clearUploadQueue(i),
  26018. this.updateActivePanos()
  26019. }
  26020. ,
  26021. n.prototype.updateActivePanos = (s = [],
  26022. function(e, t) {
  26023. for (var i = s.length = 0; i < this.activePanos.length; i++) {
  26024. e && s.length === t && s.push(e);
  26025. var n = this.activePanos[i]
  26026. , r = this.getActiveRenderTargetDescriptor(n.id);
  26027. e && n.id === e.id || !this.isRenderTargetDescriptorValid(r) || s.push(n)
  26028. }
  26029. e && t >= s.length && s.push(e),
  26030. this.activePanos.length = 0,
  26031. this.activePanos.push.apply(this.activePanos, s)
  26032. }
  26033. ),
  26034. n.prototype.getActivePanoCount = function() {
  26035. return this.activePanos.length
  26036. }
  26037. ,
  26038. n.prototype.resetRenderStatus = function(e, r, o, t) {
  26039. var i = null;
  26040. t && (i = v.getLevelCountForSize(A.TILE_SIZE, t) + 1);
  26041. for (var n = function(e, t, i, n) {
  26042. o && (t.tile.zoomUploaded = !1),
  26043. r && (t.tile.uploaded = !1)
  26044. }, a = 0; a < A.FACES_PER_PANO; a++) {
  26045. this.getTileTree(e, a).breadthFirst({
  26046. callback: n.bind(this, a),
  26047. minLevel: i
  26048. })
  26049. }
  26050. }
  26051. ,
  26052. n.prototype.copyBaseRenderStatusToZoomed = function(e) {
  26053. for (var t = v.getLevelCountForSize(A.TILE_SIZE, this.qualityManager.getMaxNavPanoSize()), i = function(e, t, i, n) {
  26054. t.tile.zoomUploaded = t.tile.uploaded,
  26055. t.zoomCovered = t.covered
  26056. }, n = 0; n < A.FACES_PER_PANO; n++) {
  26057. this.getTileTree(e, n).breadthFirst({
  26058. callback: i.bind(this, n),
  26059. maxLevel: t
  26060. })
  26061. }
  26062. }
  26063. ,
  26064. n.prototype.renderPanoTiles = (h = [],
  26065. function(e, t, i, n) {
  26066. this.zoomRenderTarget && this.zoomRenderTarget.width === this.qualityManager.getMaxZoomPanoSize() || this.zoomPanoRenderingDisabled || this.setupZoomRenderTarget(),
  26067. t = t || this.direction || m.FORWARD;
  26068. var r = this.getActiveRenderTargetDescriptor(e);
  26069. if (!this.isRenderTargetDescriptorValid(r))
  26070. throw new u("PanoRenderer.renderPanoTiles() -> Cannot render to a pano that is not activated.");
  26071. for (var o = 0; o < A.FACES_PER_PANO; o++) {
  26072. var a = this.getTileTree(e, o);
  26073. h.length = 0,
  26074. a.breadthFirst({
  26075. saveVisited: h
  26076. });
  26077. for (var s = 0; s < h.length; s++) {
  26078. var l = h[s];
  26079. this.queueTileUpload(l.tile, !1, n || 0 === s && i)
  26080. }
  26081. }
  26082. this.updateDirection(t)
  26083. }
  26084. ),
  26085. n.prototype.isRenderTargetDescriptorValid = function(e) {
  26086. return e && e.renderTarget
  26087. }
  26088. ,
  26089. n.prototype.isPanoActive = function(e) {
  26090. var t = this.getActiveRenderTargetDescriptor(e);
  26091. return this.isRenderTargetDescriptorValid(t)
  26092. }
  26093. ,
  26094. n.prototype.isPanoZoomed = function(e) {
  26095. return this.zoomingActive && this.zoomPanoId === e
  26096. }
  26097. ,
  26098. n.prototype.initTileTree = function(e, t, i) {
  26099. var n = this.tileTrees[e];
  26100. n || (n = [],
  26101. this.tileTrees[e] = n);
  26102. var r = n[t];
  26103. if (!r) {
  26104. var o = v.getLevelCountForSize(A.TILE_SIZE, i);
  26105. r = new v(A.TILE_SIZE,o),
  26106. n[t] = r
  26107. }
  26108. }
  26109. ,
  26110. n.prototype.getTileTree = function(e, t) {
  26111. var i = this.tileTrees[e];
  26112. if (!i)
  26113. throw new u("PanoRenderer.getTileTree() -> Tree array not yet initialized!");
  26114. var n = i[t];
  26115. if (!n)
  26116. throw new u("PanoRenderer.getTileTree() -> Tree not yet initialized!");
  26117. return n
  26118. }
  26119. ,
  26120. n.prototype.initTiledPano = function(e, t) {
  26121. var i = this.sceneRenderer.renderer
  26122. , n = (i.context,
  26123. new _.WebGLRenderTargetCube(e,e,{
  26124. stencilBuffer: !1
  26125. }))
  26126. , r = new _.CubeTexture([]);
  26127. (n.texture = r).image = [null, null, null, null, null, null],
  26128. r.flipY = !0,
  26129. t ? (r.generateMipmaps = !0,
  26130. r.magFilter = _.LinearFilter,
  26131. r.minFilter = _.LinearMipMapLinearFilter) : (r.generateMipmaps = !1,
  26132. r.magFilter = _.LinearFilter,
  26133. r.minFilter = _.LinearFilter),
  26134. r.format = _.RGBAFormat,
  26135. i.setRenderTarget(n),
  26136. i.setRenderTarget(null);
  26137. var o = i.properties.get(r);
  26138. return o.__image__webglTextureCube = o.__webglTexture,
  26139. n
  26140. }
  26141. ,
  26142. n.prototype.getUploadQueueForPano = function(e) {
  26143. var t = this.uploadQueues[e];
  26144. return t || (t = [],
  26145. this.uploadQueues[e] = t),
  26146. t
  26147. }
  26148. ,
  26149. n.prototype.isTileUploaded = function(e) {
  26150. return this.isPanoZoomed(e.panoId) ? e.zoomUploaded : e.uploaded
  26151. }
  26152. ,
  26153. n.prototype.setUploaded = function(e, t) {
  26154. this.isPanoZoomed(e.panoId) ? e.zoomUploaded = t : e.uploaded = t
  26155. }
  26156. ,
  26157. n.prototype.queueTileUpload = function(e, t, i) {
  26158. var n = this.getActiveRenderTargetDescriptor(e.panoId);
  26159. if (this.isRenderTargetDescriptorValid(n) && e.downloaded && !this.isTileUploaded(e) && (!e.uploadQueued || i) && (!(e.panoSize > this.qualityManager.getMaxNavPanoSize()) || this.zoomingActive)) {
  26160. var r = this.getUploadQueueForPano(e.panoId);
  26161. 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),
  26162. e.uploadQueued = !0,
  26163. this.uploadInterval || this.uploadIntervalCancelled || this.refreshUploadInterval(0))
  26164. }
  26165. }
  26166. ,
  26167. n.prototype.shoulPushToFrontOfQueue = function(e) {
  26168. return 0 === v.getLevelCountForSize(A.TILE_SIZE, e.panoSize)
  26169. }
  26170. ,
  26171. n.prototype.getTopUploadQueue = function() {
  26172. for (var e = null, t = null, i = P.Base; i <= P.Remaining; i++)
  26173. for (var n = 0; n < this.activePanos.length; n++)
  26174. if (e = this.activePanos[n],
  26175. 0 < (t = this.getUploadQueueForPano(e.id)).length)
  26176. switch (i) {
  26177. case P.Base:
  26178. if (0 === t[0].level)
  26179. return t;
  26180. break;
  26181. case P.Remaining:
  26182. return t
  26183. }
  26184. return null
  26185. }
  26186. ,
  26187. n.prototype.getNextFromUploadQueue = function() {
  26188. if (0 < this.forceQueue.length)
  26189. return L(this.forceQueue);
  26190. var e = this.getTopUploadQueue();
  26191. return e && 0 < e.length ? L(e) : null
  26192. }
  26193. ,
  26194. n.prototype.peekNextFromUploadQueue = function() {
  26195. if (0 < this.forceQueue.length)
  26196. return this.forceQueue[0];
  26197. var e = this.getTopUploadQueue();
  26198. return e && 0 < e.length ? e[0] : null
  26199. }
  26200. ,
  26201. n.prototype.clearAllQueuedUploads = function() {
  26202. this.clearAllUploadQueues(null, 0)
  26203. }
  26204. ,
  26205. n.prototype.clearAllQueuedUploadsForPano = function(e) {
  26206. this.clearAllUploadQueues(e, 0)
  26207. }
  26208. ,
  26209. n.prototype.clearAllUploadQueues = function(e, t) {
  26210. if (e)
  26211. this.clearUploadQueue(this.getUploadQueueForPano(e), t),
  26212. this.clearUploadQueue(this.forceQueue, t, e);
  26213. else {
  26214. for (var i = 0; i < this.activePanos.length; i++) {
  26215. var n = this.activePanos[i];
  26216. this.clearUploadQueue(this.getUploadQueueForPano(n.id), t)
  26217. }
  26218. this.clearUploadQueue(this.forceQueue, t)
  26219. }
  26220. }
  26221. ,
  26222. n.prototype.clearUploadQueue = function(e, t, i) {
  26223. null != t || (t = 0);
  26224. for (var n = 0; n < e.length; ) {
  26225. var r = e[n];
  26226. (!i || i && i === r.tile.panoId) && r.level >= t ? (r.uploadQueued = !1,
  26227. e.splice(n, 1)) : n++
  26228. }
  26229. }
  26230. ,
  26231. n.prototype.refreshUploadInterval = (a = null,
  26232. function(e) {
  26233. this.uploadIntervalCancelled || (a = a || function() {
  26234. this.uploadIntervalCancelled || (this.overlayTilesLoaded || !this.usingTileOverlay ? (T = !0,
  26235. this.updateUploadQueue(this.maxNonBaseUploadsPerFrame, this.maxBaseUploadsPerFrame),
  26236. this.peekNextFromUploadQueue() ? this.refreshUploadInterval(x) : this.uploadInterval = null) : this.refreshUploadInterval(this.uploadIntervalDelay))
  26237. }
  26238. .bind(this),
  26239. null != e || (e = x),
  26240. T || (e = S),
  26241. this.uploadInterval = window.setTimeout(a, e),
  26242. this.uploadIntervalDelay = e)
  26243. }
  26244. ),
  26245. n.prototype.update = (r = performance.now(),
  26246. o = 0,
  26247. function() {
  26248. this.uploadIntervalCancelled = !0,
  26249. window.clearTimeout(this.uploadInterval),
  26250. this.uploadInterval = null;
  26251. var e = performance.now() - r;
  26252. !(x < e || 0 === o) || !this.overlayTilesLoaded && this.usingTileOverlay || (this.updateUploadQueue(this.maxNonBaseUploadsPerFrame, this.maxBaseUploadsPerFrame),
  26253. r = performance.now()),
  26254. o++
  26255. }
  26256. ),
  26257. n.prototype.updateUploadQueue = function(e, t) {
  26258. e = e || 1;
  26259. for (var i = 0, n = 0; !(t <= n || e <= i); ) {
  26260. var r = this.getNextFromUploadQueue();
  26261. if (!r)
  26262. break;
  26263. if (0 !== r.level ? i++ : n++,
  26264. !(r.panoSize > this.qualityManager.getMaxNavPanoSize()) || this.zoomingActive) {
  26265. var o = this.getActiveRenderTargetDescriptor(r.panoId);
  26266. this.isRenderTargetDescriptorValid(o) && this.uploadTile(r, r.forceUpload)
  26267. }
  26268. }
  26269. }
  26270. ,
  26271. n.prototype.updateDirection = function(e) {
  26272. if (e = e || this.direction) {
  26273. this.direction = e;
  26274. for (var t = 0; t < this.activePanos.length; t++) {
  26275. var i = this.activePanos[t]
  26276. , n = this.getUploadQueueForPano(i.id);
  26277. y.sortPanoTiles(n, i, this.direction)
  26278. }
  26279. }
  26280. }
  26281. ,
  26282. n.prototype.uploadTile = (I = {},
  26283. new _.Vector4,
  26284. E = d.tiling.overlayStyle,
  26285. function(e, t) {
  26286. var i = e.panoId
  26287. , n = e.image
  26288. , r = e.tileSize
  26289. , o = e.panoSize
  26290. , a = e.tileIndex
  26291. , s = (e.faceTileIndex,
  26292. e.totalTiles)
  26293. , l = (e.face,
  26294. e.tileX)
  26295. , c = e.tileY
  26296. , h = !0
  26297. , u = !1
  26298. , d = (this.getPanoDescriptor(i),
  26299. this.getPanoLODDescriptor(i, o))
  26300. , p = this.getActiveRenderTargetDescriptor(i)
  26301. , f = p.renderTarget
  26302. , g = p.size;
  26303. if (this.isPanoZoomed(i) && (f = this.zoomRenderTarget,
  26304. g = this.qualityManager.getMaxZoomPanoSize()),
  26305. this.isRenderTargetDescriptorValid(p) || (u = h = !1),
  26306. t || (this.anyUploaded(e.node) && (u = !(h = !1)),
  26307. this.isTileUploaded(e) && (u = h = !1)),
  26308. h) {
  26309. var m = r / o * g
  26310. , v = l * r / o * g
  26311. , y = c * r / o * g;
  26312. I[r] || (I[r] = this.sceneRenderer.initSizedTexture2D(r, _.ClampToEdgeWrapping));
  26313. var A = I[r];
  26314. if (this.sceneRenderer.uploadTexture2D(n, A, 0, 0, r, r),
  26315. 1 === E || 2 === E) {
  26316. var C = 1 === E ? this.overlayTilesBasic : this.overlayTilesEnhanced;
  26317. this.sceneRenderer.renderToCubeMap(A, f, r, r, 0, 0, r, r, v, y, m, m, e.cubeFace),
  26318. this.sceneRenderer.renderToCubeMap(C[o], f, r, r, 0, 0, r, r, v, y, m, m, e.cubeFace, _.NormalBlending, !0, .5)
  26319. } else
  26320. this.sceneRenderer.renderToCubeMap(A, f, r, r, 0, 0, r, r, v, y, m, m, e.cubeFace);
  26321. d.uploadCount++,
  26322. this.emit(b.TileRenderSuccess, i, o, a, s),
  26323. d.uploadCount === s && this.emit(b.PanoRenderComplete, i, o, s),
  26324. this.setUploaded(e, !0),
  26325. this.addCoverageForNode(e.node)
  26326. } else
  26327. this.setUploaded(e, !1);
  26328. return e.uploadAttempted || (d.uploadAttempts++,
  26329. this.emit(b.TileUploadAttempted, i, o, a, s)),
  26330. e.uploadAttempted = !0,
  26331. d.uploadAttempts === s && this.emit(b.UploadAttemptedForAllTiles, i, o, s),
  26332. u
  26333. }
  26334. ),
  26335. n.prototype.linkTileAndNode = function(e, t) {
  26336. (t.tile = e).node = t
  26337. }
  26338. ,
  26339. n.prototype.linkAllTilesAndNodes = function(a) {
  26340. for (var e = function(e, t, i, n, r) {
  26341. var o = this.getTileDirectoryEntry(a.id, t, n, r);
  26342. this.linkTileAndNode(o, i)
  26343. }, t = 0; t < A.FACES_PER_PANO; t++) {
  26344. var i = this.getTileTree(a.id, t);
  26345. i.breadthFirst({
  26346. callback: e.bind(this, i, t)
  26347. })
  26348. }
  26349. }
  26350. ,
  26351. n.prototype.anyUploaded = function(e) {
  26352. if (!e)
  26353. return !1;
  26354. if (e.tile && this.isTileUploaded(e.tile))
  26355. return !0;
  26356. if (e.children)
  26357. for (var t = 0; t < e.children.length; t++) {
  26358. var i = e.children[t];
  26359. if (this.anyUploaded(i))
  26360. return !0
  26361. }
  26362. return !1
  26363. }
  26364. ,
  26365. n.prototype.setNodeCovered = function(e, t) {
  26366. this.isPanoZoomed(e.tile.panoId) ? e.zoomCovered = t : e.covered = t
  26367. }
  26368. ,
  26369. n.prototype.isNodeCovered = function(e) {
  26370. return !!e && (this.isPanoZoomed(e.tile.panoId) ? e.zoomCovered : e.covered)
  26371. }
  26372. ,
  26373. n.prototype.addCoverageForNode = function(e) {
  26374. if (this.setNodeCovered(e, !0),
  26375. e.parent && e.covered) {
  26376. var t = e.parent;
  26377. this.nodeSubcovered(t) && this.addCoverageForNode(t, !0)
  26378. }
  26379. }
  26380. ,
  26381. n.prototype.calcFullCoverage = function(e) {
  26382. var t = !1;
  26383. if (e.children)
  26384. for (var i = 0; i < e.children.length; i++) {
  26385. var n = e.children[i];
  26386. t = t || this.calcFullCoverage(n)
  26387. }
  26388. e.covered = e.tile.uploaded || t
  26389. }
  26390. ,
  26391. n.prototype.nodeSubcovered = function(e) {
  26392. if (!e.children)
  26393. return !1;
  26394. for (var t = 0; t < e.children.length; t++)
  26395. if (!e.children[t] || !this.isNodeCovered(e.children[t]))
  26396. return !1;
  26397. return !0
  26398. }
  26399. ,
  26400. n.prototype.resetPanoDescriptor = function(e) {
  26401. this.getPanoDescriptor(e)
  26402. }
  26403. ,
  26404. n.prototype.getPanoDescriptor = function(e) {
  26405. var t = this.panoDescriptors[e];
  26406. return t || (t = {},
  26407. this.panoDescriptors[e] = t),
  26408. t
  26409. }
  26410. ,
  26411. n.prototype.resetPanoLODDescriptors = function(e) {
  26412. var t = this.getPanoLODDescriptors(e);
  26413. for (var i in t)
  26414. if (t.hasOwnProperty(i)) {
  26415. var n = t[i];
  26416. n.uploadCount = 0,
  26417. n.uploadAttempts = 0
  26418. }
  26419. }
  26420. ,
  26421. n.prototype.getPanoLODDescriptor = function(e, t) {
  26422. var i = this.getPanoLODDescriptors(e)
  26423. , n = i[t];
  26424. return n || (n = {
  26425. uploadCount: 0,
  26426. uploadAttempts: 0
  26427. },
  26428. i[t] = n),
  26429. n
  26430. }
  26431. ,
  26432. n.prototype.getPanoLODDescriptors = function(e) {
  26433. var t = this.panoLODDescriptors[e];
  26434. return t || (t = {},
  26435. this.panoLODDescriptors[e] = t),
  26436. t
  26437. }
  26438. ,
  26439. n.prototype.onTileDownloaded = function(e) {
  26440. var t = v.getLevelCountForSize(A.TILE_SIZE, e.panoSize)
  26441. , i = this.getTileDirectoryEntry(e.panoId, e.face, t, e.faceTileIndex);
  26442. if (i.downloaded = !0,
  26443. i.image = e.image,
  26444. i.panoSize = e.panoSize,
  26445. i.tileX = e.tileX,
  26446. i.tileY = e.tileY,
  26447. i.totalTiles = e.totalTiles,
  26448. i.tileIndex = e.tileIndex,
  26449. i.faceTileIndex = e.faceTileIndex,
  26450. i.face = e.face,
  26451. i.cubeFace = C.mapFaceToCubemapFace(e.face),
  26452. i.panoId = e.panoId,
  26453. i.tileSize = e.tileSize,
  26454. i.direction = (new _.Vector3).copy(e.direction),
  26455. i.node = null,
  26456. i.level = v.getLevelCountForSize(A.TILE_SIZE, i.panoSize),
  26457. this.isPanoActive(i.panoId)) {
  26458. var n = this.getTileTree(i.panoId, i.face).getSubNode(i.panoSize, i.tileX, i.tileY);
  26459. this.linkTileAndNode(i, n),
  26460. this.queueTileUpload(i, !0)
  26461. }
  26462. }
  26463. ,
  26464. n.prototype.getTileDirectoryEntry = function(e, t, i, n) {
  26465. var r = this.tileDirectory[e];
  26466. r || (r = {},
  26467. this.tileDirectory[e] = r);
  26468. var o = 16384 * t + 1024 * i + n
  26469. , a = r[o];
  26470. return a || (a = {
  26471. downloaded: !1,
  26472. uploaded: !1,
  26473. zoomUploaded: !1
  26474. },
  26475. r[o] = a),
  26476. a._key = e + ":" + t + ":" + i + ":" + n,
  26477. a._tileKey = o,
  26478. a
  26479. }
  26480. ,
  26481. n.prototype.setZoomingActive = function(e, t, i) {
  26482. this.zoomPanoRenderingDisabled || e === this.zoomingActive && this.zoomPanoId === t.id || (this.zoomingActive = e,
  26483. this.zoomPanoId = t.id,
  26484. this.zoomingActive && (this.zoomPanoId !== t.id || i) && this.updateZoomedPanoFromBase(t))
  26485. }
  26486. ,
  26487. n.prototype.updateZoomedPanoFromBase = function(e) {
  26488. if (!this.zoomPanoRenderingDisabled) {
  26489. var t = this.getActiveRenderTargetDescriptor(e.id);
  26490. if (t && t.renderTarget) {
  26491. var i = this.qualityManager.getMaxZoomPanoSize()
  26492. , n = t.renderTarget
  26493. , r = t.size;
  26494. this.sceneRenderer.copyCubeMap(n.texture, this.zoomRenderTarget, r, r, i, i),
  26495. this.copyBaseRenderStatusToZoomed(e.id)
  26496. }
  26497. }
  26498. }
  26499. ,
  26500. t.exports = n
  26501. }
  26502. , {
  26503. "../enum/GLCubeFaces": 25,
  26504. "../enum/PanoRendererEvents": 35,
  26505. "../enum/PanoSizeClass": 36,
  26506. "../enum/SceneRendererEvents": 43,
  26507. "../enum/TileDownloaderEvents": 45,
  26508. "../enum/Vectors": 50,
  26509. "../exception/BasicException": 55,
  26510. "../objects/Panorama": 148,
  26511. "../settings": 166,
  26512. "../util/browser": 182,
  26513. "../util/panorama": 191,
  26514. "./TileDownloader": 171,
  26515. "./TilePrioritizer": 172,
  26516. "./TileTree": 173,
  26517. "./TileUtils": 174,
  26518. events: 202,
  26519. three: 217
  26520. }],
  26521. 170: [function(e, t, i) {
  26522. "use strict";
  26523. function n(e, t, i) {
  26524. this.maxNavPanoSize = -1,
  26525. this.maxZoomPanoSize = -1,
  26526. this.devicePixelDensity = e,
  26527. this.deviceScreenSize = t,
  26528. this.clientBandwidth = i,
  26529. this.panoSizeClassMap = {},
  26530. this.useHighResolutionPanos = !0,
  26531. this.useUltraHighResolutionPanos = !1,
  26532. this.modelHasUltraHighPanos = !1
  26533. }
  26534. var r = e("../enum/PanoSizeClass")
  26535. , o = e("../settings")
  26536. , a = e("../util/browser")
  26537. , s = e("../constants")
  26538. , l = e("../util/showcase")
  26539. , c = e("../enum/ModelManagerEvents");
  26540. n.prototype.init = function(e) {
  26541. this.buildPanoSizeClassMap(this.devicePixelDensity, this.deviceScreenSize, this.clientBandwidth),
  26542. this.ultraHighSize = this.getPanoSize(r.ULTRAHIGH),
  26543. this.highSize = this.getPanoSize(r.HIGH),
  26544. this.standardSize = this.getPanoSize(r.STANDARD),
  26545. this.baseSize = this.getPanoSize(r.BASE),
  26546. o.tiling.maxZoomPanoQuality && this.ultraHighSize <= o.tiling.maxZoomPanoQuality && (o.tiling.allowUltraHighResolution = !0),
  26547. this.highQualityThreshold = a.valueFromHash("threshold2k", s.windowHeightHighQualityThreshold),
  26548. this.updateMaximums(),
  26549. e.on(c.ActiveModelChanged, this.onModelChanged.bind(this))
  26550. }
  26551. ,
  26552. n.prototype.updateFromModel = function(e) {
  26553. this.updateHighResolutionSettings(e),
  26554. this.updateUltraHighResolutionSettings(e)
  26555. }
  26556. ,
  26557. n.prototype.updateHighResolutionSettings = function(e) {
  26558. l.modelDataPromisesTiles(e.data) ? this.useHighResolutionPanos = !0 : this.useHighResolutionPanos = !1,
  26559. this.updateMaximums()
  26560. }
  26561. ,
  26562. n.prototype.updateUltraHighResolutionSettings = function(e) {
  26563. o.tiling.allowUltraHighResolution && this.modelHasUltraHighPanos ? this.useUltraHighResolutionPanos = !0 : this.useUltraHighResolutionPanos = !1,
  26564. this.updateMaximums()
  26565. }
  26566. ,
  26567. n.prototype.enableUltraHighQualityMode = function() {
  26568. this.modelHasUltraHighPanos = !0,
  26569. this.updateUltraHighResolutionSettings(null)
  26570. }
  26571. ,
  26572. n.prototype.ultraHighQualityModeEnabled = function() {
  26573. return this.modelHasUltraHighPanos
  26574. }
  26575. ,
  26576. n.prototype.onModelChanged = function(e) {
  26577. this.updateFromModel(e.model),
  26578. this.updateMaximums()
  26579. }
  26580. ,
  26581. n.prototype.updateMaximums = function() {
  26582. this.maxNavPanoSize = o.tiling.maxNavPanoQuality || this.detectMaxNavPanoSize(),
  26583. this.maxZoomPanoSize = o.tiling.maxZoomPanoQuality || this.detectMaxZoomPanoSize(),
  26584. this.maxZoomPanoSize < this.maxNavPanoSize && (this.maxNavPanoSize = this.maxZoomPanoSize)
  26585. }
  26586. ,
  26587. n.prototype.buildPanoSizeClassMap = function() {
  26588. this.panoSizeClassMap[r.BASE] = 512,
  26589. this.panoSizeClassMap[r.STANDARD] = 1024,
  26590. this.panoSizeClassMap[r.HIGH] = 2048,
  26591. this.panoSizeClassMap[r.ULTRAHIGH] = 4096
  26592. }
  26593. ,
  26594. n.prototype.getPanoSize = function(e) {
  26595. return this.panoSizeClassMap[e]
  26596. }
  26597. ,
  26598. n.prototype.getMaxPossiblePanoSize = function() {
  26599. return this.getPanoSize(r.ULTRAHIGH)
  26600. }
  26601. ,
  26602. n.prototype.getMaxPanoSize = function() {
  26603. return this.maxZoomPanoSize
  26604. }
  26605. ,
  26606. n.prototype.getMaxNavPanoSize = function() {
  26607. return this.maxNavPanoSize
  26608. }
  26609. ,
  26610. n.prototype.getMaxZoomPanoSize = function() {
  26611. return this.maxZoomPanoSize
  26612. }
  26613. ,
  26614. n.prototype.detectMaxNavPanoSizeClass = function() {
  26615. return this.useHighResolutionPanos ? a.isMobile() ? r.STANDARD : $("#player").height() < this.highQualityThreshold ? r.STANDARD : r.HIGH : r.STANDARD
  26616. }
  26617. ,
  26618. n.prototype.detectMaxNavPanoSize = function() {
  26619. var e = this.detectMaxNavPanoSizeClass();
  26620. return this.getPanoSize(e)
  26621. }
  26622. ,
  26623. n.prototype.detectMaxZoomPanoSize = function() {
  26624. 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)
  26625. }
  26626. ,
  26627. t.exports = n
  26628. }
  26629. , {
  26630. "../constants": 8,
  26631. "../enum/ModelManagerEvents": 33,
  26632. "../enum/PanoSizeClass": 36,
  26633. "../settings": 166,
  26634. "../util/browser": 182,
  26635. "../util/showcase": 193
  26636. }],
  26637. 171: [function(A, C, e) {
  26638. (function(e) {
  26639. "use strict";
  26640. function i(e) {
  26641. this.panos = null,
  26642. this.retryMinimumTime = 1e4,
  26643. this.urls = null,
  26644. this.panoLoadCallbacks = {},
  26645. this.downloadDescriptors = {},
  26646. this.priorityQueue = [],
  26647. this.forceQueue = [],
  26648. this.activeDownloads = [],
  26649. this.qualityManager = null,
  26650. this.tilePrioritizer = null,
  26651. this.refreshInterval = null,
  26652. this.processPriorityQueue = !1,
  26653. this.concurrentDownloads = e.concurrentDownloads || 1,
  26654. this.downloadTestResults = {}
  26655. }
  26656. var c, h, n, p, f, t = A("three"), u = (A("../enum/Viewmode"),
  26657. A("../settings")), r = (A("../objects/Panorama"),
  26658. A("../util/logger")), o = (A("../enum/Vectors"),
  26659. A("../enum/PanoSizeClass"),
  26660. A("../enum/TileDownloaderEvents")), g = A("./TilePrioritizer"), m = A("./TileUtils"), v = (A("../enum/GLCubeFaces"),
  26661. A("../enum/DownloadStatus")), a = A("../util/panorama"), s = A("../util/ajax"), d = A("../ab"), l = A("events").EventEmitter, y = (new r(e),
  26662. Object.freeze({
  26663. Testing: 1,
  26664. Success: 2,
  26665. Fail: 3
  26666. }));
  26667. i.prototype = Object.create(l.prototype),
  26668. i.IDLE_REFRESH_DELAY = 500,
  26669. i.ACTIVE_REFRESH_DELAY = 16,
  26670. i.DOWNLOAD_RETRIES = 4,
  26671. i.prototype.init = function(e) {
  26672. this.qualityManager = e
  26673. }
  26674. ,
  26675. i.prototype.setUrls = function(e) {
  26676. this.urls = e
  26677. }
  26678. ,
  26679. i.prototype.setPanoData = function(e, t, i) {
  26680. this.panos = e,
  26681. this.imagePanos = t,
  26682. this.panoGroupId = i
  26683. }
  26684. ,
  26685. i.prototype.start = function() {
  26686. this.refreshUpdateInterval(0)
  26687. }
  26688. ,
  26689. i.prototype.stop = function() {
  26690. window.cancel(this.refreshInterval)
  26691. }
  26692. ,
  26693. i.prototype.refreshUpdateInterval = function(e) {
  26694. e = e || 0,
  26695. this.refreshInterval = window.setTimeout(function() {
  26696. this.update() ? this.refreshUpdateInterval(i.ACTIVE_REFRESH_DELAY) : this.refreshUpdateInterval(i.IDLE_REFRESH_DELAY)
  26697. }
  26698. .bind(this), e)
  26699. }
  26700. ,
  26701. i.prototype.update = function() {
  26702. var e = 0 < this.forceQueue.length;
  26703. return this.processQueueForDownloading(this.forceQueue),
  26704. this.processPriorityQueue && (this.queuePrioritizedTilesForPanos(this.panos),
  26705. 0 < this.priorityQueue.length && (e = !0),
  26706. this.processQueueForDownloading(this.priorityQueue)),
  26707. e
  26708. }
  26709. ,
  26710. i.prototype.forceQueueTilesForPano = (p = [],
  26711. f = [],
  26712. function(e, t, i, n, r, o) {
  26713. p.length = 0;
  26714. for (var a = this.getTileDownloadDescriptors(e, t), s = 0; s < a.length; s++) {
  26715. var l = a[s];
  26716. l.status !== v.None && l.status !== v.Queued || p.push(l)
  26717. }
  26718. if (i && 0 < p.length) {
  26719. g.sortPanoTiles(p, e, i),
  26720. f.length = 0,
  26721. m.matchingTilesInDirection(e, t, i, n, r, f);
  26722. for (var c = 0, h = function(e) {
  26723. return e.face === u.face && e.faceTileIndex === u.faceTileIndex
  26724. }; c < p.length; ) {
  26725. var u = p[c];
  26726. f.findIndex(h) < 0 ? p.splice(c, 1) : c++
  26727. }
  26728. }
  26729. for (var d = 0; d < p.length; d++)
  26730. this.forceQueue.push(p[d]);
  26731. this.setStatusForAllDescriptors(this.forceQueue, v.ForceQueued),
  26732. this.clearFromQueue(this.priorityQueue, v.ForceQueued, !1),
  26733. o && this.processQueueForDownloading(this.forceQueue, !0)
  26734. }
  26735. ),
  26736. i.prototype.clearForceQueue = function() {
  26737. this.clearQueue(this.forceQueue)
  26738. }
  26739. ,
  26740. i.prototype.queuePrioritizedTilesForPanos = function(e) {
  26741. this.tilePrioritizer && (this.clearQueue(this.priorityQueue),
  26742. this.tilePrioritizer.filterAndPrioritize(this.priorityQueue, e, this),
  26743. this.clearFromQueue(this.priorityQueue, v.None, !0),
  26744. this.setStatusOrRemoveForAllDescriptors(this.priorityQueue, v.Queued))
  26745. }
  26746. ,
  26747. i.prototype.clearQueue = function(e) {
  26748. this.setStatusForAllDescriptors(e, v.None),
  26749. e.length = 0
  26750. }
  26751. ,
  26752. i.prototype.clearFromQueue = function(e, t, i) {
  26753. for (var n = 0; n < e.length; n++) {
  26754. var r = e[n];
  26755. r && (t === r.status && !i || t !== r.status && i) && (e[n] = null)
  26756. }
  26757. }
  26758. ,
  26759. i.prototype.setStatusForAllDescriptors = function(e, t) {
  26760. for (var i = 0; i < e.length; i++) {
  26761. var n = e[i];
  26762. n && (n.status = t)
  26763. }
  26764. }
  26765. ,
  26766. i.prototype.setStatusOrRemoveForAllDescriptors = function(e, t) {
  26767. for (var i = 0; i < e.length; i++) {
  26768. var n = e[i];
  26769. n && (n.status !== t ? n.status = t : e[i] = null)
  26770. }
  26771. }
  26772. ,
  26773. i.prototype.getTileDownloadDescriptors = function(e, t) {
  26774. var i = this.getAllTileDownloadDescriptorsForPano(e)
  26775. , n = i[t];
  26776. return n || (n = this.buildDownloadDescriptorArray(t),
  26777. i[t] = n,
  26778. this.initTileDownloadDescriptors(n, e, t)),
  26779. n
  26780. }
  26781. ,
  26782. i.prototype.getAllTileDownloadDescriptorsForPano = function(e) {
  26783. var t = this.downloadDescriptors[e.id];
  26784. return t || (t = {},
  26785. this.downloadDescriptors[e.id] = t),
  26786. t
  26787. }
  26788. ,
  26789. i.prototype.processQueueForDownloading = function(e, t) {
  26790. if (this.cleanupActiveDownloads(),
  26791. this.activeDownloads.length < this.concurrentDownloads || t)
  26792. for (var i = t ? e.length : this.concurrentDownloads - this.activeDownloads.length, n = 0; n < i && 0 < e.length; 0) {
  26793. var r = e.shift();
  26794. r && (this.startDownload(r),
  26795. n++)
  26796. }
  26797. }
  26798. ,
  26799. i.prototype.testDownload = function(t, e, i) {
  26800. var n = this.downloadTestResults[t];
  26801. if (n)
  26802. n === y.Success ? i(!0) : n === y.Fail && i(!1);
  26803. else {
  26804. this.downloadTestResults[t] = y.Testing;
  26805. var r = this.panos.list[0]
  26806. , o = this.getTileUrl(r.id, t, e, 0)
  26807. , a = function(e) {
  26808. this.downloadTestResults[t] = y.Success,
  26809. i(!0)
  26810. }
  26811. .bind(this)
  26812. , s = function() {
  26813. this.downloadTestResults[t] = y.Fail,
  26814. i(!1)
  26815. }
  26816. .bind(this);
  26817. this.loadImage(o, 0, a, s)
  26818. }
  26819. }
  26820. ,
  26821. i.prototype.startDownload = function(e) {
  26822. e.status = v.Downloading;
  26823. var t = this.getTileUrl(e.pano.id, e.panoSize, e.tileSize, e.tileIndex);
  26824. this.activeDownloads.push(e),
  26825. this.loadImage(t, i.DOWNLOAD_RETRIES, this.downloadComplete.bind(this, e), this.downloadFailed.bind(this, e))
  26826. }
  26827. ,
  26828. i.prototype.downloadFailed = function(e, t) {}
  26829. ,
  26830. i.prototype.downloadComplete = function(e, t) {
  26831. if (e.panoGroupId === this.panoGroupId) {
  26832. var i = this.getPanoLoadCallbacks(e.pano, e.panoSize);
  26833. e.status = v.Downloaded,
  26834. i && i.onProgress && i.onProgress(e.pano, e.panoSize);
  26835. var n = {
  26836. panoId: e.pano.id,
  26837. image: t,
  26838. tileSize: e.tileSize,
  26839. panoSize: e.panoSize,
  26840. tileIndex: e.tileIndex,
  26841. faceTileIndex: e.faceTileIndex,
  26842. totalTiles: e.totalTiles,
  26843. face: e.face,
  26844. tileX: e.tileX,
  26845. tileY: e.tileY,
  26846. direction: e.direction
  26847. };
  26848. e.image = t,
  26849. this.emit(o.TileDownloadSuccess, n),
  26850. this.isPanoDownloaded(e.pano, e.panoSize) && (n = {
  26851. panoId: e.pano.id,
  26852. tileSize: e.tileSize,
  26853. panoSize: e.panoSize
  26854. },
  26855. this.emit(o.PanoDownloadComplete, n),
  26856. i && i.onLoad && i.onLoad(e.pano, e.panoSize))
  26857. }
  26858. }
  26859. ,
  26860. i.prototype.cleanupActiveDownloads = (n = [],
  26861. function() {
  26862. for (var e = n.length = 0; e < this.activeDownloads.length; e++) {
  26863. var t = this.activeDownloads[e];
  26864. t.status !== v.Downloaded && t.status !== v.Failed && n.push(t)
  26865. }
  26866. this.activeDownloads.length = 0,
  26867. this.activeDownloads.push.apply(this.activeDownloads, n)
  26868. }
  26869. ),
  26870. i.prototype.isPanoDownloaded = function(e, t) {
  26871. var i = this.getTileDownloadDescriptors(e, t);
  26872. if (i.length <= 0)
  26873. return !1;
  26874. for (var n = 0; n < i.length; n++) {
  26875. if (i[n].status !== v.Downloaded)
  26876. return !1
  26877. }
  26878. return !0
  26879. }
  26880. ,
  26881. i.prototype.setPanoLoadCallbacks = function(e, t, i, n, r) {
  26882. var o = e.id + ":" + this.qualityManager.getPanoSize(t);
  26883. this.panoLoadCallbacks[o] = {
  26884. onLoad: i,
  26885. onFail: n,
  26886. onProgress: r
  26887. }
  26888. }
  26889. ,
  26890. i.prototype.getPanoLoadCallbacks = function(e, t) {
  26891. var i = e.id + ":" + t;
  26892. return this.panoLoadCallbacks[i]
  26893. }
  26894. ,
  26895. i.prototype.buildDownloadDescriptorArray = function(e) {
  26896. for (var t = m.getTileCountForSize(e), i = [], n = 0; n < t; n++) {
  26897. var r = this.buildDownloadDescriptor();
  26898. i.push(r)
  26899. }
  26900. return i
  26901. }
  26902. ,
  26903. i.prototype.buildDownloadDescriptor = function() {
  26904. return {
  26905. panoGroupId: null,
  26906. pano: null,
  26907. panoSize: -1,
  26908. tileSize: -1,
  26909. tileIndex: -1,
  26910. totalTiles: -1,
  26911. faceTileIndex: -1,
  26912. status: v.None,
  26913. url: null,
  26914. image: null,
  26915. direction: new t.Vector3,
  26916. face: -1,
  26917. cubeFace: -1,
  26918. tileX: -1,
  26919. tileY: -1
  26920. }
  26921. }
  26922. ,
  26923. i.prototype.initTileDownloadDescriptors = function(e, t, i) {
  26924. for (var n = 0; n < e.length; n++) {
  26925. var r = e[n];
  26926. this.initTileDownloadDescriptor(r, t, i, n)
  26927. }
  26928. }
  26929. ,
  26930. i.prototype.initTileDownloadDescriptor = function(e, t, i, n) {
  26931. var r = i >= m.TILE_SIZE ? m.TILE_SIZE : i;
  26932. e.face = m.getFaceForTile(i, n),
  26933. e.cubeFace = a.mapFaceToCubemapFace(e.face),
  26934. e.panoGroupId = this.panoGroupId,
  26935. e.pano = t,
  26936. e.panoSize = i,
  26937. e.tileSize = r,
  26938. e.tileIndex = n,
  26939. e.totalTiles = m.getTileCountForSize(i),
  26940. e.status = v.None,
  26941. e.image = null,
  26942. m.getTileLocation(e.panoSize, e.tileIndex, e),
  26943. m.getTileVector(e.panoSize, e.tileSize, e.cubeFace, e.tileX, e.tileY, m.LocationOnTile.Center, 0, e.direction)
  26944. }
  26945. ,
  26946. i.prototype.getTileUrl = (c = {
  26947. 256: "256",
  26948. 512: "512",
  26949. 1024: "1k",
  26950. 2048: "2k",
  26951. 4096: "4k"
  26952. },
  26953. h = {
  26954. face: -1,
  26955. faceTileIndex: -1,
  26956. tileX: -1,
  26957. tileY: -1
  26958. },
  26959. function(e, t, i, n) {
  26960. m.getTileLocation(t, n, h);
  26961. var r = Math.floor(t / i)
  26962. , o = r * r
  26963. , a = Math.floor(n / o)
  26964. , s = "";
  26965. 1 === u.tiling.customCompression && (s = "_" + u.tiling["q" + c[t]]);
  26966. var l = this.urls.get("tiles/" + e + "/" + c[t] + s + "_face" + a + "_" + h.tileX + "_" + h.tileY + ".jpg");
  26967. return d.changeIfTileGenerating(l)
  26968. }
  26969. ),
  26970. i.prototype.loadImage = function(e, t, i, n) {
  26971. s.getImage(e, t).then(function(e) {
  26972. i(e)
  26973. }).fail(n)
  26974. }
  26975. ,
  26976. C.exports = i
  26977. }
  26978. ).call(this, "/js/tile/TileDownloader.js")
  26979. }
  26980. , {
  26981. "../ab": 3,
  26982. "../enum/DownloadStatus": 24,
  26983. "../enum/GLCubeFaces": 25,
  26984. "../enum/PanoSizeClass": 36,
  26985. "../enum/TileDownloaderEvents": 45,
  26986. "../enum/Vectors": 50,
  26987. "../enum/Viewmode": 51,
  26988. "../objects/Panorama": 148,
  26989. "../settings": 166,
  26990. "../util/ajax": 181,
  26991. "../util/logger": 189,
  26992. "../util/panorama": 191,
  26993. "./TilePrioritizer": 172,
  26994. "./TileUtils": 174,
  26995. events: 202,
  26996. three: 217
  26997. }],
  26998. 172: [function(n, C, e) {
  26999. (function(e) {
  27000. "use strict";
  27001. function h(e, t, i, n, r) {
  27002. this.qualityManager = e,
  27003. this.maxNavQuality = this.qualityManager.getMaxNavPanoSize(),
  27004. this.maxZoomQuality = this.qualityManager.getMaxZoomPanoSize(),
  27005. this.baseSize = t,
  27006. this.standardSize = i,
  27007. this.highSize = n,
  27008. this.ultraHighSize = r,
  27009. this.priorityCriteria = new h.PriorityCriteria(null,new o.Vector3(0,0,0),new o.Vector3(0,0,-1),new o.Vector3(0,0,-1))
  27010. }
  27011. var c, s, l, d, r, u, p, f, o = n("three"), g = (n("../enum/Viewmode"),
  27012. n("../settings"),
  27013. n("../settings"),
  27014. n("../objects/Panorama")), t = n("../util/logger"), i = (n("../enum/Vectors"),
  27015. n("../enum/PanoSizeClass"),
  27016. n("../enum/ModelManagerEvents"),
  27017. n("../enum/GLCubeFaces"),
  27018. n("../enum/DownloadStatus")), m = (n("../util/browser"),
  27019. n("./TileUtils")), v = n("../util/math"), a = (n("events").EventEmitter,
  27020. new t(e),
  27021. Object.freeze({
  27022. None: 0,
  27023. DirectionalFOV: 1
  27024. }));
  27025. h.PriorityCriteria = function(e, t, i, n, r) {
  27026. this.pano = e,
  27027. this.cameraPosition = (new o.Vector3).copy(t),
  27028. this.cameraDir = (new o.Vector3).copy(i),
  27029. this.panoSpaceDir = (new o.Vector3).copy(n),
  27030. this.upcomingPanos = r,
  27031. this.copy = function(e) {
  27032. this.pano = e.pano,
  27033. this.cameraPosition.copy(e.cameraPosition),
  27034. this.cameraDir.copy(e.cameraDir),
  27035. this.panoSpaceDir.copy(e.panoSpaceDir),
  27036. this.upcomingPanos = r
  27037. }
  27038. ,
  27039. this.zoomingActive = !1
  27040. }
  27041. ,
  27042. h.DIRECTIONAL_FOV = 180,
  27043. h.DIRECTIONAL_FOV_NARROW = 120,
  27044. h.MAX_SCORED_PANOS_TOCONSIDER = 6,
  27045. h.MAX_SCORED_PANOS_TOADD = 2,
  27046. h.MAX_UPCOMING_PANOS_TOADD = 3,
  27047. h.DIRECTION_SCORE_STRICTNESS = .75,
  27048. h.appendQueue = function(e, t) {
  27049. if (e && t)
  27050. for (var i = 0; i < t.length; i++)
  27051. e.push(t[i])
  27052. }
  27053. ,
  27054. h.prototype.updateCriteria = function(e, t, i, n) {
  27055. this.priorityCriteria.pano = e,
  27056. this.priorityCriteria.cameraPosition.copy(t),
  27057. this.priorityCriteria.cameraDir.copy(i),
  27058. this.priorityCriteria.upcomingPanos = n,
  27059. this.maxNavQuality = this.qualityManager.getMaxNavPanoSize(),
  27060. this.maxZoomQuality = this.qualityManager.getMaxZoomPanoSize()
  27061. }
  27062. ,
  27063. h.prototype.filterAndPrioritize = (u = [],
  27064. p = [],
  27065. f = [],
  27066. function(e, t, i) {
  27067. this.populateNeighborPanos(this.priorityCriteria.pano, t, u),
  27068. this.populateScoredPanos(this.priorityCriteria.pano, t, p, this.priorityCriteria.cameraDir, h.MAX_SCORED_PANOS_TOCONSIDER);
  27069. var n = this.baseSize
  27070. , r = this.standardSize
  27071. , o = this.highSize
  27072. , a = this.ultraHighSize;
  27073. this.queueTilesForPano(e, i, this.priorityCriteria.pano, n),
  27074. this.priorityCriteria.upcomingPanos && this.queueTilesForPanos(e, this.priorityCriteria.upcomingPanos, i, n, h.MAX_UPCOMING_PANOS_TOADD),
  27075. f.length = 0,
  27076. this.canDownloadSize(r) && this.queueTilesInDirectionForPano(f, i, this.priorityCriteria.pano, r, this.priorityCriteria.cameraPosition, this.priorityCriteria.cameraDir, h.DIRECTIONAL_FOV_NARROW),
  27077. h.sortPanoTiles(f, this.priorityCriteria.pano, this.priorityCriteria.cameraDir),
  27078. h.appendQueue(e, f),
  27079. this.queueTilesForPanos(e, p, i, n, h.MAX_SCORED_PANOS_TOADD),
  27080. f.length = 0,
  27081. this.canDownloadSize(o) && this.queueTilesInDirectionForPano(f, i, this.priorityCriteria.pano, o, this.priorityCriteria.cameraPosition, this.priorityCriteria.cameraDir, h.DIRECTIONAL_FOV_NARROW),
  27082. this.canDownloadSize(a) && this.queueTilesInDirectionForPano(f, i, this.priorityCriteria.pano, a, this.priorityCriteria.cameraPosition, this.priorityCriteria.cameraDir, h.DIRECTIONAL_FOV_NARROW),
  27083. h.sortPanoTiles(f, this.priorityCriteria.pano, this.priorityCriteria.cameraDir),
  27084. h.appendQueue(e, f),
  27085. f.length = 0,
  27086. this.canDownloadSize(r) && this.queueTilesInDirectionForPano(f, i, this.priorityCriteria.pano, r, this.priorityCriteria.cameraPosition, this.priorityCriteria.cameraDir, h.DIRECTIONAL_FOV),
  27087. this.canDownloadSize(o) && this.queueTilesInDirectionForPano(f, i, this.priorityCriteria.pano, o, this.priorityCriteria.cameraPosition, this.priorityCriteria.cameraDir, h.DIRECTIONAL_FOV),
  27088. this.canDownloadSize(a) && this.queueTilesInDirectionForPano(f, i, this.priorityCriteria.pano, a, this.priorityCriteria.cameraPosition, this.priorityCriteria.cameraDir, h.DIRECTIONAL_FOV),
  27089. h.sortPanoTiles(f, this.priorityCriteria.pano, this.priorityCriteria.cameraDir),
  27090. h.appendQueue(e, f),
  27091. this.queueTilesForPanos(e, u, i, n)
  27092. }
  27093. ),
  27094. h.prototype.canDownloadSize = function(e) {
  27095. return this.maxNavQuality >= e || this.maxZoomQuality >= e && this.zoomingActive
  27096. }
  27097. ,
  27098. h.prototype.populateNeighborPanos = function(e, t, i) {
  27099. (i = i || []).length = 0;
  27100. var n = t.getNeighbours(e);
  27101. for (var r in n)
  27102. if (n.hasOwnProperty(r)) {
  27103. var o = t.get(r);
  27104. i.push(o)
  27105. }
  27106. return i
  27107. }
  27108. ,
  27109. h.prototype.populateScoredPanos = function(e, t, i, n, r) {
  27110. (i = i || []).length = 0;
  27111. var o = [g.filters.inPanoDirection(e.position, n, h.DIRECTION_SCORE_STRICTNESS), g.filters.not(e)]
  27112. , a = [g.scoreFunctions.distanceSquared(e), g.scoreFunctions.direction(e.position, n)]
  27113. , s = t.sortByScore(o, a);
  27114. if (s)
  27115. for (var l = 0; l < s.length && l < r; l++) {
  27116. var c = s[l].pano;
  27117. i.push(c)
  27118. }
  27119. return i
  27120. }
  27121. ,
  27122. h.prototype.queueTilesForPanos = function(e, t, i, n, r) {
  27123. for (var o = 0, a = 0; a < t.length; a++) {
  27124. var s = t[a];
  27125. if (o += 0 < this.queueTilesForPano(e, i, s, n) ? 1 : 0,
  27126. r && r <= o)
  27127. break
  27128. }
  27129. return o
  27130. }
  27131. ,
  27132. h.prototype.queueTilesForPano = (r = {
  27133. filter: a.None
  27134. },
  27135. function(e, t, i, n) {
  27136. return this.filterAndQueueTileDownloadDescriptors(e, t, i, n, r)
  27137. }
  27138. ),
  27139. h.prototype.queueTilesForPanosInDirection = (d = new o.Vector3,
  27140. function(e, t, i, n, r, o, a, s) {
  27141. for (var l = 0, c = 0; c < i.length; c++) {
  27142. var h = i[c];
  27143. d.copy(h.position),
  27144. d.sub(r),
  27145. d.normalize();
  27146. var u = Math.max(Math.min(o.dot(d), 1), -1);
  27147. if (v.getFOVDotThreshold(a) <= u && (l += 0 < this.queueTilesInDirectionForPano(e, t, h, n, r, o, a) ? 1 : 0,
  27148. s && s <= l))
  27149. break
  27150. }
  27151. return l
  27152. }
  27153. ),
  27154. h.prototype.queueTilesInDirectionForPanos = function(e, t, i, n, r, o, a, s) {
  27155. for (var l = 0, c = 0; c < i.length; c++) {
  27156. var h = i[c];
  27157. if (l += 0 < this.queueTilesInDirectionForPano(e, t, h, n, o, a) ? 1 : 0,
  27158. s && s <= l)
  27159. break
  27160. }
  27161. return l
  27162. }
  27163. ,
  27164. h.prototype.queueTilesInDirectionForPano = (s = {
  27165. filter: a.DirectionalFOV,
  27166. direction: new o.Vector3,
  27167. fov: 60
  27168. },
  27169. l = new o.Vector3,
  27170. function(e, t, i, n, r, o, a) {
  27171. return l.copy(o),
  27172. m.getRelativeDirection(i.quaternion, l),
  27173. s.direction.copy(l),
  27174. s.fov = a,
  27175. this.filterAndQueueTileDownloadDescriptors(e, t, i, n, s)
  27176. }
  27177. ),
  27178. h.prototype.filterAndQueueTileDownloadDescriptors = (c = [],
  27179. function(e, t, i, n, r) {
  27180. var o = t.getTileDownloadDescriptors(i, n);
  27181. c.length = 0,
  27182. this.filterTileDownloadDescriptors(i, o, c, r);
  27183. for (var a = 0, s = 0; s < c.length; s++) {
  27184. var l = c[s];
  27185. l && (e.push(l),
  27186. a++)
  27187. }
  27188. return a
  27189. }
  27190. ),
  27191. h.prototype.filterTileDownloadDescriptors = (new o.Vector3,
  27192. function(e, t, i, n) {
  27193. var r, o;
  27194. switch (n.filter) {
  27195. case a.DirectionalFOV:
  27196. for (r = 0; r < t.length; r++)
  27197. o = t[r],
  27198. m.isTileWithinFOV(o.panoSize, o.tileSize, o.face, o.tileX, o.tileY, n.direction, n.fov) && i.push(o);
  27199. break;
  27200. default:
  27201. for (r = 0; r < t.length; r++)
  27202. o = t[r],
  27203. i.push(o)
  27204. }
  27205. for (r = 0; r < i.length; r++)
  27206. o = i[r],
  27207. this.canIncludeDescriptor(o) || (i[r] = null)
  27208. }
  27209. ),
  27210. h.prototype.canIncludeDescriptor = function(e) {
  27211. return e.status !== i.Downloading && e.status !== i.Downloaded
  27212. }
  27213. ,
  27214. h.prototype.canIncludePano = function(e, t) {
  27215. return !e.isLoaded(t)
  27216. }
  27217. ,
  27218. h.getFOVDotThreshold = function(e) {
  27219. return Math.cos(o.Math.degToRad(e / 2))
  27220. }
  27221. ;
  27222. var y = (A._panoSpaceDir = new o.Vector3,
  27223. A._fovThreshold = -1,
  27224. A._fovThresholdNarrow = -1,
  27225. A);
  27226. function A(e, t) {
  27227. var i = A._panoSpaceDir
  27228. , n = A._fovThreshold
  27229. , r = A._fovThresholdNarrow
  27230. , o = Math.max(Math.min(i.dot(e.direction), 1), -1)
  27231. , a = Math.max(Math.min(i.dot(t.direction), 1), -1);
  27232. return e._dot = o,
  27233. t._dot = a,
  27234. 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)
  27235. }
  27236. h.sortPanoTiles = function(e, t, i) {
  27237. y._panoSpaceDir.copy(i),
  27238. m.getRelativeDirection(t.quaternion, y._panoSpaceDir),
  27239. y._fovThresholdNarrow = v.getFOVDotThreshold(h.DIRECTIONAL_FOV_NARROW),
  27240. y._fovThreshold = v.getFOVDotThreshold(h.DIRECTIONAL_FOV),
  27241. e.sort(y)
  27242. }
  27243. ,
  27244. h.insertSortedPanoTile = function(e, t, i, n) {
  27245. y._panoSpaceDir.copy(n),
  27246. m.getRelativeDirection(i.quaternion, y._panoSpaceDir),
  27247. y._fovThresholdNarrow = v.getFOVDotThreshold(h.DIRECTIONAL_FOV_NARROW),
  27248. y._fovThreshold = v.getFOVDotThreshold(h.DIRECTIONAL_FOV);
  27249. for (var r = -1, o = 0; o < e.length; o++) {
  27250. if (y(t, e[o]) <= 0) {
  27251. r = o;
  27252. break
  27253. }
  27254. }
  27255. if (-1 === r)
  27256. e[e.length] = t;
  27257. else {
  27258. for (var a = e.length; r < a; a--)
  27259. e[a] = e[a - 1];
  27260. e[r] = t
  27261. }
  27262. }
  27263. ,
  27264. h.prototype.setZoomingActive = function(e) {
  27265. e !== this.zoomingActive && (this.zoomingActive = e)
  27266. }
  27267. ,
  27268. C.exports = h
  27269. }
  27270. ).call(this, "/js/tile/TilePrioritizer.js")
  27271. }
  27272. , {
  27273. "../enum/DownloadStatus": 24,
  27274. "../enum/GLCubeFaces": 25,
  27275. "../enum/ModelManagerEvents": 33,
  27276. "../enum/PanoSizeClass": 36,
  27277. "../enum/Vectors": 50,
  27278. "../enum/Viewmode": 51,
  27279. "../objects/Panorama": 148,
  27280. "../settings": 166,
  27281. "../util/browser": 182,
  27282. "../util/logger": 189,
  27283. "../util/math": 190,
  27284. "./TileUtils": 174,
  27285. events: 202,
  27286. three: 217
  27287. }],
  27288. 173: [function(e, t, i) {
  27289. "use strict";
  27290. function f(e, t) {
  27291. this.levels = t,
  27292. this.tileSize = e,
  27293. this.root = null,
  27294. this.allNodes = [],
  27295. function(e) {
  27296. e.root = function e(t, i, n) {
  27297. if (n > t.levels)
  27298. return null;
  27299. var r = new a(t,i);
  27300. t.allNodes.push(r);
  27301. for (var o = 0; o < s; o++)
  27302. r.children[o] = e(t, r, n + 1);
  27303. return r
  27304. }(e, null, 0)
  27305. }(this)
  27306. }
  27307. function a(e, t) {
  27308. this.tree = e,
  27309. this.parent = t,
  27310. this.children = [],
  27311. this.id = ++n
  27312. }
  27313. var g = (e("three"),
  27314. e("./TileUtils"),
  27315. e("../objects/Panorama"),
  27316. e("../util/panorama"),
  27317. e("events").EventEmitter,
  27318. 2)
  27319. , s = g * g;
  27320. f.TraversalType = Object.freeze({
  27321. PreOrder: 0,
  27322. PostOrder: 1
  27323. });
  27324. var n = 0;
  27325. f.getLevelCountForSize = function(e, t) {
  27326. var i = 0;
  27327. for (t < e && (t = e); !((t /= g) < e); )
  27328. i++;
  27329. return i
  27330. }
  27331. ,
  27332. f.getSizeForLevel = function(e, t) {
  27333. return Math.pow(g, t) * e
  27334. }
  27335. ,
  27336. f.prototype.getSubNode = function(e, t, i) {
  27337. (!t || e < this.tileSize) && (t = 0),
  27338. (!i || e < this.tileSize) && (i = 0),
  27339. e < this.tileSize && (e = this.tileSize);
  27340. var n = f.getLevelCountForSize(this.tileSize, e);
  27341. return function e(t, i, n, r, o) {
  27342. if (!t)
  27343. return null;
  27344. if (0 === n)
  27345. return t;
  27346. if (!t.children || 0 === t.children.length)
  27347. return null;
  27348. var a = Math.pow(g, n) / g
  27349. , s = r % a
  27350. , l = o % a
  27351. , c = Math.floor(o / a)
  27352. , h = Math.floor(r / a)
  27353. , u = c * g + h;
  27354. return e(t.children[u], i + 1, n - 1, s, l)
  27355. }(this.root, 0, n, t, i)
  27356. }
  27357. ,
  27358. f.prototype.breadthFirst = function(e) {
  27359. var t = !!(e = e || {}).nullLevelEnd
  27360. , i = e.maxLevel
  27361. , n = e.minLevel
  27362. , r = e.callback
  27363. , o = e.saveVisited
  27364. , a = []
  27365. , s = {}
  27366. , l = 0;
  27367. for (a.push(this.root),
  27368. a.push(s); 0 < a.length && !(i && i < l); ) {
  27369. var c = a.shift();
  27370. if (c === s)
  27371. (!n || n <= l) && (r && t && r(null),
  27372. o && t && o.push(null)),
  27373. 0 < a.length && a.push(s),
  27374. l++,
  27375. 0;
  27376. else {
  27377. if (c.children)
  27378. for (var h = 0; h < c.children.length; h++) {
  27379. c.children[h] && a.push(c.children[h])
  27380. }
  27381. var u = this.getFaceIndexFromNode(c);
  27382. (!n || n <= l) && (r && r(c, l, u),
  27383. o && o.push(c)),
  27384. 0
  27385. }
  27386. }
  27387. }
  27388. ,
  27389. f.prototype.getFaceIndexFromNode = function(e) {
  27390. if (!e)
  27391. return -1;
  27392. for (var t = 1, i = e, n = 0, r = 0; ; ) {
  27393. var o = i.parent;
  27394. if (!o)
  27395. break;
  27396. for (var a = -1, s = 0; s < o.children.length; s++)
  27397. o.children[s] === i && (a = s);
  27398. n = a % g * t + n,
  27399. r = Math.floor(a / g) * t + r,
  27400. t *= g,
  27401. i = o
  27402. }
  27403. return r * t + n
  27404. }
  27405. ,
  27406. f.prototype.depthFirst = function(e, t, i) {
  27407. !function e(t, i, n, r, o, a, s, l) {
  27408. if (t) {
  27409. s = s || f.TraversalType.PreOrder;
  27410. var c = r * g + n;
  27411. if (s === f.TraversalType.PreOrder && (o && o(t, i, c, n, r),
  27412. a && a.push(t)),
  27413. t.children && 0 !== t.children.length) {
  27414. for (var h = r * g, u = n * g, d = 0; d < g; d++)
  27415. for (var p = 0; p < g; p++)
  27416. e(t.children[p * g + d], i + 1, u + d, h + p, o, a, s, l);
  27417. s === f.TraversalType.PostOrder && (o && o(t, i, c, n, r),
  27418. a && a.push(t))
  27419. }
  27420. }
  27421. }(this.root, 0, 0, 0, e, t, i, this.tileSize)
  27422. }
  27423. ,
  27424. t.exports = f
  27425. }
  27426. , {
  27427. "../objects/Panorama": 148,
  27428. "../util/panorama": 191,
  27429. "./TileUtils": 174,
  27430. events: 202,
  27431. three: 217
  27432. }],
  27433. 174: [function(e, t, i) {
  27434. "use strict";
  27435. var n, a, s, p, f, g, E, l, c, h, u, d, r, o, m = e("../enum/GLCubeFaces"), _ = e("../util/MathLight"), b = {};
  27436. b.TILE_SIZE = 512,
  27437. b.FACES_PER_PANO = 6,
  27438. b.LocationOnTile = {
  27439. Center: 0,
  27440. UpperLeft: 1,
  27441. UpperRight: 2,
  27442. LowerRight: 3,
  27443. LowerLeft: 4
  27444. },
  27445. b.getTileVector = function(e, t, i, n, r, o, a, s) {
  27446. var l = e / t
  27447. , c = t / e * 2
  27448. , h = c / 2
  27449. , u = n / l * 2 - 1 + h
  27450. , d = (r = l - 1 - r) / l * 2 - 1 + h;
  27451. switch (o = o || b.LocationOnTile.Center) {
  27452. case b.LocationOnTile.UpperLeft:
  27453. u -= h,
  27454. d += h,
  27455. u += a * c;
  27456. break;
  27457. case b.LocationOnTile.UpperRight:
  27458. u += h,
  27459. d += h,
  27460. d -= a * c;
  27461. break;
  27462. case b.LocationOnTile.LowerRight:
  27463. u += h,
  27464. d -= h,
  27465. u -= a * c;
  27466. break;
  27467. case b.LocationOnTile.LowerLeft:
  27468. u -= h,
  27469. d -= h,
  27470. d += a * c;
  27471. break;
  27472. case b.LocationOnTile.Center:
  27473. }
  27474. switch (i) {
  27475. case m.GL_TEXTURE_CUBE_MAP_POSITIVE_X:
  27476. _.setVector(s, -1, d, -u);
  27477. break;
  27478. case m.GL_TEXTURE_CUBE_MAP_NEGATIVE_X:
  27479. _.setVector(s, 1, d, u);
  27480. break;
  27481. case m.GL_TEXTURE_CUBE_MAP_POSITIVE_Y:
  27482. _.setVector(s, -u, 1, -d);
  27483. break;
  27484. case m.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y:
  27485. _.setVector(s, -u, -1, d);
  27486. break;
  27487. case m.GL_TEXTURE_CUBE_MAP_POSITIVE_Z:
  27488. _.setVector(s, -u, d, 1);
  27489. break;
  27490. case m.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z:
  27491. _.setVector(s, u, d, -1)
  27492. }
  27493. _.normalize(s)
  27494. }
  27495. ,
  27496. b.getFaceForTile = function(e, t) {
  27497. var i = b.TILE_SIZE;
  27498. e < b.TILE_SIZE && (i = e);
  27499. var n = Math.floor(e / i)
  27500. , r = n * n;
  27501. return Math.floor(t / r)
  27502. }
  27503. ,
  27504. b.getTileLocation = function(e, t, i) {
  27505. var n = b.TILE_SIZE;
  27506. e < b.TILE_SIZE && (n = e);
  27507. var r = b.getFaceForTile(e, t)
  27508. , o = Math.floor(e / n)
  27509. , a = t - r * (o * o);
  27510. i.tileX = a % o,
  27511. i.tileY = Math.floor(a / o),
  27512. i.face = r,
  27513. i.faceTileIndex = a
  27514. }
  27515. ,
  27516. b.getTileCountForSize = function(e) {
  27517. if (e <= b.TILE_SIZE)
  27518. return b.FACES_PER_PANO;
  27519. var t = Math.floor(e / b.TILE_SIZE);
  27520. return t * t * b.FACES_PER_PANO
  27521. }
  27522. ,
  27523. b.getRelativeDirection = (r = new _.Matrix4,
  27524. o = new _.Quaternion,
  27525. function(e, t) {
  27526. o.copy(e),
  27527. o.inverse(),
  27528. r.makeRotationFromQuaternion(o),
  27529. r.applyToVector3(t),
  27530. _.normalize(t)
  27531. }
  27532. ),
  27533. b.matchingTilesInDirection = (c = new _.Vector3,
  27534. h = new _.Vector3(0,0,-1),
  27535. u = new _.Quaternion,
  27536. l = {
  27537. face: -1,
  27538. faceTileIndex: -1,
  27539. tileX: -1,
  27540. tileY: -1
  27541. },
  27542. d = function(e, t, i) {
  27543. for (var n = b.getTileCountForSize(e), r = 0, o = 0; o < n; o++)
  27544. b.getTileLocation(e, o, l),
  27545. t && !t(l) || (r++,
  27546. i && (a = l,
  27547. i.push({
  27548. face: a.face,
  27549. faceTileIndex: a.faceTileIndex,
  27550. tileX: a.tileX,
  27551. tileY: a.tileY
  27552. })));
  27553. var a;
  27554. return r
  27555. }
  27556. ,
  27557. function(e, t, i, n, r, o) {
  27558. var a = t < b.TILE_SIZE ? t : b.TILE_SIZE;
  27559. if (b.getTileCountForSize(t),
  27560. !n && !r)
  27561. return d(t, null, o);
  27562. var s = !!r;
  27563. return r = r || n,
  27564. r = Math.max(0, Math.min(r, 360)),
  27565. n = Math.max(0, Math.min(n, 360)),
  27566. _.copyVector(i, c),
  27567. b.getRelativeDirection(e.quaternion, c),
  27568. s ? (u.setFromUnitVectors(c, h),
  27569. d(t, function(e) {
  27570. return b.isTileWithinFrustum(t, a, e.face, e.tileX, e.tileY, u, n, r)
  27571. }, o)) : d(t, function(e) {
  27572. return b.isTileWithinFOV(t, a, e.face, e.tileX, e.tileY, c, n)
  27573. }, o)
  27574. }
  27575. ),
  27576. b.isTileWithinFrustum = (E = new _.Vector3,
  27577. function(e, t, i, n, r, o, a, s) {
  27578. 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++)
  27579. if (b.getTileVector(e, t, d, n, r, y, 0, E),
  27580. _.applyQuaternionToVector(o, E),
  27581. -1e-5 <= E.z)
  27582. ;
  27583. else {
  27584. var A = -1 / E.z
  27585. , C = E.x * A
  27586. , I = E.y * A;
  27587. l < I ? p++ : I < c && f++,
  27588. h < C ? g++ : C < u && m++,
  27589. v++
  27590. }
  27591. return f !== v && p !== v && g !== v && m !== v
  27592. }
  27593. ),
  27594. b.isTileWithinFOV = (p = new _.Vector3,
  27595. f = new _.Vector3(0,1,0),
  27596. g = new _.Vector3(1,0,0),
  27597. function(e, t, i, n, r, o, a) {
  27598. var s = b.mapFaceToCubemapFace(i);
  27599. if (_.cross(o, f, g),
  27600. b.getTileVector(e, t, s, n, r, b.LocationOnTile.Center, 0, p),
  27601. b.isWithinFOV(p, o, a, null))
  27602. return !0;
  27603. for (var l = a / 360, c = Math.floor(1 / l), h = 0, u = 0; u < c; u++) {
  27604. for (var d = b.LocationOnTile.UpperLeft; d <= b.LocationOnTile.LowerLeft; d++)
  27605. if (b.getTileVector(e, t, s, n, r, d, h, p),
  27606. b.isWithinFOV(p, o, a, null))
  27607. return !0;
  27608. h += l
  27609. }
  27610. return !1
  27611. }
  27612. ),
  27613. b.isWithinFOV = (a = new _.Vector3,
  27614. s = new _.Vector3,
  27615. function(e, t, i, n) {
  27616. if (_.copyVector(e, s),
  27617. n) {
  27618. _.copyVector(n, a),
  27619. _.normalize(a);
  27620. var r = _.dot(a, e);
  27621. a.x *= r,
  27622. a.y *= r,
  27623. a.z *= r,
  27624. _.subVector(s, a)
  27625. }
  27626. var o = i / 2 * _.RADIANS_PER_DEGREE;
  27627. return Math.cos(o) <= _.dot(s, t)
  27628. }
  27629. ),
  27630. b.mapFaceToCubemapFace = (n = {
  27631. 0: m.GL_TEXTURE_CUBE_MAP_POSITIVE_Y,
  27632. 1: m.GL_TEXTURE_CUBE_MAP_POSITIVE_Z,
  27633. 2: m.GL_TEXTURE_CUBE_MAP_POSITIVE_X,
  27634. 3: m.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z,
  27635. 4: m.GL_TEXTURE_CUBE_MAP_NEGATIVE_X,
  27636. 5: m.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y
  27637. },
  27638. function(e) {
  27639. return n[e]
  27640. }
  27641. ),
  27642. t.exports = b
  27643. }
  27644. , {
  27645. "../enum/GLCubeFaces": 25,
  27646. "../util/MathLight": 176
  27647. }],
  27648. 175: [function(i, n, e) {
  27649. (function(e) {
  27650. "use strict";
  27651. function t() {
  27652. this.list = [],
  27653. this.index = {},
  27654. Object.defineProperty(this, "length", {
  27655. get: function() {
  27656. return this.list.length
  27657. }
  27658. })
  27659. }
  27660. new (i("./common"),
  27661. i("./logger"))(e),
  27662. t.prototype.forEach = function(e) {
  27663. this.list.forEach(e)
  27664. }
  27665. ,
  27666. t.prototype.add = function(e) {
  27667. this.list.push(e),
  27668. this.index[this.getIndex(e)] = e
  27669. }
  27670. ,
  27671. t.prototype.getIndex = function(e) {
  27672. throw new Error("IndexedCollection.getIndex not implemented in subclass.")
  27673. }
  27674. ,
  27675. t.prototype.extend = function(e) {
  27676. for (var t = 0; t < e.length; t++)
  27677. this.add(e[t])
  27678. }
  27679. ,
  27680. t.prototype.get = function(e) {
  27681. return this.index[e]
  27682. }
  27683. ,
  27684. t.prototype.first = function() {
  27685. return this.list[0]
  27686. }
  27687. ,
  27688. t.prototype.last = function() {
  27689. return this.list[this.list.length - 1]
  27690. }
  27691. ,
  27692. t.prototype.reIndex = function() {
  27693. this.index = {};
  27694. var t = this;
  27695. this.forEach(function(e) {
  27696. t.index[t.getIndex(e)] = e
  27697. })
  27698. }
  27699. ,
  27700. t.prototype.filter = function(e) {
  27701. var t = this.list.filter(e);
  27702. return this.reIndex(),
  27703. t
  27704. }
  27705. ,
  27706. t.prototype.reduce = function(e, t) {
  27707. return this.list.reduce(e, t)
  27708. }
  27709. ,
  27710. t.prototype.sort = function(e) {
  27711. return this.list.sort(e)
  27712. }
  27713. ,
  27714. t.prototype.indexOf = function(e) {
  27715. for (var t = 0; t < this.list.length; ++t)
  27716. if (this.list[t] === e)
  27717. return t;
  27718. return -1
  27719. }
  27720. ,
  27721. n.exports = t
  27722. }
  27723. ).call(this, "/js/util/IndexedCollection.js")
  27724. }
  27725. , {
  27726. "./common": 185,
  27727. "./logger": 189
  27728. }],
  27729. 176: [function(e, t, i) {
  27730. "use strict";
  27731. e("../constants");
  27732. var n, r, o = {};
  27733. o.RADIANS_PER_DEGREE = Math.PI / 180,
  27734. o.DEGREES_PER_RADIAN = 180 / Math.PI,
  27735. o.Vector3 = function(e, t, i) {
  27736. this.x = e || 0,
  27737. this.y = t || 0,
  27738. this.z = i || 0
  27739. }
  27740. ,
  27741. o.Matrix4 = function() {
  27742. this.elements = new Float32Array([1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1]),
  27743. 0 < arguments.length && console.error("MathLight.Matrix4: the constructor no longer reads arguments. use .set() instead.")
  27744. }
  27745. ,
  27746. o.Matrix4.prototype = {
  27747. identity: function() {
  27748. return this.set(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1),
  27749. this
  27750. },
  27751. copy: function(e) {
  27752. return this.elements.set(e.elements),
  27753. this
  27754. },
  27755. applyToVector3: function(e) {
  27756. var t = e.x
  27757. , i = e.y
  27758. , n = e.z
  27759. , r = this.elements;
  27760. return e.x = r[0] * t + r[4] * i + r[8] * n + r[12],
  27761. e.y = r[1] * t + r[5] * i + r[9] * n + r[13],
  27762. e.z = r[2] * t + r[6] * i + r[10] * n + r[14],
  27763. this
  27764. },
  27765. getInverse: function(e, t) {
  27766. var i = this.elements
  27767. , n = e.elements
  27768. , r = n[0]
  27769. , o = n[1]
  27770. , a = n[2]
  27771. , s = n[3]
  27772. , l = n[4]
  27773. , c = n[5]
  27774. , h = n[6]
  27775. , u = n[7]
  27776. , d = n[8]
  27777. , p = n[9]
  27778. , f = n[10]
  27779. , g = n[11]
  27780. , m = n[12]
  27781. , v = n[13]
  27782. , y = n[14]
  27783. , A = n[15]
  27784. , C = p * y * u - v * f * u + v * h * g - c * y * g - p * h * A + c * f * A
  27785. , I = m * f * u - d * y * u - m * h * g + l * y * g + d * h * A - l * f * A
  27786. , E = d * v * u - m * p * u + m * c * g - l * v * g - d * c * A + l * p * A
  27787. , _ = m * p * h - d * v * h - m * c * f + l * v * f + d * c * y - l * p * y
  27788. , b = r * C + o * I + a * E + s * _;
  27789. if (0 == b) {
  27790. var w = "MathLight.Matrix4.getInverse(): can't invert matrix, determinant is 0";
  27791. if (t)
  27792. throw new Error(w);
  27793. return console.warn(w),
  27794. this.identity()
  27795. }
  27796. var T = 1 / b;
  27797. return i[0] = C * T,
  27798. i[1] = (v * f * s - p * y * s - v * a * g + o * y * g + p * a * A - o * f * A) * T,
  27799. i[2] = (c * y * s - v * h * s + v * a * u - o * y * u - c * a * A + o * h * A) * T,
  27800. i[3] = (p * h * s - c * f * s - p * a * u + o * f * u + c * a * g - o * h * g) * T,
  27801. i[4] = I * T,
  27802. i[5] = (d * y * s - m * f * s + m * a * g - r * y * g - d * a * A + r * f * A) * T,
  27803. i[6] = (m * h * s - l * y * s - m * a * u + r * y * u + l * a * A - r * h * A) * T,
  27804. i[7] = (l * f * s - d * h * s + d * a * u - r * f * u - l * a * g + r * h * g) * T,
  27805. i[8] = E * T,
  27806. i[9] = (m * p * s - d * v * s - m * o * g + r * v * g + d * o * A - r * p * A) * T,
  27807. i[10] = (l * v * s - m * c * s + m * o * u - r * v * u - l * o * A + r * c * A) * T,
  27808. i[11] = (d * c * s - l * p * s - d * o * u + r * p * u + l * o * g - r * c * g) * T,
  27809. i[12] = _ * T,
  27810. i[13] = (d * v * a - m * p * a + m * o * f - r * v * f - d * o * y + r * p * y) * T,
  27811. i[14] = (m * c * a - l * v * a - m * o * h + r * v * h + l * o * y - r * c * y) * T,
  27812. i[15] = (l * p * a - d * c * a + d * o * h - r * p * h - l * o * f + r * c * f) * T,
  27813. this
  27814. },
  27815. makeRotationFromQuaternion: function(e) {
  27816. var t = this.elements
  27817. , i = e.x
  27818. , n = e.y
  27819. , r = e.z
  27820. , o = e.w
  27821. , a = i + i
  27822. , s = n + n
  27823. , l = r + r
  27824. , c = i * a
  27825. , h = i * s
  27826. , u = i * l
  27827. , d = n * s
  27828. , p = n * l
  27829. , f = r * l
  27830. , g = o * a
  27831. , m = o * s
  27832. , v = o * l;
  27833. return t[0] = 1 - (d + f),
  27834. t[4] = h - v,
  27835. t[8] = u + m,
  27836. t[1] = h + v,
  27837. t[5] = 1 - (c + f),
  27838. t[9] = p - g,
  27839. t[2] = u - m,
  27840. t[6] = p + g,
  27841. t[10] = 1 - (c + d),
  27842. t[3] = 0,
  27843. t[7] = 0,
  27844. t[11] = 0,
  27845. t[12] = 0,
  27846. t[13] = 0,
  27847. t[14] = 0,
  27848. t[15] = 1,
  27849. this
  27850. }
  27851. },
  27852. o.Quaternion = function(e, t, i, n) {
  27853. this._x = e || 0,
  27854. this._y = t || 0,
  27855. this._z = i || 0,
  27856. this._w = void 0 !== n ? n : 1
  27857. }
  27858. ,
  27859. o.Quaternion.prototype = {
  27860. get x() {
  27861. return this._x
  27862. },
  27863. set x(e) {
  27864. this._x = e
  27865. },
  27866. get y() {
  27867. return this._y
  27868. },
  27869. set y(e) {
  27870. this._y = e
  27871. },
  27872. get z() {
  27873. return this._z
  27874. },
  27875. set z(e) {
  27876. this._z = e
  27877. },
  27878. get w() {
  27879. return this._w
  27880. },
  27881. set w(e) {
  27882. this._w = e
  27883. },
  27884. copy: function(e) {
  27885. this._x = e.x,
  27886. this._y = e.y,
  27887. this._z = e.z,
  27888. this._w = e.w
  27889. },
  27890. inverse: function() {
  27891. return this.conjugate().normalize()
  27892. },
  27893. conjugate: function() {
  27894. return this._x *= -1,
  27895. this._y *= -1,
  27896. this._z *= -1,
  27897. this
  27898. },
  27899. length: function() {
  27900. return Math.sqrt(this._x * this._x + this._y * this._y + this._z * this._z + this._w * this._w)
  27901. },
  27902. normalize: function() {
  27903. var e = this.length();
  27904. return 0 === e ? (this._x = 0,
  27905. this._y = 0,
  27906. this._z = 0,
  27907. this._w = 1) : (e = 1 / e,
  27908. this._x = this._x * e,
  27909. this._y = this._y * e,
  27910. this._z = this._z * e,
  27911. this._w = this._w * e),
  27912. this
  27913. },
  27914. setFromAxisAngle: function(e, t) {
  27915. var i = t / 2
  27916. , n = Math.sin(i);
  27917. return this._x = e.x * n,
  27918. this._y = e.y * n,
  27919. this._z = e.z * n,
  27920. this._w = Math.cos(i),
  27921. this
  27922. },
  27923. setFromUnitVectors: function(e, t) {
  27924. return void 0 === n && (n = new o.Vector3),
  27925. (r = o.dot(e, t) + 1) < 1e-6 ? (r = 0,
  27926. 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),
  27927. this._x = n.x,
  27928. this._y = n.y,
  27929. this._z = n.z,
  27930. this._w = r,
  27931. this.normalize()
  27932. },
  27933. multiply: function(e) {
  27934. return this.multiplyQuaternions(this, e)
  27935. },
  27936. premultiply: function(e) {
  27937. return this.multiplyQuaternions(e, this)
  27938. },
  27939. multiplyQuaternions: function(e, t) {
  27940. var i = e._x
  27941. , n = e._y
  27942. , r = e._z
  27943. , o = e._w
  27944. , a = t._x
  27945. , s = t._y
  27946. , l = t._z
  27947. , c = t._w;
  27948. return this._x = i * c + o * a + n * l - r * s,
  27949. this._y = n * c + o * s + r * a - i * l,
  27950. this._z = r * c + o * l + i * s - n * a,
  27951. this._w = o * c - i * a - n * s - r * l,
  27952. this
  27953. }
  27954. },
  27955. o.convertWorkshopVector = function(e) {
  27956. return new o.Vector3(-e.x,e.y,e.z)
  27957. }
  27958. ,
  27959. o.convertWorkshopQuaternion = function(e) {
  27960. 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))
  27961. }
  27962. ,
  27963. o.convertWorkshopOrthoZoom = function(e) {
  27964. return -1 === e ? -1 : e * ($("#player").width() / $("#player").height()) / g_snapShotWidth * g_snapShotHeight
  27965. }
  27966. ,
  27967. o.convertWorkshopPanoramaQuaternion = function(e) {
  27968. 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))
  27969. }
  27970. ,
  27971. o.normalize = function(e) {
  27972. var t = e.x * e.x + e.y * e.y + e.z * e.z
  27973. , i = Math.sqrt(t);
  27974. e.x /= i,
  27975. e.y /= i,
  27976. e.z /= i
  27977. }
  27978. ,
  27979. o.dot = function(e, t) {
  27980. return e.x * t.x + e.y * t.y + e.z * t.z
  27981. }
  27982. ,
  27983. o.cross = function(e, t, i) {
  27984. var n = e.x
  27985. , r = e.y
  27986. , o = e.z;
  27987. i.x = r * t.z - o * t.y,
  27988. i.y = o * t.x - n * t.z,
  27989. i.z = n * t.y - r * t.x
  27990. }
  27991. ,
  27992. o.setVector = function(e, t, i, n) {
  27993. e.x = t,
  27994. e.y = i,
  27995. e.z = n
  27996. }
  27997. ,
  27998. o.copyVector = function(e, t) {
  27999. t.x = e.x,
  28000. t.y = e.y,
  28001. t.z = e.z
  28002. }
  28003. ,
  28004. o.addVector = function(e, t) {
  28005. e.x += t.x,
  28006. e.y += t.y,
  28007. e.z += t.z
  28008. }
  28009. ,
  28010. o.subVector = function(e, t) {
  28011. e.x -= t.x,
  28012. e.y -= t.y,
  28013. e.z -= t.z
  28014. }
  28015. ,
  28016. o.applyQuaternionToVector = function(e, t) {
  28017. var i = t.x
  28018. , n = t.y
  28019. , r = t.z
  28020. , o = e.x
  28021. , a = e.y
  28022. , s = e.z
  28023. , l = e.w
  28024. , c = l * i + a * r - s * n
  28025. , h = l * n + s * i - o * r
  28026. , u = l * r + o * n - a * i
  28027. , d = -o * i - a * n - s * r;
  28028. t.x = c * l + d * -o + h * -s - u * -a,
  28029. t.y = h * l + d * -a + u * -o - c * -s,
  28030. t.z = u * l + d * -s + c * -a - h * -o
  28031. }
  28032. ,
  28033. o.angleBetweenVectors = function(e, t) {
  28034. return Math.acos(o.dot(e, t))
  28035. }
  28036. ,
  28037. t.exports = o
  28038. }
  28039. , {
  28040. "../constants": 8
  28041. }],
  28042. 177: [function(c, h, e) {
  28043. (function(e) {
  28044. "use strict";
  28045. function t(e) {
  28046. this.cache = null,
  28047. this.expires = 0
  28048. }
  28049. function i() {
  28050. this.baseUrl = null,
  28051. this.cache = null,
  28052. this.expires = 0
  28053. }
  28054. function n() {
  28055. this.baseUrl = null,
  28056. this.expires = 0
  28057. }
  28058. function r(e) {
  28059. this.initialLoadingPromise = null,
  28060. this.endpoint = e + "?type=3",
  28061. this.urlContainer = null,
  28062. this.authorizationHeader = s.getAuthorizationHeader(),
  28063. this.containerClasses = [n, i, t]
  28064. }
  28065. c("./ajax");
  28066. var o = c("./logger")
  28067. , a = c("../constants")
  28068. , s = c("./showcase")
  28069. , l = (c("../ab"),
  28070. new o(e));
  28071. t.prototype = {
  28072. version: 1,
  28073. validate: function(e) {
  28074. return "catalog.json"in e && 0 < Object.keys(e).length
  28075. },
  28076. update: function(e) {
  28077. return this.cache = e,
  28078. this.expires = Date.now() + a.signedUrlDefaultExpireTime,
  28079. $.when()
  28080. },
  28081. get: function(e) {
  28082. return this.cache[e]
  28083. }
  28084. },
  28085. i.prototype = {
  28086. version: 2,
  28087. validate: function(e) {
  28088. return "catalog.json"in e && "base.url"in e && 1 < Object.keys(e).length
  28089. },
  28090. update: function(e) {
  28091. return this.baseUrl = e["base.url"],
  28092. this.cache = e,
  28093. this.expires = Date.now() + a.signedUrlDefaultExpireTime,
  28094. $.when()
  28095. },
  28096. get: function(e) {
  28097. var t = this.cache[e];
  28098. return t ? this.baseUrl.replace("{{filename}}", e) + t : null
  28099. }
  28100. },
  28101. n.prototype = {
  28102. version: 3,
  28103. validate: function(e) {
  28104. return e.templates && e.catalog_file && (!e.expires || 1e3 * e.expires > Date.now())
  28105. },
  28106. update: function(e) {
  28107. return this.baseUrl = e.templates[0],
  28108. e.expires ? this.expires = 1e3 * e.expires : this.expires = Date.now() + a.signedUrlDefaultExpireTime,
  28109. $.when()
  28110. },
  28111. get: function(e) {
  28112. return this.baseUrl.replace("{{filename}}", e)
  28113. }
  28114. },
  28115. r.prototype = {
  28116. init: function() {
  28117. return this.initialLoadingPromise || (setInterval(function() {
  28118. var e = this.urlContainer ? this.urlContainer.expires : Date.now();
  28119. Date.now() + a.signedUrlRefreshBuffer > e && (l.debug("Refreshing urls..."),
  28120. this.refresh().done(function() {
  28121. l.debug("Refreshed")
  28122. }).fail(function() {
  28123. l.error("Failed url refresh, urls might go stale soon")
  28124. }))
  28125. }
  28126. .bind(this), a.signedUrlCheckInterval),
  28127. this.initialLoadingPromise = this.refresh()),
  28128. this.initialLoadingPromise
  28129. },
  28130. refresh: function(e) {
  28131. return {},
  28132. $.Deferred().resolve()
  28133. },
  28134. get: function(e) {
  28135. return window.DATA.files.templates[0].replace("{{filename}}", e)
  28136. }
  28137. },
  28138. h.exports = r
  28139. }
  28140. ).call(this, "/js/util/ModelUrls.js")
  28141. }
  28142. , {
  28143. "../ab": 3,
  28144. "../constants": 8,
  28145. "./ajax": 181,
  28146. "./logger": 189,
  28147. "./showcase": 193
  28148. }],
  28149. 178: [function(l, c, e) {
  28150. (function(e) {
  28151. "use strict";
  28152. function t() {
  28153. i.call(this),
  28154. this.neighbourMap = {},
  28155. this.map = null
  28156. }
  28157. 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"),
  28158. l("./aStar")), T = new (l("./logger"))(e), i = l("./IndexedCollection"), s = l("./transitions");
  28159. n.inherit(t, i),
  28160. t.prototype.getIndex = function(e) {
  28161. return e.id
  28162. }
  28163. ,
  28164. t.prototype.find = function(e, t) {
  28165. var i = n.filterAll(this.list, e);
  28166. return 0 === i.length ? null : (t && t.forEach(function(e) {
  28167. i = n.stableSort(i, e)
  28168. }),
  28169. i[0])
  28170. }
  28171. ,
  28172. t.prototype.sortByScore = function(e, t) {
  28173. var i = n.filterAll(this.list, e);
  28174. return 0 === i.length ? null : i = i.map(function(i) {
  28175. return {
  28176. pano: i,
  28177. score: t.reduce(function(e, t) {
  28178. return e + t(i)
  28179. }, 0)
  28180. }
  28181. }).sort(function(e, t) {
  28182. return t.score - e.score
  28183. })
  28184. }
  28185. ,
  28186. t.prototype.lowestByScore = function(e, t, i) {
  28187. return this.findRankedByScore(0, e, t, i)
  28188. }
  28189. ,
  28190. t.prototype.findRankedByScore = function(e, t, i, n) {
  28191. n && (n.candidates = null,
  28192. n.pano = null),
  28193. e = e || 0;
  28194. var r = this.sortByScore(t, i);
  28195. return !r || 0 === r.length || e >= r.length ? null : (n && (n.candidates = r,
  28196. n.pano = r[e].pano),
  28197. r[e].pano)
  28198. }
  28199. ,
  28200. t.prototype.showPanoScores = function(e) {
  28201. this.list.forEach(function(e) {
  28202. e.removeTextSprite()
  28203. });
  28204. var t = 6344768;
  28205. e.forEach(function(e) {
  28206. e.pano.addTextSprite(e.score.toFixed(2), t),
  28207. t = 16428055
  28208. })
  28209. }
  28210. ,
  28211. t.prototype.isNeighbour = function(e, t) {
  28212. return this.neighbourMap[e.id][t.id]
  28213. }
  28214. ,
  28215. t.prototype.getNeighbours = function(e) {
  28216. return this.neighbourMap[e.id]
  28217. }
  28218. ,
  28219. t.prototype.setNeighbour = function(e, t, i) {
  28220. return this.neighbourMap[e.id] || (this.neighbourMap[e.id] = {}),
  28221. this.neighbourMap[t.id] || (this.neighbourMap[t.id] = {}),
  28222. this.neighbourMap[e.id][e.id] = !0,
  28223. this.neighbourMap[t.id][t.id] = !0,
  28224. this.neighbourMap[e.id][t.id] = i,
  28225. this.neighbourMap[t.id][e.id] = i,
  28226. this.neighbourMap[e.id]
  28227. }
  28228. ,
  28229. t.prototype.findClosest = function(e, t) {
  28230. var i = [r.filters.isPanoAligned()];
  28231. return t && i.push(r.filters.inDirection(e, t, .75)),
  28232. this.find(i, [r.sortFunctions.distanceToPoint(e)])
  28233. }
  28234. ,
  28235. t.prototype.dualNeighbors = function(e, t) {
  28236. var i, n = [];
  28237. for (i in this.neighbourMap[e.id])
  28238. this.neighbourMap[t.id][i] && n.push(i);
  28239. return n
  28240. }
  28241. ,
  28242. t.prototype.populate_path_graph = function() {
  28243. var e, t, i, n, r, o, a, s, l = Date.now(), c = {}, h = 0, u = new w.Vector3(0,0,0);
  28244. for (e = 0; e < this.list.length; e += 1) {
  28245. for (t in s = !(a = {}),
  28246. i = (r = this.list[e]).neighbourPanos || r.findNeighourPanos())
  28247. if (i[t]) {
  28248. o = this.index[t],
  28249. u.copy(r.floorPosition),
  28250. u.sub(o.floorPosition);
  28251. var d = Math.sqrt(u.x * u.x + u.z * u.z)
  28252. , p = (Math.abs(u.y),
  28253. Math.max(d, .01),
  28254. Math.max(0, Math.abs(u.y) - .2));
  28255. n = 0 < p ? (1,
  28256. p = Math.pow(4 * p, 2),
  28257. d = Math.pow(d, 2),
  28258. Math.sqrt(p * p + d * d)) : (1,
  28259. u.length()),
  28260. a[o.id] = n,
  28261. s = !0
  28262. }
  28263. s ? c[r.id] = a : h += 1
  28264. }
  28265. this.map = c,
  28266. T.info("graph ready in " + (Date.now() - l) + "ms, " + h + " had no neighbors")
  28267. }
  28268. ,
  28269. t.prototype.aStarSearch = function(e, t) {
  28270. var i = Date.now()
  28271. , n = new o({
  28272. start: e,
  28273. isEnd: function(e) {
  28274. return e === t
  28275. },
  28276. neighbor: function(e) {
  28277. var t = e.neighbourPanos || e.findNeighourPanos()
  28278. , i = [];
  28279. for (var n in t)
  28280. t[n] && i.push(this.index[n]); //add: t[n] &&
  28281. return i
  28282. }
  28283. .bind(this),
  28284. distance: function(e, t) {
  28285. return this.map[e.id][t.id]
  28286. }
  28287. .bind(this),
  28288. heuristic: function(e, t) {
  28289. return 1
  28290. }
  28291. .bind(this),
  28292. hash: function(e) {
  28293. return e.id
  28294. },
  28295. timeout: 5e3
  28296. });
  28297. if (T.debug("A* search in " + (Date.now() - i) + "ms"),
  28298. "success" !== n.status)
  28299. return T.debug("Did not find A* path from " + e + " to " + t),
  28300. null;
  28301. T.debug("Total cost " + n.cost.toPrecision(3) + ", " + n.path.length + " steps");
  28302. var r = [];
  28303. return n.path.forEach(function(e) {
  28304. r.push(e.id)
  28305. }),
  28306. r
  28307. }
  28308. ,
  28309. t.prototype.includeNodesNearPath = (f = new w.Vector3,
  28310. g = new w.Vector3,
  28311. m = new w.Vector3,
  28312. v = new w.Vector3,
  28313. y = new w.Vector3,
  28314. A = new w.Vector3,
  28315. C = new w.Vector3,
  28316. I = new w.Vector3,
  28317. E = [],
  28318. _ = new w.Vector3,
  28319. b = new w.Vector3,
  28320. function(e, t) {
  28321. if (e)
  28322. for (var i = function(e, t, i) {
  28323. return y.copy(t).sub(e),
  28324. y.dot(i)
  28325. }, n = function(e, t) {
  28326. return i(_, e.position, m) - i(_, t.position, m)
  28327. }, r = 0; r < e.length - 1; ) {
  28328. var o = e[r]
  28329. , a = e[r + 1]
  28330. , s = this.index[o]
  28331. , l = this.index[a];
  28332. _.copy(s.position),
  28333. b.copy(l.position),
  28334. E.length = 0,
  28335. f.copy(b).sub(_),
  28336. m.copy(f).normalize();
  28337. for (var c = 0; c < this.list.length; c++) {
  28338. var h = this.list[c];
  28339. y.copy(h.position).sub(_);
  28340. var u = y.dot(m);
  28341. 0 < u && (C.copy(m),
  28342. C.multiplyScalar(u),
  28343. A.copy(y),
  28344. A.sub(C),
  28345. A.length() < t && (g.copy(f).negate(),
  28346. v.copy(g).normalize(),
  28347. I.copy(h.position).sub(b),
  28348. 0 < I.dot(v) && E.push(h)))
  28349. }
  28350. if (0 < E.length) {
  28351. E.sort(n);
  28352. for (var d = e.length + E.length - 1; d >= r + E.length; d--)
  28353. e[d] = e[d - E.length];
  28354. for (var p = 0; p < E.length; p++)
  28355. e[p + r + 1] = E[p].id
  28356. }
  28357. r += E.length + 1
  28358. }
  28359. }
  28360. ),
  28361. t.prototype.fadeMarkerOpacity = function(e, t) {
  28362. var i = void 0 === e ? a.panorama.markerOpacity : e
  28363. , n = this.list.findIndex(function(e) {
  28364. return e.marker
  28365. });
  28366. if (!(n < 0)) {
  28367. var r = this.list[n].marker.material.opacity;
  28368. if (r !== e) {
  28369. var o = i - r;
  28370. s.trigger({
  28371. func: function(e, t) {
  28372. var i = r + e * o;
  28373. this.forEach(function(e) {
  28374. e.marker && (e.marker.material.opacity = i)
  28375. })
  28376. }
  28377. .bind(this),
  28378. duration: void 0 === t ? a.markerOpacityTransitionTime : t,
  28379. name: "_fpm"
  28380. })
  28381. }
  28382. }
  28383. }
  28384. ,
  28385. c.exports = t
  28386. }
  28387. ).call(this, "/js/util/PanoramaCollection.js")
  28388. }
  28389. , {
  28390. "../objects/Panorama": 148,
  28391. "../settings": 166,
  28392. "./IndexedCollection": 175,
  28393. "./aStar": 180,
  28394. "./common": 185,
  28395. "./logger": 189,
  28396. "./transitions": 195,
  28397. three: 217
  28398. }],
  28399. 179: [function(e, t, i) {
  28400. "use strict";
  28401. function n() {
  28402. this.actionSequence = [],
  28403. this.actionSequenceInProgress = !1
  28404. }
  28405. function r(e, t, i, n) {
  28406. c.trackAlways("zoom_" + e, {
  28407. from: t,
  28408. to: i,
  28409. pano: n
  28410. })
  28411. }
  28412. var o, a, s, l, c = e("../analytics");
  28413. n.prototype.reset = function(e) {
  28414. this.actionSequenceInProgress = !1,
  28415. this.actionSequence.length = 0
  28416. }
  28417. ,
  28418. n.prototype.addZoomAction = (a = o = null,
  28419. s = !1,
  28420. l = function() {
  28421. if (o = null,
  28422. 0 < this.actionSequence.length) {
  28423. var e = this.actionSequence[0].start
  28424. , t = this.actionSequence[this.actionSequence.length - 1].end;
  28425. 1 === e ? function(e, t) {
  28426. r("initial", 1, e, t)
  28427. }(t, a) : function(e, t, i) {
  28428. r("followup", e, t, i)
  28429. }(e, t, a)
  28430. }
  28431. this.reset()
  28432. }
  28433. ,
  28434. function(e, t, i) {
  28435. if (e !== t) {
  28436. s || (l = l.bind(this),
  28437. s = !0),
  28438. o && (window.clearTimeout(o),
  28439. o = null),
  28440. i === a && this.actionSequenceInProgress || (this.reset(),
  28441. a = i),
  28442. this.actionSequenceInProgress = !0;
  28443. var n = {
  28444. start: e,
  28445. end: t
  28446. };
  28447. this.actionSequence.push(n),
  28448. o = window.setTimeout(l, 150)
  28449. }
  28450. }
  28451. ),
  28452. t.exports = n
  28453. }
  28454. , {
  28455. "../analytics": 4
  28456. }],
  28457. 180: [function(e, t, i) {
  28458. "use strict";
  28459. function g(e) {
  28460. if (void 0 === e.parent)
  28461. return [e.data];
  28462. var t = g(e.parent);
  28463. return t.push(e.data),
  28464. t
  28465. }
  28466. function m(e) {
  28467. return e.toString()
  28468. }
  28469. function v(e, t) {
  28470. return e.f - t.f
  28471. }
  28472. var y = e("Set")
  28473. , A = e("heap")
  28474. , C = e("dict");
  28475. t.exports = function(e) {
  28476. void 0 === e.timeout && (e.timeout = 1 / 0);
  28477. var t = e.hash || m
  28478. , i = {
  28479. data: e.start,
  28480. g: 0,
  28481. h: e.heuristic(e.start)
  28482. }
  28483. , n = i;
  28484. i.f = i.h;
  28485. var r = new y
  28486. , o = new A(v)
  28487. , a = C();
  28488. o.push(i),
  28489. a.set(t(i.data), i);
  28490. for (var s = new Date; o.size(); ) {
  28491. if (new Date - s > e.timeout)
  28492. return {
  28493. status: "timeout",
  28494. cost: n.g,
  28495. path: g(n)
  28496. };
  28497. var l = o.pop();
  28498. if (a.delete(t(l.data)),
  28499. e.isEnd(l.data))
  28500. return {
  28501. status: "success",
  28502. cost: l.g,
  28503. path: g(l)
  28504. };
  28505. r.add(t(l.data));
  28506. for (var c = e.neighbor(l.data), h = 0; h < c.length; h++) {
  28507. var u = c[h];
  28508. if (!r.contains(t(u))) {
  28509. var d = l.g + e.distance(l.data, u)
  28510. , p = a.get(t(u))
  28511. , f = !1;
  28512. if (void 0 === p)
  28513. p = {
  28514. data: u
  28515. },
  28516. a.set(t(u), p);
  28517. else {
  28518. if (p.g < d)
  28519. continue;
  28520. f = !0
  28521. }
  28522. p.parent = l,
  28523. p.g = d,
  28524. p.h = e.heuristic(u),
  28525. p.f = d + p.h,
  28526. p.h < n.h && (n = p),
  28527. f ? o.heapify() : o.push(p)
  28528. }
  28529. }
  28530. }
  28531. return {
  28532. status: "noPath",
  28533. cost: n.g,
  28534. path: g(n)
  28535. }
  28536. }
  28537. }
  28538. , {
  28539. Set: 196,
  28540. dict: 210,
  28541. heap: 211
  28542. }],
  28543. 181: [function(i, n, e) {
  28544. (function(e) {
  28545. "use strict";
  28546. function s(e, t, i) {
  28547. function n() {
  28548. l.warn("Retrying ", t),
  28549. s(e, t, i).done(a.resolve.bind(a)).progress(a.notify.bind(a)).fail(a.reject.bind(a))
  28550. }
  28551. var r = function(e, t, i) {
  28552. var n = new XMLHttpRequest;
  28553. if (i && "withCredentials"in n)
  28554. n.open(e, t, i);
  28555. else if ("undefined" != typeof XDomainRequest)
  28556. (n = new XDomainRequest).open(e, t);
  28557. else {
  28558. if (i)
  28559. throw "Browser does not support CORS!";
  28560. n.open(e, t)
  28561. }
  28562. return n
  28563. }(e, t, !1);
  28564. if ((i = i || {}).retries = void 0 !== i.retries ? i.retries : 0,
  28565. i.retry = void 0 !== i.retry ? i.retry : "get" === e.toLowerCase(),
  28566. i.responseType)
  28567. if (-1 < ["arraybuffer", "text", "json"].indexOf(i.responseType))
  28568. r.responseType = i.responseType;
  28569. else {
  28570. if ("image/jpeg" !== i.responseType)
  28571. throw new Error('reponseType can only be one of "arraybuffer", "text" or "json", "image/jpeg"');
  28572. r.responseType = "arraybuffer"
  28573. }
  28574. if ("json" === i.responseType && r.setRequestHeader("Accept", "application/json"),
  28575. i.auth && r.setRequestHeader("Authorization", i.auth),
  28576. "object" == typeof i.data && (i.data = JSON.stringify(i.data),
  28577. r.setRequestHeader("Content-Type", "application/json")),
  28578. "object" == typeof i.headers)
  28579. for (var o in i.headers)
  28580. r.setRequestHeader(o, i.headers[o]);
  28581. var a = $.Deferred();
  28582. return r.onreadystatechange = function(e) {
  28583. if (4 === this.readyState)
  28584. if (500 <= this.status && this.status <= 600 && i.retry && i.retries < 3)
  28585. i.retries++,
  28586. setTimeout(n, 1e3);
  28587. else if (200 === this.status) {
  28588. var t = function(e, t) {
  28589. var i = e.response;
  28590. if ("json" === t && "object" != typeof i)
  28591. try {
  28592. i = JSON.parse(e.responseText)
  28593. } catch (e) {
  28594. return void a.reject({
  28595. error: "Failed parsing JSON"
  28596. })
  28597. }
  28598. else if ("image/jpeg" === t) {
  28599. var n = new Uint8Array(e.response)
  28600. , r = new Blob([n],{
  28601. type: "image/jpeg"
  28602. })
  28603. , o = URL.createObjectURL(r);
  28604. (i = new Image).src = o,
  28605. i.crossOrigin = "Anonymous",
  28606. i.onload = function() {
  28607. URL.revokeObjectURL(o)
  28608. }
  28609. }
  28610. return i
  28611. }(this, i.responseType);
  28612. a.resolve(t)
  28613. } else
  28614. a.reject(this)
  28615. }
  28616. ,
  28617. r.onprogress = function(e) {
  28618. a.notify(e)
  28619. }
  28620. ,
  28621. r.send(i.data),
  28622. a.promise()
  28623. }
  28624. function o(e, t) {
  28625. var i = e + "__" + (t.responseType || null) + "__" + (t.auth || null) + "__" + (t.prefetchFrom || null);
  28626. return t.headers && function(t) {
  28627. return Object.keys(t).sort().map(function(e) {
  28628. return {
  28629. key: e,
  28630. value: t[e]
  28631. }
  28632. })
  28633. }(t.headers).forEach(function(e) {
  28634. i += "__" + e.key + ":" + e.value
  28635. }),
  28636. i
  28637. }
  28638. var t = i("./logger")
  28639. , a = i("../ab")
  28640. , l = new t(e);
  28641. window.URL = window.URL || window.webkitURL,
  28642. window.MP_REQUEST_CACHE = window.MP_REQUEST_CACHE || {},
  28643. window.DATA = window.DATA || {},
  28644. n.exports = {
  28645. get: function(e, t) {
  28646. var i, n = void 0 === (t = t || {}).cache || t.cache;
  28647. if (n) {
  28648. var r = function(e, t) {
  28649. return window.MP_REQUEST_CACHE ? window.MP_REQUEST_CACHE[o(e, t)] : null
  28650. }(e, t);
  28651. if (r)
  28652. return r
  28653. }
  28654. return i = t.prefetchFrom && window.DATA[t.prefetchFrom] ? $.when(window.DATA[t.prefetchFrom]) : s("GET", e, t),
  28655. n && function(e, t, i) {
  28656. window.MP_REQUEST_CACHE && (window.MP_REQUEST_CACHE[o(e, t)] = i)
  28657. }(e, t, i),
  28658. i
  28659. },
  28660. post: function(e, t) {
  28661. return s("POST", e, t)
  28662. },
  28663. patch: function(e, t) {
  28664. return s("PATCH", e, t)
  28665. },
  28666. getImage: function(e, t) {
  28667. function i() {
  28668. l.warn("Retrying ", e),
  28669. o.getImage(e, t - 1).done(n.resolve.bind(n)).progress(n.notify.bind(n)).fail(n.reject.bind(n))
  28670. }
  28671. var n = $.Deferred()
  28672. , r = new Image
  28673. , o = this;
  28674. return e = a.changeIfImageOptimzing(e),
  28675. null != t || (t = 3),
  28676. r.onerror = function() {
  28677. 0 < t ? setTimeout(i, 1e3) : n.reject()
  28678. }
  28679. ,
  28680. r.onload = function() {
  28681. n.resolve(r)
  28682. }
  28683. ,
  28684. r.crossOrigin = "anonymous",
  28685. r.src = e,
  28686. n
  28687. }
  28688. }
  28689. }
  28690. ).call(this, "/js/util/ajax.js")
  28691. }
  28692. , {
  28693. "../ab": 3,
  28694. "./logger": 189
  28695. }],
  28696. 182: [function(e, t, i) {
  28697. "use strict";
  28698. function n(e, t) {
  28699. var i = window.navigator.userAgent.match(e);
  28700. return i = i ? i[1].split(t) : [],
  28701. {
  28702. major: parseInt(i[0]) || 0,
  28703. minor: parseInt(i[1]) || 0,
  28704. patch: parseInt(i[2]) || 0
  28705. }
  28706. }
  28707. var r = e("../exception/DeviceMismatchException");
  28708. window.browser = t.exports = {
  28709. isFullscreen: function() {
  28710. return document.fullscreenElement || document.mozFullscreenElement || document.mozFullScreenElement || document.webkitFullscreenElement || document.msFullscreenElement
  28711. },
  28712. supportsFullscreen: function() {
  28713. return document.fullscreenEnabled || document.mozFullscreenEnabled || document.mozFullScreenEnabled || document.webkitFullscreenEnabled || document.msFullscreenEnabled
  28714. },
  28715. isPointerLocked: function() {
  28716. return document.pointerLockElement || document.mozPointerLockElement || document.webkitPointerLockElement
  28717. },
  28718. requestFullscreen: function(e, t) {
  28719. e.requestFullscreen ? e.requestFullscreen() : e.mozRequestFullScreen ? e.mozRequestFullScreen() : e.webkitRequestFullscreen ? e.webkitRequestFullscreen(Element.ALLOW_KEYBOARD_INPUT) : e.msRequestFullscreen && e.msRequestFullscreen(),
  28720. t && $(document).on("fullscreenchange webkitfullscreenchange mozfullscreenchange MSFullscreenChange", browser.requestPointerLock)
  28721. },
  28722. requestPointerLock: function() {
  28723. var e;
  28724. if (document.fullscreenElement)
  28725. e = document.fullscreenElement();
  28726. else if (document.mozFullscreenElement)
  28727. e = document.mozFullscreenElement();
  28728. else if (document.mozFullScreenElement)
  28729. e = document.mozFullScreenElement();
  28730. else {
  28731. if (!document.webkitFullscreenElement)
  28732. return;
  28733. e = document.webkitFullscreenElement()
  28734. }
  28735. e.requestPointerLock = e.requestPointerLock || e.mozRequestPointerLock || e.webkitRequestPointerLock,
  28736. e.requestPointerLock(),
  28737. $(document).off("fullscreenchange webkitfullscreenchange mozfullscreenchange MSFullscreenChange", this)
  28738. },
  28739. exitPointerLock: function() {
  28740. document.exitPointerLock = document.exitPointerLock || document.mozExitPointerLock || document.webkitExitPointerLock,
  28741. document.exitPointerLock()
  28742. },
  28743. exitFullscreen: function() {
  28744. document.exitFullscreen ? document.exitFullscreen() : document.msExitFullscreen ? document.msExitFullscreen() : document.mozCancelFullScreen ? document.mozCancelFullScreen() : document.webkitExitFullscreen && document.webkitExitFullscreen()
  28745. },
  28746. details: function() {
  28747. var e = navigator.userAgent.match("(Firefox|Chrome|Safari)/([\\d]+)");
  28748. return e ? {
  28749. name: e[1],
  28750. version: parseInt(e[2]),
  28751. platform: navigator.platform
  28752. } : {}
  28753. },
  28754. is: function(e) {
  28755. return this.details() && this.details().name === e
  28756. },
  28757. inIframe: function() {
  28758. return window.parent !== window
  28759. },
  28760. aspectRatio: function() {
  28761. var e = $("#player").width() / $("#player").height();
  28762. return isFinite(e) ? e : 0
  28763. },
  28764. userAgent: function() {
  28765. return window.navigator.userAgent
  28766. },
  28767. isMobile: function() {
  28768. var e = navigator.userAgent || navigator.vendor || window.opera;
  28769. return /(android|bb\d+|meego).+mobile|android|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od|ad)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i.test(e) || /1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(e.substr(0, 4))
  28770. },
  28771. isLandscape: function() {
  28772. return this.isMobile && 1 < this.aspectRatio()
  28773. },
  28774. isSmallScreen: function() {
  28775. return screen.width / window.devicePixelRatio < 240
  28776. },
  28777. detectIE: function() {
  28778. return -1 !== window.navigator.userAgent.indexOf("MSIE ") || !!navigator.userAgent.match(/Trident.*rv\:11\./)
  28779. },
  28780. detectSafari: function() {
  28781. return -1 !== window.navigator.userAgent.indexOf("Safari") && !this.detectChrome()
  28782. },
  28783. detectFirefox: function() {
  28784. return -1 !== window.navigator.userAgent.indexOf("Firefox")
  28785. },
  28786. detectChrome: function() {
  28787. return -1 !== window.navigator.userAgent.indexOf("Chrome") && !this.detectOpera()
  28788. },
  28789. detectOpera: function() {
  28790. return -1 !== window.navigator.userAgent.indexOf("OPR")
  28791. },
  28792. detectIOS: function() {
  28793. return this.detectIPhone() || this.detectIPad() || this.detectIPod()
  28794. },
  28795. detectIPad: function() {
  28796. var e = window.navigator.userAgent;
  28797. return /iPad/.test(e)
  28798. },
  28799. detectIPod: function() {
  28800. var e = window.navigator.userAgent;
  28801. return /iPod/.test(e)
  28802. },
  28803. detectIPhone: function() {
  28804. var e = window.navigator.userAgent;
  28805. return /iPhone/.test(e)
  28806. },
  28807. detectAndroid: function() {
  28808. return -1 !== window.navigator.userAgent.indexOf("Android")
  28809. },
  28810. detectAndroidMobile: function() {
  28811. var e = window.navigator.userAgent;
  28812. return this.detectAndroid() && -1 !== e.indexOf("Mobile")
  28813. },
  28814. detectSamsungNative: function() {
  28815. var e = window.navigator.userAgent;
  28816. return -1 !== e.indexOf("SM-G900H") || -1 !== e.indexOf("GT-I9500") || -1 !== e.indexOf("SM-N900")
  28817. },
  28818. detectSamsungS6: function() {
  28819. return -1 !== window.navigator.userAgent.indexOf("SM-G92")
  28820. },
  28821. detectHUAWEI5X: function() {
  28822. return -1 !== window.navigator.userAgent.indexOf("KIW-TL00H")
  28823. },
  28824. detectWebVR: function() {
  28825. return !(!window.navigator.getVRDisplays || !window.VRDisplay)
  28826. },
  28827. getVRDisplay: function() {
  28828. var t = $.Deferred();
  28829. return this.detectWebVR() ? (navigator.getVRDisplays().then(function(e) {
  28830. 1 <= e.length && t.resolve(e[0]),
  28831. t.reject(null)
  28832. }),
  28833. t) : t.reject(null)
  28834. },
  28835. iosVersion: function() {
  28836. if (!this.detectIOS())
  28837. throw new r("Did not detect an iDevice");
  28838. return n(/((?:\d+\_?){1,3}) like Mac OS/, "_")
  28839. },
  28840. androidVersion: function() {
  28841. if (!this.detectAndroid())
  28842. throw new r("Did not detect an Android based device");
  28843. return n(/Android ((?:\d+\.?){1,3})/, ".")
  28844. },
  28845. valueFromCookie: function(e, t) {
  28846. var i = new RegExp(e + "=([0-9a-f]+)(; ?|$)").exec(document.cookie);
  28847. if (!i)
  28848. return t;
  28849. var n = i[1];
  28850. return "boolean" == typeof t ? "true" === n || "1" === n : "number" == typeof t ? parseFloat(n) : n
  28851. },
  28852. valueFromHash: function(e, t) {
  28853. var i = new RegExp("[#&?]" + e + "=([^#&?]*)").exec(window.location.href);
  28854. if (!i)
  28855. return t;
  28856. var n = i[1];
  28857. return "boolean" == typeof t ? "true" === n || "1" === n : "number" == typeof t ? parseFloat(n) : window.decodeURIComponent(n)
  28858. }
  28859. }
  28860. }
  28861. , {
  28862. "../exception/DeviceMismatchException": 56
  28863. }],
  28864. 183: [function(i, n, e) {
  28865. (function(e) {
  28866. "use strict";
  28867. var o = i("../controls/serializer")
  28868. , a = i("../util/math")
  28869. , s = i("./browser")
  28870. , l = i("../enum/Viewmode")
  28871. , t = i("../util/logger")
  28872. , c = i("three")
  28873. , h = new t(e);
  28874. n.exports = {
  28875. getStartCameraOptions: function(e, t) {
  28876. var i = function(e) {
  28877. var t = s.valueFromHash("start", "")
  28878. , i = {};
  28879. if ("" !== t) {
  28880. h.debug("Start override found in parameters, trying to parse..."),
  28881. i = function(e) {
  28882. return o.deserialize(e)
  28883. }(t) || {};
  28884. var n = s.valueFromHash("tag", null);
  28885. n && (i.tag = n),
  28886. i.panoId && (i.pano = e.get(i.panoId))
  28887. }
  28888. return i
  28889. }(t);
  28890. if (0 < Object.keys(i).length)
  28891. return i;
  28892. if (e.heroImage)
  28893. i = function(e, t) {
  28894. if (!e.heroImage || !e.heroImage.metadata.camera_position)
  28895. return {};
  28896. var i = {}
  28897. , n = e.heroImage.metadata;
  28898. h.debug("Using start position from thumbnail image"),
  28899. i.position = n.camera_position,
  28900. i.quaternion = n.camera_quaternion;
  28901. try {
  28902. i.mode = l.convertWorkshopModeInt(n.camera_mode),
  28903. i.mode === l.PANORAMA ? i.pano = t.get(n.scan_id) : i.floorVisibility = n.floor_visibility
  28904. } catch (e) {
  28905. h.debug(e.message)
  28906. }
  28907. return i
  28908. }(e, t);
  28909. else if (window.DATA.camera_start) {
  28910. var n = window.DATA.camera_start;
  28911. try {
  28912. 0 < Object.keys(n).length && !a.isEmptyQuaternion(n.camera.quaternion) && (i.mode = l.convertWorkshopModeInt(n.mode),
  28913. i.position = (new c.Vector3).fromArray(n.camera.position),
  28914. i.quaternion = (new c.Quaternion).fromArray(n.camera.quaternion),
  28915. i.zoom = a.convertWorkshopOrthoZoom(n.camera.zoom),
  28916. n.pano && (i.pano = t.get(n.pano.uuid) || t.findClosest(i.position),
  28917. h.debug("Using camera_start"),
  28918. h.debug("Modeldata pano: ", i.pano.quaternion),
  28919. h.debug("Camera start pano: ", n.pano.quaternion)),
  28920. i.mode !== l.PANORAMA && (i.floorVisibility = e.heroImage.metadata.floor_visibility));
  28921. } catch (e) {
  28922. h.warn(e.message)
  28923. if(i.mode == "panorama" && !i.pano){
  28924. i.pano = t.list[0]
  28925. }
  28926. }
  28927. }
  28928. if (e.outsideAllowed() || i.mode === l.PANORAMA || (i = {}),
  28929. i.mode === l.MESH && i.position && (i.mode = l.PANORAMA,
  28930. i.pano = t.findClosest(i.position) ,
  28931. i.quaternion = i.pano.quaternion),
  28932. 0 === Object.keys(i).length) {
  28933. var r = t.list[0];
  28934. r && (i.mode = l.PANORAMA,
  28935. i.pano = r,
  28936. i.position = r.position,
  28937. i.quaternion = r.quaternion,
  28938. h.info("Starting at 1st pano " + r.id))
  28939. }
  28940. return i.mode = i.mode || l.DOLLHOUSE,
  28941. i
  28942. }
  28943. }
  28944. }
  28945. ).call(this, "/js/util/camera.js")
  28946. }
  28947. , {
  28948. "../controls/serializer": 14,
  28949. "../enum/Viewmode": 51,
  28950. "../util/logger": 189,
  28951. "../util/math": 190,
  28952. "./browser": 182,
  28953. three: 217
  28954. }],
  28955. 184: [function(e, t, i) {
  28956. "use strict";
  28957. function r(e, t, i) {
  28958. var n = t
  28959. , r = i;
  28960. return 2 * Math.atan(Math.tan(e * a.RADIANS_PER_DEGREE / 2) * (n / r)) * a.DEGREES_PER_RADIAN
  28961. }
  28962. function o(e, t, i) {
  28963. var n = t
  28964. , r = i;
  28965. return 2 * Math.atan(Math.tan(e * a.RADIANS_PER_DEGREE / 2) * (r / n)) * a.DEGREES_PER_RADIAN
  28966. }
  28967. var a = e("./MathLight");
  28968. t.exports = {
  28969. clampVFOV: function(e, t, i, n) {
  28970. return t < r(e, i, n) ? o(t, i, n) : e
  28971. },
  28972. getHFOVForCamera: function(e, t, i) {
  28973. return r(e.fov, t, i)
  28974. },
  28975. getHFOVFromVFOV: r,
  28976. getVFOVFromHFOV: o
  28977. }
  28978. window.MathLight = t.exports
  28979. MathLight.closeTo = function(e1,e2, precision){//xzw add 判断e1,e2是否接近
  28980. var prec = Math.pow(10, - (precision || 4));
  28981. var s1 = Math.abs(e1.x - e2.x) < prec && Math.abs(e1.y - e2.y) < prec && Math.abs(e1.z - e2.z) < prec
  28982. if(e1.w){
  28983. return s1 && Math.abs(e1.w - e2.w) < prec
  28984. }else return s1
  28985. }
  28986. }
  28987. , {
  28988. "./MathLight": 176
  28989. }],
  28990. 185: [function(e, t, i) {
  28991. "use strict";
  28992. var a = e("three");
  28993. t.exports = {
  28994. delayOneFrame: function(e) {
  28995. window.setTimeout(e, 1)
  28996. },
  28997. normalizeUrl: function(e) {
  28998. return e.replace("https://", "http://")
  28999. },
  29000. domainFromUrl: function(e) {
  29001. var t = /^([^:]*:\/\/)?(www\.)?([^\/]+)/.exec(e);
  29002. return t ? t[3] : e
  29003. },
  29004. average: function(e, t) {
  29005. if (0 === e.length)
  29006. return null;
  29007. for (var i = 0, n = 0, r = 0; r < e.length; r++) {
  29008. i += t ? e[r][t] : e[r],
  29009. n++
  29010. }
  29011. return i / n
  29012. },
  29013. countUnique: function(e) {
  29014. for (var t = {}, i = 0; i < e.length; i++)
  29015. t[e[i]] = 1 + (t[e[i]] || 0);
  29016. return Object.keys(t).length
  29017. },
  29018. averageVectors: function(e, t) {
  29019. var i = new a.Vector3;
  29020. if (0 === e.length)
  29021. return i;
  29022. for (var n = 0, r = 0; r < e.length; r++) {
  29023. var o = t ? e[r][t] : e[r];
  29024. i.add(o),
  29025. n++
  29026. }
  29027. return i.divideScalar(n)
  29028. },
  29029. equalLists: function(e, t) {
  29030. if (e.length !== t.length)
  29031. return !1;
  29032. for (var i = 0; i < e.length; i++)
  29033. if (e[i] !== t[i])
  29034. return !1;
  29035. return !0
  29036. },
  29037. lowerMedian: function(e, t) {
  29038. return 0 === e.length ? null : (t = t || 2,
  29039. e.sort(function(e, t) {
  29040. return e - t
  29041. }),
  29042. e[Math.floor(e.length / t)])
  29043. },
  29044. stableSort: function(e, n) {
  29045. return e.map(function(e, t) {
  29046. return {
  29047. value: e,
  29048. index: t
  29049. }
  29050. }).sort(function(e, t) {
  29051. var i = n(e.value, t.value);
  29052. return 0 !== i ? i : e.index - t.index
  29053. }).map(function(e) {
  29054. return e.value
  29055. })
  29056. },
  29057. filterAll: function(e, i) {
  29058. return e.filter(function(t) {
  29059. return i.every(function(e) {
  29060. return e(t)
  29061. })
  29062. })
  29063. },
  29064. formatDate: function(e) {
  29065. return [e.getFullYear(), e.getMonth() + 1, e.getDate()].join("-")
  29066. },
  29067. formatDatetime: function(e) {
  29068. return [e.getFullYear(), e.getMonth() + 1, e.getDate(), e.getHours(), e.getMinutes()].join("-")
  29069. },
  29070. randomString: function(e) {
  29071. for (var t = "", i = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789", n = 0; n < e; n++)
  29072. t += i.charAt(Math.floor(Math.random() * i.length));
  29073. return t
  29074. },
  29075. uint8ToBase64: function(e, t) {
  29076. t && "number" == typeof t || (t = 8192);
  29077. for (var i = [], n = 0; n < e.length; n += t)
  29078. i.push(String.fromCharCode.apply(null, e.subarray(n, n + t)));
  29079. return btoa(i.join(""))
  29080. },
  29081. uuid4: function e(t) {
  29082. return t ? (t ^ 16 * Math.random() >> t / 4).toString(16) : ([1e7] + -1e3 + -4e3 + -8e3 + -1e11).replace(/[018]/g, e)
  29083. },
  29084. nth: function(e) {
  29085. return 1 === (e %= 10) ? e + "st" : 2 === e ? e + "nd" : 3 === e ? e + "rd" : e + "th"
  29086. },
  29087. extendObject: function(t, i) {
  29088. return Object.keys(i).forEach(function(e) {
  29089. t[e] = i[e]
  29090. }),
  29091. t
  29092. },
  29093. deepExtend: function e(t) {
  29094. t = t || {};
  29095. for (var i = 1; i < arguments.length; i++) {
  29096. var n = arguments[i];
  29097. if (n)
  29098. for (var r in n)
  29099. n.hasOwnProperty(r) && ("object" == typeof n[r] ? t[r] = e(t[r], n[r]) : t[r] = n[r])
  29100. }
  29101. return t
  29102. },
  29103. inherit: function(e, t) {
  29104. e.prototype = Object.create(t.prototype),
  29105. e.prototype.constructor = e
  29106. },
  29107. extend: function(e, t) {
  29108. for (var i in t.prototype)
  29109. e.prototype[i] = t.prototype[i]
  29110. },
  29111. getVisiblePano : function(positions = [], panos, options={}){//add
  29112. var visiblePanos = [];
  29113. options.posAtPanos = options.posAtPanos || {}//在不同漫游点的positions
  29114. panos.forEach((pano)=>{
  29115. if(!pano.isAligned())return;
  29116. var A = pano.position.clone();
  29117. var posB = options.posAtPanos[pano.id] || positions;
  29118. var posLength = posB.length
  29119. for(let i=0;i<posLength;i++){
  29120. var B = posB[i];
  29121. var ray = new THREE.Raycaster(A.clone(), B.clone().sub(A).normalize(), 0, A.distanceTo(B) - (options.tolerance||0) )
  29122. var o = ray.intersectObjects(options.model || player.model.colliders, true);
  29123. if (!o || !o.length){ //只要有一点可见,就算整体可见
  29124. visiblePanos.push(pano.id);
  29125. break;
  29126. }
  29127. }
  29128. })
  29129. return visiblePanos
  29130. }
  29131. ,
  29132. sortByScore : function(list, request, rank) {
  29133. var i = this.filterAll(list, request);
  29134. return 0 === i.length ? null : i = i.map(function(e) {
  29135. return {
  29136. item: e,
  29137. score: rank.reduce(function(t, i) {
  29138. return t + i(e);
  29139. }, 0)
  29140. };
  29141. }).sort(function(e, t) {
  29142. return t.score - e.score;
  29143. });
  29144. }
  29145. },
  29146. Math.sign = function(e) {
  29147. return e < 0 ? -1 : 1
  29148. }
  29149. window.common = t.exports
  29150. }
  29151. , {
  29152. three: 217
  29153. }],
  29154. 186: [function(e, t, i) {
  29155. "use strict";
  29156. var r = {
  29157. linearTween: function(e, t, i, n) {
  29158. return i * e / n + t
  29159. },
  29160. easeInQuad: function(e, t, i, n) {
  29161. return i * (e /= n) * e + t
  29162. },
  29163. easeOutQuad: function(e, t, i, n) {
  29164. return -i * (e /= n) * (e - 2) + t
  29165. },
  29166. easeInOutQuad: function(e, t, i, n) {
  29167. return (e /= n / 2) < 1 ? i / 2 * e * e + t : -i / 2 * (--e * (e - 2) - 1) + t
  29168. },
  29169. easeInCubic: function(e, t, i, n) {
  29170. return i * (e /= n) * e * e + t
  29171. },
  29172. easeOutCubic: function(e, t, i, n) {
  29173. return e /= n,
  29174. i * (--e * e * e + 1) + t
  29175. },
  29176. easeInOutCubic: function(e, t, i, n) {
  29177. return (e /= n / 2) < 1 ? i / 2 * e * e * e + t : i / 2 * ((e -= 2) * e * e + 2) + t
  29178. },
  29179. easeInQuart: function(e, t, i, n) {
  29180. return i * (e /= n) * e * e * e + t
  29181. },
  29182. easeOutQuart: function(e, t, i, n) {
  29183. return e /= n,
  29184. -i * (--e * e * e * e - 1) + t
  29185. },
  29186. easeInOutQuart: function(e, t, i, n) {
  29187. return (e /= n / 2) < 1 ? i / 2 * e * e * e * e + t : -i / 2 * ((e -= 2) * e * e * e - 2) + t
  29188. },
  29189. easeInQuint: function(e, t, i, n) {
  29190. return i * (e /= n) * e * e * e * e + t
  29191. },
  29192. easeOutQuint: function(e, t, i, n) {
  29193. return e /= n,
  29194. i * (--e * e * e * e * e + 1) + t
  29195. },
  29196. easeInOutQuint: function(e, t, i, n) {
  29197. return (e /= n / 2) < 1 ? i / 2 * e * e * e * e * e + t : i / 2 * ((e -= 2) * e * e * e * e + 2) + t
  29198. },
  29199. easeInSine: function(e, t, i, n) {
  29200. return -i * Math.cos(e / n * (Math.PI / 2)) + i + t
  29201. },
  29202. easeOutSine: function(e, t, i, n) {
  29203. return i * Math.sin(e / n * (Math.PI / 2)) + t
  29204. },
  29205. easeInOutSine: function(e, t, i, n) {
  29206. return -i / 2 * (Math.cos(Math.PI * e / n) - 1) + t
  29207. },
  29208. easeInExpo: function(e, t, i, n) {
  29209. return i * Math.pow(2, 10 * (e / n - 1)) + t
  29210. },
  29211. easeOutExpo: function(e, t, i, n) {
  29212. return i * (1 - Math.pow(2, -10 * e / n)) + t
  29213. },
  29214. easeInOutExpo: function(e, t, i, n) {
  29215. return (e /= n / 2) < 1 ? i / 2 * Math.pow(2, 10 * (e - 1)) + t : (e--,
  29216. i / 2 * (2 - Math.pow(2, -10 * e)) + t)
  29217. },
  29218. easeInCirc: function(e, t, i, n) {
  29219. return e /= n,
  29220. -i * (Math.sqrt(1 - e * e) - 1) + t
  29221. },
  29222. easeOutCirc: function(e, t, i, n) {
  29223. return e /= n,
  29224. e--,
  29225. i * Math.sqrt(1 - e * e) + t
  29226. },
  29227. easeInOutCirc: function(e, t, i, n) {
  29228. return (e /= n / 2) < 1 ? -i / 2 * (Math.sqrt(1 - e * e) - 1) + t : (e -= 2,
  29229. i / 2 * (Math.sqrt(1 - e * e) + 1) + t)
  29230. },
  29231. easeInElastic: function(e, t, i, n) {
  29232. var r = 1.70158
  29233. , o = 0
  29234. , a = i;
  29235. return 0 === e ? t : 1 == (e /= n) ? t + i : (o = o || .3 * n,
  29236. r = a < Math.abs(i) ? (a = i,
  29237. o / 4) : o / (2 * Math.PI) * Math.asin(i / a),
  29238. -a * Math.pow(2, 10 * (e -= 1)) * Math.sin((e * n - r) * (2 * Math.PI) / o) + t)
  29239. },
  29240. easeOutElastic: function(e, t, i, n) {
  29241. var r = 1.70158
  29242. , o = 0
  29243. , a = i;
  29244. return 0 === e ? t : 1 == (e /= n) ? t + i : (o = o || .3 * n,
  29245. r = a < Math.abs(i) ? (a = i,
  29246. o / 4) : o / (2 * Math.PI) * Math.asin(i / a),
  29247. a * Math.pow(2, -10 * e) * Math.sin((e * n - r) * (2 * Math.PI) / o) + i + t)
  29248. },
  29249. easeInOutElastic: function(e, t, i, n) {
  29250. var r = 1.70158
  29251. , o = 0
  29252. , a = i;
  29253. return 0 === e ? t : 2 == (e /= n / 2) ? t + i : (o = o || n * (.3 * 1.5),
  29254. r = a < Math.abs(i) ? (a = i,
  29255. o / 4) : o / (2 * Math.PI) * Math.asin(i / a),
  29256. 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)
  29257. },
  29258. easeInBack: function(e, t, i, n, r) {
  29259. return void 0 === r && (r = 1.70158),
  29260. i * (e /= n) * e * ((r + 1) * e - r) + t
  29261. },
  29262. easeOutBack: function(e, t, i, n, r) {
  29263. return void 0 === r && (r = 1.70158),
  29264. i * ((e = e / n - 1) * e * ((r + 1) * e + r) + 1) + t
  29265. },
  29266. easeInOutBack: function(e, t, i, n, r) {
  29267. return void 0 === r && (r = 1.70158),
  29268. (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
  29269. },
  29270. easeOutBounce: function(e, t, i, n) {
  29271. 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
  29272. },
  29273. easeInBounce: function(e, t, i, n) {
  29274. return i - r.easeOutBounce(n - e, 0, i, n) + t
  29275. },
  29276. easeInOutBounce: function(e, t, i, n) {
  29277. 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
  29278. }
  29279. };
  29280. window.easing = t.exports = r
  29281. }
  29282. , {}],
  29283. 187: [function(e, t, i) {
  29284. "use strict";
  29285. function n() {
  29286. this.events = [],
  29287. this.valid = !1
  29288. }
  29289. var r = e("../enum/Joystick");
  29290. n.prototype.push = function(e, t) {
  29291. this.events.push({
  29292. direction: e,
  29293. pano: t
  29294. }),
  29295. this.valid = !0
  29296. }
  29297. ,
  29298. n.prototype.pop = function(e) {
  29299. var t = this.events.pop();
  29300. return this.events.length < 1 && (this.valid = !1),
  29301. t
  29302. }
  29303. ,
  29304. n.prototype.peek = function() {
  29305. return this.events.length ? this.events[this.events.length - 1] : {
  29306. direction: null,
  29307. pano: null
  29308. }
  29309. }
  29310. ,
  29311. n.prototype.invalidate = function() {
  29312. this.events = [],
  29313. this.valid = !1
  29314. }
  29315. ,
  29316. n.prototype.reversePano = function(e) {
  29317. if (!this.valid)
  29318. return null;
  29319. var t = this.peek();
  29320. return r.opposite(e) === t.direction ? (this.pop(),
  29321. t.pano) : null
  29322. }
  29323. ,
  29324. t.exports = n
  29325. }
  29326. , {
  29327. "../enum/Joystick": 29
  29328. }],
  29329. 188: [function(e, t, i) {
  29330. "use strict";
  29331. t.exports = {
  29332. vector: function(t, i) {
  29333. var n = t.clone();
  29334. return i = i.clone(),
  29335. function(e) {
  29336. t.set(n.x * (1 - e) + i.x * e, n.y * (1 - e) + i.y * e, n.z * (1 - e) + i.z * e)
  29337. }
  29338. },
  29339. quaternion: function(t, i) {
  29340. var n = t.clone();
  29341. return function(e) {
  29342. t.copy(n).slerp(i, e)
  29343. }
  29344. },
  29345. property: function(t, i, n, r) {
  29346. var o = t[i];
  29347. return function(e) {
  29348. t[i] = o * (1 - e) + n * e,
  29349. r && r(t[i])
  29350. }
  29351. },
  29352. uniform: function(t, i, n) {
  29353. var r = t.material.uniforms[i].value;
  29354. return function(e) {
  29355. t.material.uniforms[i] && (t.material.uniforms[i].value = r * (1 - e) + n * e)
  29356. }
  29357. },
  29358. matrix4: function(o, a) {
  29359. var s = o.clone();
  29360. return function(e) {
  29361. for (var t = o.elements, i = s.elements, n = a.elements, r = 0; r < 16; r++)
  29362. t[r] = i[r] * (1 - e) + n[r] * e
  29363. }
  29364. },
  29365. allUniforms: function(e, t, i) {
  29366. var n = e.map(function(e) {
  29367. return this.uniform(e, t, i)
  29368. }
  29369. .bind(this));
  29370. return function(t) {
  29371. n.forEach(function(e) {
  29372. e(t)
  29373. })
  29374. }
  29375. }
  29376. }
  29377. }
  29378. , {}],
  29379. 189: [function(e, t, i) {
  29380. "use strict";
  29381. function h(n) {
  29382. var e, t, i, r, o = n.split("/"), a = "[" + o[o.length - 1].replace(".js", "") + "]", s = {};
  29383. if (h.consoleEnabled) {
  29384. var l = function(e) {
  29385. $("#debug-console").append("<p>" + e + "</p>"),
  29386. $("#debug-console")[0].scrollTop = $("#debug-console")[0].scrollHeight
  29387. };
  29388. e = function(e) {
  29389. l(Array.prototype.slice.call(arguments).join(" "))
  29390. }
  29391. ,
  29392. t = function(e) {
  29393. l(Array.prototype.slice.call(arguments).join(" "))
  29394. }
  29395. ,
  29396. i = function(e) {
  29397. l("WARN: " + Array.prototype.slice.call(arguments).join(" "))
  29398. }
  29399. ,
  29400. r = function(e) {
  29401. l("ERROR: " + Array.prototype.slice.call(arguments).join(" "))
  29402. }
  29403. } else
  29404. console.log ? (e = console.log,
  29405. t = console.info ? console.info : console.log,
  29406. i = console.warn ? console.warn : console.log,
  29407. r = console.error ? console.error : console.log) : e = t = i = r = function() {}
  29408. ;
  29409. function c(e) {
  29410. return [a, h.timestamp()].concat(Array.prototype.slice.call(e))
  29411. }
  29412. return {
  29413. debug: function() {
  29414. h.level >= h.levels.debug && e.apply(console, c(arguments))
  29415. },
  29416. info: function() {
  29417. h.level >= h.levels.info && t.apply(console, c(arguments))
  29418. },
  29419. warn: function() {
  29420. (function(e, t) {
  29421. if (u) {
  29422. var i = Array.prototype.slice.call(e).join(" ");
  29423. u.captureMessage(i, {
  29424. level: t,
  29425. path: n,
  29426. timestamp: h.timestamp()
  29427. })
  29428. }
  29429. }
  29430. )(arguments, "warn"),
  29431. h.level >= h.levels.warn && i.apply(console, c(arguments))
  29432. },
  29433. error: function() {
  29434. (function(e, t) {
  29435. if (u) {
  29436. var i = Array.prototype.slice.call(e).join(" ");
  29437. u.captureException(new Error(i), {
  29438. level: t,
  29439. path: n,
  29440. timestamp: h.timestamp()
  29441. })
  29442. }
  29443. }
  29444. )(arguments, "error"),
  29445. h.level >= h.levels.error && r.apply(console, c(arguments))
  29446. },
  29447. v3str: function(e, t) {
  29448. var i = void 0 === t ? 2 : t;
  29449. return "(" + e.x.toPrecision(i) + ", " + e.y.toPrecision(i) + ", " + e.z.toPrecision(i) + ")"
  29450. },
  29451. eulstr: function(e, t) {
  29452. var i = void 0 === t ? 2 : t;
  29453. return "(" + THREE.Math.radToDeg(e.x).toPrecision(i) + ", " + THREE.Math.radToDeg(e.y).toPrecision(i) + ", " + THREE.Math.radToDeg(e.z).toPrecision(i) + ' "' + e.order + '")'
  29454. },
  29455. time: function(e) {
  29456. h.level >= h.levels.debug && (s[e] = Date.now())
  29457. },
  29458. timeEnd: function(e) {
  29459. if (h.level >= h.levels.debug) {
  29460. var t = s[e];
  29461. if (!t)
  29462. return;
  29463. var i = (Date.now() - t) / 1e3;
  29464. this.debug(e, i + "s")
  29465. }
  29466. }
  29467. }
  29468. }
  29469. var u = window.Raven;
  29470. h.timestamp = function() {
  29471. return (Date.now() - window.navigationStart) / 1e3 + "s"
  29472. }
  29473. ,
  29474. h.level = (h.levels = {
  29475. debug: 3,
  29476. info: 2,
  29477. warn: 1,
  29478. error: 0
  29479. }).info,
  29480. t.exports = h
  29481. }
  29482. , {}],
  29483. 190: [function(e, t, i) {
  29484. "use strict";
  29485. var o = e("three")
  29486. , r = e("../enum/GLCubeFaces");
  29487. e("../constants");
  29488. t.exports = {
  29489. convertVisionVector: function(e) {
  29490. return new o.Vector3(e.x,e.z,-e.y)
  29491. },
  29492. convertVisionQuaternion: function(e) {
  29493. 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)))
  29494. },
  29495. convertWorkshopVector: function(e) {
  29496. return new o.Vector3(-e.x,e.y,e.z)
  29497. },
  29498. convertWorkshopQuaternion: function(e) {
  29499. 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))
  29500. },
  29501. convertWorkshopPanoramaQuaternion: function(e) {
  29502. 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)))
  29503. },
  29504. convertWorkshopOrthoZoom: function(e) {
  29505. return -1 === e ? -1 : e * ($("#player").width() / $("#player").height()) / g_snapShotWidth * g_snapShotHeight
  29506. },
  29507. toPrecision: function(e, t) {
  29508. function i(e, t) {
  29509. var i = Math.pow(10, t);
  29510. return Math.round(e * i) / i
  29511. }
  29512. if (e instanceof Array) {
  29513. for (var n = 0; n < e.length; n++)
  29514. e[n] = i(e[n], t);
  29515. return e
  29516. }
  29517. return i(e, t)
  29518. },
  29519. isEmptyQuaternion: function(e) {
  29520. return 0 === Math.abs(e.x) && 0 === Math.abs(e.y) && 0 === Math.abs(e.z) && 0 === Math.abs(e.w)
  29521. },
  29522. projectPositionToCanvas: function(e, t, i) {
  29523. (i = i || new o.Vector3).copy(e);
  29524. var n = .5 * $("#player").width()
  29525. , r = .5 * $("#player").height();
  29526. return i.project(t),
  29527. i.x = i.x * n + n,
  29528. i.y = -i.y * r + r,
  29529. i
  29530. },
  29531. convertScreenPositionToNDC: function(e, t, i) {
  29532. return (i = i || new o.Vector2).x = e / $("#player").width() * 2 - 1,
  29533. i.y = -t / $("#player").height() * 2 + 1,
  29534. i
  29535. },
  29536. constrainedTurn: function(e) {
  29537. var t = e % (2 * Math.PI);
  29538. return t > Math.PI ? t -= 2 * Math.PI : t < -Math.PI ? t += 2 * Math.PI : t
  29539. },
  29540. getFOVDotThreshold: function(e) {
  29541. return Math.cos(o.Math.degToRad(e / 2))
  29542. },
  29543. transform2DForwardVectorByCubeFace: function(e, t, i, n) {
  29544. switch (e) {
  29545. case r.GL_TEXTURE_CUBE_MAP_POSITIVE_X:
  29546. i.set(1, t.y, t.x);
  29547. break;
  29548. case r.GL_TEXTURE_CUBE_MAP_NEGATIVE_X:
  29549. i.set(-1, t.y, -t.x);
  29550. break;
  29551. case r.GL_TEXTURE_CUBE_MAP_POSITIVE_Y:
  29552. i.set(-t.x, 1, -t.y);
  29553. break;
  29554. case r.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y:
  29555. i.set(-t.x, -1, t.y);
  29556. break;
  29557. case r.GL_TEXTURE_CUBE_MAP_POSITIVE_Z:
  29558. i.set(-t.x, t.y, 1);
  29559. break;
  29560. case r.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z:
  29561. i.set(t.x, t.y, -1)
  29562. }
  29563. n && i.normalize()
  29564. },
  29565. //add:
  29566. getPos2d : function(point, camera, dom){
  29567. var camera = camera ;
  29568. var dom = dom;
  29569. 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);
  29570. var x,y;
  29571. x = (pos.x + 1) / 2 * dom.clientWidth;
  29572. y = (1 - (pos.y + 1) / 2) * dom.clientHeight;
  29573. var inSight = x <= dom.clientWidth && x >= 0
  29574. && y <= dom.clientHeight && y >= 0
  29575. return {
  29576. pos: new THREE.Vector2(x,y),
  29577. vector: pos,
  29578. trueSide : pos.z<1, //trueSide为false时,即使在屏幕范围内可见,也是反方向的另一个不可以被渲染的点 参见Tag.update
  29579. inSight : inSight //在屏幕范围内可见
  29580. };
  29581. },
  29582. getDirByLonLat: function(lon, lat) {
  29583. var dir = new THREE.Vector3();
  29584. var phi = THREE.Math.degToRad(90 - lat);
  29585. var theta = THREE.Math.degToRad(lon);
  29586. dir.x = Math.sin(phi) * Math.cos(theta);
  29587. dir.y = Math.cos(phi);
  29588. dir.z = Math.sin(phi) * Math.sin(theta);
  29589. return dir.negate();
  29590. }
  29591. }
  29592. window.math = t.exports
  29593. }
  29594. , {
  29595. "../constants": 8,
  29596. "../enum/GLCubeFaces": 25,
  29597. three: 217
  29598. }],
  29599. 191: [function(e, t, i) {
  29600. "use strict";
  29601. function o(e) {
  29602. return r[e]
  29603. }
  29604. var n = e("../enum/GLCubeFaces")
  29605. , a = [0, 1, 2, 3, 4, 5]
  29606. , r = {
  29607. 0: n.GL_TEXTURE_CUBE_MAP_POSITIVE_Y,
  29608. 1: n.GL_TEXTURE_CUBE_MAP_POSITIVE_Z,
  29609. 2: n.GL_TEXTURE_CUBE_MAP_POSITIVE_X,
  29610. 3: n.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z,
  29611. 4: n.GL_TEXTURE_CUBE_MAP_NEGATIVE_X,
  29612. 5: n.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y
  29613. };
  29614. t.exports = {
  29615. mapFaceToCubemapFace: o,
  29616. getCubemapUrls: function(i, n, r) {
  29617. return a.map(function(e, t) {
  29618. return i.get("pan/" + r + "/" + n + "_skybox" + o(e) + ".jpg")
  29619. }
  29620. .bind(this))
  29621. }
  29622. }
  29623. }
  29624. , {
  29625. "../enum/GLCubeFaces": 25
  29626. }],
  29627. 192: [function(e, t, i) {
  29628. "use strict";
  29629. t.exports = {
  29630. captureErrors: function(e, t, i) {
  29631. if ("Raven"in window) {
  29632. Raven.config(e, t).install(),
  29633. i && Raven.setTagsContext(i);
  29634. var n = console.warn
  29635. , r = console.error;
  29636. console.warn = function() {
  29637. var e = Array.prototype.slice.call(arguments);
  29638. Raven.captureMessage(e.join(" "), {
  29639. level: "warning"
  29640. }),
  29641. n.apply(console, e)
  29642. }
  29643. ,
  29644. console.error = function() {
  29645. var e = Array.prototype.slice.call(arguments);
  29646. Raven.captureException(new Error(e.join(" ")), {
  29647. level: "error"
  29648. }),
  29649. r.apply(console, e)
  29650. }
  29651. } else
  29652. console.error("Raven not found, not capturing errors.")
  29653. }
  29654. }
  29655. }
  29656. , {}],
  29657. 193: [function(c, h, e) {
  29658. (function(e) {
  29659. "use strict";
  29660. var i, n = c("./browser"), r = c("../constants"), o = c("url"), t = c("./logger"), a = c("three"), s = new t(e), l = {
  29661. getAuthorizationHeader: function() {
  29662. var e = n.valueFromHash("auth");
  29663. if (e)
  29664. return e.replace(",", " ");
  29665. var t = n.valueFromCookie("token");
  29666. return t ? "Token " + t : null
  29667. },
  29668. parseSidUrl: function(e) {
  29669. var t, i;
  29670. if (t = g_Prefix,
  29671. (e = e || "").match(/^https?/)) {
  29672. o.parse(e);
  29673. t = g_Prefix,
  29674. i = e
  29675. } else
  29676. i = (t = g_Prefix) + "data/" + e;
  29677. return {
  29678. urlBase: t,
  29679. urlModel: i,
  29680. urlFiles: i + (i.match(/\/$/) ? "files" : "/files"),
  29681. urlThumb: i + (i.match(/\/$/) ? "thumb" : "/thumb")
  29682. }
  29683. },
  29684. getModelIDFromQueryString: function() {
  29685. return n.valueFromHash("model") || n.valueFromHash("m")
  29686. },
  29687. /* normalizeModeldata: function(e, i) {
  29688. e = JSON.parse(JSON.stringify(e));
  29689. var n = null;
  29690. if (e.images.forEach(function(t) {
  29691. if (t.metadata) {
  29692. if ("string" == typeof t.metadata)
  29693. try {
  29694. t.metadata = JSON.parse(t.metadata)
  29695. } catch (e) {
  29696. s.warn("Unable to parse image metadata"),
  29697. t.metadata = null
  29698. }
  29699. else
  29700. "object" == typeof t.metadata && s.debug("image.metadata already a JSON object");
  29701. t.metadata.camera_position instanceof Array ? (t.metadata.camera_position = (new a.Vector3).fromArray(t.metadata.camera_position),
  29702. 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)),
  29703. t.metadata.camera_position && (t.metadata.camera_position = i.convertWorkshopVector(t.metadata.camera_position)),
  29704. t.metadata.zoom = t.metadata.zoom || 1),
  29705. !n && e.icon && e.icon === t.sid && (n = t.metadata)
  29706. }
  29707. }),
  29708. n && n.camera_quaternion && n.camera_position && n.scan_position && n.scan_quaternion) {
  29709. var t = {};
  29710. t.pano = {
  29711. quaternion: i.convertWorkshopPanoramaQuaternion(n.scan_quaternion),
  29712. position: i.convertWorkshopVector(n.scan_position),
  29713. uuid: n.scan_id
  29714. },
  29715. t.camera = {
  29716. quaternion: n.camera_quaternion,
  29717. position: n.camera_position
  29718. },
  29719. e.startPano = t
  29720. }
  29721. return e
  29722. }, */
  29723. normalizeModeldata: function(e, t) {//xzw 修改导览images数据
  29724. e = JSON.parse(JSON.stringify(e));
  29725. var i = null;
  29726. var deal = function(n) {
  29727. if(!n.metadata) return;
  29728. if ("string" == typeof n.metadata)
  29729. try {
  29730. n.metadata = JSON.parse(n.metadata)
  29731. } catch (e) {
  29732. s.warn("Unable to parse image metadata"),
  29733. n.metadata = null
  29734. }
  29735. else{
  29736. "object" == typeof n.metadata && s.debug("image.metadata already a JSON object");
  29737. }
  29738. if(n.metadata.camera_position instanceof Array){//xzw 改的格式
  29739. n.metadata.camera_position = new a.Vector3().fromArray(n.metadata.camera_position);
  29740. n.metadata.camera_quaternion = new a.Quaternion().fromArray(n.metadata.camera_quaternion);
  29741. }else{
  29742. n.metadata.camera_position = new a.Vector3().copy(n.metadata.camera_position)
  29743. n.metadata.camera_quaternion = new a.Quaternion().copy(n.metadata.camera_quaternion)
  29744. /* n.metadata.camera_quaternion && (n.metadata.camera_quaternion = i.convertWorkshopQuaternion(n.metadata.camera_quaternion)),
  29745. n.metadata.camera_position && (n.metadata.camera_position = i.convertWorkshopVector(n.metadata.camera_position)) */
  29746. }
  29747. !i && e.icon && e.icon === n.sid && (i = n.metadata)
  29748. }
  29749. //改
  29750. e.images.forEach(info=>{
  29751. if(info.locations){
  29752. info.locations.forEach(a=>deal(a))
  29753. }else{
  29754. deal(info)
  29755. }
  29756. })
  29757. //icon初始视角的:
  29758. if(i && i.camera_quaternion && i.camera_position && i.scan_position && i.scan_quaternion) {
  29759. var n = {};
  29760. n.pano = {
  29761. quaternion: t.convertWorkshopPanoramaQuaternion(i.scan_quaternion),
  29762. position: t.convertWorkshopVector(i.scan_position),
  29763. uuid: i.scan_id
  29764. },
  29765. n.camera = {
  29766. quaternion: i.camera_quaternion,
  29767. position: i.camera_position
  29768. },
  29769. e.startPano = n
  29770. }
  29771. return e
  29772. },
  29773. visionVersionToInt: (i = new RegExp(["(?:[0-9.]+\\.){1,4}", "([0-9]+)", "[^\\.]*$"].join("")),
  29774. function(e) {
  29775. if (!e)
  29776. throw new Error("Vision version is required");
  29777. var t = i.exec(e);
  29778. if (null === t)
  29779. throw new Error("String is not a vision version: " + e);
  29780. return parseInt(t[1])
  29781. }
  29782. ),
  29783. modelDataPromisesTiles: function(e) {
  29784. var t = e.vision_version || window.DATA.vision_version;
  29785. if (t)
  29786. try {
  29787. return l.visionVersionToInt(t) >= l.visionVersionToInt(r.visionTilingStartVersion)
  29788. } catch (e) {
  29789. s.warn("Invalid vision version: " + t)
  29790. }
  29791. return !1
  29792. }
  29793. };
  29794. h.exports = l
  29795. }
  29796. ).call(this, "/js/util/showcase.js")
  29797. }
  29798. , {
  29799. "../constants": 8,
  29800. "./browser": 182,
  29801. "./logger": 189,
  29802. three: 217,
  29803. url: 208
  29804. }],
  29805. 194: [function(e, t, i) {
  29806. "use strict";
  29807. var r = e("../util/ajax")
  29808. , o = e("three")
  29809. , a = e("../settings")
  29810. , s = {};
  29811. t.exports = {
  29812. load: function(e, t, i) {
  29813. var n = s[e];
  29814. return n ? t && setTimeout(function() {
  29815. t(n)
  29816. }, 1) : (n = new o.Texture,
  29817. a.minimalMemoryMode && (n.minFilter = o.LinearFilter,
  29818. n.magFilter = o.LinearFilter,
  29819. n.generateMipmaps = !1),
  29820. n.sourceFile = e,
  29821. s[e] = n,
  29822. r.getImage(e).then(function(e) {
  29823. n.image = e,
  29824. n.needsUpdate = !0,
  29825. t && t(n)
  29826. }).fail(i)),
  29827. n
  29828. },
  29829. loadBase64: function(e, t) {
  29830. t = t || "png";
  29831. var i = new o.Texture;
  29832. return i.image = document.createElement("img"),
  29833. i.image.setAttribute("src", "data:image/" + t + ";base64," + e),
  29834. a.minimalMemoryMode && (i.minFilter = o.LinearFilter,
  29835. i.magFilter = o.LinearFilter,
  29836. i.generateMipmaps = !1),
  29837. i.needsUpdate = !0,
  29838. i
  29839. },
  29840. isLoaded: function(e) {
  29841. return !!s[e]
  29842. }
  29843. }
  29844. window.Texture = t.exports
  29845. }
  29846. , {
  29847. "../settings": 166,
  29848. "../util/ajax": 181,
  29849. three: 217
  29850. }],
  29851. 195: [function(e, t, i) {
  29852. "use strict";
  29853. var l = e("./easing");
  29854. window.transitions = t.exports = {
  29855. globalDone: null,
  29856. funcs: [],
  29857. counter: 0,
  29858. uniqueID: 0,
  29859. start: function(e, t, i, n, r, o, a) {
  29860. return n = n || 0,
  29861. this.funcs.push({
  29862. func: e,
  29863. current: -n * Math.abs(t),
  29864. duration: (1 - Math.max(n, 0)) * Math.abs(t),
  29865. done: i,
  29866. easing: r || l.linearTween,
  29867. cycling: t < 0,
  29868. running: !0,
  29869. debug: n < 0,
  29870. name: o || "T" + this.counter,
  29871. id: void 0 === a ? this.counter : a,
  29872. paused: !1
  29873. }),
  29874. e(0, 16),
  29875. this.counter += 1,
  29876. e
  29877. },
  29878. trigger: function(e) {
  29879. var t = void 0 === e.delayRatio ? 0 : e.delayRatio
  29880. , i = e.func || function() {}
  29881. , n = void 0 === e.duration ? 0 : e.duration;
  29882. void 0 !== e.cycling && e.cycling && (n = -Math.abs(n));
  29883. var r = e.done || null
  29884. , o = e.easing || l.linearTween
  29885. , a = e.name || "R" + this.counter
  29886. , s = void 0 === e.id ? this.counter : e.id;
  29887. return this.start(i, n, r, t, o, a, s)
  29888. },
  29889. setTimeout: function(e, t, i) {
  29890. var n = void 0 === i ? this.counter : i;
  29891. return this.trigger({
  29892. done: e,
  29893. duration: void 0 === t ? 0 : t,
  29894. name: "O" + this.counter,
  29895. id: n
  29896. })
  29897. },
  29898. pause: function() {
  29899. this.paused = !0
  29900. },
  29901. resume: function() {
  29902. this.paused = !1
  29903. },
  29904. update: function(n) {
  29905. this.funcs.forEach(function(e) {
  29906. if (!(e.paused || (e.current += 1e3 * n,
  29907. e.current < 0)))
  29908. if (e.current >= e.duration && !e.cycling) {
  29909. var t = e.easing(1, 0, 1, 1);
  29910. e.func(t, 1e3 * n),
  29911. e.done && e.done(),
  29912. e.running = !1
  29913. } else {
  29914. var i = e.easing(e.current % e.duration / e.duration, 0, 1, 1);
  29915. (e.func(i, 1e3 * n) || !1) && (e.done && e.done(),
  29916. e.running = !1)
  29917. }
  29918. });
  29919. var e = this.funcs.length;
  29920. this.funcs = this.funcs.filter(function(e) {
  29921. return e.running
  29922. });
  29923. var t = this.funcs.length;
  29924. if (0 < e && 0 === t && this.globalDone) {
  29925. var i = this.globalDone;
  29926. this.globalDone = null,
  29927. i()
  29928. }
  29929. },
  29930. adjustSpeed: function(e, t) {
  29931. for (var i = this.getById(e), n = 0; n < i.length; n++) {
  29932. var r = i[n];
  29933. r.duration /= t,
  29934. r.current /= t
  29935. }
  29936. },
  29937. getById: function(t) {
  29938. return this.funcs.filter(function(e) {
  29939. return t === e.id
  29940. })
  29941. },
  29942. get: function(e) {
  29943. for (var t = 0; t < this.funcs.length; t += 1)
  29944. if (this.funcs[t].func === e)
  29945. return this.funcs[t];
  29946. return null
  29947. },
  29948. isRunning: function(e) {
  29949. var t = this.get(e);
  29950. return null !== t && t.running
  29951. },
  29952. countActive: function() {
  29953. for (var e = 0, t = 0; t < this.funcs.length; t += 1)
  29954. e += this.funcs[t].running;
  29955. return e
  29956. },
  29957. listActive: function() {
  29958. for (var e = [], t = 0; t < this.funcs.length; t += 1)
  29959. this.funcs[t].running && e.push(this.funcs[t].name);
  29960. return e
  29961. },
  29962. done: function(e) {
  29963. this.globalDone = e
  29964. },
  29965. cancelById: function(e) {
  29966. var t = void 0 === e ? 0 : e;
  29967. this.funcs = this.funcs.filter(function(e) {
  29968. return e.id !== t
  29969. })
  29970. },
  29971. cancel: function(t) {
  29972. this.funcs = this.funcs.filter(function(e) {
  29973. return e.func !== t
  29974. })
  29975. },
  29976. getUniqueId: function() {
  29977. return this.uniqueID -= 1,
  29978. this.uniqueID
  29979. }
  29980. }
  29981. }
  29982. , {
  29983. "./easing": 186
  29984. }],
  29985. 196: [function(e, t, i) {
  29986. function n(e) {
  29987. if (this.set = {},
  29988. this.infContains = function() {
  29989. return !0
  29990. }
  29991. ,
  29992. "object" == typeof e)
  29993. if (e instanceof Array)
  29994. for (var t = 0; t < e.length; t++)
  29995. this.set[e[t]] = !0;
  29996. else
  29997. this.set = e;
  29998. else if ("function" == typeof e)
  29999. this.infContains = e;
  30000. else if (void 0 !== e)
  30001. throw new Error("set must be either an array or an object.")
  30002. }
  30003. (t.exports = n).prototype.has = n.prototype.contains = function(e) {
  30004. return !!this.set[e]
  30005. }
  30006. ,
  30007. n.prototype.add = function(e) {
  30008. if (1 == arguments.length)
  30009. this.set[e] = !0;
  30010. else
  30011. for (var t = 0; t < arguments.length; t++)
  30012. this.set[arguments[t]] = !0
  30013. }
  30014. ,
  30015. n.prototype.addAll = function(e) {
  30016. if ("object" != typeof e && !(e instanceof Array))
  30017. throw new Error("arr must be an array.");
  30018. for (var t = 0; t < e.length; t++)
  30019. this.add(e[t])
  30020. }
  30021. ,
  30022. n.prototype.delete = n.prototype.remove = function(e) {
  30023. if (1 == arguments.length)
  30024. delete this.set[e];
  30025. else
  30026. for (var t = 0; t < arguments.length; t++)
  30027. delete this.set[arguments[t]]
  30028. }
  30029. ,
  30030. n.prototype.clear = function() {
  30031. this.set = {}
  30032. }
  30033. ,
  30034. n.prototype.size = function() {
  30035. return Object.keys(this.set).length
  30036. }
  30037. ,
  30038. n.prototype.toString = function() {
  30039. return "{" + Object.keys(this.set).toString() + "}"
  30040. }
  30041. ,
  30042. n.prototype["*values"] = n.prototype.toArray = function() {
  30043. return void 0 === this.set ? [] : Object.keys(this.set)
  30044. }
  30045. }
  30046. , {}],
  30047. 197: [function(e, t, i) {}
  30048. , {}],
  30049. 198: [function(N, e, F) {
  30050. (function(e) {
  30051. "use strict";
  30052. function i() {
  30053. return u.TYPED_ARRAY_SUPPORT ? 2147483647 : 1073741823
  30054. }
  30055. function o(e, t) {
  30056. if (i() < t)
  30057. throw new RangeError("Invalid typed array length");
  30058. return u.TYPED_ARRAY_SUPPORT ? (e = new Uint8Array(t)).__proto__ = u.prototype : (null === e && (e = new u(t)),
  30059. e.length = t),
  30060. e
  30061. }
  30062. function u(e, t, i) {
  30063. if (!(u.TYPED_ARRAY_SUPPORT || this instanceof u))
  30064. return new u(e,t,i);
  30065. if ("number" != typeof e)
  30066. return n(this, e, t, i);
  30067. if ("string" == typeof t)
  30068. throw new Error("If encoding is specified then the first argument must be a string");
  30069. return a(this, e)
  30070. }
  30071. function n(e, t, i, n) {
  30072. if ("number" == typeof t)
  30073. throw new TypeError('"value" argument must not be a number');
  30074. return "undefined" != typeof ArrayBuffer && t instanceof ArrayBuffer ? function(e, t, i, n) {
  30075. if (t.byteLength,
  30076. i < 0 || t.byteLength < i)
  30077. throw new RangeError("'offset' is out of bounds");
  30078. if (t.byteLength < i + (n || 0))
  30079. throw new RangeError("'length' is out of bounds");
  30080. return t = void 0 === i && void 0 === n ? new Uint8Array(t) : void 0 === n ? new Uint8Array(t,i) : new Uint8Array(t,i,n),
  30081. u.TYPED_ARRAY_SUPPORT ? (e = t).__proto__ = u.prototype : e = s(e, t),
  30082. e
  30083. }(e, t, i, n) : "string" == typeof t ? function(e, t, i) {
  30084. if ("string" == typeof i && "" !== i || (i = "utf8"),
  30085. !u.isEncoding(i))
  30086. throw new TypeError('"encoding" must be a valid string encoding');
  30087. var n = 0 | c(t, i)
  30088. , r = (e = o(e, n)).write(t, i);
  30089. return r !== n && (e = e.slice(0, r)),
  30090. e
  30091. }(e, t, i) : function(e, t) {
  30092. if (u.isBuffer(t)) {
  30093. var i = 0 | l(t.length);
  30094. return 0 === (e = o(e, i)).length || t.copy(e, 0, 0, i),
  30095. e
  30096. }
  30097. if (t) {
  30098. if ("undefined" != typeof ArrayBuffer && t.buffer instanceof ArrayBuffer || "length"in t)
  30099. return "number" != typeof t.length || function(e) {
  30100. return e != e
  30101. }(t.length) ? o(e, 0) : s(e, t);
  30102. if ("Buffer" === t.type && L(t.data))
  30103. return s(e, t.data)
  30104. }
  30105. throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")
  30106. }(e, t)
  30107. }
  30108. function r(e) {
  30109. if ("number" != typeof e)
  30110. throw new TypeError('"size" argument must be a number');
  30111. if (e < 0)
  30112. throw new RangeError('"size" argument must not be negative')
  30113. }
  30114. function a(e, t) {
  30115. if (r(t),
  30116. e = o(e, t < 0 ? 0 : 0 | l(t)),
  30117. !u.TYPED_ARRAY_SUPPORT)
  30118. for (var i = 0; i < t; ++i)
  30119. e[i] = 0;
  30120. return e
  30121. }
  30122. function s(e, t) {
  30123. var i = t.length < 0 ? 0 : 0 | l(t.length);
  30124. e = o(e, i);
  30125. for (var n = 0; n < i; n += 1)
  30126. e[n] = 255 & t[n];
  30127. return e
  30128. }
  30129. function l(e) {
  30130. if (e >= i())
  30131. throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x" + i().toString(16) + " bytes");
  30132. return 0 | e
  30133. }
  30134. function c(e, t) {
  30135. if (u.isBuffer(e))
  30136. return e.length;
  30137. if ("undefined" != typeof ArrayBuffer && "function" == typeof ArrayBuffer.isView && (ArrayBuffer.isView(e) || e instanceof ArrayBuffer))
  30138. return e.byteLength;
  30139. "string" != typeof e && (e = "" + e);
  30140. var i = e.length;
  30141. if (0 === i)
  30142. return 0;
  30143. for (var n = !1; ; )
  30144. switch (t) {
  30145. case "ascii":
  30146. case "latin1":
  30147. case "binary":
  30148. return i;
  30149. case "utf8":
  30150. case "utf-8":
  30151. case void 0:
  30152. return S(e).length;
  30153. case "ucs2":
  30154. case "ucs-2":
  30155. case "utf16le":
  30156. case "utf-16le":
  30157. return 2 * i;
  30158. case "hex":
  30159. return i >>> 1;
  30160. case "base64":
  30161. return M(e).length;
  30162. default:
  30163. if (n)
  30164. return S(e).length;
  30165. t = ("" + t).toLowerCase(),
  30166. n = !0
  30167. }
  30168. }
  30169. function h(e, t, i) {
  30170. var n = e[t];
  30171. e[t] = e[i],
  30172. e[i] = n
  30173. }
  30174. function d(e, t, i, n, r) {
  30175. if (0 === e.length)
  30176. return -1;
  30177. if ("string" == typeof i ? (n = i,
  30178. i = 0) : 2147483647 < i ? i = 2147483647 : i < -2147483648 && (i = -2147483648),
  30179. i = +i,
  30180. isNaN(i) && (i = r ? 0 : e.length - 1),
  30181. i < 0 && (i = e.length + i),
  30182. i >= e.length) {
  30183. if (r)
  30184. return -1;
  30185. i = e.length - 1
  30186. } else if (i < 0) {
  30187. if (!r)
  30188. return -1;
  30189. i = 0
  30190. }
  30191. if ("string" == typeof t && (t = u.from(t, n)),
  30192. u.isBuffer(t))
  30193. return 0 === t.length ? -1 : p(e, t, i, n, r);
  30194. if ("number" == typeof t)
  30195. return t &= 255,
  30196. 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);
  30197. throw new TypeError("val must be string, number or Buffer")
  30198. }
  30199. function p(e, t, i, n, r) {
  30200. function o(e, t) {
  30201. return 1 === s ? e[t] : e.readUInt16BE(t * s)
  30202. }
  30203. var a, s = 1, l = e.length, c = t.length;
  30204. if (void 0 !== n && ("ucs2" === (n = String(n).toLowerCase()) || "ucs-2" === n || "utf16le" === n || "utf-16le" === n)) {
  30205. if (e.length < 2 || t.length < 2)
  30206. return -1;
  30207. l /= s = 2,
  30208. c /= 2,
  30209. i /= 2
  30210. }
  30211. if (r) {
  30212. var h = -1;
  30213. for (a = i; a < l; a++)
  30214. if (o(e, a) === o(t, -1 === h ? 0 : a - h)) {
  30215. if (-1 === h && (h = a),
  30216. a - h + 1 === c)
  30217. return h * s
  30218. } else
  30219. -1 !== h && (a -= a - h),
  30220. h = -1
  30221. } else
  30222. for (l < i + c && (i = l - c),
  30223. a = i; 0 <= a; a--) {
  30224. for (var u = !0, d = 0; d < c; d++)
  30225. if (o(e, a + d) !== o(t, d)) {
  30226. u = !1;
  30227. break
  30228. }
  30229. if (u)
  30230. return a
  30231. }
  30232. return -1
  30233. }
  30234. function g(e, t, i, n) {
  30235. i = Number(i) || 0;
  30236. var r = e.length - i;
  30237. n ? r < (n = Number(n)) && (n = r) : n = r;
  30238. var o = t.length;
  30239. if (o % 2 != 0)
  30240. throw new TypeError("Invalid hex string");
  30241. o / 2 < n && (n = o / 2);
  30242. for (var a = 0; a < n; ++a) {
  30243. var s = parseInt(t.substr(2 * a, 2), 16);
  30244. if (isNaN(s))
  30245. return a;
  30246. e[i + a] = s
  30247. }
  30248. return a
  30249. }
  30250. function m(e, t, i, n) {
  30251. return R(function(e) {
  30252. for (var t = [], i = 0; i < e.length; ++i)
  30253. t.push(255 & e.charCodeAt(i));
  30254. return t
  30255. }(t), e, i, n)
  30256. }
  30257. function f(e, t, i) {
  30258. i = Math.min(e.length, i);
  30259. for (var n = [], r = t; r < i; ) {
  30260. var o, a, s, l, c = e[r], h = null, u = 239 < c ? 4 : 223 < c ? 3 : 191 < c ? 2 : 1;
  30261. if (r + u <= i)
  30262. switch (u) {
  30263. case 1:
  30264. c < 128 && (h = c);
  30265. break;
  30266. case 2:
  30267. 128 == (192 & (o = e[r + 1])) && (127 < (l = (31 & c) << 6 | 63 & o) && (h = l));
  30268. break;
  30269. case 3:
  30270. o = e[r + 1],
  30271. a = e[r + 2],
  30272. 128 == (192 & o) && 128 == (192 & a) && (2047 < (l = (15 & c) << 12 | (63 & o) << 6 | 63 & a) && (l < 55296 || 57343 < l) && (h = l));
  30273. break;
  30274. case 4:
  30275. o = e[r + 1],
  30276. a = e[r + 2],
  30277. s = e[r + 3],
  30278. 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))
  30279. }
  30280. null === h ? (h = 65533,
  30281. u = 1) : 65535 < h && (h -= 65536,
  30282. n.push(h >>> 10 & 1023 | 55296),
  30283. h = 56320 | 1023 & h),
  30284. n.push(h),
  30285. r += u
  30286. }
  30287. return function(e) {
  30288. var t = e.length;
  30289. if (t <= D)
  30290. return String.fromCharCode.apply(String, e);
  30291. for (var i = "", n = 0; n < t; )
  30292. i += String.fromCharCode.apply(String, e.slice(n, n += D));
  30293. return i
  30294. }(n)
  30295. }
  30296. function v(e, t, i) {
  30297. var n = "";
  30298. i = Math.min(e.length, i);
  30299. for (var r = t; r < i; ++r)
  30300. n += String.fromCharCode(127 & e[r]);
  30301. return n
  30302. }
  30303. function y(e, t, i) {
  30304. var n = "";
  30305. i = Math.min(e.length, i);
  30306. for (var r = t; r < i; ++r)
  30307. n += String.fromCharCode(e[r]);
  30308. return n
  30309. }
  30310. function A(e, t, i) {
  30311. var n, r = e.length;
  30312. (!t || t < 0) && (t = 0),
  30313. (!i || i < 0 || r < i) && (i = r);
  30314. for (var o = "", a = t; a < i; ++a)
  30315. o += (n = e[a]) < 16 ? "0" + n.toString(16) : n.toString(16);
  30316. return o
  30317. }
  30318. function C(e, t, i) {
  30319. for (var n = e.slice(t, i), r = "", o = 0; o < n.length; o += 2)
  30320. r += String.fromCharCode(n[o] + 256 * n[o + 1]);
  30321. return r
  30322. }
  30323. function I(e, t, i) {
  30324. if (e % 1 != 0 || e < 0)
  30325. throw new RangeError("offset is not uint");
  30326. if (i < e + t)
  30327. throw new RangeError("Trying to access beyond buffer length")
  30328. }
  30329. function E(e, t, i, n, r, o) {
  30330. if (!u.isBuffer(e))
  30331. throw new TypeError('"buffer" argument must be a Buffer instance');
  30332. if (r < t || t < o)
  30333. throw new RangeError('"value" argument is out of bounds');
  30334. if (i + n > e.length)
  30335. throw new RangeError("Index out of range")
  30336. }
  30337. function _(e, t, i, n) {
  30338. t < 0 && (t = 65535 + t + 1);
  30339. for (var r = 0, o = Math.min(e.length - i, 2); r < o; ++r)
  30340. e[i + r] = (t & 255 << 8 * (n ? r : 1 - r)) >>> 8 * (n ? r : 1 - r)
  30341. }
  30342. function b(e, t, i, n) {
  30343. t < 0 && (t = 4294967295 + t + 1);
  30344. for (var r = 0, o = Math.min(e.length - i, 4); r < o; ++r)
  30345. e[i + r] = t >>> 8 * (n ? r : 3 - r) & 255
  30346. }
  30347. function w(e, t, i, n) {
  30348. if (i + n > e.length)
  30349. throw new RangeError("Index out of range");
  30350. if (i < 0)
  30351. throw new RangeError("Index out of range")
  30352. }
  30353. function T(e, t, i, n, r) {
  30354. return r || w(e, 0, i, 4),
  30355. O.write(e, t, i, n, 23, 4),
  30356. i + 4
  30357. }
  30358. function x(e, t, i, n, r) {
  30359. return r || w(e, 0, i, 8),
  30360. O.write(e, t, i, n, 52, 8),
  30361. i + 8
  30362. }
  30363. function S(e, t) {
  30364. t = t || 1 / 0;
  30365. for (var i, n = e.length, r = null, o = [], a = 0; a < n; ++a) {
  30366. if (55295 < (i = e.charCodeAt(a)) && i < 57344) {
  30367. if (!r) {
  30368. if (56319 < i) {
  30369. -1 < (t -= 3) && o.push(239, 191, 189);
  30370. continue
  30371. }
  30372. if (a + 1 === n) {
  30373. -1 < (t -= 3) && o.push(239, 191, 189);
  30374. continue
  30375. }
  30376. r = i;
  30377. continue
  30378. }
  30379. if (i < 56320) {
  30380. -1 < (t -= 3) && o.push(239, 191, 189),
  30381. r = i;
  30382. continue
  30383. }
  30384. i = 65536 + (r - 55296 << 10 | i - 56320)
  30385. } else
  30386. r && -1 < (t -= 3) && o.push(239, 191, 189);
  30387. if (r = null,
  30388. i < 128) {
  30389. if ((t -= 1) < 0)
  30390. break;
  30391. o.push(i)
  30392. } else if (i < 2048) {
  30393. if ((t -= 2) < 0)
  30394. break;
  30395. o.push(i >> 6 | 192, 63 & i | 128)
  30396. } else if (i < 65536) {
  30397. if ((t -= 3) < 0)
  30398. break;
  30399. o.push(i >> 12 | 224, i >> 6 & 63 | 128, 63 & i | 128)
  30400. } else {
  30401. if (!(i < 1114112))
  30402. throw new Error("Invalid code point");
  30403. if ((t -= 4) < 0)
  30404. break;
  30405. o.push(i >> 18 | 240, i >> 12 & 63 | 128, i >> 6 & 63 | 128, 63 & i | 128)
  30406. }
  30407. }
  30408. return o
  30409. }
  30410. function M(e) {
  30411. return P.toByteArray(function(e) {
  30412. if ((e = function(e) {
  30413. return e.trim ? e.trim() : e.replace(/^\s+|\s+$/g, "")
  30414. }(e).replace(t, "")).length < 2)
  30415. return "";
  30416. for (; e.length % 4 != 0; )
  30417. e += "=";
  30418. return e
  30419. }(e))
  30420. }
  30421. function R(e, t, i, n) {
  30422. for (var r = 0; r < n && !(r + i >= t.length || r >= e.length); ++r)
  30423. t[r + i] = e[r];
  30424. return r
  30425. }
  30426. var P = N("base64-js")
  30427. , O = N("ieee754")
  30428. , L = N("isarray");
  30429. F.Buffer = u,
  30430. F.SlowBuffer = function(e) {
  30431. return +e != e && (e = 0),
  30432. u.alloc(+e)
  30433. }
  30434. ,
  30435. F.INSPECT_MAX_BYTES = 50,
  30436. u.TYPED_ARRAY_SUPPORT = void 0 !== e.TYPED_ARRAY_SUPPORT ? e.TYPED_ARRAY_SUPPORT : function() {
  30437. try {
  30438. var e = new Uint8Array(1);
  30439. return e.__proto__ = {
  30440. __proto__: Uint8Array.prototype,
  30441. foo: function() {
  30442. return 42
  30443. }
  30444. },
  30445. 42 === e.foo() && "function" == typeof e.subarray && 0 === e.subarray(1, 1).byteLength
  30446. } catch (e) {
  30447. return !1
  30448. }
  30449. }(),
  30450. F.kMaxLength = i(),
  30451. u.poolSize = 8192,
  30452. u._augment = function(e) {
  30453. return e.__proto__ = u.prototype,
  30454. e
  30455. }
  30456. ,
  30457. u.from = function(e, t, i) {
  30458. return n(null, e, t, i)
  30459. }
  30460. ,
  30461. u.TYPED_ARRAY_SUPPORT && (u.prototype.__proto__ = Uint8Array.prototype,
  30462. u.__proto__ = Uint8Array,
  30463. "undefined" != typeof Symbol && Symbol.species && u[Symbol.species] === u && Object.defineProperty(u, Symbol.species, {
  30464. value: null,
  30465. configurable: !0
  30466. })),
  30467. u.alloc = function(e, t, i) {
  30468. return function(e, t, i, n) {
  30469. return r(t),
  30470. 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)
  30471. }(null, e, t, i)
  30472. }
  30473. ,
  30474. u.allocUnsafe = function(e) {
  30475. return a(null, e)
  30476. }
  30477. ,
  30478. u.allocUnsafeSlow = function(e) {
  30479. return a(null, e)
  30480. }
  30481. ,
  30482. u.isBuffer = function(e) {
  30483. return !(null == e || !e._isBuffer)
  30484. }
  30485. ,
  30486. u.compare = function(e, t) {
  30487. if (!u.isBuffer(e) || !u.isBuffer(t))
  30488. throw new TypeError("Arguments must be Buffers");
  30489. if (e === t)
  30490. return 0;
  30491. for (var i = e.length, n = t.length, r = 0, o = Math.min(i, n); r < o; ++r)
  30492. if (e[r] !== t[r]) {
  30493. i = e[r],
  30494. n = t[r];
  30495. break
  30496. }
  30497. return i < n ? -1 : n < i ? 1 : 0
  30498. }
  30499. ,
  30500. u.isEncoding = function(e) {
  30501. switch (String(e).toLowerCase()) {
  30502. case "hex":
  30503. case "utf8":
  30504. case "utf-8":
  30505. case "ascii":
  30506. case "latin1":
  30507. case "binary":
  30508. case "base64":
  30509. case "ucs2":
  30510. case "ucs-2":
  30511. case "utf16le":
  30512. case "utf-16le":
  30513. return !0;
  30514. default:
  30515. return !1
  30516. }
  30517. }
  30518. ,
  30519. u.concat = function(e, t) {
  30520. if (!L(e))
  30521. throw new TypeError('"list" argument must be an Array of Buffers');
  30522. if (0 === e.length)
  30523. return u.alloc(0);
  30524. var i;
  30525. if (void 0 === t)
  30526. for (i = t = 0; i < e.length; ++i)
  30527. t += e[i].length;
  30528. var n = u.allocUnsafe(t)
  30529. , r = 0;
  30530. for (i = 0; i < e.length; ++i) {
  30531. var o = e[i];
  30532. if (!u.isBuffer(o))
  30533. throw new TypeError('"list" argument must be an Array of Buffers');
  30534. o.copy(n, r),
  30535. r += o.length
  30536. }
  30537. return n
  30538. }
  30539. ,
  30540. u.byteLength = c,
  30541. u.prototype._isBuffer = !0,
  30542. u.prototype.swap16 = function() {
  30543. var e = this.length;
  30544. if (e % 2 != 0)
  30545. throw new RangeError("Buffer size must be a multiple of 16-bits");
  30546. for (var t = 0; t < e; t += 2)
  30547. h(this, t, t + 1);
  30548. return this
  30549. }
  30550. ,
  30551. u.prototype.swap32 = function() {
  30552. var e = this.length;
  30553. if (e % 4 != 0)
  30554. throw new RangeError("Buffer size must be a multiple of 32-bits");
  30555. for (var t = 0; t < e; t += 4)
  30556. h(this, t, t + 3),
  30557. h(this, t + 1, t + 2);
  30558. return this
  30559. }
  30560. ,
  30561. u.prototype.swap64 = function() {
  30562. var e = this.length;
  30563. if (e % 8 != 0)
  30564. throw new RangeError("Buffer size must be a multiple of 64-bits");
  30565. for (var t = 0; t < e; t += 8)
  30566. h(this, t, t + 7),
  30567. h(this, t + 1, t + 6),
  30568. h(this, t + 2, t + 5),
  30569. h(this, t + 3, t + 4);
  30570. return this
  30571. }
  30572. ,
  30573. u.prototype.toString = function() {
  30574. var e = 0 | this.length;
  30575. return 0 == e ? "" : 0 === arguments.length ? f(this, 0, e) : function(e, t, i) {
  30576. var n, r, o, a = !1;
  30577. if ((void 0 === t || t < 0) && (t = 0),
  30578. t > this.length)
  30579. return "";
  30580. if ((void 0 === i || i > this.length) && (i = this.length),
  30581. i <= 0)
  30582. return "";
  30583. if ((i >>>= 0) <= (t >>>= 0))
  30584. return "";
  30585. for (e = e || "utf8"; ; )
  30586. switch (e) {
  30587. case "hex":
  30588. return A(this, t, i);
  30589. case "utf8":
  30590. case "utf-8":
  30591. return f(this, t, i);
  30592. case "ascii":
  30593. return v(this, t, i);
  30594. case "latin1":
  30595. case "binary":
  30596. return y(this, t, i);
  30597. case "base64":
  30598. return n = this,
  30599. o = i,
  30600. 0 === (r = t) && o === n.length ? P.fromByteArray(n) : P.fromByteArray(n.slice(r, o));
  30601. case "ucs2":
  30602. case "ucs-2":
  30603. case "utf16le":
  30604. case "utf-16le":
  30605. return C(this, t, i);
  30606. default:
  30607. if (a)
  30608. throw new TypeError("Unknown encoding: " + e);
  30609. e = (e + "").toLowerCase(),
  30610. a = !0
  30611. }
  30612. }
  30613. .apply(this, arguments)
  30614. }
  30615. ,
  30616. u.prototype.equals = function(e) {
  30617. if (!u.isBuffer(e))
  30618. throw new TypeError("Argument must be a Buffer");
  30619. return this === e || 0 === u.compare(this, e)
  30620. }
  30621. ,
  30622. u.prototype.inspect = function() {
  30623. var e = ""
  30624. , t = F.INSPECT_MAX_BYTES;
  30625. return 0 < this.length && (e = this.toString("hex", 0, t).match(/.{2}/g).join(" "),
  30626. this.length > t && (e += " ... ")),
  30627. "<Buffer " + e + ">"
  30628. }
  30629. ,
  30630. u.prototype.compare = function(e, t, i, n, r) {
  30631. if (!u.isBuffer(e))
  30632. throw new TypeError("Argument must be a Buffer");
  30633. if (void 0 === t && (t = 0),
  30634. void 0 === i && (i = e ? e.length : 0),
  30635. void 0 === n && (n = 0),
  30636. void 0 === r && (r = this.length),
  30637. t < 0 || i > e.length || n < 0 || r > this.length)
  30638. throw new RangeError("out of range index");
  30639. if (r <= n && i <= t)
  30640. return 0;
  30641. if (r <= n)
  30642. return -1;
  30643. if (i <= t)
  30644. return 1;
  30645. if (this === e)
  30646. return 0;
  30647. 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)
  30648. if (l[h] !== c[h]) {
  30649. o = l[h],
  30650. a = c[h];
  30651. break
  30652. }
  30653. return o < a ? -1 : a < o ? 1 : 0
  30654. }
  30655. ,
  30656. u.prototype.includes = function(e, t, i) {
  30657. return -1 !== this.indexOf(e, t, i)
  30658. }
  30659. ,
  30660. u.prototype.indexOf = function(e, t, i) {
  30661. return d(this, e, t, i, !0)
  30662. }
  30663. ,
  30664. u.prototype.lastIndexOf = function(e, t, i) {
  30665. return d(this, e, t, i, !1)
  30666. }
  30667. ,
  30668. u.prototype.write = function(e, t, i, n) {
  30669. if (void 0 === t)
  30670. n = "utf8",
  30671. i = this.length,
  30672. t = 0;
  30673. else if (void 0 === i && "string" == typeof t)
  30674. n = t,
  30675. i = this.length,
  30676. t = 0;
  30677. else {
  30678. if (!isFinite(t))
  30679. throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");
  30680. t |= 0,
  30681. isFinite(i) ? (i |= 0,
  30682. void 0 === n && (n = "utf8")) : (n = i,
  30683. i = void 0)
  30684. }
  30685. var r, o, a, s, l, c, h, u, d, p = this.length - t;
  30686. if ((void 0 === i || p < i) && (i = p),
  30687. 0 < e.length && (i < 0 || t < 0) || t > this.length)
  30688. throw new RangeError("Attempt to write outside buffer bounds");
  30689. n = n || "utf8";
  30690. for (var f = !1; ; )
  30691. switch (n) {
  30692. case "hex":
  30693. return g(this, e, t, i);
  30694. case "utf8":
  30695. case "utf-8":
  30696. return u = t,
  30697. d = i,
  30698. R(S(e, (h = this).length - u), h, u, d);
  30699. case "ascii":
  30700. return m(this, e, t, i);
  30701. case "latin1":
  30702. case "binary":
  30703. return m(this, e, t, i);
  30704. case "base64":
  30705. return s = this,
  30706. l = t,
  30707. c = i,
  30708. R(M(e), s, l, c);
  30709. case "ucs2":
  30710. case "ucs-2":
  30711. case "utf16le":
  30712. case "utf-16le":
  30713. return o = t,
  30714. a = i,
  30715. R(function(e, t) {
  30716. for (var i, n, r, o = [], a = 0; a < e.length && !((t -= 2) < 0); ++a)
  30717. i = e.charCodeAt(a),
  30718. n = i >> 8,
  30719. r = i % 256,
  30720. o.push(r),
  30721. o.push(n);
  30722. return o
  30723. }(e, (r = this).length - o), r, o, a);
  30724. default:
  30725. if (f)
  30726. throw new TypeError("Unknown encoding: " + n);
  30727. n = ("" + n).toLowerCase(),
  30728. f = !0
  30729. }
  30730. }
  30731. ,
  30732. u.prototype.toJSON = function() {
  30733. return {
  30734. type: "Buffer",
  30735. data: Array.prototype.slice.call(this._arr || this, 0)
  30736. }
  30737. }
  30738. ;
  30739. var D = 4096;
  30740. u.prototype.slice = function(e, t) {
  30741. var i, n = this.length;
  30742. if ((e = ~~e) < 0 ? (e += n) < 0 && (e = 0) : n < e && (e = n),
  30743. (t = void 0 === t ? n : ~~t) < 0 ? (t += n) < 0 && (t = 0) : n < t && (t = n),
  30744. t < e && (t = e),
  30745. u.TYPED_ARRAY_SUPPORT)
  30746. (i = this.subarray(e, t)).__proto__ = u.prototype;
  30747. else {
  30748. var r = t - e;
  30749. i = new u(r,void 0);
  30750. for (var o = 0; o < r; ++o)
  30751. i[o] = this[o + e]
  30752. }
  30753. return i
  30754. }
  30755. ,
  30756. u.prototype.readUIntLE = function(e, t, i) {
  30757. e |= 0,
  30758. t |= 0,
  30759. i || I(e, t, this.length);
  30760. for (var n = this[e], r = 1, o = 0; ++o < t && (r *= 256); )
  30761. n += this[e + o] * r;
  30762. return n
  30763. }
  30764. ,
  30765. u.prototype.readUIntBE = function(e, t, i) {
  30766. e |= 0,
  30767. t |= 0,
  30768. i || I(e, t, this.length);
  30769. for (var n = this[e + --t], r = 1; 0 < t && (r *= 256); )
  30770. n += this[e + --t] * r;
  30771. return n
  30772. }
  30773. ,
  30774. u.prototype.readUInt8 = function(e, t) {
  30775. return t || I(e, 1, this.length),
  30776. this[e]
  30777. }
  30778. ,
  30779. u.prototype.readUInt16LE = function(e, t) {
  30780. return t || I(e, 2, this.length),
  30781. this[e] | this[e + 1] << 8
  30782. }
  30783. ,
  30784. u.prototype.readUInt16BE = function(e, t) {
  30785. return t || I(e, 2, this.length),
  30786. this[e] << 8 | this[e + 1]
  30787. }
  30788. ,
  30789. u.prototype.readUInt32LE = function(e, t) {
  30790. return t || I(e, 4, this.length),
  30791. (this[e] | this[e + 1] << 8 | this[e + 2] << 16) + 16777216 * this[e + 3]
  30792. }
  30793. ,
  30794. u.prototype.readUInt32BE = function(e, t) {
  30795. return t || I(e, 4, this.length),
  30796. 16777216 * this[e] + (this[e + 1] << 16 | this[e + 2] << 8 | this[e + 3])
  30797. }
  30798. ,
  30799. u.prototype.readIntLE = function(e, t, i) {
  30800. e |= 0,
  30801. t |= 0,
  30802. i || I(e, t, this.length);
  30803. for (var n = this[e], r = 1, o = 0; ++o < t && (r *= 256); )
  30804. n += this[e + o] * r;
  30805. return (r *= 128) <= n && (n -= Math.pow(2, 8 * t)),
  30806. n
  30807. }
  30808. ,
  30809. u.prototype.readIntBE = function(e, t, i) {
  30810. e |= 0,
  30811. t |= 0,
  30812. i || I(e, t, this.length);
  30813. for (var n = t, r = 1, o = this[e + --n]; 0 < n && (r *= 256); )
  30814. o += this[e + --n] * r;
  30815. return (r *= 128) <= o && (o -= Math.pow(2, 8 * t)),
  30816. o
  30817. }
  30818. ,
  30819. u.prototype.readInt8 = function(e, t) {
  30820. return t || I(e, 1, this.length),
  30821. 128 & this[e] ? -1 * (255 - this[e] + 1) : this[e]
  30822. }
  30823. ,
  30824. u.prototype.readInt16LE = function(e, t) {
  30825. t || I(e, 2, this.length);
  30826. var i = this[e] | this[e + 1] << 8;
  30827. return 32768 & i ? 4294901760 | i : i
  30828. }
  30829. ,
  30830. u.prototype.readInt16BE = function(e, t) {
  30831. t || I(e, 2, this.length);
  30832. var i = this[e + 1] | this[e] << 8;
  30833. return 32768 & i ? 4294901760 | i : i
  30834. }
  30835. ,
  30836. u.prototype.readInt32LE = function(e, t) {
  30837. return t || I(e, 4, this.length),
  30838. this[e] | this[e + 1] << 8 | this[e + 2] << 16 | this[e + 3] << 24
  30839. }
  30840. ,
  30841. u.prototype.readInt32BE = function(e, t) {
  30842. return t || I(e, 4, this.length),
  30843. this[e] << 24 | this[e + 1] << 16 | this[e + 2] << 8 | this[e + 3]
  30844. }
  30845. ,
  30846. u.prototype.readFloatLE = function(e, t) {
  30847. return t || I(e, 4, this.length),
  30848. O.read(this, e, !0, 23, 4)
  30849. }
  30850. ,
  30851. u.prototype.readFloatBE = function(e, t) {
  30852. return t || I(e, 4, this.length),
  30853. O.read(this, e, !1, 23, 4)
  30854. }
  30855. ,
  30856. u.prototype.readDoubleLE = function(e, t) {
  30857. return t || I(e, 8, this.length),
  30858. O.read(this, e, !0, 52, 8)
  30859. }
  30860. ,
  30861. u.prototype.readDoubleBE = function(e, t) {
  30862. return t || I(e, 8, this.length),
  30863. O.read(this, e, !1, 52, 8)
  30864. }
  30865. ,
  30866. u.prototype.writeUIntLE = function(e, t, i, n) {
  30867. e = +e,
  30868. t |= 0,
  30869. i |= 0,
  30870. n || E(this, e, t, i, Math.pow(2, 8 * i) - 1, 0);
  30871. var r = 1
  30872. , o = 0;
  30873. for (this[t] = 255 & e; ++o < i && (r *= 256); )
  30874. this[t + o] = e / r & 255;
  30875. return t + i
  30876. }
  30877. ,
  30878. u.prototype.writeUIntBE = function(e, t, i, n) {
  30879. e = +e,
  30880. t |= 0,
  30881. i |= 0,
  30882. n || E(this, e, t, i, Math.pow(2, 8 * i) - 1, 0);
  30883. var r = i - 1
  30884. , o = 1;
  30885. for (this[t + r] = 255 & e; 0 <= --r && (o *= 256); )
  30886. this[t + r] = e / o & 255;
  30887. return t + i
  30888. }
  30889. ,
  30890. u.prototype.writeUInt8 = function(e, t, i) {
  30891. return e = +e,
  30892. t |= 0,
  30893. i || E(this, e, t, 1, 255, 0),
  30894. u.TYPED_ARRAY_SUPPORT || (e = Math.floor(e)),
  30895. this[t] = 255 & e,
  30896. t + 1
  30897. }
  30898. ,
  30899. u.prototype.writeUInt16LE = function(e, t, i) {
  30900. return e = +e,
  30901. t |= 0,
  30902. i || E(this, e, t, 2, 65535, 0),
  30903. u.TYPED_ARRAY_SUPPORT ? (this[t] = 255 & e,
  30904. this[t + 1] = e >>> 8) : _(this, e, t, !0),
  30905. t + 2
  30906. }
  30907. ,
  30908. u.prototype.writeUInt16BE = function(e, t, i) {
  30909. return e = +e,
  30910. t |= 0,
  30911. i || E(this, e, t, 2, 65535, 0),
  30912. u.TYPED_ARRAY_SUPPORT ? (this[t] = e >>> 8,
  30913. this[t + 1] = 255 & e) : _(this, e, t, !1),
  30914. t + 2
  30915. }
  30916. ,
  30917. u.prototype.writeUInt32LE = function(e, t, i) {
  30918. return e = +e,
  30919. t |= 0,
  30920. i || E(this, e, t, 4, 4294967295, 0),
  30921. u.TYPED_ARRAY_SUPPORT ? (this[t + 3] = e >>> 24,
  30922. this[t + 2] = e >>> 16,
  30923. this[t + 1] = e >>> 8,
  30924. this[t] = 255 & e) : b(this, e, t, !0),
  30925. t + 4
  30926. }
  30927. ,
  30928. u.prototype.writeUInt32BE = function(e, t, i) {
  30929. return e = +e,
  30930. t |= 0,
  30931. i || E(this, e, t, 4, 4294967295, 0),
  30932. u.TYPED_ARRAY_SUPPORT ? (this[t] = e >>> 24,
  30933. this[t + 1] = e >>> 16,
  30934. this[t + 2] = e >>> 8,
  30935. this[t + 3] = 255 & e) : b(this, e, t, !1),
  30936. t + 4
  30937. }
  30938. ,
  30939. u.prototype.writeIntLE = function(e, t, i, n) {
  30940. if (e = +e,
  30941. t |= 0,
  30942. !n) {
  30943. var r = Math.pow(2, 8 * i - 1);
  30944. E(this, e, t, i, r - 1, -r)
  30945. }
  30946. var o = 0
  30947. , a = 1
  30948. , s = 0;
  30949. for (this[t] = 255 & e; ++o < i && (a *= 256); )
  30950. e < 0 && 0 === s && 0 !== this[t + o - 1] && (s = 1),
  30951. this[t + o] = (e / a >> 0) - s & 255;
  30952. return t + i
  30953. }
  30954. ,
  30955. u.prototype.writeIntBE = function(e, t, i, n) {
  30956. if (e = +e,
  30957. t |= 0,
  30958. !n) {
  30959. var r = Math.pow(2, 8 * i - 1);
  30960. E(this, e, t, i, r - 1, -r)
  30961. }
  30962. var o = i - 1
  30963. , a = 1
  30964. , s = 0;
  30965. for (this[t + o] = 255 & e; 0 <= --o && (a *= 256); )
  30966. e < 0 && 0 === s && 0 !== this[t + o + 1] && (s = 1),
  30967. this[t + o] = (e / a >> 0) - s & 255;
  30968. return t + i
  30969. }
  30970. ,
  30971. u.prototype.writeInt8 = function(e, t, i) {
  30972. return e = +e,
  30973. t |= 0,
  30974. i || E(this, e, t, 1, 127, -128),
  30975. u.TYPED_ARRAY_SUPPORT || (e = Math.floor(e)),
  30976. e < 0 && (e = 255 + e + 1),
  30977. this[t] = 255 & e,
  30978. t + 1
  30979. }
  30980. ,
  30981. u.prototype.writeInt16LE = function(e, t, i) {
  30982. return e = +e,
  30983. t |= 0,
  30984. i || E(this, e, t, 2, 32767, -32768),
  30985. u.TYPED_ARRAY_SUPPORT ? (this[t] = 255 & e,
  30986. this[t + 1] = e >>> 8) : _(this, e, t, !0),
  30987. t + 2
  30988. }
  30989. ,
  30990. u.prototype.writeInt16BE = function(e, t, i) {
  30991. return e = +e,
  30992. t |= 0,
  30993. i || E(this, e, t, 2, 32767, -32768),
  30994. u.TYPED_ARRAY_SUPPORT ? (this[t] = e >>> 8,
  30995. this[t + 1] = 255 & e) : _(this, e, t, !1),
  30996. t + 2
  30997. }
  30998. ,
  30999. u.prototype.writeInt32LE = function(e, t, i) {
  31000. return e = +e,
  31001. t |= 0,
  31002. i || E(this, e, t, 4, 2147483647, -2147483648),
  31003. u.TYPED_ARRAY_SUPPORT ? (this[t] = 255 & e,
  31004. this[t + 1] = e >>> 8,
  31005. this[t + 2] = e >>> 16,
  31006. this[t + 3] = e >>> 24) : b(this, e, t, !0),
  31007. t + 4
  31008. }
  31009. ,
  31010. u.prototype.writeInt32BE = function(e, t, i) {
  31011. return e = +e,
  31012. t |= 0,
  31013. i || E(this, e, t, 4, 2147483647, -2147483648),
  31014. e < 0 && (e = 4294967295 + e + 1),
  31015. u.TYPED_ARRAY_SUPPORT ? (this[t] = e >>> 24,
  31016. this[t + 1] = e >>> 16,
  31017. this[t + 2] = e >>> 8,
  31018. this[t + 3] = 255 & e) : b(this, e, t, !1),
  31019. t + 4
  31020. }
  31021. ,
  31022. u.prototype.writeFloatLE = function(e, t, i) {
  31023. return T(this, e, t, !0, i)
  31024. }
  31025. ,
  31026. u.prototype.writeFloatBE = function(e, t, i) {
  31027. return T(this, e, t, !1, i)
  31028. }
  31029. ,
  31030. u.prototype.writeDoubleLE = function(e, t, i) {
  31031. return x(this, e, t, !0, i)
  31032. }
  31033. ,
  31034. u.prototype.writeDoubleBE = function(e, t, i) {
  31035. return x(this, e, t, !1, i)
  31036. }
  31037. ,
  31038. u.prototype.copy = function(e, t, i, n) {
  31039. if (i = i || 0,
  31040. n || 0 === n || (n = this.length),
  31041. t >= e.length && (t = e.length),
  31042. t = t || 0,
  31043. 0 < n && n < i && (n = i),
  31044. n === i)
  31045. return 0;
  31046. if (0 === e.length || 0 === this.length)
  31047. return 0;
  31048. if (t < 0)
  31049. throw new RangeError("targetStart out of bounds");
  31050. if (i < 0 || i >= this.length)
  31051. throw new RangeError("sourceStart out of bounds");
  31052. if (n < 0)
  31053. throw new RangeError("sourceEnd out of bounds");
  31054. n > this.length && (n = this.length),
  31055. e.length - t < n - i && (n = e.length - t + i);
  31056. var r, o = n - i;
  31057. if (this === e && i < t && t < n)
  31058. for (r = o - 1; 0 <= r; --r)
  31059. e[r + t] = this[r + i];
  31060. else if (o < 1e3 || !u.TYPED_ARRAY_SUPPORT)
  31061. for (r = 0; r < o; ++r)
  31062. e[r + t] = this[r + i];
  31063. else
  31064. Uint8Array.prototype.set.call(e, this.subarray(i, i + o), t);
  31065. return o
  31066. }
  31067. ,
  31068. u.prototype.fill = function(e, t, i, n) {
  31069. if ("string" == typeof e) {
  31070. if ("string" == typeof t ? (n = t,
  31071. t = 0,
  31072. i = this.length) : "string" == typeof i && (n = i,
  31073. i = this.length),
  31074. 1 === e.length) {
  31075. var r = e.charCodeAt(0);
  31076. r < 256 && (e = r)
  31077. }
  31078. if (void 0 !== n && "string" != typeof n)
  31079. throw new TypeError("encoding must be a string");
  31080. if ("string" == typeof n && !u.isEncoding(n))
  31081. throw new TypeError("Unknown encoding: " + n)
  31082. } else
  31083. "number" == typeof e && (e &= 255);
  31084. if (t < 0 || this.length < t || this.length < i)
  31085. throw new RangeError("Out of range index");
  31086. if (i <= t)
  31087. return this;
  31088. var o;
  31089. if (t >>>= 0,
  31090. i = void 0 === i ? this.length : i >>> 0,
  31091. "number" == typeof (e = e || 0))
  31092. for (o = t; o < i; ++o)
  31093. this[o] = e;
  31094. else {
  31095. var a = u.isBuffer(e) ? e : S(new u(e,n).toString())
  31096. , s = a.length;
  31097. for (o = 0; o < i - t; ++o)
  31098. this[o + t] = a[o % s]
  31099. }
  31100. return this
  31101. }
  31102. ;
  31103. var t = /[^+\/0-9A-Za-z-_]/g
  31104. }
  31105. ).call(this, "undefined" != typeof global ? global : "undefined" != typeof self ? self : "undefined" != typeof window ? window : {})
  31106. }
  31107. , {
  31108. "base64-js": 199,
  31109. ieee754: 200,
  31110. isarray: 201
  31111. }],
  31112. 199: [function(e, t, i) {
  31113. "use strict";
  31114. function l(e) {
  31115. var t = e.length;
  31116. if (0 < t % 4)
  31117. throw new Error("Invalid string. Length must be a multiple of 4");
  31118. return "=" === e[t - 2] ? 2 : "=" === e[t - 1] ? 1 : 0
  31119. }
  31120. function c(e, t, i) {
  31121. for (var n, r = [], o = t; o < i; o += 3)
  31122. n = (e[o] << 16) + (e[o + 1] << 8) + e[o + 2],
  31123. r.push(h[(a = n) >> 18 & 63] + h[a >> 12 & 63] + h[a >> 6 & 63] + h[63 & a]);
  31124. var a;
  31125. return r.join("")
  31126. }
  31127. i.byteLength = function(e) {
  31128. return 3 * e.length / 4 - l(e)
  31129. }
  31130. ,
  31131. i.toByteArray = function(e) {
  31132. var t, i, n, r, o, a = e.length;
  31133. r = l(e),
  31134. o = new d(3 * a / 4 - r),
  31135. i = 0 < r ? a - 4 : a;
  31136. var s = 0;
  31137. for (t = 0; t < i; t += 4,
  31138. 3)
  31139. n = u[e.charCodeAt(t)] << 18 | u[e.charCodeAt(t + 1)] << 12 | u[e.charCodeAt(t + 2)] << 6 | u[e.charCodeAt(t + 3)],
  31140. o[s++] = n >> 16 & 255,
  31141. o[s++] = n >> 8 & 255,
  31142. o[s++] = 255 & n;
  31143. return 2 === r ? (n = u[e.charCodeAt(t)] << 2 | u[e.charCodeAt(t + 1)] >> 4,
  31144. o[s++] = 255 & n) : 1 === r && (n = u[e.charCodeAt(t)] << 10 | u[e.charCodeAt(t + 1)] << 4 | u[e.charCodeAt(t + 2)] >> 2,
  31145. o[s++] = n >> 8 & 255,
  31146. o[s++] = 255 & n),
  31147. o
  31148. }
  31149. ,
  31150. i.fromByteArray = function(e) {
  31151. for (var t, i = e.length, n = i % 3, r = "", o = [], a = 0, s = i - n; a < s; a += 16383)
  31152. o.push(c(e, a, s < a + 16383 ? s : a + 16383));
  31153. return 1 == n ? (t = e[i - 1],
  31154. r += h[t >> 2],
  31155. r += h[t << 4 & 63],
  31156. r += "==") : 2 == n && (t = (e[i - 2] << 8) + e[i - 1],
  31157. r += h[t >> 10],
  31158. r += h[t >> 4 & 63],
  31159. r += h[t << 2 & 63],
  31160. r += "="),
  31161. o.push(r),
  31162. o.join("")
  31163. }
  31164. ;
  31165. for (var h = [], u = [], d = "undefined" != typeof Uint8Array ? Uint8Array : Array, n = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", r = 0, o = n.length; r < o; ++r)
  31166. h[r] = n[r],
  31167. u[n.charCodeAt(r)] = r;
  31168. u["-".charCodeAt(0)] = 62,
  31169. u["_".charCodeAt(0)] = 63
  31170. }
  31171. , {}],
  31172. 200: [function(e, t, i) {
  31173. i.read = function(e, t, i, n, r) {
  31174. 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];
  31175. for (u += d,
  31176. o = p & (1 << -h) - 1,
  31177. p >>= -h,
  31178. h += s; 0 < h; o = 256 * o + e[t + u],
  31179. u += d,
  31180. h -= 8)
  31181. ;
  31182. for (a = o & (1 << -h) - 1,
  31183. o >>= -h,
  31184. h += n; 0 < h; a = 256 * a + e[t + u],
  31185. u += d,
  31186. h -= 8)
  31187. ;
  31188. if (0 === o)
  31189. o = 1 - c;
  31190. else {
  31191. if (o === l)
  31192. return a ? NaN : 1 / 0 * (p ? -1 : 1);
  31193. a += Math.pow(2, n),
  31194. o -= c
  31195. }
  31196. return (p ? -1 : 1) * a * Math.pow(2, o - n)
  31197. }
  31198. ,
  31199. i.write = function(e, t, i, n, r, o) {
  31200. 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;
  31201. for (t = Math.abs(t),
  31202. isNaN(t) || t === 1 / 0 ? (s = isNaN(t) ? 1 : 0,
  31203. a = h) : (a = Math.floor(Math.log(t) / Math.LN2),
  31204. t * (l = Math.pow(2, -a)) < 1 && (a--,
  31205. l *= 2),
  31206. 2 <= (t += 1 <= a + u ? d / l : d * Math.pow(2, 1 - u)) * l && (a++,
  31207. l /= 2),
  31208. h <= a + u ? (s = 0,
  31209. a = h) : 1 <= a + u ? (s = (t * l - 1) * Math.pow(2, r),
  31210. a += u) : (s = t * Math.pow(2, u - 1) * Math.pow(2, r),
  31211. a = 0)); 8 <= r; e[i + p] = 255 & s,
  31212. p += f,
  31213. s /= 256,
  31214. r -= 8)
  31215. ;
  31216. for (a = a << r | s,
  31217. c += r; 0 < c; e[i + p] = 255 & a,
  31218. p += f,
  31219. a /= 256,
  31220. c -= 8)
  31221. ;
  31222. e[i + p - f] |= 128 * g
  31223. }
  31224. }
  31225. , {}],
  31226. 201: [function(e, t, i) {
  31227. var n = {}.toString;
  31228. t.exports = Array.isArray || function(e) {
  31229. return "[object Array]" == n.call(e)
  31230. }
  31231. }
  31232. , {}],
  31233. 202: [function(e, t, i) {
  31234. function n() {
  31235. this._events = this._events || {},
  31236. this._maxListeners = this._maxListeners || void 0
  31237. }
  31238. function l(e) {
  31239. return "function" == typeof e
  31240. }
  31241. function c(e) {
  31242. return "object" == typeof e && null !== e
  31243. }
  31244. function h(e) {
  31245. return void 0 === e
  31246. }
  31247. ((t.exports = n).EventEmitter = n).prototype._events = void 0,
  31248. n.prototype._maxListeners = void 0,
  31249. n.defaultMaxListeners = 10,
  31250. n.prototype.setMaxListeners = function(e) {
  31251. if (!function(e) {
  31252. return "number" == typeof e
  31253. }(e) || e < 0 || isNaN(e))
  31254. throw TypeError("n must be a positive number");
  31255. return this._maxListeners = e,
  31256. this
  31257. }
  31258. ,
  31259. n.prototype.emit = function(e) {
  31260. var t, i, n, r, o, a;
  31261. if (this._events || (this._events = {}),
  31262. "error" === e && (!this._events.error || c(this._events.error) && !this._events.error.length)) {
  31263. if ((t = arguments[1])instanceof Error)
  31264. throw t;
  31265. var s = new Error('Uncaught, unspecified "error" event. (' + t + ")");
  31266. throw s.context = t,
  31267. s
  31268. }
  31269. if (h(i = this._events[e]))
  31270. return !1;
  31271. if (l(i))
  31272. switch (arguments.length) {
  31273. case 1:
  31274. i.call(this);
  31275. break;
  31276. case 2:
  31277. i.call(this, arguments[1]);
  31278. break;
  31279. case 3:
  31280. i.call(this, arguments[1], arguments[2]);
  31281. break;
  31282. default:
  31283. r = Array.prototype.slice.call(arguments, 1),
  31284. i.apply(this, r)
  31285. }
  31286. else if (c(i))
  31287. for (r = Array.prototype.slice.call(arguments, 1),
  31288. n = (a = i.slice()).length,
  31289. o = 0; o < n; o++)
  31290. a[o].apply(this, r);
  31291. return !0
  31292. }
  31293. ,
  31294. n.prototype.on = n.prototype.addListener = function(e, t) {
  31295. var i;
  31296. if (!l(t))
  31297. throw TypeError("listener must be a function");
  31298. return this._events || (this._events = {}),
  31299. this._events.newListener && this.emit("newListener", e, l(t.listener) ? t.listener : t),
  31300. this._events[e] ? c(this._events[e]) ? this._events[e].push(t) : this._events[e] = [this._events[e], t] : this._events[e] = t,
  31301. 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,
  31302. console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.", this._events[e].length),
  31303. "function" == typeof console.trace && console.trace())),
  31304. this
  31305. }
  31306. ,
  31307. n.prototype.once = function(e, t) {
  31308. function i() {
  31309. this.removeListener(e, i),
  31310. n || (n = !0,
  31311. t.apply(this, arguments))
  31312. }
  31313. if (!l(t))
  31314. throw TypeError("listener must be a function");
  31315. var n = !1;
  31316. return i.listener = t,
  31317. this.on(e, i),
  31318. this
  31319. }
  31320. ,
  31321. n.prototype.removeListener = function(e, t) {
  31322. var i, n, r, o;
  31323. if (!l(t))
  31324. throw TypeError("listener must be a function");
  31325. if (!this._events || !this._events[e])
  31326. return this;
  31327. if (r = (i = this._events[e]).length,
  31328. n = -1,
  31329. i === t || l(i.listener) && i.listener === t)
  31330. delete this._events[e],
  31331. this._events.removeListener && this.emit("removeListener", e, t);
  31332. else if (c(i)) {
  31333. for (o = r; 0 < o--; )
  31334. if (i[o] === t || i[o].listener && i[o].listener === t) {
  31335. n = o;
  31336. break
  31337. }
  31338. if (n < 0)
  31339. return this;
  31340. 1 === i.length ? (i.length = 0,
  31341. delete this._events[e]) : i.splice(n, 1),
  31342. this._events.removeListener && this.emit("removeListener", e, t)
  31343. }
  31344. return this
  31345. }
  31346. ,
  31347. n.prototype.removeAllListeners = function(e) {
  31348. var t, i;
  31349. if (!this._events)
  31350. return this;
  31351. if (!this._events.removeListener)
  31352. return 0 === arguments.length ? this._events = {} : this._events[e] && delete this._events[e],
  31353. this;
  31354. if (0 === arguments.length) {
  31355. for (t in this._events)
  31356. "removeListener" !== t && this.removeAllListeners(t);
  31357. return this.removeAllListeners("removeListener"),
  31358. this._events = {},
  31359. this
  31360. }
  31361. if (l(i = this._events[e]))
  31362. this.removeListener(e, i);
  31363. else if (i)
  31364. for (; i.length; )
  31365. this.removeListener(e, i[i.length - 1]);
  31366. return delete this._events[e],
  31367. this
  31368. }
  31369. ,
  31370. n.prototype.listeners = function(e) {
  31371. return this._events && this._events[e] ? l(this._events[e]) ? [this._events[e]] : this._events[e].slice() : []
  31372. }
  31373. ,
  31374. n.prototype.listenerCount = function(e) {
  31375. if (this._events) {
  31376. var t = this._events[e];
  31377. if (l(t))
  31378. return 1;
  31379. if (t)
  31380. return t.length
  31381. }
  31382. return 0
  31383. }
  31384. ,
  31385. n.listenerCount = function(e, t) {
  31386. return e.listenerCount(t)
  31387. }
  31388. }
  31389. , {}],
  31390. 203: [function(e, t, i) {
  31391. function n() {
  31392. throw new Error("setTimeout has not been defined")
  31393. }
  31394. function r() {
  31395. throw new Error("clearTimeout has not been defined")
  31396. }
  31397. function o(t) {
  31398. if (h === setTimeout)
  31399. return setTimeout(t, 0);
  31400. if ((h === n || !h) && setTimeout)
  31401. return h = setTimeout,
  31402. setTimeout(t, 0);
  31403. try {
  31404. return h(t, 0)
  31405. } catch (e) {
  31406. try {
  31407. return h.call(null, t, 0)
  31408. } catch (e) {
  31409. return h.call(this, t, 0)
  31410. }
  31411. }
  31412. }
  31413. function a() {
  31414. g && p && (g = !1,
  31415. p.length ? f = p.concat(f) : m = -1,
  31416. f.length && s())
  31417. }
  31418. function s() {
  31419. if (!g) {
  31420. var e = o(a);
  31421. g = !0;
  31422. for (var t = f.length; t; ) {
  31423. for (p = f,
  31424. f = []; ++m < t; )
  31425. p && p[m].run();
  31426. m = -1,
  31427. t = f.length
  31428. }
  31429. p = null,
  31430. g = !1,
  31431. function(t) {
  31432. if (u === clearTimeout)
  31433. return clearTimeout(t);
  31434. if ((u === r || !u) && clearTimeout)
  31435. return u = clearTimeout,
  31436. clearTimeout(t);
  31437. try {
  31438. u(t)
  31439. } catch (e) {
  31440. try {
  31441. return u.call(null, t)
  31442. } catch (e) {
  31443. return u.call(this, t)
  31444. }
  31445. }
  31446. }(e)
  31447. }
  31448. }
  31449. function l(e, t) {
  31450. this.fun = e,
  31451. this.array = t
  31452. }
  31453. function c() {}
  31454. var h, u, d = t.exports = {};
  31455. !function() {
  31456. try {
  31457. h = "function" == typeof setTimeout ? setTimeout : n
  31458. } catch (e) {
  31459. h = n
  31460. }
  31461. try {
  31462. u = "function" == typeof clearTimeout ? clearTimeout : r
  31463. } catch (e) {
  31464. u = r
  31465. }
  31466. }();
  31467. var p, f = [], g = !1, m = -1;
  31468. d.nextTick = function(e) {
  31469. var t = new Array(arguments.length - 1);
  31470. if (1 < arguments.length)
  31471. for (var i = 1; i < arguments.length; i++)
  31472. t[i - 1] = arguments[i];
  31473. f.push(new l(e,t)),
  31474. 1 !== f.length || g || o(s)
  31475. }
  31476. ,
  31477. l.prototype.run = function() {
  31478. this.fun.apply(null, this.array)
  31479. }
  31480. ,
  31481. d.title = "browser",
  31482. d.browser = !0,
  31483. d.env = {},
  31484. d.argv = [],
  31485. d.version = "",
  31486. d.versions = {},
  31487. d.on = c,
  31488. d.addListener = c,
  31489. d.once = c,
  31490. d.off = c,
  31491. d.removeListener = c,
  31492. d.removeAllListeners = c,
  31493. d.emit = c,
  31494. d.binding = function(e) {
  31495. throw new Error("process.binding is not supported")
  31496. }
  31497. ,
  31498. d.cwd = function() {
  31499. return "/"
  31500. }
  31501. ,
  31502. d.chdir = function(e) {
  31503. throw new Error("process.chdir is not supported")
  31504. }
  31505. ,
  31506. d.umask = function() {
  31507. return 0
  31508. }
  31509. }
  31510. , {}],
  31511. 204: [function(e, O, L) {
  31512. (function(P) {
  31513. !function(e) {
  31514. function v(e) {
  31515. throw new RangeError(g[e])
  31516. }
  31517. function r(e, t) {
  31518. for (var i = e.length, n = []; i--; )
  31519. n[i] = t(e[i]);
  31520. return n
  31521. }
  31522. function t(e, t) {
  31523. var i = e.split("@")
  31524. , n = "";
  31525. return 1 < i.length && (n = i[0] + "@",
  31526. e = i[1]),
  31527. n + r((e = e.replace(f, ".")).split("."), t).join(".")
  31528. }
  31529. function y(e) {
  31530. for (var t, i, n = [], r = 0, o = e.length; r < o; )
  31531. 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),
  31532. r--) : n.push(t);
  31533. return n
  31534. }
  31535. function A(e) {
  31536. return r(e, function(e) {
  31537. var t = "";
  31538. return 65535 < e && (t += R((e -= 65536) >>> 10 & 1023 | 55296),
  31539. e = 56320 | 1023 & e),
  31540. t + R(e)
  31541. }).join("")
  31542. }
  31543. function C(e, t) {
  31544. return e + 22 + 75 * (e < 26) - ((0 != t) << 5)
  31545. }
  31546. function I(e, t, i) {
  31547. var n = 0;
  31548. for (e = i ? M(e / u) : e >> 1,
  31549. e += M(e / t); m * w >> 1 < e; n += _)
  31550. e = M(e / m);
  31551. return M(n + (m + 1) * e / (e + h))
  31552. }
  31553. function i(e) {
  31554. var t, i, n, r, o, a, s, l, c, h, u, d = [], p = e.length, f = 0, g = x, m = T;
  31555. for ((i = e.lastIndexOf(S)) < 0 && (i = 0),
  31556. n = 0; n < i; ++n)
  31557. 128 <= e.charCodeAt(n) && v("not-basic"),
  31558. d.push(e.charCodeAt(n));
  31559. for (r = 0 < i ? i + 1 : 0; r < p; ) {
  31560. for (o = f,
  31561. a = 1,
  31562. s = _; p <= r && v("invalid-input"),
  31563. u = e.charCodeAt(r++),
  31564. (_ <= (l = u - 48 < 10 ? u - 22 : u - 65 < 26 ? u - 65 : u - 97 < 26 ? u - 97 : _) || l > M((E - f) / a)) && v("overflow"),
  31565. f += l * a,
  31566. !(l < (c = s <= m ? b : m + w <= s ? w : s - m)); s += _)
  31567. a > M(E / (h = _ - c)) && v("overflow"),
  31568. a *= h;
  31569. m = I(f - o, t = d.length + 1, 0 == o),
  31570. M(f / t) > E - g && v("overflow"),
  31571. g += M(f / t),
  31572. f %= t,
  31573. d.splice(f++, 0, g)
  31574. }
  31575. return A(d)
  31576. }
  31577. function n(e) {
  31578. var t, i, n, r, o, a, s, l, c, h, u, d, p, f, g, m = [];
  31579. for (d = (e = y(e)).length,
  31580. t = x,
  31581. o = T,
  31582. a = i = 0; a < d; ++a)
  31583. (u = e[a]) < 128 && m.push(R(u));
  31584. for (n = r = m.length,
  31585. r && m.push(S); n < d; ) {
  31586. for (s = E,
  31587. a = 0; a < d; ++a)
  31588. t <= (u = e[a]) && u < s && (s = u);
  31589. for (s - t > M((E - i) / (p = n + 1)) && v("overflow"),
  31590. i += (s - t) * p,
  31591. t = s,
  31592. a = 0; a < d; ++a)
  31593. if ((u = e[a]) < t && ++i > E && v("overflow"),
  31594. u == t) {
  31595. for (l = i,
  31596. c = _; !(l < (h = c <= o ? b : o + w <= c ? w : c - o)); c += _)
  31597. g = l - h,
  31598. f = _ - h,
  31599. m.push(R(C(h + g % f, 0))),
  31600. l = M(g / f);
  31601. m.push(R(C(l, 0))),
  31602. o = I(i, p, n == r),
  31603. i = 0,
  31604. ++n
  31605. }
  31606. ++i,
  31607. ++t
  31608. }
  31609. return m.join("")
  31610. }
  31611. var o = "object" == typeof L && L && !L.nodeType && L
  31612. , a = "object" == typeof O && O && !O.nodeType && O
  31613. , s = "object" == typeof P && P;
  31614. s.global !== s && s.window !== s && s.self !== s || (e = s);
  31615. 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 = {
  31616. overflow: "Overflow: input needs wider integers to process",
  31617. "not-basic": "Illegal input >= 0x80 (not a basic code point)",
  31618. "invalid-input": "Invalid input"
  31619. }, m = _ - b, M = Math.floor, R = String.fromCharCode;
  31620. if (l = {
  31621. version: "1.4.1",
  31622. ucs2: {
  31623. decode: y,
  31624. encode: A
  31625. },
  31626. decode: i,
  31627. encode: n,
  31628. toASCII: function(e) {
  31629. return t(e, function(e) {
  31630. return p.test(e) ? "xn--" + n(e) : e
  31631. })
  31632. },
  31633. toUnicode: function(e) {
  31634. return t(e, function(e) {
  31635. return d.test(e) ? i(e.slice(4).toLowerCase()) : e
  31636. })
  31637. }
  31638. },
  31639. "function" == typeof define && "object" == typeof define.amd && define.amd)
  31640. define("punycode", function() {
  31641. return l
  31642. });
  31643. else if (o && a)
  31644. if (O.exports == o)
  31645. a.exports = l;
  31646. else
  31647. for (c in l)
  31648. l.hasOwnProperty(c) && (o[c] = l[c]);
  31649. else
  31650. e.punycode = l
  31651. }(this)
  31652. }
  31653. ).call(this, "undefined" != typeof global ? global : "undefined" != typeof self ? self : "undefined" != typeof window ? window : {})
  31654. }
  31655. , {}],
  31656. 205: [function(e, t, i) {
  31657. "use strict";
  31658. t.exports = function(e, t, i, n) {
  31659. t = t || "&",
  31660. i = i || "=";
  31661. var r = {};
  31662. if ("string" != typeof e || 0 === e.length)
  31663. return r;
  31664. var o = /\+/g;
  31665. e = e.split(t);
  31666. var a = 1e3;
  31667. n && "number" == typeof n.maxKeys && (a = n.maxKeys);
  31668. var s, l, c = e.length;
  31669. 0 < a && a < c && (c = a);
  31670. for (var h = 0; h < c; ++h) {
  31671. var u, d, p, f, g = e[h].replace(o, "%20"), m = g.indexOf(i);
  31672. d = 0 <= m ? (u = g.substr(0, m),
  31673. g.substr(m + 1)) : (u = g,
  31674. ""),
  31675. p = decodeURIComponent(u),
  31676. f = decodeURIComponent(d),
  31677. s = r,
  31678. l = p,
  31679. Object.prototype.hasOwnProperty.call(s, l) ? v(r[p]) ? r[p].push(f) : r[p] = [r[p], f] : r[p] = f
  31680. }
  31681. return r
  31682. }
  31683. ;
  31684. var v = Array.isArray || function(e) {
  31685. return "[object Array]" === Object.prototype.toString.call(e)
  31686. }
  31687. }
  31688. , {}],
  31689. 206: [function(e, t, i) {
  31690. "use strict";
  31691. function o(e, t) {
  31692. if (e.map)
  31693. return e.map(t);
  31694. for (var i = [], n = 0; n < e.length; n++)
  31695. i.push(t(e[n], n));
  31696. return i
  31697. }
  31698. function a(e) {
  31699. switch (typeof e) {
  31700. case "string":
  31701. return e;
  31702. case "boolean":
  31703. return e ? "true" : "false";
  31704. case "number":
  31705. return isFinite(e) ? e : "";
  31706. default:
  31707. return ""
  31708. }
  31709. }
  31710. t.exports = function(i, n, r, e) {
  31711. return n = n || "&",
  31712. r = r || "=",
  31713. null === i && (i = void 0),
  31714. "object" == typeof i ? o(l(i), function(e) {
  31715. var t = encodeURIComponent(a(e)) + r;
  31716. return s(i[e]) ? o(i[e], function(e) {
  31717. return t + encodeURIComponent(a(e))
  31718. }).join(n) : t + encodeURIComponent(a(i[e]))
  31719. }).join(n) : e ? encodeURIComponent(a(e)) + r + encodeURIComponent(a(i)) : ""
  31720. }
  31721. ;
  31722. var s = Array.isArray || function(e) {
  31723. return "[object Array]" === Object.prototype.toString.call(e)
  31724. }
  31725. , l = Object.keys || function(e) {
  31726. var t = [];
  31727. for (var i in e)
  31728. Object.prototype.hasOwnProperty.call(e, i) && t.push(i);
  31729. return t
  31730. }
  31731. }
  31732. , {}],
  31733. 207: [function(e, t, i) {
  31734. "use strict";
  31735. i.decode = i.parse = e("./decode"),
  31736. i.encode = i.stringify = e("./encode")
  31737. }
  31738. , {
  31739. "./decode": 205,
  31740. "./encode": 206
  31741. }],
  31742. 208: [function(e, t, i) {
  31743. "use strict";
  31744. function x() {
  31745. this.protocol = null,
  31746. this.slashes = null,
  31747. this.auth = null,
  31748. this.host = null,
  31749. this.port = null,
  31750. this.hostname = null,
  31751. this.hash = null,
  31752. this.search = null,
  31753. this.query = null,
  31754. this.pathname = null,
  31755. this.path = null,
  31756. this.href = null
  31757. }
  31758. function n(e, t, i) {
  31759. if (e && D.isObject(e) && e instanceof x)
  31760. return e;
  31761. var n = new x;
  31762. return n.parse(e, t, i),
  31763. n
  31764. }
  31765. var L = e("punycode")
  31766. , D = e("./util");
  31767. i.parse = n,
  31768. i.resolve = function(e, t) {
  31769. return n(e, !1, !0).resolve(t)
  31770. }
  31771. ,
  31772. i.resolveObject = function(e, t) {
  31773. return e ? n(e, !1, !0).resolveObject(t) : t
  31774. }
  31775. ,
  31776. i.format = function(e) {
  31777. return D.isString(e) && (e = n(e)),
  31778. e instanceof x ? e.format() : x.prototype.format.call(e)
  31779. }
  31780. ,
  31781. i.Url = x;
  31782. var N = /^([a-z0-9.+-]+:)/i
  31783. , r = /:[0-9]*$/
  31784. , F = /^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/
  31785. , o = ["{", "}", "|", "\\", "^", "`"].concat(["<", ">", '"', "`", " ", "\r", "\n", "\t"])
  31786. , B = ["'"].concat(o)
  31787. , V = ["%", "/", "?", ";", "#"].concat(B)
  31788. , k = ["/", "?", "#"]
  31789. , U = /^[+a-z0-9A-Z_-]{0,63}$/
  31790. , H = /^([+a-z0-9A-Z_-]{0,63})(.*)$/
  31791. , z = {
  31792. javascript: !0,
  31793. "javascript:": !0
  31794. }
  31795. , G = {
  31796. javascript: !0,
  31797. "javascript:": !0
  31798. }
  31799. , W = {
  31800. http: !0,
  31801. https: !0,
  31802. ftp: !0,
  31803. gopher: !0,
  31804. file: !0,
  31805. "http:": !0,
  31806. "https:": !0,
  31807. "ftp:": !0,
  31808. "gopher:": !0,
  31809. "file:": !0
  31810. }
  31811. , j = e("querystring");
  31812. x.prototype.parse = function(e, t, i) {
  31813. if (!D.isString(e))
  31814. throw new TypeError("Parameter 'url' must be a string, not " + typeof e);
  31815. var n = e.indexOf("?")
  31816. , r = -1 !== n && n < e.indexOf("#") ? "?" : "#"
  31817. , o = e.split(r);
  31818. o[0] = o[0].replace(/\\/g, "/");
  31819. var a = e = o.join(r);
  31820. if (a = a.trim(),
  31821. !i && 1 === e.split("#").length) {
  31822. var s = F.exec(a);
  31823. if (s)
  31824. return this.path = a,
  31825. this.href = a,
  31826. this.pathname = s[1],
  31827. s[2] ? (this.search = s[2],
  31828. this.query = t ? j.parse(this.search.substr(1)) : this.search.substr(1)) : t && (this.search = "",
  31829. this.query = {}),
  31830. this
  31831. }
  31832. var l = N.exec(a);
  31833. if (l) {
  31834. var c = (l = l[0]).toLowerCase();
  31835. this.protocol = c,
  31836. a = a.substr(l.length)
  31837. }
  31838. if (i || l || a.match(/^\/\/[^@\/]+@[^@\/]+/)) {
  31839. var h = "//" === a.substr(0, 2);
  31840. !h || l && G[l] || (a = a.substr(2),
  31841. this.slashes = !0)
  31842. }
  31843. if (!G[l] && (h || l && !W[l])) {
  31844. for (var u = -1, d = 0; d < k.length; d++) {
  31845. -1 !== (g = a.indexOf(k[d])) && (-1 === u || g < u) && (u = g)
  31846. }
  31847. var p, f;
  31848. -1 !== (f = -1 === u ? a.lastIndexOf("@") : a.lastIndexOf("@", u)) && (p = a.slice(0, f),
  31849. a = a.slice(f + 1),
  31850. this.auth = decodeURIComponent(p)),
  31851. u = -1;
  31852. for (d = 0; d < V.length; d++) {
  31853. var g;
  31854. -1 !== (g = a.indexOf(V[d])) && (-1 === u || g < u) && (u = g)
  31855. }
  31856. -1 === u && (u = a.length),
  31857. this.host = a.slice(0, u),
  31858. a = a.slice(u),
  31859. this.parseHost(),
  31860. this.hostname = this.hostname || "";
  31861. var m = "[" === this.hostname[0] && "]" === this.hostname[this.hostname.length - 1];
  31862. if (!m)
  31863. for (var v = this.hostname.split(/\./), y = (d = 0,
  31864. v.length); d < y; d++) {
  31865. var A = v[d];
  31866. if (A && !A.match(U)) {
  31867. for (var C = "", I = 0, E = A.length; I < E; I++)
  31868. C += 127 < A.charCodeAt(I) ? "x" : A[I];
  31869. if (!C.match(U)) {
  31870. var _ = v.slice(0, d)
  31871. , b = v.slice(d + 1)
  31872. , w = A.match(H);
  31873. w && (_.push(w[1]),
  31874. b.unshift(w[2])),
  31875. b.length && (a = "/" + b.join(".") + a),
  31876. this.hostname = _.join(".");
  31877. break
  31878. }
  31879. }
  31880. }
  31881. 255 < this.hostname.length ? this.hostname = "" : this.hostname = this.hostname.toLowerCase(),
  31882. m || (this.hostname = L.toASCII(this.hostname));
  31883. var T = this.port ? ":" + this.port : ""
  31884. , x = this.hostname || "";
  31885. this.host = x + T,
  31886. this.href += this.host,
  31887. m && (this.hostname = this.hostname.substr(1, this.hostname.length - 2),
  31888. "/" !== a[0] && (a = "/" + a))
  31889. }
  31890. if (!z[c])
  31891. for (d = 0,
  31892. y = B.length; d < y; d++) {
  31893. var S = B[d];
  31894. if (-1 !== a.indexOf(S)) {
  31895. var M = encodeURIComponent(S);
  31896. M === S && (M = escape(S)),
  31897. a = a.split(S).join(M)
  31898. }
  31899. }
  31900. var R = a.indexOf("#");
  31901. -1 !== R && (this.hash = a.substr(R),
  31902. a = a.slice(0, R));
  31903. var P = a.indexOf("?");
  31904. if (-1 !== P ? (this.search = a.substr(P),
  31905. this.query = a.substr(P + 1),
  31906. t && (this.query = j.parse(this.query)),
  31907. a = a.slice(0, P)) : t && (this.search = "",
  31908. this.query = {}),
  31909. a && (this.pathname = a),
  31910. W[c] && this.hostname && !this.pathname && (this.pathname = "/"),
  31911. this.pathname || this.search) {
  31912. T = this.pathname || "";
  31913. var O = this.search || "";
  31914. this.path = T + O
  31915. }
  31916. return this.href = this.format(),
  31917. this
  31918. }
  31919. ,
  31920. x.prototype.format = function() {
  31921. var e = this.auth || "";
  31922. e && (e = (e = encodeURIComponent(e)).replace(/%3A/i, ":"),
  31923. e += "@");
  31924. var t = this.protocol || ""
  31925. , i = this.pathname || ""
  31926. , n = this.hash || ""
  31927. , r = !1
  31928. , o = "";
  31929. this.host ? r = e + this.host : this.hostname && (r = e + (-1 === this.hostname.indexOf(":") ? this.hostname : "[" + this.hostname + "]"),
  31930. this.port && (r += ":" + this.port)),
  31931. this.query && D.isObject(this.query) && Object.keys(this.query).length && (o = j.stringify(this.query));
  31932. var a = this.search || o && "?" + o || "";
  31933. return t && ":" !== t.substr(-1) && (t += ":"),
  31934. this.slashes || (!t || W[t]) && !1 !== r ? (r = "//" + (r || ""),
  31935. i && "/" !== i.charAt(0) && (i = "/" + i)) : r = r || "",
  31936. n && "#" !== n.charAt(0) && (n = "#" + n),
  31937. a && "?" !== a.charAt(0) && (a = "?" + a),
  31938. t + r + (i = i.replace(/[?#]/g, function(e) {
  31939. return encodeURIComponent(e)
  31940. })) + (a = a.replace("#", "%23")) + n
  31941. }
  31942. ,
  31943. x.prototype.resolve = function(e) {
  31944. return this.resolveObject(n(e, !1, !0)).format()
  31945. }
  31946. ,
  31947. x.prototype.resolveObject = function(e) {
  31948. if (D.isString(e)) {
  31949. var t = new x;
  31950. t.parse(e, !1, !0),
  31951. e = t
  31952. }
  31953. for (var i = new x, n = Object.keys(this), r = 0; r < n.length; r++) {
  31954. var o = n[r];
  31955. i[o] = this[o]
  31956. }
  31957. if (i.hash = e.hash,
  31958. "" === e.href)
  31959. return i.href = i.format(),
  31960. i;
  31961. if (e.slashes && !e.protocol) {
  31962. for (var a = Object.keys(e), s = 0; s < a.length; s++) {
  31963. var l = a[s];
  31964. "protocol" !== l && (i[l] = e[l])
  31965. }
  31966. return W[i.protocol] && i.hostname && !i.pathname && (i.path = i.pathname = "/"),
  31967. i.href = i.format(),
  31968. i
  31969. }
  31970. if (e.protocol && e.protocol !== i.protocol) {
  31971. if (!W[e.protocol]) {
  31972. for (var c = Object.keys(e), h = 0; h < c.length; h++) {
  31973. var u = c[h];
  31974. i[u] = e[u]
  31975. }
  31976. return i.href = i.format(),
  31977. i
  31978. }
  31979. if (i.protocol = e.protocol,
  31980. e.host || G[e.protocol])
  31981. i.pathname = e.pathname;
  31982. else {
  31983. for (var d = (e.pathname || "").split("/"); d.length && !(e.host = d.shift()); )
  31984. ;
  31985. e.host || (e.host = ""),
  31986. e.hostname || (e.hostname = ""),
  31987. "" !== d[0] && d.unshift(""),
  31988. d.length < 2 && d.unshift(""),
  31989. i.pathname = d.join("/")
  31990. }
  31991. if (i.search = e.search,
  31992. i.query = e.query,
  31993. i.host = e.host || "",
  31994. i.auth = e.auth,
  31995. i.hostname = e.hostname || e.host,
  31996. i.port = e.port,
  31997. i.pathname || i.search) {
  31998. var p = i.pathname || ""
  31999. , f = i.search || "";
  32000. i.path = p + f
  32001. }
  32002. return i.slashes = i.slashes || e.slashes,
  32003. i.href = i.format(),
  32004. i
  32005. }
  32006. var g = i.pathname && "/" === i.pathname.charAt(0)
  32007. , m = e.host || e.pathname && "/" === e.pathname.charAt(0)
  32008. , v = m || g || i.host && e.pathname
  32009. , y = v
  32010. , A = i.pathname && i.pathname.split("/") || []
  32011. , C = (d = e.pathname && e.pathname.split("/") || [],
  32012. i.protocol && !W[i.protocol]);
  32013. if (C && (i.hostname = "",
  32014. i.port = null,
  32015. i.host && ("" === A[0] ? A[0] = i.host : A.unshift(i.host)),
  32016. i.host = "",
  32017. e.protocol && (e.hostname = null,
  32018. e.port = null,
  32019. e.host && ("" === d[0] ? d[0] = e.host : d.unshift(e.host)),
  32020. e.host = null),
  32021. v = v && ("" === d[0] || "" === A[0])),
  32022. m)
  32023. i.host = e.host || "" === e.host ? e.host : i.host,
  32024. i.hostname = e.hostname || "" === e.hostname ? e.hostname : i.hostname,
  32025. i.search = e.search,
  32026. i.query = e.query,
  32027. A = d;
  32028. else if (d.length)
  32029. (A = A || []).pop(),
  32030. A = A.concat(d),
  32031. i.search = e.search,
  32032. i.query = e.query;
  32033. else if (!D.isNullOrUndefined(e.search)) {
  32034. if (C)
  32035. i.hostname = i.host = A.shift(),
  32036. (w = !!(i.host && 0 < i.host.indexOf("@")) && i.host.split("@")) && (i.auth = w.shift(),
  32037. i.host = i.hostname = w.shift());
  32038. return i.search = e.search,
  32039. i.query = e.query,
  32040. D.isNull(i.pathname) && D.isNull(i.search) || (i.path = (i.pathname ? i.pathname : "") + (i.search ? i.search : "")),
  32041. i.href = i.format(),
  32042. i
  32043. }
  32044. if (!A.length)
  32045. return i.pathname = null,
  32046. i.search ? i.path = "/" + i.search : i.path = null,
  32047. i.href = i.format(),
  32048. i;
  32049. 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--)
  32050. "." === (I = A[b]) ? A.splice(b, 1) : ".." === I ? (A.splice(b, 1),
  32051. _++) : _ && (A.splice(b, 1),
  32052. _--);
  32053. if (!v && !y)
  32054. for (; _--; )
  32055. A.unshift("..");
  32056. !v || "" === A[0] || A[0] && "/" === A[0].charAt(0) || A.unshift(""),
  32057. E && "/" !== A.join("/").substr(-1) && A.push("");
  32058. var w, T = "" === A[0] || A[0] && "/" === A[0].charAt(0);
  32059. C && (i.hostname = i.host = T ? "" : A.length ? A.shift() : "",
  32060. (w = !!(i.host && 0 < i.host.indexOf("@")) && i.host.split("@")) && (i.auth = w.shift(),
  32061. i.host = i.hostname = w.shift()));
  32062. return (v = v || i.host && A.length) && !T && A.unshift(""),
  32063. A.length ? i.pathname = A.join("/") : (i.pathname = null,
  32064. i.path = null),
  32065. D.isNull(i.pathname) && D.isNull(i.search) || (i.path = (i.pathname ? i.pathname : "") + (i.search ? i.search : "")),
  32066. i.auth = e.auth || i.auth,
  32067. i.slashes = i.slashes || e.slashes,
  32068. i.href = i.format(),
  32069. i
  32070. }
  32071. ,
  32072. x.prototype.parseHost = function() {
  32073. var e = this.host
  32074. , t = r.exec(e);
  32075. t && (":" !== (t = t[0]) && (this.port = t.substr(1)),
  32076. e = e.substr(0, e.length - t.length)),
  32077. e && (this.hostname = e)
  32078. }
  32079. }
  32080. , {
  32081. "./util": 209,
  32082. punycode: 204,
  32083. querystring: 207
  32084. }],
  32085. 209: [function(e, t, i) {
  32086. "use strict";
  32087. t.exports = {
  32088. isString: function(e) {
  32089. return "string" == typeof e
  32090. },
  32091. isObject: function(e) {
  32092. return "object" == typeof e && null !== e
  32093. },
  32094. isNull: function(e) {
  32095. return null === e
  32096. },
  32097. isNullOrUndefined: function(e) {
  32098. return null == e
  32099. }
  32100. }
  32101. }
  32102. , {}],
  32103. 210: [function(e, t, i) {
  32104. "use strict";
  32105. function r(e) {
  32106. return c + e
  32107. }
  32108. function s(e) {
  32109. if ("string" != typeof e)
  32110. throw new TypeError("key must be a string.")
  32111. }
  32112. var l = Object.prototype.hasOwnProperty
  32113. , c = "~";
  32114. t.exports = function(t) {
  32115. var o = Object.create(null)
  32116. , n = 0
  32117. , a = {};
  32118. return function(e, t) {
  32119. for (var i in t)
  32120. Object.defineProperty(e, i, {
  32121. value: t[i],
  32122. configurable: !0,
  32123. writable: !0
  32124. })
  32125. }(a, {
  32126. get: function(e, t) {
  32127. s(e);
  32128. var i = r(e);
  32129. return i in o ? o[i] : t
  32130. },
  32131. set: function(e, t) {
  32132. s(e);
  32133. var i = r(e);
  32134. return i in o || ++n,
  32135. o[i] = t
  32136. },
  32137. has: function(e) {
  32138. return s(e),
  32139. r(e)in o
  32140. },
  32141. delete: function(e) {
  32142. s(e);
  32143. var t = r(e);
  32144. return t in o && (--n,
  32145. delete o[t],
  32146. !0)
  32147. },
  32148. clear: function() {
  32149. o = Object.create(null),
  32150. n = 0
  32151. },
  32152. forEach: function(e, t) {
  32153. if ("function" != typeof e)
  32154. throw new TypeError("`callback` must be a function");
  32155. for (var i in o)
  32156. if (l.call(o, i)) {
  32157. var n = i.substring(c.length)
  32158. , r = o[i];
  32159. e.call(t, r, n, a)
  32160. }
  32161. }
  32162. }),
  32163. Object.defineProperty(a, "size", {
  32164. get: function() {
  32165. return n
  32166. },
  32167. configurable: !0
  32168. }),
  32169. "object" == typeof t && null !== t && Object.keys(t).forEach(function(e) {
  32170. a.set(e, t[e])
  32171. }),
  32172. a
  32173. }
  32174. }
  32175. , {}],
  32176. 211: [function(e, t, i) {
  32177. t.exports = e("./lib/heap")
  32178. }
  32179. , {
  32180. "./lib/heap": 212
  32181. }],
  32182. 212: [function(e, y, A) {
  32183. (function() {
  32184. var e, d, l, p, f, t, c, i, g, m, n, r, o, h, u, a, s;
  32185. function v(e) {
  32186. this.cmp = null != e ? e : d,
  32187. this.nodes = []
  32188. }
  32189. l = Math.floor,
  32190. m = Math.min,
  32191. d = function(e, t) {
  32192. return e < t ? -1 : t < e ? 1 : 0
  32193. }
  32194. ,
  32195. g = function(e, t, i, n, r) {
  32196. var o;
  32197. if (null == i && (i = 0),
  32198. null == r && (r = d),
  32199. i < 0)
  32200. throw new Error("lo must be non-negative");
  32201. for (null == n && (n = e.length); i < n; )
  32202. r(t, e[o = l((i + n) / 2)]) < 0 ? n = o : i = o + 1;
  32203. return [].splice.apply(e, [i, i - i].concat(t)),
  32204. t
  32205. }
  32206. ,
  32207. t = function(e, t, i) {
  32208. return null == i && (i = d),
  32209. e.push(t),
  32210. h(e, 0, e.length - 1, i)
  32211. }
  32212. ,
  32213. f = function(e, t) {
  32214. var i, n;
  32215. return null == t && (t = d),
  32216. i = e.pop(),
  32217. e.length ? (n = e[0],
  32218. e[0] = i,
  32219. u(e, 0, t)) : n = i,
  32220. n
  32221. }
  32222. ,
  32223. i = function(e, t, i) {
  32224. var n;
  32225. return null == i && (i = d),
  32226. n = e[0],
  32227. e[0] = t,
  32228. u(e, 0, i),
  32229. n
  32230. }
  32231. ,
  32232. c = function(e, t, i) {
  32233. var n;
  32234. return null == i && (i = d),
  32235. e.length && i(e[0], t) < 0 && (t = (n = [e[0], t])[0],
  32236. e[0] = n[1],
  32237. u(e, 0, i)),
  32238. t
  32239. }
  32240. ,
  32241. p = function(i, e) {
  32242. var t, n, r, o, a, s;
  32243. for (null == e && (e = d),
  32244. a = [],
  32245. n = 0,
  32246. r = (o = function() {
  32247. s = [];
  32248. for (var e = 0, t = l(i.length / 2); 0 <= t ? e < t : t < e; 0 <= t ? e++ : e--)
  32249. s.push(e);
  32250. return s
  32251. }
  32252. .apply(this).reverse()).length; n < r; n++)
  32253. t = o[n],
  32254. a.push(u(i, t, e));
  32255. return a
  32256. }
  32257. ,
  32258. o = function(e, t, i) {
  32259. var n;
  32260. if (null == i && (i = d),
  32261. -1 !== (n = e.indexOf(t)))
  32262. return h(e, 0, n, i),
  32263. u(e, n, i)
  32264. }
  32265. ,
  32266. n = function(e, t, i) {
  32267. var n, r, o, a, s;
  32268. if (null == i && (i = d),
  32269. !(r = e.slice(0, t)).length)
  32270. return r;
  32271. for (p(r, i),
  32272. o = 0,
  32273. a = (s = e.slice(t)).length; o < a; o++)
  32274. n = s[o],
  32275. c(r, n, i);
  32276. return r.sort(i).reverse()
  32277. }
  32278. ,
  32279. r = function(e, t, i) {
  32280. var n, r, o, a, s, l, c, h, u;
  32281. if (null == i && (i = d),
  32282. 10 * t <= e.length) {
  32283. if (!(o = e.slice(0, t).sort(i)).length)
  32284. return o;
  32285. for (r = o[o.length - 1],
  32286. a = 0,
  32287. l = (c = e.slice(t)).length; a < l; a++)
  32288. i(n = c[a], r) < 0 && (g(o, n, 0, null, i),
  32289. o.pop(),
  32290. r = o[o.length - 1]);
  32291. return o
  32292. }
  32293. for (p(e, i),
  32294. u = [],
  32295. s = 0,
  32296. h = m(t, e.length); 0 <= h ? s < h : h < s; 0 <= h ? ++s : --s)
  32297. u.push(f(e, i));
  32298. return u
  32299. }
  32300. ,
  32301. h = function(e, t, i, n) {
  32302. var r, o, a;
  32303. for (null == n && (n = d),
  32304. r = e[i]; t < i && n(r, o = e[a = i - 1 >> 1]) < 0; )
  32305. e[i] = o,
  32306. i = a;
  32307. return e[i] = r
  32308. }
  32309. ,
  32310. u = function(e, t, i) {
  32311. var n, r, o, a, s;
  32312. for (null == i && (i = d),
  32313. r = e.length,
  32314. o = e[s = t],
  32315. n = 2 * t + 1; n < r; )
  32316. (a = n + 1) < r && !(i(e[n], e[a]) < 0) && (n = a),
  32317. e[t] = e[n],
  32318. n = 2 * (t = n) + 1;
  32319. return e[t] = o,
  32320. h(e, s, t, i)
  32321. }
  32322. ,
  32323. v.push = t,
  32324. v.pop = f,
  32325. v.replace = i,
  32326. v.pushpop = c,
  32327. v.heapify = p,
  32328. v.updateItem = o,
  32329. v.nlargest = n,
  32330. v.nsmallest = r,
  32331. v.prototype.push = function(e) {
  32332. return t(this.nodes, e, this.cmp)
  32333. }
  32334. ,
  32335. v.prototype.pop = function() {
  32336. return f(this.nodes, this.cmp)
  32337. }
  32338. ,
  32339. v.prototype.peek = function() {
  32340. return this.nodes[0]
  32341. }
  32342. ,
  32343. v.prototype.contains = function(e) {
  32344. return -1 !== this.nodes.indexOf(e)
  32345. }
  32346. ,
  32347. v.prototype.replace = function(e) {
  32348. return i(this.nodes, e, this.cmp)
  32349. }
  32350. ,
  32351. v.prototype.pushpop = function(e) {
  32352. return c(this.nodes, e, this.cmp)
  32353. }
  32354. ,
  32355. v.prototype.heapify = function() {
  32356. return p(this.nodes, this.cmp)
  32357. }
  32358. ,
  32359. v.prototype.updateItem = function(e) {
  32360. return o(this.nodes, e, this.cmp)
  32361. }
  32362. ,
  32363. v.prototype.clear = function() {
  32364. return this.nodes = []
  32365. }
  32366. ,
  32367. v.prototype.empty = function() {
  32368. return 0 === this.nodes.length
  32369. }
  32370. ,
  32371. v.prototype.size = function() {
  32372. return this.nodes.length
  32373. }
  32374. ,
  32375. v.prototype.clone = function() {
  32376. var e;
  32377. return (e = new v).nodes = this.nodes.slice(0),
  32378. e
  32379. }
  32380. ,
  32381. v.prototype.toArray = function() {
  32382. return this.nodes.slice(0)
  32383. }
  32384. ,
  32385. v.prototype.insert = v.prototype.push,
  32386. v.prototype.top = v.prototype.peek,
  32387. v.prototype.front = v.prototype.peek,
  32388. v.prototype.has = v.prototype.contains,
  32389. v.prototype.copy = v.prototype.clone,
  32390. e = v,
  32391. a = this,
  32392. s = function() {
  32393. return e
  32394. }
  32395. ,
  32396. "function" == typeof define && define.amd ? define([], s) : "object" == typeof A ? y.exports = s() : a.Heap = s()
  32397. }
  32398. ).call(this)
  32399. }
  32400. , {}],
  32401. 213: [function(e, t, i) {
  32402. function n() {}
  32403. function o(e) {
  32404. if ("object" != typeof this)
  32405. throw new TypeError("Promises must be constructed via new");
  32406. if ("function" != typeof e)
  32407. throw new TypeError("not a function");
  32408. this._state = 0,
  32409. this._handled = !1,
  32410. this._value = void 0,
  32411. this._deferreds = [],
  32412. h(e, this)
  32413. }
  32414. function r(i, n) {
  32415. for (; 3 === i._state; )
  32416. i = i._value;
  32417. return 0 === i._state ? void i._deferreds.push(n) : (i._handled = !0,
  32418. void o._immediateFn(function() {
  32419. var e = 1 === i._state ? n.onFulfilled : n.onRejected;
  32420. if (null !== e) {
  32421. var t;
  32422. try {
  32423. t = e(i._value)
  32424. } catch (e) {
  32425. return void s(n.promise, e)
  32426. }
  32427. a(n.promise, t)
  32428. } else
  32429. (1 === i._state ? a : s)(n.promise, i._value)
  32430. }))
  32431. }
  32432. function a(e, t) {
  32433. try {
  32434. if (t === e)
  32435. throw new TypeError("A promise cannot be resolved with itself.");
  32436. if (t && ("object" == typeof t || "function" == typeof t)) {
  32437. var i = t.then;
  32438. if (t instanceof o)
  32439. return e._state = 3,
  32440. e._value = t,
  32441. void l(e);
  32442. if ("function" == typeof i)
  32443. return void h(function(e, t) {
  32444. return function() {
  32445. e.apply(t, arguments)
  32446. }
  32447. }(i, t), e)
  32448. }
  32449. e._state = 1,
  32450. e._value = t,
  32451. l(e)
  32452. } catch (t) {
  32453. s(e, t)
  32454. }
  32455. }
  32456. function s(e, t) {
  32457. e._state = 2,
  32458. e._value = t,
  32459. l(e)
  32460. }
  32461. function l(e) {
  32462. 2 === e._state && 0 === e._deferreds.length && o._immediateFn(function() {
  32463. e._handled || o._unhandledRejectionFn(e._value)
  32464. });
  32465. for (var t = 0, i = e._deferreds.length; t < i; t++)
  32466. r(e, e._deferreds[t]);
  32467. e._deferreds = null
  32468. }
  32469. function c(e, t, i) {
  32470. this.onFulfilled = "function" == typeof e ? e : null,
  32471. this.onRejected = "function" == typeof t ? t : null,
  32472. this.promise = i
  32473. }
  32474. function h(e, t) {
  32475. var i = !1;
  32476. try {
  32477. e(function(e) {
  32478. i || (i = !0,
  32479. a(t, e))
  32480. }, function(e) {
  32481. i || (i = !0,
  32482. s(t, e))
  32483. })
  32484. } catch (e) {
  32485. if (i)
  32486. return;
  32487. i = !0,
  32488. s(t, e)
  32489. }
  32490. }
  32491. var u, d;
  32492. u = this,
  32493. d = setTimeout,
  32494. o.prototype.catch = function(e) {
  32495. return this.then(null, e)
  32496. }
  32497. ,
  32498. o.prototype.then = function(e, t) {
  32499. var i = new this.constructor(n);
  32500. return r(this, new c(e,t,i)),
  32501. i
  32502. }
  32503. ,
  32504. o.all = function(e) {
  32505. var s = Array.prototype.slice.call(e);
  32506. return new o(function(n, r) {
  32507. function o(t, e) {
  32508. try {
  32509. if (e && ("object" == typeof e || "function" == typeof e)) {
  32510. var i = e.then;
  32511. if ("function" == typeof i)
  32512. return void i.call(e, function(e) {
  32513. o(t, e)
  32514. }, r)
  32515. }
  32516. s[t] = e,
  32517. 0 == --a && n(s)
  32518. } catch (e) {
  32519. r(e)
  32520. }
  32521. }
  32522. if (0 === s.length)
  32523. return n([]);
  32524. for (var a = s.length, e = 0; e < s.length; e++)
  32525. o(e, s[e])
  32526. }
  32527. )
  32528. }
  32529. ,
  32530. o.resolve = function(t) {
  32531. return t && "object" == typeof t && t.constructor === o ? t : new o(function(e) {
  32532. e(t)
  32533. }
  32534. )
  32535. }
  32536. ,
  32537. o.reject = function(i) {
  32538. return new o(function(e, t) {
  32539. t(i)
  32540. }
  32541. )
  32542. }
  32543. ,
  32544. o.race = function(r) {
  32545. return new o(function(e, t) {
  32546. for (var i = 0, n = r.length; i < n; i++)
  32547. r[i].then(e, t)
  32548. }
  32549. )
  32550. }
  32551. ,
  32552. o._immediateFn = "function" == typeof setImmediate && function(e) {
  32553. setImmediate(e)
  32554. }
  32555. || function(e) {
  32556. d(e, 0)
  32557. }
  32558. ,
  32559. o._unhandledRejectionFn = function(e) {
  32560. "undefined" != typeof console && console && console.warn("Possible Unhandled Promise Rejection:", e)
  32561. }
  32562. ,
  32563. o._setImmediateFn = function(e) {
  32564. o._immediateFn = e
  32565. }
  32566. ,
  32567. o._setUnhandledRejectionFn = function(e) {
  32568. o._unhandledRejectionFn = e
  32569. }
  32570. ,
  32571. void 0 !== t && t.exports ? t.exports = o : u.Promise || (u.Promise = o)
  32572. }
  32573. , {}],
  32574. 214: [function(p, i, e) {
  32575. (function(d) {
  32576. var e, t;
  32577. e = this,
  32578. t = function(I, e) {
  32579. "use strict";
  32580. var a, t, u, i, s, n, r, o = {};
  32581. return o.ByteBuffer = I,
  32582. o.Long = I.Long || null,
  32583. o.VERSION = "5.0.1",
  32584. o.WIRE_TYPES = {},
  32585. o.WIRE_TYPES.VARINT = 0,
  32586. o.WIRE_TYPES.BITS64 = 1,
  32587. o.WIRE_TYPES.LDELIM = 2,
  32588. o.WIRE_TYPES.STARTGROUP = 3,
  32589. o.WIRE_TYPES.ENDGROUP = 4,
  32590. o.WIRE_TYPES.BITS32 = 5,
  32591. o.PACKABLE_WIRE_TYPES = [o.WIRE_TYPES.VARINT, o.WIRE_TYPES.BITS64, o.WIRE_TYPES.BITS32],
  32592. o.TYPES = {
  32593. int32: {
  32594. name: "int32",
  32595. wireType: o.WIRE_TYPES.VARINT,
  32596. defaultValue: 0
  32597. },
  32598. uint32: {
  32599. name: "uint32",
  32600. wireType: o.WIRE_TYPES.VARINT,
  32601. defaultValue: 0
  32602. },
  32603. sint32: {
  32604. name: "sint32",
  32605. wireType: o.WIRE_TYPES.VARINT,
  32606. defaultValue: 0
  32607. },
  32608. int64: {
  32609. name: "int64",
  32610. wireType: o.WIRE_TYPES.VARINT,
  32611. defaultValue: o.Long ? o.Long.ZERO : void 0
  32612. },
  32613. uint64: {
  32614. name: "uint64",
  32615. wireType: o.WIRE_TYPES.VARINT,
  32616. defaultValue: o.Long ? o.Long.UZERO : void 0
  32617. },
  32618. sint64: {
  32619. name: "sint64",
  32620. wireType: o.WIRE_TYPES.VARINT,
  32621. defaultValue: o.Long ? o.Long.ZERO : void 0
  32622. },
  32623. bool: {
  32624. name: "bool",
  32625. wireType: o.WIRE_TYPES.VARINT,
  32626. defaultValue: !1
  32627. },
  32628. double: {
  32629. name: "double",
  32630. wireType: o.WIRE_TYPES.BITS64,
  32631. defaultValue: 0
  32632. },
  32633. string: {
  32634. name: "string",
  32635. wireType: o.WIRE_TYPES.LDELIM,
  32636. defaultValue: ""
  32637. },
  32638. bytes: {
  32639. name: "bytes",
  32640. wireType: o.WIRE_TYPES.LDELIM,
  32641. defaultValue: null
  32642. },
  32643. fixed32: {
  32644. name: "fixed32",
  32645. wireType: o.WIRE_TYPES.BITS32,
  32646. defaultValue: 0
  32647. },
  32648. sfixed32: {
  32649. name: "sfixed32",
  32650. wireType: o.WIRE_TYPES.BITS32,
  32651. defaultValue: 0
  32652. },
  32653. fixed64: {
  32654. name: "fixed64",
  32655. wireType: o.WIRE_TYPES.BITS64,
  32656. defaultValue: o.Long ? o.Long.UZERO : void 0
  32657. },
  32658. sfixed64: {
  32659. name: "sfixed64",
  32660. wireType: o.WIRE_TYPES.BITS64,
  32661. defaultValue: o.Long ? o.Long.ZERO : void 0
  32662. },
  32663. float: {
  32664. name: "float",
  32665. wireType: o.WIRE_TYPES.BITS32,
  32666. defaultValue: 0
  32667. },
  32668. enum: {
  32669. name: "enum",
  32670. wireType: o.WIRE_TYPES.VARINT,
  32671. defaultValue: 0
  32672. },
  32673. message: {
  32674. name: "message",
  32675. wireType: o.WIRE_TYPES.LDELIM,
  32676. defaultValue: null
  32677. },
  32678. group: {
  32679. name: "group",
  32680. wireType: o.WIRE_TYPES.STARTGROUP,
  32681. defaultValue: null
  32682. }
  32683. },
  32684. 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],
  32685. o.ID_MIN = 1,
  32686. o.ID_MAX = 536870911,
  32687. o.convertFieldsToCamelCase = !1,
  32688. o.populateAccessors = !0,
  32689. o.populateDefaults = !0,
  32690. o.Util = ((r = {}).IS_NODE = !("object" != typeof d || d + "" != "[object process]" || d.browser),
  32691. r.XHR = function() {
  32692. for (var e = [function() {
  32693. return new XMLHttpRequest
  32694. }
  32695. , function() {
  32696. return new ActiveXObject("Msxml2.XMLHTTP")
  32697. }
  32698. , function() {
  32699. return new ActiveXObject("Msxml3.XMLHTTP")
  32700. }
  32701. , function() {
  32702. return new ActiveXObject("Microsoft.XMLHTTP")
  32703. }
  32704. ], t = null, i = 0; i < e.length; i++) {
  32705. try {
  32706. t = e[i]()
  32707. } catch (e) {
  32708. continue
  32709. }
  32710. break
  32711. }
  32712. if (!t)
  32713. throw Error("XMLHttpRequest is not supported");
  32714. return t
  32715. }
  32716. ,
  32717. r.fetch = function(e, i) {
  32718. if (i && "function" != typeof i && (i = null),
  32719. r.IS_NODE) {
  32720. var t = p("fs");
  32721. if (i)
  32722. t.readFile(e, function(e, t) {
  32723. i(e ? null : "" + t)
  32724. });
  32725. else
  32726. try {
  32727. return t.readFileSync(e)
  32728. } catch (e) {
  32729. return null
  32730. }
  32731. } else {
  32732. var n = r.XHR();
  32733. if (n.open("GET", e, !!i),
  32734. n.setRequestHeader("Accept", "text/plain"),
  32735. "function" == typeof n.overrideMimeType && n.overrideMimeType("text/plain"),
  32736. !i)
  32737. return n.send(null),
  32738. 200 == n.status || 0 == n.status && "string" == typeof n.responseText ? n.responseText : null;
  32739. if (n.onreadystatechange = function() {
  32740. 4 == n.readyState && i(200 == n.status || 0 == n.status && "string" == typeof n.responseText ? n.responseText : null)
  32741. }
  32742. ,
  32743. 4 == n.readyState)
  32744. return;
  32745. n.send(null)
  32746. }
  32747. }
  32748. ,
  32749. r.toCamelCase = function(e) {
  32750. return e.replace(/_([a-zA-Z])/g, function(e, t) {
  32751. return t.toUpperCase()
  32752. })
  32753. }
  32754. ,
  32755. r),
  32756. o.Lang = {
  32757. DELIM: /[\s\{\}=;:\[\],'"\(\)<>]/g,
  32758. RULE: /^(?:required|optional|repeated|map)$/,
  32759. TYPE: /^(?:double|float|int32|uint32|sint32|int64|uint64|sint64|fixed32|sfixed32|fixed64|sfixed64|bool|string|bytes)$/,
  32760. NAME: /^[a-zA-Z_][a-zA-Z_0-9]*$/,
  32761. TYPEDEF: /^[a-zA-Z][a-zA-Z_0-9]*$/,
  32762. TYPEREF: /^(?:\.?[a-zA-Z_][a-zA-Z_0-9]*)+$/,
  32763. FQTYPEREF: /^(?:\.[a-zA-Z][a-zA-Z_0-9]*)+$/,
  32764. NUMBER: /^-?(?:[1-9][0-9]*|0|0[xX][0-9a-fA-F]+|0[0-7]+|([0-9]*(\.[0-9]*)?([Ee][+-]?[0-9]+)?)|inf|nan)$/,
  32765. NUMBER_DEC: /^(?:[1-9][0-9]*|0)$/,
  32766. NUMBER_HEX: /^0[xX][0-9a-fA-F]+$/,
  32767. NUMBER_OCT: /^0[0-7]+$/,
  32768. NUMBER_FLT: /^([0-9]*(\.[0-9]*)?([Ee][+-]?[0-9]+)?|inf|nan)$/,
  32769. BOOL: /^(?:true|false)$/i,
  32770. ID: /^(?:[1-9][0-9]*|0|0[xX][0-9a-fA-F]+|0[0-7]+)$/,
  32771. NEGID: /^\-?(?:[1-9][0-9]*|0|0[xX][0-9a-fA-F]+|0[0-7]+)$/,
  32772. WHITESPACE: /\s/,
  32773. STRING: /(?:"([^"\\]*(?:\\.[^"\\]*)*)")|(?:'([^'\\]*(?:\\.[^'\\]*)*)')/g,
  32774. STRING_DQ: /(?:"([^"\\]*(?:\\.[^"\\]*)*)")/g,
  32775. STRING_SQ: /(?:'([^'\\]*(?:\\.[^'\\]*)*)')/g
  32776. },
  32777. o.DotProto = function(r, a) {
  32778. function s(e, t) {
  32779. var i = -1
  32780. , n = 1;
  32781. if ("-" == e.charAt(0) && (n = -1,
  32782. e = e.substring(1)),
  32783. a.NUMBER_DEC.test(e))
  32784. i = parseInt(e);
  32785. else if (a.NUMBER_HEX.test(e))
  32786. i = parseInt(e.substring(2), 16);
  32787. else {
  32788. if (!a.NUMBER_OCT.test(e))
  32789. throw Error("illegal id value: " + (n < 0 ? "-" : "") + e);
  32790. i = parseInt(e.substring(1), 8)
  32791. }
  32792. if (i = n * i | 0,
  32793. !t && i < 0)
  32794. throw Error("illegal id value: " + (n < 0 ? "-" : "") + e);
  32795. return i
  32796. }
  32797. function o(e) {
  32798. var t = 1;
  32799. if ("-" == e.charAt(0) && (t = -1,
  32800. e = e.substring(1)),
  32801. a.NUMBER_DEC.test(e))
  32802. return t * parseInt(e, 10);
  32803. if (a.NUMBER_HEX.test(e))
  32804. return t * parseInt(e.substring(2), 16);
  32805. if (a.NUMBER_OCT.test(e))
  32806. return t * parseInt(e.substring(1), 8);
  32807. if ("inf" === e)
  32808. return t * (1 / 0);
  32809. if ("nan" === e)
  32810. return NaN;
  32811. if (a.NUMBER_FLT.test(e))
  32812. return t * parseFloat(e);
  32813. throw Error("illegal number value: " + (t < 0 ? "-" : "") + e)
  32814. }
  32815. function n(e, t, i) {
  32816. void 0 === e[t] ? e[t] = i : (Array.isArray(e[t]) || (e[t] = [e[t]]),
  32817. e[t].push(i))
  32818. }
  32819. function t(e) {
  32820. this.source = e + "",
  32821. this.index = 0,
  32822. this.line = 1,
  32823. this.stack = [],
  32824. this._stringOpen = null
  32825. }
  32826. var e = {}
  32827. , i = t.prototype;
  32828. i._readString = function() {
  32829. var e = '"' === this._stringOpen ? a.STRING_DQ : a.STRING_SQ;
  32830. e.lastIndex = this.index - 1;
  32831. var t = e.exec(this.source);
  32832. if (!t)
  32833. throw Error("unterminated string");
  32834. return this.index = e.lastIndex,
  32835. this.stack.push(this._stringOpen),
  32836. this._stringOpen = null,
  32837. t[1]
  32838. }
  32839. ,
  32840. i.next = function() {
  32841. if (0 < this.stack.length)
  32842. return this.stack.shift();
  32843. if (this.index >= this.source.length)
  32844. return null;
  32845. if (null !== this._stringOpen)
  32846. return this._readString();
  32847. var e, t, i;
  32848. do {
  32849. for (e = !1; a.WHITESPACE.test(i = this.source.charAt(this.index)); )
  32850. if ("\n" === i && ++this.line,
  32851. ++this.index === this.source.length)
  32852. return null;
  32853. if ("/" === this.source.charAt(this.index))
  32854. if (++this.index,
  32855. "/" === this.source.charAt(this.index)) {
  32856. for (; "\n" !== this.source.charAt(++this.index); )
  32857. if (this.index == this.source.length)
  32858. return null;
  32859. ++this.index,
  32860. ++this.line,
  32861. e = !0
  32862. } else {
  32863. if ("*" !== (i = this.source.charAt(this.index)))
  32864. return "/";
  32865. do {
  32866. if ("\n" === i && ++this.line,
  32867. ++this.index === this.source.length)
  32868. return null;
  32869. t = i,
  32870. i = this.source.charAt(this.index)
  32871. } while ("*" !== t || "/" !== i);++this.index,
  32872. e = !0
  32873. }
  32874. } while (e);if (this.index === this.source.length)
  32875. return null;
  32876. var n = this.index;
  32877. if (a.DELIM.lastIndex = 0,
  32878. !a.DELIM.test(this.source.charAt(n++)))
  32879. for (; n < this.source.length && !a.DELIM.test(this.source.charAt(n)); )
  32880. ++n;
  32881. var r = this.source.substring(this.index, this.index = n);
  32882. return '"' !== r && "'" !== r || (this._stringOpen = r),
  32883. r
  32884. }
  32885. ,
  32886. i.peek = function() {
  32887. if (0 === this.stack.length) {
  32888. var e = this.next();
  32889. if (null === e)
  32890. return null;
  32891. this.stack.push(e)
  32892. }
  32893. return this.stack[0]
  32894. }
  32895. ,
  32896. i.skip = function(e) {
  32897. var t = this.next();
  32898. if (t !== e)
  32899. throw Error("illegal '" + t + "', '" + e + "' expected")
  32900. }
  32901. ,
  32902. i.omit = function(e) {
  32903. return this.peek() === e && (this.next(),
  32904. !0)
  32905. }
  32906. ,
  32907. i.toString = function() {
  32908. return "Tokenizer (" + this.index + "/" + this.source.length + " at line " + this.line + ")"
  32909. }
  32910. ,
  32911. e.Tokenizer = t;
  32912. function l(e) {
  32913. this.tn = new t(e),
  32914. this.proto3 = !1
  32915. }
  32916. var c = l.prototype;
  32917. return c.parse = function() {
  32918. var e, t, i = {
  32919. name: "[ROOT]",
  32920. package: null,
  32921. messages: [],
  32922. enums: [],
  32923. imports: [],
  32924. options: {},
  32925. services: []
  32926. }, n = !0;
  32927. try {
  32928. for (; e = this.tn.next(); )
  32929. switch (e) {
  32930. case "package":
  32931. if (!n || null !== i.package)
  32932. throw Error("unexpected 'package'");
  32933. if (e = this.tn.next(),
  32934. !a.TYPEREF.test(e))
  32935. throw Error("illegal package name: " + e);
  32936. this.tn.skip(";"),
  32937. i.package = e;
  32938. break;
  32939. case "import":
  32940. if (!n)
  32941. throw Error("unexpected 'import'");
  32942. "public" !== (e = this.tn.peek()) && !(t = "weak" === e) || this.tn.next(),
  32943. e = this._readString(),
  32944. this.tn.skip(";"),
  32945. t || i.imports.push(e);
  32946. break;
  32947. case "syntax":
  32948. if (!n)
  32949. throw Error("unexpected 'syntax'");
  32950. this.tn.skip("="),
  32951. "proto3" === (i.syntax = this._readString()) && (this.proto3 = !0),
  32952. this.tn.skip(";");
  32953. break;
  32954. case "message":
  32955. this._parseMessage(i, null),
  32956. n = !1;
  32957. break;
  32958. case "enum":
  32959. this._parseEnum(i),
  32960. n = !1;
  32961. break;
  32962. case "option":
  32963. this._parseOption(i);
  32964. break;
  32965. case "service":
  32966. this._parseService(i);
  32967. break;
  32968. case "extend":
  32969. this._parseExtend(i);
  32970. break;
  32971. default:
  32972. throw Error("unexpected '" + e + "'")
  32973. }
  32974. } catch (e) {
  32975. throw e.message = "Parse error at line " + this.tn.line + ": " + e.message,
  32976. e
  32977. }
  32978. return delete i.name,
  32979. i
  32980. }
  32981. ,
  32982. l.parse = function(e) {
  32983. return new l(e).parse()
  32984. }
  32985. ,
  32986. c._readString = function() {
  32987. var e, t, i = "";
  32988. do {
  32989. if ("'" !== (t = this.tn.next()) && '"' !== t)
  32990. throw Error("illegal string delimiter: " + t);
  32991. i += this.tn.next(),
  32992. this.tn.skip(t),
  32993. e = this.tn.peek()
  32994. } while ('"' === e || '"' === e);return i
  32995. }
  32996. ,
  32997. c._readValue = function(e) {
  32998. var t = this.tn.peek();
  32999. if ('"' === t || "'" === t)
  33000. return this._readString();
  33001. if (this.tn.next(),
  33002. a.NUMBER.test(t))
  33003. return o(t);
  33004. if (a.BOOL.test(t))
  33005. return "true" === t.toLowerCase();
  33006. if (e && a.TYPEREF.test(t))
  33007. return t;
  33008. throw Error("illegal value: " + t)
  33009. }
  33010. ,
  33011. c._parseOption = function(e, t) {
  33012. var i = this.tn.next()
  33013. , n = !1;
  33014. if ("(" === i && (n = !0,
  33015. i = this.tn.next()),
  33016. !a.TYPEREF.test(i))
  33017. throw Error("illegal option name: " + i);
  33018. var r = i;
  33019. n && (this.tn.skip(")"),
  33020. r = "(" + r + ")",
  33021. i = this.tn.peek(),
  33022. a.FQTYPEREF.test(i) && (r += i,
  33023. this.tn.next())),
  33024. this.tn.skip("="),
  33025. this._parseOptionValue(e, r),
  33026. t || this.tn.skip(";")
  33027. }
  33028. ,
  33029. c._parseOptionValue = function(e, t) {
  33030. var i = this.tn.peek();
  33031. if ("{" !== i)
  33032. n(e.options, t, this._readValue(!0));
  33033. else
  33034. for (this.tn.skip("{"); "}" !== (i = this.tn.next()); ) {
  33035. if (!a.NAME.test(i))
  33036. throw Error("illegal option name: " + t + "." + i);
  33037. this.tn.omit(":") ? n(e.options, t + "." + i, this._readValue(!0)) : this._parseOptionValue(e, t + "." + i)
  33038. }
  33039. }
  33040. ,
  33041. c._parseService = function(e) {
  33042. var t = this.tn.next();
  33043. if (!a.NAME.test(t))
  33044. throw Error("illegal service name at line " + this.tn.line + ": " + t);
  33045. var i = {
  33046. name: t,
  33047. rpc: {},
  33048. options: {}
  33049. };
  33050. for (this.tn.skip("{"); "}" !== (t = this.tn.next()); )
  33051. if ("option" === t)
  33052. this._parseOption(i);
  33053. else {
  33054. if ("rpc" !== t)
  33055. throw Error("illegal service token: " + t);
  33056. this._parseServiceRPC(i)
  33057. }
  33058. this.tn.omit(";"),
  33059. e.services.push(i)
  33060. }
  33061. ,
  33062. c._parseServiceRPC = function(e) {
  33063. var t = this.tn.next();
  33064. if (!a.NAME.test(t))
  33065. throw Error("illegal rpc service method name: " + t);
  33066. var i = t
  33067. , n = {
  33068. request: null,
  33069. response: null,
  33070. request_stream: !1,
  33071. response_stream: !1,
  33072. options: {}
  33073. };
  33074. if (this.tn.skip("("),
  33075. "stream" === (t = this.tn.next()).toLowerCase() && (n.request_stream = !0,
  33076. t = this.tn.next()),
  33077. !a.TYPEREF.test(t))
  33078. throw Error("illegal rpc service request type: " + t);
  33079. if (n.request = t,
  33080. this.tn.skip(")"),
  33081. "returns" !== (t = this.tn.next()).toLowerCase())
  33082. throw Error("illegal rpc service request type delimiter: " + t);
  33083. if (this.tn.skip("("),
  33084. "stream" === (t = this.tn.next()).toLowerCase() && (n.response_stream = !0,
  33085. t = this.tn.next()),
  33086. n.response = t,
  33087. this.tn.skip(")"),
  33088. "{" === (t = this.tn.peek())) {
  33089. for (this.tn.next(); "}" !== (t = this.tn.next()); ) {
  33090. if ("option" !== t)
  33091. throw Error("illegal rpc service token: " + t);
  33092. this._parseOption(n)
  33093. }
  33094. this.tn.omit(";")
  33095. } else
  33096. this.tn.skip(";");
  33097. void 0 === e.rpc && (e.rpc = {}),
  33098. e.rpc[i] = n
  33099. }
  33100. ,
  33101. c._parseMessage = function(e, t) {
  33102. var i = !!t
  33103. , n = this.tn.next()
  33104. , r = {
  33105. name: "",
  33106. fields: [],
  33107. enums: [],
  33108. messages: [],
  33109. options: {},
  33110. services: [],
  33111. oneofs: {}
  33112. };
  33113. if (!a.NAME.test(n))
  33114. throw Error("illegal " + (i ? "group" : "message") + " name: " + n);
  33115. for (r.name = n,
  33116. i && (this.tn.skip("="),
  33117. t.id = s(this.tn.next()),
  33118. r.isGroup = !0),
  33119. "[" === (n = this.tn.peek()) && t && this._parseFieldOptions(t),
  33120. this.tn.skip("{"); "}" !== (n = this.tn.next()); )
  33121. if (a.RULE.test(n))
  33122. this._parseMessageField(r, n);
  33123. else if ("oneof" === n)
  33124. this._parseMessageOneOf(r);
  33125. else if ("enum" === n)
  33126. this._parseEnum(r);
  33127. else if ("message" === n)
  33128. this._parseMessage(r);
  33129. else if ("option" === n)
  33130. this._parseOption(r);
  33131. else if ("service" === n)
  33132. this._parseService(r);
  33133. else if ("extensions" === n)
  33134. r.extensions = this._parseExtensionRanges();
  33135. else if ("reserved" === n)
  33136. this._parseIgnored();
  33137. else if ("extend" === n)
  33138. this._parseExtend(r);
  33139. else {
  33140. if (!a.TYPEREF.test(n))
  33141. throw Error("illegal message token: " + n);
  33142. if (!this.proto3)
  33143. throw Error("illegal field rule: " + n);
  33144. this._parseMessageField(r, "optional", n)
  33145. }
  33146. return this.tn.omit(";"),
  33147. e.messages.push(r),
  33148. r
  33149. }
  33150. ,
  33151. c._parseIgnored = function() {
  33152. for (; ";" !== this.tn.peek(); )
  33153. this.tn.next();
  33154. this.tn.skip(";")
  33155. }
  33156. ,
  33157. c._parseMessageField = function(e, t, i) {
  33158. if (!a.RULE.test(t))
  33159. throw Error("illegal message field rule: " + t);
  33160. var n, r = {
  33161. rule: t,
  33162. type: "",
  33163. name: "",
  33164. options: {},
  33165. id: 0
  33166. };
  33167. if ("map" === t) {
  33168. if (i)
  33169. throw Error("illegal type: " + i);
  33170. if (this.tn.skip("<"),
  33171. n = this.tn.next(),
  33172. !a.TYPE.test(n) && !a.TYPEREF.test(n))
  33173. throw Error("illegal message field type: " + n);
  33174. if (r.keytype = n,
  33175. this.tn.skip(","),
  33176. n = this.tn.next(),
  33177. !a.TYPE.test(n) && !a.TYPEREF.test(n))
  33178. throw Error("illegal message field: " + n);
  33179. if (r.type = n,
  33180. this.tn.skip(">"),
  33181. n = this.tn.next(),
  33182. !a.NAME.test(n))
  33183. throw Error("illegal message field name: " + n);
  33184. r.name = n,
  33185. this.tn.skip("="),
  33186. r.id = s(this.tn.next()),
  33187. "[" === (n = this.tn.peek()) && this._parseFieldOptions(r),
  33188. this.tn.skip(";")
  33189. } else if ("group" === (i = void 0 !== i ? i : this.tn.next())) {
  33190. var o = this._parseMessage(e, r);
  33191. if (!/^[A-Z]/.test(o.name))
  33192. throw Error("illegal group name: " + o.name);
  33193. r.type = o.name,
  33194. r.name = o.name.toLowerCase(),
  33195. this.tn.omit(";")
  33196. } else {
  33197. if (!a.TYPE.test(i) && !a.TYPEREF.test(i))
  33198. throw Error("illegal message field type: " + i);
  33199. if (r.type = i,
  33200. n = this.tn.next(),
  33201. !a.NAME.test(n))
  33202. throw Error("illegal message field name: " + n);
  33203. r.name = n,
  33204. this.tn.skip("="),
  33205. r.id = s(this.tn.next()),
  33206. "[" === (n = this.tn.peek()) && this._parseFieldOptions(r),
  33207. this.tn.skip(";")
  33208. }
  33209. return e.fields.push(r),
  33210. r
  33211. }
  33212. ,
  33213. c._parseMessageOneOf = function(e) {
  33214. var t = this.tn.next();
  33215. if (!a.NAME.test(t))
  33216. throw Error("illegal oneof name: " + t);
  33217. var i, n = t, r = [];
  33218. for (this.tn.skip("{"); "}" !== (t = this.tn.next()); )
  33219. (i = this._parseMessageField(e, "optional", t)).oneof = n,
  33220. r.push(i.id);
  33221. this.tn.omit(";"),
  33222. e.oneofs[n] = r
  33223. }
  33224. ,
  33225. c._parseFieldOptions = function(e) {
  33226. this.tn.skip("[");
  33227. for (var t = !0; "]" !== this.tn.peek(); )
  33228. t || this.tn.skip(","),
  33229. this._parseOption(e, !0),
  33230. t = !1;
  33231. this.tn.next()
  33232. }
  33233. ,
  33234. c._parseEnum = function(e) {
  33235. var t = {
  33236. name: "",
  33237. values: [],
  33238. options: {}
  33239. }
  33240. , i = this.tn.next();
  33241. if (!a.NAME.test(i))
  33242. throw Error("illegal name: " + i);
  33243. for (t.name = i,
  33244. this.tn.skip("{"); "}" !== (i = this.tn.next()); )
  33245. if ("option" === i)
  33246. this._parseOption(t);
  33247. else {
  33248. if (!a.NAME.test(i))
  33249. throw Error("illegal name: " + i);
  33250. this.tn.skip("=");
  33251. var n = {
  33252. name: i,
  33253. id: s(this.tn.next(), !0)
  33254. };
  33255. "[" === (i = this.tn.peek()) && this._parseFieldOptions({
  33256. options: {}
  33257. }),
  33258. this.tn.skip(";"),
  33259. t.values.push(n)
  33260. }
  33261. this.tn.omit(";"),
  33262. e.enums.push(t)
  33263. }
  33264. ,
  33265. c._parseExtensionRanges = function() {
  33266. var e, t, i, n = [];
  33267. do {
  33268. for (t = []; ; ) {
  33269. switch (e = this.tn.next()) {
  33270. case "min":
  33271. i = r.ID_MIN;
  33272. break;
  33273. case "max":
  33274. i = r.ID_MAX;
  33275. break;
  33276. default:
  33277. i = o(e)
  33278. }
  33279. if (t.push(i),
  33280. 2 === t.length)
  33281. break;
  33282. if ("to" !== this.tn.peek()) {
  33283. t.push(i);
  33284. break
  33285. }
  33286. this.tn.next()
  33287. }
  33288. n.push(t)
  33289. } while (this.tn.omit(","));return this.tn.skip(";"),
  33290. n
  33291. }
  33292. ,
  33293. c._parseExtend = function(e) {
  33294. var t = this.tn.next();
  33295. if (!a.TYPEREF.test(t))
  33296. throw Error("illegal extend reference: " + t);
  33297. var i = {
  33298. ref: t,
  33299. fields: []
  33300. };
  33301. for (this.tn.skip("{"); "}" !== (t = this.tn.next()); )
  33302. if (a.RULE.test(t))
  33303. this._parseMessageField(i, t);
  33304. else {
  33305. if (!a.TYPEREF.test(t))
  33306. throw Error("illegal extend token: " + t);
  33307. if (!this.proto3)
  33308. throw Error("illegal field rule: " + t);
  33309. this._parseMessageField(i, "optional", t)
  33310. }
  33311. return this.tn.omit(";"),
  33312. e.messages.push(i),
  33313. i
  33314. }
  33315. ,
  33316. c.toString = function() {
  33317. return "Parser at line " + this.tn.line
  33318. }
  33319. ,
  33320. e.Parser = l,
  33321. e
  33322. }(o, o.Lang),
  33323. o.Reflect = function(g) {
  33324. function a(e, t) {
  33325. if (e && "number" == typeof e.low && "number" == typeof e.high && "boolean" == typeof e.unsigned && e.low == e.low && e.high == e.high)
  33326. return new g.Long(e.low,e.high,void 0 === t ? e.unsigned : t);
  33327. if ("string" == typeof e)
  33328. return g.Long.fromString(e, t || !1, 10);
  33329. if ("number" == typeof e)
  33330. return g.Long.fromNumber(e, t || !1);
  33331. throw Error("not convertible to Long")
  33332. }
  33333. function m(e, t) {
  33334. var i = t.readVarint32()
  33335. , n = 7 & i
  33336. , r = i >>> 3;
  33337. switch (n) {
  33338. case g.WIRE_TYPES.VARINT:
  33339. for (; 128 == (128 & (i = t.readUint8())); )
  33340. ;
  33341. break;
  33342. case g.WIRE_TYPES.BITS64:
  33343. t.offset += 8;
  33344. break;
  33345. case g.WIRE_TYPES.LDELIM:
  33346. i = t.readVarint32(),
  33347. t.offset += i;
  33348. break;
  33349. case g.WIRE_TYPES.STARTGROUP:
  33350. m(r, t);
  33351. break;
  33352. case g.WIRE_TYPES.ENDGROUP:
  33353. if (r === e)
  33354. return !1;
  33355. throw Error("Illegal GROUPEND after unknown group: " + r + " (" + e + " expected)");
  33356. case g.WIRE_TYPES.BITS32:
  33357. t.offset += 4;
  33358. break;
  33359. default:
  33360. throw Error("Illegal wire type in unknown group " + e + ": " + n)
  33361. }
  33362. return !0
  33363. }
  33364. function h(e, t, i) {
  33365. this.builder = e,
  33366. this.parent = t,
  33367. this.name = i,
  33368. this.className
  33369. }
  33370. var s = {}
  33371. , e = h.prototype;
  33372. e.fqn = function() {
  33373. for (var e = this.name, t = this; null != (t = t.parent); )
  33374. e = t.name + "." + e;
  33375. return e
  33376. }
  33377. ,
  33378. e.toString = function(e) {
  33379. return (e ? this.className + " " : "") + this.fqn()
  33380. }
  33381. ,
  33382. e.build = function() {
  33383. throw Error(this.toString(!0) + " cannot be built directly")
  33384. }
  33385. ,
  33386. s.T = h;
  33387. function l(e, t, i, n, r) {
  33388. h.call(this, e, t, i),
  33389. this.className = "Namespace",
  33390. this.children = [],
  33391. this.options = n || {},
  33392. this.syntax = r || "proto2"
  33393. }
  33394. var t = l.prototype = Object.create(h.prototype);
  33395. t.getChildren = function(e) {
  33396. if (null == (e = e || null))
  33397. return this.children.slice();
  33398. for (var t = [], i = 0, n = this.children.length; i < n; ++i)
  33399. this.children[i]instanceof e && t.push(this.children[i]);
  33400. return t
  33401. }
  33402. ,
  33403. t.addChild = function(e) {
  33404. var t;
  33405. if (t = this.getChild(e.name))
  33406. if (t instanceof d.Field && t.name !== t.originalName && null === this.getChild(t.originalName))
  33407. t.name = t.originalName;
  33408. else {
  33409. if (!(e instanceof d.Field && e.name !== e.originalName && null === this.getChild(e.originalName)))
  33410. throw Error("Duplicate name in namespace " + this.toString(!0) + ": " + e.name);
  33411. e.name = e.originalName
  33412. }
  33413. this.children.push(e)
  33414. }
  33415. ,
  33416. t.getChild = function(e) {
  33417. for (var t = "number" == typeof e ? "id" : "name", i = 0, n = this.children.length; i < n; ++i)
  33418. if (this.children[i][t] === e)
  33419. return this.children[i];
  33420. return null
  33421. }
  33422. ,
  33423. t.resolve = function(e, t) {
  33424. var i, n = "string" == typeof e ? e.split(".") : e, r = this, o = 0;
  33425. if ("" === n[o]) {
  33426. for (; null !== r.parent; )
  33427. r = r.parent;
  33428. o++
  33429. }
  33430. do {
  33431. do {
  33432. if (!(r instanceof s.Namespace)) {
  33433. r = null;
  33434. break
  33435. }
  33436. if (!(i = r.getChild(n[o])) || !(i instanceof s.T) || t && !(i instanceof s.Namespace)) {
  33437. r = null;
  33438. break
  33439. }
  33440. r = i,
  33441. o++
  33442. } while (o < n.length);if (null != r)
  33443. break;
  33444. if (null !== this.parent)
  33445. return this.parent.resolve(e, t)
  33446. } while (null != r);return r
  33447. }
  33448. ,
  33449. t.qn = function(e) {
  33450. for (var t = [], i = e; t.unshift(i.name),
  33451. null !== (i = i.parent); )
  33452. ;
  33453. for (var n = 1; n <= t.length; n++) {
  33454. var r = t.slice(t.length - n);
  33455. if (e === this.resolve(r, e instanceof s.Namespace))
  33456. return r.join(".")
  33457. }
  33458. return e.fqn()
  33459. }
  33460. ,
  33461. t.build = function() {
  33462. for (var e, t = {}, i = this.children, n = 0, r = i.length; n < r; ++n)
  33463. (e = i[n])instanceof l && (t[e.name] = e.build());
  33464. return Object.defineProperty && Object.defineProperty(t, "$options", {
  33465. value: this.buildOpt()
  33466. }),
  33467. t
  33468. }
  33469. ,
  33470. t.buildOpt = function() {
  33471. for (var e = {}, t = Object.keys(this.options), i = 0, n = t.length; i < n; ++i) {
  33472. var r = t[i]
  33473. , o = this.options[t[i]];
  33474. e[r] = o
  33475. }
  33476. return e
  33477. }
  33478. ,
  33479. t.getOption = function(e) {
  33480. return void 0 === e ? this.options : void 0 !== this.options[e] ? this.options[e] : null
  33481. }
  33482. ,
  33483. s.Namespace = l;
  33484. function u(e, t, i, n) {
  33485. if (this.type = e,
  33486. this.resolvedType = t,
  33487. this.isMapKey = i,
  33488. this.syntax = n,
  33489. i && g.MAP_KEY_TYPES.indexOf(e) < 0)
  33490. throw Error("Invalid map key type: " + e.name)
  33491. }
  33492. var i = u.prototype;
  33493. u.defaultFieldValue = function(e) {
  33494. if ("string" == typeof e && (e = g.TYPES[e]),
  33495. void 0 === e.defaultValue)
  33496. throw Error("default value for type " + e.name + " is not supported");
  33497. return e == g.TYPES.bytes ? new I(0) : e.defaultValue
  33498. }
  33499. ,
  33500. i.verifyValue = function(t) {
  33501. function i(e, t) {
  33502. throw Error("Illegal value for " + n.toString(!0) + " of type " + n.type.name + ": " + e + " (" + t + ")")
  33503. }
  33504. var n = this;
  33505. switch (this.type) {
  33506. case g.TYPES.int32:
  33507. case g.TYPES.sint32:
  33508. case g.TYPES.sfixed32:
  33509. return ("number" != typeof t || t == t && t % 1 != 0) && i(typeof t, "not an integer"),
  33510. 4294967295 < t ? 0 | t : t;
  33511. case g.TYPES.uint32:
  33512. case g.TYPES.fixed32:
  33513. return ("number" != typeof t || t == t && t % 1 != 0) && i(typeof t, "not an integer"),
  33514. t < 0 ? t >>> 0 : t;
  33515. case g.TYPES.int64:
  33516. case g.TYPES.sint64:
  33517. case g.TYPES.sfixed64:
  33518. if (g.Long)
  33519. try {
  33520. return a(t, !1)
  33521. } catch (e) {
  33522. i(typeof t, e.message)
  33523. }
  33524. else
  33525. i(typeof t, "requires Long.js");
  33526. case g.TYPES.uint64:
  33527. case g.TYPES.fixed64:
  33528. if (g.Long)
  33529. try {
  33530. return a(t, !0)
  33531. } catch (e) {
  33532. i(typeof t, e.message)
  33533. }
  33534. else
  33535. i(typeof t, "requires Long.js");
  33536. case g.TYPES.bool:
  33537. return "boolean" != typeof t && i(typeof t, "not a boolean"),
  33538. t;
  33539. case g.TYPES.float:
  33540. case g.TYPES.double:
  33541. return "number" != typeof t && i(typeof t, "not a number"),
  33542. t;
  33543. case g.TYPES.string:
  33544. return "string" == typeof t || t && t instanceof String || i(typeof t, "not a string"),
  33545. "" + t;
  33546. case g.TYPES.bytes:
  33547. return I.isByteBuffer(t) ? t : I.wrap(t, "base64");
  33548. case g.TYPES.enum:
  33549. var e = this.resolvedType.getChildren(g.Reflect.Enum.Value);
  33550. for (o = 0; o < e.length; o++) {
  33551. if (e[o].name == t)
  33552. return e[o].id;
  33553. if (e[o].id == t)
  33554. return e[o].id
  33555. }
  33556. if ("proto3" === this.syntax)
  33557. return ("number" != typeof t || t == t && t % 1 != 0) && i(typeof t, "not an integer"),
  33558. (4294967295 < t || t < 0) && i(typeof t, "not in range for uint32"),
  33559. t;
  33560. i(t, "not a valid enum value");
  33561. case g.TYPES.group:
  33562. case g.TYPES.message:
  33563. if (t && "object" == typeof t || i(typeof t, "object expected"),
  33564. t instanceof this.resolvedType.clazz)
  33565. return t;
  33566. if (t instanceof g.Builder.Message) {
  33567. var r = {};
  33568. for (var o in t)
  33569. t.hasOwnProperty(o) && (r[o] = t[o]);
  33570. t = r
  33571. }
  33572. return new this.resolvedType.clazz(t)
  33573. }
  33574. throw Error("[INTERNAL] Illegal value for " + this.toString(!0) + ": " + t + " (undefined type " + this.type + ")")
  33575. }
  33576. ,
  33577. i.calculateLength = function(e, t) {
  33578. if (null === t)
  33579. return 0;
  33580. var i;
  33581. switch (this.type) {
  33582. case g.TYPES.int32:
  33583. return t < 0 ? I.calculateVarint64(t) : I.calculateVarint32(t);
  33584. case g.TYPES.uint32:
  33585. return I.calculateVarint32(t);
  33586. case g.TYPES.sint32:
  33587. return I.calculateVarint32(I.zigZagEncode32(t));
  33588. case g.TYPES.fixed32:
  33589. case g.TYPES.sfixed32:
  33590. case g.TYPES.float:
  33591. return 4;
  33592. case g.TYPES.int64:
  33593. case g.TYPES.uint64:
  33594. return I.calculateVarint64(t);
  33595. case g.TYPES.sint64:
  33596. return I.calculateVarint64(I.zigZagEncode64(t));
  33597. case g.TYPES.fixed64:
  33598. case g.TYPES.sfixed64:
  33599. return 8;
  33600. case g.TYPES.bool:
  33601. return 1;
  33602. case g.TYPES.enum:
  33603. return I.calculateVarint32(t);
  33604. case g.TYPES.double:
  33605. return 8;
  33606. case g.TYPES.string:
  33607. return i = I.calculateUTF8Bytes(t),
  33608. I.calculateVarint32(i) + i;
  33609. case g.TYPES.bytes:
  33610. if (t.remaining() < 0)
  33611. throw Error("Illegal value for " + this.toString(!0) + ": " + t.remaining() + " bytes remaining");
  33612. return I.calculateVarint32(t.remaining()) + t.remaining();
  33613. case g.TYPES.message:
  33614. return i = this.resolvedType.calculate(t),
  33615. I.calculateVarint32(i) + i;
  33616. case g.TYPES.group:
  33617. return (i = this.resolvedType.calculate(t)) + I.calculateVarint32(e << 3 | g.WIRE_TYPES.ENDGROUP)
  33618. }
  33619. throw Error("[INTERNAL] Illegal value to encode in " + this.toString(!0) + ": " + t + " (unknown type)")
  33620. }
  33621. ,
  33622. i.encodeValue = function(e, t, i) {
  33623. if (null === t)
  33624. return i;
  33625. switch (this.type) {
  33626. case g.TYPES.int32:
  33627. t < 0 ? i.writeVarint64(t) : i.writeVarint32(t);
  33628. break;
  33629. case g.TYPES.uint32:
  33630. i.writeVarint32(t);
  33631. break;
  33632. case g.TYPES.sint32:
  33633. i.writeVarint32ZigZag(t);
  33634. break;
  33635. case g.TYPES.fixed32:
  33636. i.writeUint32(t);
  33637. break;
  33638. case g.TYPES.sfixed32:
  33639. i.writeInt32(t);
  33640. break;
  33641. case g.TYPES.int64:
  33642. case g.TYPES.uint64:
  33643. i.writeVarint64(t);
  33644. break;
  33645. case g.TYPES.sint64:
  33646. i.writeVarint64ZigZag(t);
  33647. break;
  33648. case g.TYPES.fixed64:
  33649. i.writeUint64(t);
  33650. break;
  33651. case g.TYPES.sfixed64:
  33652. i.writeInt64(t);
  33653. break;
  33654. case g.TYPES.bool:
  33655. "string" == typeof t ? i.writeVarint32("false" === t.toLowerCase() ? 0 : !!t) : i.writeVarint32(t ? 1 : 0);
  33656. break;
  33657. case g.TYPES.enum:
  33658. i.writeVarint32(t);
  33659. break;
  33660. case g.TYPES.float:
  33661. i.writeFloat32(t);
  33662. break;
  33663. case g.TYPES.double:
  33664. i.writeFloat64(t);
  33665. break;
  33666. case g.TYPES.string:
  33667. i.writeVString(t);
  33668. break;
  33669. case g.TYPES.bytes:
  33670. if (t.remaining() < 0)
  33671. throw Error("Illegal value for " + this.toString(!0) + ": " + t.remaining() + " bytes remaining");
  33672. var n = t.offset;
  33673. i.writeVarint32(t.remaining()),
  33674. i.append(t),
  33675. t.offset = n;
  33676. break;
  33677. case g.TYPES.message:
  33678. var r = (new I).LE();
  33679. this.resolvedType.encode(t, r),
  33680. i.writeVarint32(r.offset),
  33681. i.append(r.flip());
  33682. break;
  33683. case g.TYPES.group:
  33684. this.resolvedType.encode(t, i),
  33685. i.writeVarint32(e << 3 | g.WIRE_TYPES.ENDGROUP);
  33686. break;
  33687. default:
  33688. throw Error("[INTERNAL] Illegal value to encode in " + this.toString(!0) + ": " + t + " (unknown type)")
  33689. }
  33690. return i
  33691. }
  33692. ,
  33693. i.decode = function(e, t, i) {
  33694. if (t != this.type.wireType)
  33695. throw Error("Unexpected wire type for element");
  33696. var n, r;
  33697. switch (this.type) {
  33698. case g.TYPES.int32:
  33699. return 0 | e.readVarint32();
  33700. case g.TYPES.uint32:
  33701. return e.readVarint32() >>> 0;
  33702. case g.TYPES.sint32:
  33703. return 0 | e.readVarint32ZigZag();
  33704. case g.TYPES.fixed32:
  33705. return e.readUint32() >>> 0;
  33706. case g.TYPES.sfixed32:
  33707. return 0 | e.readInt32();
  33708. case g.TYPES.int64:
  33709. return e.readVarint64();
  33710. case g.TYPES.uint64:
  33711. return e.readVarint64().toUnsigned();
  33712. case g.TYPES.sint64:
  33713. return e.readVarint64ZigZag();
  33714. case g.TYPES.fixed64:
  33715. return e.readUint64();
  33716. case g.TYPES.sfixed64:
  33717. return e.readInt64();
  33718. case g.TYPES.bool:
  33719. return !!e.readVarint32();
  33720. case g.TYPES.enum:
  33721. return e.readVarint32();
  33722. case g.TYPES.float:
  33723. return e.readFloat();
  33724. case g.TYPES.double:
  33725. return e.readDouble();
  33726. case g.TYPES.string:
  33727. return e.readVString();
  33728. case g.TYPES.bytes:
  33729. if (r = e.readVarint32(),
  33730. e.remaining() < r)
  33731. throw Error("Illegal number of bytes for " + this.toString(!0) + ": " + r + " required but got only " + e.remaining());
  33732. return (n = e.clone()).limit = n.offset + r,
  33733. e.offset += r,
  33734. n;
  33735. case g.TYPES.message:
  33736. return r = e.readVarint32(),
  33737. this.resolvedType.decode(e, r);
  33738. case g.TYPES.group:
  33739. return this.resolvedType.decode(e, -1, i)
  33740. }
  33741. throw Error("[INTERNAL] Illegal decode type")
  33742. }
  33743. ,
  33744. i.valueFromString = function(e) {
  33745. if (!this.isMapKey)
  33746. throw Error("valueFromString() called on non-map-key element");
  33747. switch (this.type) {
  33748. case g.TYPES.int32:
  33749. case g.TYPES.sint32:
  33750. case g.TYPES.sfixed32:
  33751. case g.TYPES.uint32:
  33752. case g.TYPES.fixed32:
  33753. return this.verifyValue(parseInt(e));
  33754. case g.TYPES.int64:
  33755. case g.TYPES.sint64:
  33756. case g.TYPES.sfixed64:
  33757. case g.TYPES.uint64:
  33758. case g.TYPES.fixed64:
  33759. return this.verifyValue(e);
  33760. case g.TYPES.bool:
  33761. return "true" === e;
  33762. case g.TYPES.string:
  33763. return this.verifyValue(e);
  33764. case g.TYPES.bytes:
  33765. return I.fromBinary(e)
  33766. }
  33767. }
  33768. ,
  33769. i.valueToString = function(e) {
  33770. if (!this.isMapKey)
  33771. throw Error("valueToString() called on non-map-key element");
  33772. return this.type === g.TYPES.bytes ? e.toString("binary") : e.toString()
  33773. }
  33774. ,
  33775. s.Element = u;
  33776. var d = function(e, t, i, n, r, o) {
  33777. l.call(this, e, t, i, n, o),
  33778. this.className = "Message",
  33779. this.extensions = void 0,
  33780. this.clazz = null,
  33781. this.isGroup = !!r,
  33782. this._fields = null,
  33783. this._fieldsById = null,
  33784. this._fieldsByName = null
  33785. }
  33786. , n = d.prototype = Object.create(l.prototype);
  33787. n.build = function(e) {
  33788. if (this.clazz && !e)
  33789. return this.clazz;
  33790. var t = function(u, a) {
  33791. function d(e, i, n, r) {
  33792. if (null === e || "object" != typeof e) {
  33793. if (r && r instanceof u.Reflect.Enum) {
  33794. var t = u.Reflect.Enum.getName(r.object, e);
  33795. if (null !== t)
  33796. return t
  33797. }
  33798. return e
  33799. }
  33800. if (I.isByteBuffer(e))
  33801. return i ? e.toBase64() : e.toBuffer();
  33802. if (u.Long.isLong(e))
  33803. return n ? e.toString() : u.Long.fromValue(e);
  33804. var o;
  33805. if (Array.isArray(e))
  33806. return o = [],
  33807. e.forEach(function(e, t) {
  33808. o[t] = d(e, i, n, r)
  33809. }),
  33810. o;
  33811. if (o = {},
  33812. e instanceof u.Map) {
  33813. for (var a = e.entries(), s = a.next(); !s.done; s = a.next())
  33814. o[e.keyElem.valueToString(s.value[0])] = d(s.value[1], i, n, e.valueElem.resolvedType);
  33815. return o
  33816. }
  33817. var l = e.$type
  33818. , c = void 0;
  33819. for (var h in e)
  33820. e.hasOwnProperty(h) && (l && (c = l.getChild(h)) ? o[h] = d(e[h], i, n, c.resolvedType) : o[h] = d(e[h], i, n));
  33821. return o
  33822. }
  33823. var s = a.getChildren(u.Reflect.Message.Field)
  33824. , l = a.getChildren(u.Reflect.Message.OneOf)
  33825. , c = function(e, t) {
  33826. u.Builder.Message.call(this);
  33827. for (var i = 0, n = l.length; i < n; ++i)
  33828. this[l[i].name] = null;
  33829. for (i = 0,
  33830. n = s.length; i < n; ++i) {
  33831. var r = s[i];
  33832. this[r.name] = r.repeated ? [] : r.map ? new u.Map(r) : null,
  33833. !r.required && "proto3" !== a.syntax || null === r.defaultValue || (this[r.name] = r.defaultValue)
  33834. }
  33835. var o;
  33836. if (0 < arguments.length)
  33837. 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)
  33838. for (i = 0,
  33839. n = arguments.length; i < n; ++i)
  33840. void 0 !== (o = arguments[i]) && this.$set(s[i].name, o);
  33841. else
  33842. this.$set(e)
  33843. }
  33844. , o = c.prototype = Object.create(u.Builder.Message.prototype);
  33845. o.add = function(e, t, i) {
  33846. var n = a._fieldsByName[e];
  33847. if (!i) {
  33848. if (!n)
  33849. throw Error(this + "#" + e + " is undefined");
  33850. if (!(n instanceof u.Reflect.Message.Field))
  33851. throw Error(this + "#" + e + " is not a field: " + n.toString(!0));
  33852. if (!n.repeated)
  33853. throw Error(this + "#" + e + " is not a repeated field");
  33854. t = n.verifyValue(t, !0)
  33855. }
  33856. return null === this[e] && (this[e] = []),
  33857. this[e].push(t),
  33858. this
  33859. }
  33860. ,
  33861. o.$add = o.add,
  33862. o.set = function(e, t, i) {
  33863. if (e && "object" == typeof e) {
  33864. for (var n in i = t,
  33865. e)
  33866. e.hasOwnProperty(n) && void 0 !== (t = e[n]) && this.$set(n, t, i);
  33867. return this
  33868. }
  33869. var r = a._fieldsByName[e];
  33870. if (i)
  33871. this[e] = t;
  33872. else {
  33873. if (!r)
  33874. throw Error(this + "#" + e + " is not a field: undefined");
  33875. if (!(r instanceof u.Reflect.Message.Field))
  33876. throw Error(this + "#" + e + " is not a field: " + r.toString(!0));
  33877. this[r.name] = t = r.verifyValue(t)
  33878. }
  33879. if (r && r.oneof) {
  33880. var o = this[r.oneof.name];
  33881. null !== t ? (null !== o && o !== r.name && (this[o] = null),
  33882. this[r.oneof.name] = r.name) : o === e && (this[r.oneof.name] = null)
  33883. }
  33884. return this
  33885. }
  33886. ,
  33887. o.$set = o.set,
  33888. o.get = function(e, t) {
  33889. if (t)
  33890. return this[e];
  33891. var i = a._fieldsByName[e];
  33892. if (!(i && i instanceof u.Reflect.Message.Field))
  33893. throw Error(this + "#" + e + " is not a field: undefined");
  33894. if (!(i instanceof u.Reflect.Message.Field))
  33895. throw Error(this + "#" + e + " is not a field: " + i.toString(!0));
  33896. return this[i.name]
  33897. }
  33898. ,
  33899. o.$get = o.get;
  33900. for (var e = 0; e < s.length; e++) {
  33901. var t = s[e];
  33902. t instanceof u.Reflect.Message.ExtensionField || a.builder.options.populateAccessors && function(i) {
  33903. var e = i.originalName.replace(/(_[a-zA-Z])/g, function(e) {
  33904. return e.toUpperCase().replace("_", "")
  33905. });
  33906. e = e.substring(0, 1).toUpperCase() + e.substring(1);
  33907. function t(e, t) {
  33908. return this[i.name] = t ? e : i.verifyValue(e),
  33909. this
  33910. }
  33911. function n() {
  33912. return this[i.name]
  33913. }
  33914. var r = i.originalName.replace(/([A-Z])/g, function(e) {
  33915. return "_" + e
  33916. });
  33917. null === a.getChild("set" + e) && (o["set" + e] = t),
  33918. null === a.getChild("set_" + r) && (o["set_" + r] = t),
  33919. null === a.getChild("get" + e) && (o["get" + e] = n),
  33920. null === a.getChild("get_" + r) && (o["get_" + r] = n)
  33921. }(t)
  33922. }
  33923. return o.encode = function(t, e) {
  33924. "boolean" == typeof t && (e = t,
  33925. t = void 0);
  33926. var i = !1;
  33927. t || (t = new I,
  33928. i = !0);
  33929. var n = t.littleEndian;
  33930. try {
  33931. return a.encode(this, t.LE(), e),
  33932. (i ? t.flip() : t).LE(n)
  33933. } catch (e) {
  33934. throw t.LE(n),
  33935. e
  33936. }
  33937. }
  33938. ,
  33939. c.encode = function(e, t, i) {
  33940. return new c(e).encode(t, i)
  33941. }
  33942. ,
  33943. o.calculate = function() {
  33944. return a.calculate(this)
  33945. }
  33946. ,
  33947. o.encodeDelimited = function(e, t) {
  33948. var i = !1;
  33949. e || (e = new I,
  33950. i = !0);
  33951. var n = (new I).LE();
  33952. return a.encode(this, n, t).flip(),
  33953. e.writeVarint32(n.remaining()),
  33954. e.append(n),
  33955. i ? e.flip() : e
  33956. }
  33957. ,
  33958. o.encodeAB = function() {
  33959. try {
  33960. return this.encode().toArrayBuffer()
  33961. } catch (e) {
  33962. throw e.encoded && (e.encoded = e.encoded.toArrayBuffer()),
  33963. e
  33964. }
  33965. }
  33966. ,
  33967. o.toArrayBuffer = o.encodeAB,
  33968. o.encodeNB = function() {
  33969. try {
  33970. return this.encode().toBuffer()
  33971. } catch (e) {
  33972. throw e.encoded && (e.encoded = e.encoded.toBuffer()),
  33973. e
  33974. }
  33975. }
  33976. ,
  33977. o.toBuffer = o.encodeNB,
  33978. o.encode64 = function() {
  33979. try {
  33980. return this.encode().toBase64()
  33981. } catch (e) {
  33982. throw e.encoded && (e.encoded = e.encoded.toBase64()),
  33983. e
  33984. }
  33985. }
  33986. ,
  33987. o.toBase64 = o.encode64,
  33988. o.encodeHex = function() {
  33989. try {
  33990. return this.encode().toHex()
  33991. } catch (e) {
  33992. throw e.encoded && (e.encoded = e.encoded.toHex()),
  33993. e
  33994. }
  33995. }
  33996. ,
  33997. o.toHex = o.encodeHex,
  33998. o.toRaw = function(e, t) {
  33999. return d(this, !!e, !!t, this.$type)
  34000. }
  34001. ,
  34002. o.encodeJSON = function() {
  34003. return JSON.stringify(d(this, !0, !0, this.$type))
  34004. }
  34005. ,
  34006. c.decode = function(t, e, i) {
  34007. "string" == typeof e && (i = e,
  34008. e = -1),
  34009. "string" == typeof t && (t = I.wrap(t, i || "base64"));
  34010. var n = (t = I.isByteBuffer(t) ? t : I.wrap(t)).littleEndian;
  34011. try {
  34012. var r = a.decode(t.LE());
  34013. return t.LE(n),
  34014. r
  34015. } catch (e) {
  34016. throw t.LE(n),
  34017. e
  34018. }
  34019. }
  34020. ,
  34021. c.decodeDelimited = function(t, e) {
  34022. if ("string" == typeof t && (t = I.wrap(t, e || "base64")),
  34023. (t = I.isByteBuffer(t) ? t : I.wrap(t)).remaining() < 1)
  34024. return null;
  34025. var i = t.offset
  34026. , n = t.readVarint32();
  34027. if (t.remaining() < n)
  34028. return t.offset = i,
  34029. null;
  34030. try {
  34031. var r = a.decode(t.slice(t.offset, t.offset + n).LE());
  34032. return t.offset += n,
  34033. r
  34034. } catch (e) {
  34035. throw t.offset += n,
  34036. e
  34037. }
  34038. }
  34039. ,
  34040. c.decode64 = function(e) {
  34041. return c.decode(e, "base64")
  34042. }
  34043. ,
  34044. c.decodeHex = function(e) {
  34045. return c.decode(e, "hex")
  34046. }
  34047. ,
  34048. c.decodeJSON = function(e) {
  34049. return new c(JSON.parse(e))
  34050. }
  34051. ,
  34052. o.toString = function() {
  34053. return a.toString()
  34054. }
  34055. ,
  34056. Object.defineProperty && (Object.defineProperty(c, "$options", {
  34057. value: a.buildOpt()
  34058. }),
  34059. Object.defineProperty(o, "$options", {
  34060. value: c.$options
  34061. }),
  34062. Object.defineProperty(c, "$type", {
  34063. value: a
  34064. }),
  34065. Object.defineProperty(o, "$type", {
  34066. value: a
  34067. })),
  34068. c
  34069. }(g, this);
  34070. this._fields = [],
  34071. this._fieldsById = {},
  34072. this._fieldsByName = {};
  34073. for (var i, n = 0, r = this.children.length; n < r; n++)
  34074. if ((i = this.children[n])instanceof p || i instanceof d || i instanceof y) {
  34075. if (t.hasOwnProperty(i.name))
  34076. throw Error("Illegal reflect child of " + this.toString(!0) + ": " + i.toString(!0) + " cannot override static property '" + i.name + "'");
  34077. t[i.name] = i.build()
  34078. } else if (i instanceof d.Field)
  34079. i.build(),
  34080. this._fields.push(i),
  34081. this._fieldsById[i.id] = i,
  34082. this._fieldsByName[i.name] = i;
  34083. else if (!(i instanceof d.OneOf || i instanceof v))
  34084. throw Error("Illegal reflect child of " + this.toString(!0) + ": " + this.children[n].toString(!0));
  34085. return this.clazz = t
  34086. }
  34087. ,
  34088. n.encode = function(e, t, i) {
  34089. for (var n, r, o = null, a = 0, s = this._fields.length; a < s; ++a)
  34090. r = e[(n = this._fields[a]).name],
  34091. n.required && null === r ? null === o && (o = n) : n.encode(i ? r : n.verifyValue(r), t, e);
  34092. if (null === o)
  34093. return t;
  34094. var l = Error("Missing at least one required field for " + this.toString(!0) + ": " + o);
  34095. throw l.encoded = t,
  34096. l
  34097. }
  34098. ,
  34099. n.calculate = function(e) {
  34100. for (var t, i, n = 0, r = 0, o = this._fields.length; r < o; ++r) {
  34101. if (i = e[(t = this._fields[r]).name],
  34102. t.required && null === i)
  34103. throw Error("Missing at least one required field for " + this.toString(!0) + ": " + t);
  34104. n += t.calculate(i, e)
  34105. }
  34106. return n
  34107. }
  34108. ,
  34109. n.decode = function(e, t, i) {
  34110. t = "number" == typeof t ? t : -1;
  34111. for (var n, r, o, a, s = e.offset, l = new this.clazz; e.offset < s + t || -1 === t && 0 < e.remaining(); ) {
  34112. if (o = (n = e.readVarint32()) >>> 3,
  34113. (r = 7 & n) === g.WIRE_TYPES.ENDGROUP) {
  34114. if (o !== i)
  34115. throw Error("Illegal group end indicator for " + this.toString(!0) + ": " + o + " (" + (i ? i + " expected" : "not a group") + ")");
  34116. break
  34117. }
  34118. if (a = this._fieldsById[o]) {
  34119. if (a.repeated && !a.options.packed)
  34120. l[a.name].push(a.decode(r, e));
  34121. else if (a.map) {
  34122. var c = a.decode(r, e);
  34123. l[a.name].set(c[0], c[1])
  34124. } else if (l[a.name] = a.decode(r, e),
  34125. a.oneof) {
  34126. var h = l[a.oneof.name];
  34127. null !== h && h !== a.name && (l[h] = null),
  34128. l[a.oneof.name] = a.name
  34129. }
  34130. } else
  34131. switch (r) {
  34132. case g.WIRE_TYPES.VARINT:
  34133. e.readVarint32();
  34134. break;
  34135. case g.WIRE_TYPES.BITS32:
  34136. e.offset += 4;
  34137. break;
  34138. case g.WIRE_TYPES.BITS64:
  34139. e.offset += 8;
  34140. break;
  34141. case g.WIRE_TYPES.LDELIM:
  34142. var u = e.readVarint32();
  34143. e.offset += u;
  34144. break;
  34145. case g.WIRE_TYPES.STARTGROUP:
  34146. for (; m(o, e); )
  34147. ;
  34148. break;
  34149. default:
  34150. throw Error("Illegal wire type for unknown field " + o + " in " + this.toString(!0) + "#decode: " + r)
  34151. }
  34152. }
  34153. for (var d = 0, p = this._fields.length; d < p; ++d)
  34154. if (null === l[(a = this._fields[d]).name])
  34155. if ("proto3" === this.syntax)
  34156. l[a.name] = a.defaultValue;
  34157. else {
  34158. if (a.required) {
  34159. var f = Error("Missing at least one required field for " + this.toString(!0) + ": " + a.name);
  34160. throw f.decoded = l,
  34161. f
  34162. }
  34163. g.populateDefaults && null !== a.defaultValue && (l[a.name] = a.defaultValue)
  34164. }
  34165. return l
  34166. }
  34167. ,
  34168. s.Message = d;
  34169. function c(e, t, i, n, r, o, a, s, l, c) {
  34170. h.call(this, e, t, o),
  34171. this.className = "Message.Field",
  34172. this.required = "required" === i,
  34173. this.repeated = "repeated" === i,
  34174. this.map = "map" === i,
  34175. this.keyType = n || null,
  34176. this.type = r,
  34177. this.resolvedType = null,
  34178. this.id = a,
  34179. this.options = s || {},
  34180. this.defaultValue = null,
  34181. this.oneof = l || null,
  34182. this.syntax = c || "proto2",
  34183. this.originalName = this.name,
  34184. this.element = null,
  34185. this.keyElement = null,
  34186. !this.builder.options.convertFieldsToCamelCase || this instanceof d.ExtensionField || (this.name = g.Util.toCamelCase(this.name))
  34187. }
  34188. var r = c.prototype = Object.create(h.prototype);
  34189. r.build = function() {
  34190. this.element = new u(this.type,this.resolvedType,!1,this.syntax),
  34191. this.map && (this.keyElement = new u(this.keyType,void 0,!0,this.syntax)),
  34192. "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)
  34193. }
  34194. ,
  34195. r.verifyValue = function(e, t) {
  34196. function i(e, t) {
  34197. throw Error("Illegal value for " + r.toString(!0) + " of type " + r.type.name + ": " + e + " (" + t + ")")
  34198. }
  34199. t = t || !1;
  34200. var n, r = this;
  34201. if (null === e)
  34202. return this.required && i(typeof e, "required"),
  34203. "proto3" === this.syntax && this.type !== g.TYPES.message && i(typeof e, "proto3 field without field presence cannot be null"),
  34204. null;
  34205. if (!this.repeated || t)
  34206. return this.map && !t ? e instanceof g.Map ? e : (e instanceof Object || i(typeof e, "expected ProtoBuf.Map or raw object for map field"),
  34207. new g.Map(this,e)) : (!this.repeated && Array.isArray(e) && i(typeof e, "no array expected"),
  34208. this.element.verifyValue(e));
  34209. Array.isArray(e) || (e = [e]);
  34210. var o = [];
  34211. for (n = 0; n < e.length; n++)
  34212. o.push(this.element.verifyValue(e[n]));
  34213. return o
  34214. }
  34215. ,
  34216. r.hasWirePresence = function(e, t) {
  34217. if ("proto3" !== this.syntax)
  34218. return null !== e;
  34219. if (this.oneof && t[this.oneof.name] === this.name)
  34220. return !0;
  34221. switch (this.type) {
  34222. case g.TYPES.int32:
  34223. case g.TYPES.sint32:
  34224. case g.TYPES.sfixed32:
  34225. case g.TYPES.uint32:
  34226. case g.TYPES.fixed32:
  34227. return 0 !== e;
  34228. case g.TYPES.int64:
  34229. case g.TYPES.sint64:
  34230. case g.TYPES.sfixed64:
  34231. case g.TYPES.uint64:
  34232. case g.TYPES.fixed64:
  34233. return 0 !== e.low || 0 !== e.high;
  34234. case g.TYPES.bool:
  34235. return e;
  34236. case g.TYPES.float:
  34237. case g.TYPES.double:
  34238. return 0 !== e;
  34239. case g.TYPES.string:
  34240. return 0 < e.length;
  34241. case g.TYPES.bytes:
  34242. return 0 < e.remaining();
  34243. case g.TYPES.enum:
  34244. return 0 !== e;
  34245. case g.TYPES.message:
  34246. return null !== e;
  34247. default:
  34248. return !0
  34249. }
  34250. }
  34251. ,
  34252. r.encode = function(t, r, e) {
  34253. if (null === this.type || "object" != typeof this.type)
  34254. throw Error("[INTERNAL] Unresolved type in " + this.toString(!0) + ": " + this.type);
  34255. if (null === t || this.repeated && 0 == t.length)
  34256. return r;
  34257. try {
  34258. var i;
  34259. if (this.repeated)
  34260. if (this.options.packed && 0 <= g.PACKABLE_WIRE_TYPES.indexOf(this.type.wireType)) {
  34261. r.writeVarint32(this.id << 3 | g.WIRE_TYPES.LDELIM),
  34262. r.ensureCapacity(r.offset += 1);
  34263. var n = r.offset;
  34264. for (i = 0; i < t.length; i++)
  34265. this.element.encodeValue(this.id, t[i], r);
  34266. var o = r.offset - n
  34267. , a = I.calculateVarint32(o);
  34268. if (1 < a) {
  34269. var s = r.slice(n, r.offset);
  34270. n += a - 1,
  34271. r.offset = n,
  34272. r.append(s)
  34273. }
  34274. r.writeVarint32(o, n - a)
  34275. } else
  34276. for (i = 0; i < t.length; i++)
  34277. r.writeVarint32(this.id << 3 | this.type.wireType),
  34278. this.element.encodeValue(this.id, t[i], r);
  34279. else
  34280. this.map ? t.forEach(function(e, t, i) {
  34281. var n = I.calculateVarint32(8 | this.keyType.wireType) + this.keyElement.calculateLength(1, t) + I.calculateVarint32(16 | this.type.wireType) + this.element.calculateLength(2, e);
  34282. r.writeVarint32(this.id << 3 | g.WIRE_TYPES.LDELIM),
  34283. r.writeVarint32(n),
  34284. r.writeVarint32(8 | this.keyType.wireType),
  34285. this.keyElement.encodeValue(1, t, r),
  34286. r.writeVarint32(16 | this.type.wireType),
  34287. this.element.encodeValue(2, e, r)
  34288. }, this) : this.hasWirePresence(t, e) && (r.writeVarint32(this.id << 3 | this.type.wireType),
  34289. this.element.encodeValue(this.id, t, r))
  34290. } catch (e) {
  34291. throw Error("Illegal value for " + this.toString(!0) + ": " + t + " (" + e + ")")
  34292. }
  34293. return r
  34294. }
  34295. ,
  34296. r.calculate = function(t, e) {
  34297. if (t = this.verifyValue(t),
  34298. null === this.type || "object" != typeof this.type)
  34299. throw Error("[INTERNAL] Unresolved type in " + this.toString(!0) + ": " + this.type);
  34300. if (null === t || this.repeated && 0 == t.length)
  34301. return 0;
  34302. var r = 0;
  34303. try {
  34304. var i, n;
  34305. if (this.repeated)
  34306. if (this.options.packed && 0 <= g.PACKABLE_WIRE_TYPES.indexOf(this.type.wireType)) {
  34307. for (r += I.calculateVarint32(this.id << 3 | g.WIRE_TYPES.LDELIM),
  34308. i = n = 0; i < t.length; i++)
  34309. n += this.element.calculateLength(this.id, t[i]);
  34310. r += I.calculateVarint32(n),
  34311. r += n
  34312. } else
  34313. for (i = 0; i < t.length; i++)
  34314. r += I.calculateVarint32(this.id << 3 | this.type.wireType),
  34315. r += this.element.calculateLength(this.id, t[i]);
  34316. else
  34317. this.map ? t.forEach(function(e, t, i) {
  34318. var n = I.calculateVarint32(8 | this.keyType.wireType) + this.keyElement.calculateLength(1, t) + I.calculateVarint32(16 | this.type.wireType) + this.element.calculateLength(2, e);
  34319. r += I.calculateVarint32(this.id << 3 | g.WIRE_TYPES.LDELIM),
  34320. r += I.calculateVarint32(n),
  34321. r += n
  34322. }, this) : this.hasWirePresence(t, e) && (r += I.calculateVarint32(this.id << 3 | this.type.wireType),
  34323. r += this.element.calculateLength(this.id, t))
  34324. } catch (e) {
  34325. throw Error("Illegal value for " + this.toString(!0) + ": " + t + " (" + e + ")")
  34326. }
  34327. return r
  34328. }
  34329. ,
  34330. r.decode = function(e, t, i) {
  34331. var n, r;
  34332. 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))
  34333. throw Error("Illegal wire type for field " + this.toString(!0) + ": " + e + " (" + this.type.wireType + " expected)");
  34334. if (e == g.WIRE_TYPES.LDELIM && this.repeated && this.options.packed && 0 <= g.PACKABLE_WIRE_TYPES.indexOf(this.type.wireType) && !i) {
  34335. r = t.readVarint32(),
  34336. r = t.offset + r;
  34337. for (var o = []; t.offset < r; )
  34338. o.push(this.decode(this.type.wireType, t, !0));
  34339. return o
  34340. }
  34341. if (this.map) {
  34342. var a = u.defaultFieldValue(this.keyType);
  34343. if (n = u.defaultFieldValue(this.type),
  34344. r = t.readVarint32(),
  34345. t.remaining() < r)
  34346. throw Error("Illegal number of bytes for " + this.toString(!0) + ": " + r + " required but got only " + t.remaining());
  34347. var s = t.clone();
  34348. for (s.limit = s.offset + r,
  34349. t.offset += r; 0 < s.remaining(); ) {
  34350. var l = s.readVarint32();
  34351. e = 7 & l;
  34352. var c = l >>> 3;
  34353. if (1 == c)
  34354. a = this.keyElement.decode(s, e, c);
  34355. else {
  34356. if (2 != c)
  34357. throw Error("Unexpected tag in map field key/value submessage");
  34358. n = this.element.decode(s, e, c)
  34359. }
  34360. }
  34361. return [a, n]
  34362. }
  34363. return this.element.decode(t, e, this.id)
  34364. }
  34365. ,
  34366. s.Message.Field = c;
  34367. function o(e, t, i, n, r, o, a) {
  34368. c.call(this, e, t, i, null, n, r, o, a),
  34369. this.extension
  34370. }
  34371. o.prototype = Object.create(c.prototype),
  34372. s.Message.ExtensionField = o;
  34373. s.Message.OneOf = function(e, t, i) {
  34374. h.call(this, e, t, i),
  34375. this.fields = []
  34376. }
  34377. ;
  34378. var p = function(e, t, i, n, r) {
  34379. l.call(this, e, t, i, n, r),
  34380. this.className = "Enum",
  34381. this.object = null
  34382. };
  34383. p.getName = function(e, t) {
  34384. for (var i, n = Object.keys(e), r = 0; r < n.length; ++r)
  34385. if (e[i = n[r]] === t)
  34386. return i;
  34387. return null
  34388. }
  34389. ,
  34390. (p.prototype = Object.create(l.prototype)).build = function(e) {
  34391. if (this.object && !e)
  34392. return this.object;
  34393. for (var t = new g.Builder.Enum, i = this.getChildren(p.Value), n = 0, r = i.length; n < r; ++n)
  34394. t[i[n].name] = i[n].id;
  34395. return Object.defineProperty && Object.defineProperty(t, "$options", {
  34396. value: this.buildOpt(),
  34397. enumerable: !1
  34398. }),
  34399. this.object = t
  34400. }
  34401. ,
  34402. s.Enum = p;
  34403. function f(e, t, i, n) {
  34404. h.call(this, e, t, i),
  34405. this.className = "Enum.Value",
  34406. this.id = n
  34407. }
  34408. f.prototype = Object.create(h.prototype),
  34409. s.Enum.Value = f;
  34410. var v = function(e, t, i, n) {
  34411. h.call(this, e, t, i),
  34412. this.field = n
  34413. };
  34414. v.prototype = Object.create(h.prototype),
  34415. s.Extension = v;
  34416. var y = function(e, t, i, n) {
  34417. l.call(this, e, t, i, n),
  34418. this.className = "Service",
  34419. this.clazz = null
  34420. };
  34421. (y.prototype = Object.create(l.prototype)).build = function(e) {
  34422. return this.clazz && !e ? this.clazz : this.clazz = function(t, r) {
  34423. for (var o = function(e) {
  34424. t.Builder.Service.call(this),
  34425. this.rpcImpl = e || function(e, t, i) {
  34426. setTimeout(i.bind(this, Error("Not implemented, see: https://github.com/dcodeIO/ProtoBuf.js/wiki/Services")), 0)
  34427. }
  34428. }, e = o.prototype = Object.create(t.Builder.Service.prototype), i = r.getChildren(t.Reflect.Service.RPCMethod), n = 0; n < i.length; n++)
  34429. !function(n) {
  34430. e[n.name] = function(e, i) {
  34431. try {
  34432. try {
  34433. e = n.resolvedRequestType.clazz.decode(I.wrap(e))
  34434. } catch (e) {
  34435. if (!(e instanceof TypeError))
  34436. throw e
  34437. }
  34438. if (null === e || "object" != typeof e)
  34439. throw Error("Illegal arguments");
  34440. e instanceof n.resolvedRequestType.clazz || (e = new n.resolvedRequestType.clazz(e)),
  34441. this.rpcImpl(n.fqn(), e, function(e, t) {
  34442. if (!e) {
  34443. null === t && (t = "");
  34444. try {
  34445. t = n.resolvedResponseType.clazz.decode(t)
  34446. } catch (e) {}
  34447. 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))
  34448. }
  34449. i(e)
  34450. })
  34451. } catch (e) {
  34452. setTimeout(i.bind(this, e), 0)
  34453. }
  34454. }
  34455. ,
  34456. o[n.name] = function(e, t, i) {
  34457. new o(e)[n.name](t, i)
  34458. }
  34459. ,
  34460. Object.defineProperty && (Object.defineProperty(o[n.name], "$options", {
  34461. value: n.buildOpt()
  34462. }),
  34463. Object.defineProperty(e[n.name], "$options", {
  34464. value: o[n.name].$options
  34465. }))
  34466. }(i[n]);
  34467. return Object.defineProperty && (Object.defineProperty(o, "$options", {
  34468. value: r.buildOpt()
  34469. }),
  34470. Object.defineProperty(e, "$options", {
  34471. value: o.$options
  34472. }),
  34473. Object.defineProperty(o, "$type", {
  34474. value: r
  34475. }),
  34476. Object.defineProperty(e, "$type", {
  34477. value: r
  34478. })),
  34479. o
  34480. }(g, this)
  34481. }
  34482. ,
  34483. s.Service = y;
  34484. function A(e, t, i, n) {
  34485. h.call(this, e, t, i),
  34486. this.className = "Service.Method",
  34487. this.options = n || {}
  34488. }
  34489. (A.prototype = Object.create(h.prototype)).buildOpt = t.buildOpt,
  34490. s.Service.Method = A;
  34491. function C(e, t, i, n, r, o, a, s) {
  34492. A.call(this, e, t, i, s),
  34493. this.className = "Service.RPCMethod",
  34494. this.requestName = n,
  34495. this.responseName = r,
  34496. this.requestStream = o,
  34497. this.responseStream = a,
  34498. this.resolvedRequestType = null,
  34499. this.resolvedResponseType = null
  34500. }
  34501. return C.prototype = Object.create(A.prototype),
  34502. s.Service.RPCMethod = C,
  34503. s
  34504. }(o),
  34505. o.Builder = (i = (u = o).Lang,
  34506. s = o.Reflect,
  34507. n = h.prototype,
  34508. h.isMessage = function(e) {
  34509. return "string" == typeof e.name && void 0 === e.values && void 0 === e.rpc
  34510. }
  34511. ,
  34512. h.isMessageField = function(e) {
  34513. return "string" == typeof e.rule && "string" == typeof e.name && "string" == typeof e.type && void 0 !== e.id
  34514. }
  34515. ,
  34516. h.isEnum = function(e) {
  34517. return "string" == typeof e.name && !(void 0 === e.values || !Array.isArray(e.values) || 0 === e.values.length)
  34518. }
  34519. ,
  34520. h.isService = function(e) {
  34521. return !("string" != typeof e.name || "object" != typeof e.rpc || !e.rpc)
  34522. }
  34523. ,
  34524. h.isExtend = function(e) {
  34525. return "string" == typeof e.ref
  34526. }
  34527. ,
  34528. n.reset = function() {
  34529. return this.ptr = this.ns,
  34530. this
  34531. }
  34532. ,
  34533. n.define = function(e) {
  34534. if ("string" != typeof e || !i.TYPEREF.test(e))
  34535. throw Error("illegal namespace: " + e);
  34536. return e.split(".").forEach(function(e) {
  34537. var t = this.ptr.getChild(e);
  34538. null === t && this.ptr.addChild(t = new s.Namespace(this,this.ptr,e)),
  34539. this.ptr = t
  34540. }, this),
  34541. this
  34542. }
  34543. ,
  34544. n.create = function(e) {
  34545. if (!e)
  34546. return this;
  34547. if (Array.isArray(e)) {
  34548. if (0 === e.length)
  34549. return this;
  34550. e = e.slice()
  34551. } else
  34552. e = [e];
  34553. for (var t = [e]; 0 < t.length; ) {
  34554. if (e = t.pop(),
  34555. !Array.isArray(e))
  34556. throw Error("not a valid namespace: " + JSON.stringify(e));
  34557. for (; 0 < e.length; ) {
  34558. var i = e.shift();
  34559. if (h.isMessage(i)) {
  34560. var o = new s.Message(this,this.ptr,i.name,i.options,i.isGroup,i.syntax)
  34561. , n = {};
  34562. i.oneofs && Object.keys(i.oneofs).forEach(function(e) {
  34563. o.addChild(n[e] = new s.Message.OneOf(this,o,e))
  34564. }, this),
  34565. i.fields && i.fields.forEach(function(e) {
  34566. if (null !== o.getChild(0 | e.id))
  34567. throw Error("duplicate or invalid field id in " + o.name + ": " + e.id);
  34568. if (e.options && "object" != typeof e.options)
  34569. throw Error("illegal field options in " + o.name + "#" + e.name);
  34570. var t = null;
  34571. if ("string" == typeof e.oneof && !(t = n[e.oneof]))
  34572. throw Error("illegal oneof in " + o.name + "#" + e.name + ": " + e.oneof);
  34573. e = new s.Message.Field(this,o,e.rule,e.keytype,e.type,e.name,e.id,e.options,t,i.syntax),
  34574. t && t.fields.push(e),
  34575. o.addChild(e)
  34576. }, this);
  34577. var r = [];
  34578. if (i.enums && i.enums.forEach(function(e) {
  34579. r.push(e)
  34580. }),
  34581. i.messages && i.messages.forEach(function(e) {
  34582. r.push(e)
  34583. }),
  34584. i.services && i.services.forEach(function(e) {
  34585. r.push(e)
  34586. }),
  34587. i.extensions && ("number" == typeof i.extensions[0] ? o.extensions = [i.extensions] : o.extensions = i.extensions),
  34588. this.ptr.addChild(o),
  34589. 0 < r.length) {
  34590. t.push(e),
  34591. e = r,
  34592. r = null,
  34593. this.ptr = o,
  34594. o = null;
  34595. continue
  34596. }
  34597. r = null
  34598. } else if (h.isEnum(i))
  34599. o = new s.Enum(this,this.ptr,i.name,i.options,i.syntax),
  34600. i.values.forEach(function(e) {
  34601. o.addChild(new s.Enum.Value(this,o,e.name,e.id))
  34602. }, this),
  34603. this.ptr.addChild(o);
  34604. else if (h.isService(i))
  34605. o = new s.Service(this,this.ptr,i.name,i.options),
  34606. Object.keys(i.rpc).forEach(function(e) {
  34607. var t = i.rpc[e];
  34608. o.addChild(new s.Service.RPCMethod(this,o,e,t.request,t.response,!!t.request_stream,!!t.response_stream,t.options))
  34609. }, this),
  34610. this.ptr.addChild(o);
  34611. else {
  34612. if (!h.isExtend(i))
  34613. throw Error("not a valid definition: " + JSON.stringify(i));
  34614. if (o = this.ptr.resolve(i.ref, !0))
  34615. i.fields.forEach(function(t) {
  34616. if (null !== o.getChild(0 | t.id))
  34617. throw Error("duplicate extended field id in " + o.name + ": " + t.id);
  34618. if (o.extensions) {
  34619. var i = !1;
  34620. if (o.extensions.forEach(function(e) {
  34621. t.id >= e[0] && t.id <= e[1] && (i = !0)
  34622. }),
  34623. !i)
  34624. throw Error("illegal extended field id in " + o.name + ": " + t.id + " (not within valid ranges)")
  34625. }
  34626. var e = t.name;
  34627. this.options.convertFieldsToCamelCase && (e = u.Util.toCamelCase(e));
  34628. var n = new s.Message.ExtensionField(this,o,t.rule,t.type,this.ptr.fqn() + "." + e,t.id,t.options)
  34629. , r = new s.Extension(this,this.ptr,t.name,n);
  34630. n.extension = r,
  34631. this.ptr.addChild(r),
  34632. o.addChild(n)
  34633. }, this);
  34634. else if (!/\.?google\.protobuf\./.test(i.ref))
  34635. throw Error("extended message " + i.ref + " is not defined")
  34636. }
  34637. o = i = null
  34638. }
  34639. e = null,
  34640. this.ptr = this.ptr.parent
  34641. }
  34642. return this.resolved = !1,
  34643. this.result = null,
  34644. this
  34645. }
  34646. ,
  34647. n.import = function(t, e) {
  34648. var i = "/";
  34649. if ("string" == typeof e) {
  34650. if (u.Util.IS_NODE && (e = p("path").resolve(e)),
  34651. !0 === this.files[e])
  34652. return this.reset();
  34653. this.files[e] = !0
  34654. } else if ("object" == typeof e) {
  34655. var n = e.root;
  34656. u.Util.IS_NODE && (n = p("path").resolve(n)),
  34657. (0 <= n.indexOf("\\") || 0 <= e.file.indexOf("\\")) && (i = "\\");
  34658. var r = n + i + e.file;
  34659. if (!0 === this.files[r])
  34660. return this.reset();
  34661. this.files[r] = !0
  34662. }
  34663. if (t.imports && 0 < t.imports.length) {
  34664. var o, a = !1;
  34665. "object" == typeof e ? (this.importRoot = e.root,
  34666. a = !0,
  34667. o = this.importRoot,
  34668. e = e.file,
  34669. (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(/\\[^\\]*$/, ""),
  34670. i = "\\") : o = "." : o = null;
  34671. for (var s = 0; s < t.imports.length; s++)
  34672. if ("string" == typeof t.imports[s]) {
  34673. if (!o)
  34674. throw Error("cannot determine import root");
  34675. var l = t.imports[s];
  34676. if ("google/protobuf/descriptor.proto" === l)
  34677. continue;
  34678. if (l = o + i + l,
  34679. !0 === this.files[l])
  34680. continue;
  34681. /\.proto$/i.test(l) && !u.DotProto && (l = l.replace(/\.proto$/, ".json"));
  34682. var c = u.Util.fetch(l);
  34683. if (null === c)
  34684. throw Error("failed to import '" + l + "' in '" + e + "': file not found");
  34685. /\.json$/i.test(l) ? this.import(JSON.parse(c + ""), l) : this.import(u.DotProto.Parser.parse(c), l)
  34686. } else
  34687. e ? /\.(\w+)$/.test(e) ? this.import(t.imports[s], e.replace(/^(.+)\.(\w+)$/, function(e, t, i) {
  34688. return t + "_import" + s + "." + i
  34689. })) : this.import(t.imports[s], e + "_import" + s) : this.import(t.imports[s]);
  34690. a && (this.importRoot = null)
  34691. }
  34692. t.package && this.define(t.package),
  34693. t.syntax && function t(i) {
  34694. i.messages && i.messages.forEach(function(e) {
  34695. e.syntax = i.syntax,
  34696. t(e)
  34697. }),
  34698. i.enums && i.enums.forEach(function(e) {
  34699. e.syntax = i.syntax
  34700. })
  34701. }(t);
  34702. var h = this.ptr;
  34703. return t.options && Object.keys(t.options).forEach(function(e) {
  34704. h.options[e] = t.options[e]
  34705. }),
  34706. t.messages && (this.create(t.messages),
  34707. this.ptr = h),
  34708. t.enums && (this.create(t.enums),
  34709. this.ptr = h),
  34710. t.services && (this.create(t.services),
  34711. this.ptr = h),
  34712. t.extends && this.create(t.extends),
  34713. this.reset()
  34714. }
  34715. ,
  34716. n.resolveAll = function() {
  34717. var e;
  34718. if (null == this.ptr || "object" == typeof this.ptr.type)
  34719. return this;
  34720. if (this.ptr instanceof s.Namespace)
  34721. this.ptr.children.forEach(function(e) {
  34722. this.ptr = e,
  34723. this.resolveAll()
  34724. }, this);
  34725. else if (this.ptr instanceof s.Message.Field) {
  34726. if (i.TYPE.test(this.ptr.type))
  34727. this.ptr.type = u.TYPES[this.ptr.type];
  34728. else {
  34729. if (!i.TYPEREF.test(this.ptr.type))
  34730. throw Error("illegal type reference in " + this.ptr.toString(!0) + ": " + this.ptr.type);
  34731. if (!(e = (this.ptr instanceof s.Message.ExtensionField ? this.ptr.extension.parent : this.ptr.parent).resolve(this.ptr.type, !0)))
  34732. throw Error("unresolvable type reference in " + this.ptr.toString(!0) + ": " + this.ptr.type);
  34733. if ((this.ptr.resolvedType = e)instanceof s.Enum) {
  34734. if (this.ptr.type = u.TYPES.enum,
  34735. "proto3" === this.ptr.syntax && "proto3" !== e.syntax)
  34736. throw Error("proto3 message cannot reference proto2 enum")
  34737. } else {
  34738. if (!(e instanceof s.Message))
  34739. throw Error("illegal type reference in " + this.ptr.toString(!0) + ": " + this.ptr.type);
  34740. this.ptr.type = e.isGroup ? u.TYPES.group : u.TYPES.message
  34741. }
  34742. }
  34743. if (this.ptr.map) {
  34744. if (!i.TYPE.test(this.ptr.keyType))
  34745. throw Error("illegal key type for map field in " + this.ptr.toString(!0) + ": " + this.ptr.keyType);
  34746. this.ptr.keyType = u.TYPES[this.ptr.keyType]
  34747. }
  34748. } else if (this.ptr instanceof u.Reflect.Service.Method) {
  34749. if (!(this.ptr instanceof u.Reflect.Service.RPCMethod))
  34750. throw Error("illegal service type in " + this.ptr.toString(!0));
  34751. if (!((e = this.ptr.parent.resolve(this.ptr.requestName, !0)) && e instanceof u.Reflect.Message))
  34752. throw Error("Illegal type reference in " + this.ptr.toString(!0) + ": " + this.ptr.requestName);
  34753. if (this.ptr.resolvedRequestType = e,
  34754. !((e = this.ptr.parent.resolve(this.ptr.responseName, !0)) && e instanceof u.Reflect.Message))
  34755. throw Error("Illegal type reference in " + this.ptr.toString(!0) + ": " + this.ptr.responseName);
  34756. this.ptr.resolvedResponseType = e
  34757. } else if (!(this.ptr instanceof u.Reflect.Message.OneOf || this.ptr instanceof u.Reflect.Extension || this.ptr instanceof u.Reflect.Enum.Value))
  34758. throw Error("illegal object in namespace: " + typeof this.ptr + ": " + this.ptr);
  34759. return this.reset()
  34760. }
  34761. ,
  34762. n.build = function(e) {
  34763. if (this.reset(),
  34764. this.resolved || (this.resolveAll(),
  34765. this.resolved = !0,
  34766. this.result = null),
  34767. null === this.result && (this.result = this.ns.build()),
  34768. !e)
  34769. return this.result;
  34770. for (var t = "string" == typeof e ? e.split(".") : e, i = this.result, n = 0; n < t.length; n++) {
  34771. if (!i[t[n]]) {
  34772. i = null;
  34773. break
  34774. }
  34775. i = i[t[n]]
  34776. }
  34777. return i
  34778. }
  34779. ,
  34780. n.lookup = function(e, t) {
  34781. return e ? this.ns.resolve(e, t) : this.ns
  34782. }
  34783. ,
  34784. n.toString = function() {
  34785. return "Builder"
  34786. }
  34787. ,
  34788. h.Message = function() {}
  34789. ,
  34790. h.Enum = function() {}
  34791. ,
  34792. h.Service = function() {}
  34793. ,
  34794. h),
  34795. o.Map = (a = o.Reflect,
  34796. (t = c.prototype).clear = function() {
  34797. this.map = {}
  34798. }
  34799. ,
  34800. t.delete = function(e) {
  34801. var t = this.keyElem.valueToString(this.keyElem.verifyValue(e))
  34802. , i = t in this.map;
  34803. return delete this.map[t],
  34804. i
  34805. }
  34806. ,
  34807. t.entries = function() {
  34808. for (var e, t = [], i = Object.keys(this.map), n = 0; n < i.length; n++)
  34809. t.push([(e = this.map[i[n]]).key, e.value]);
  34810. return l(t)
  34811. }
  34812. ,
  34813. t.keys = function() {
  34814. for (var e = [], t = Object.keys(this.map), i = 0; i < t.length; i++)
  34815. e.push(this.map[t[i]].key);
  34816. return l(e)
  34817. }
  34818. ,
  34819. t.values = function() {
  34820. for (var e = [], t = Object.keys(this.map), i = 0; i < t.length; i++)
  34821. e.push(this.map[t[i]].value);
  34822. return l(e)
  34823. }
  34824. ,
  34825. t.forEach = function(e, t) {
  34826. for (var i, n = Object.keys(this.map), r = 0; r < n.length; r++)
  34827. e.call(t, (i = this.map[n[r]]).value, i.key, this)
  34828. }
  34829. ,
  34830. t.set = function(e, t) {
  34831. var i = this.keyElem.verifyValue(e)
  34832. , n = this.valueElem.verifyValue(t);
  34833. return this.map[this.keyElem.valueToString(i)] = {
  34834. key: i,
  34835. value: n
  34836. },
  34837. this
  34838. }
  34839. ,
  34840. t.get = function(e) {
  34841. var t = this.keyElem.valueToString(this.keyElem.verifyValue(e));
  34842. if (t in this.map)
  34843. return this.map[t].value
  34844. }
  34845. ,
  34846. t.has = function(e) {
  34847. return this.keyElem.valueToString(this.keyElem.verifyValue(e))in this.map
  34848. }
  34849. ,
  34850. c),
  34851. o.loadProto = function(e, t, i) {
  34852. return ("string" == typeof t || t && "string" == typeof t.file && "string" == typeof t.root) && (i = t,
  34853. t = void 0),
  34854. o.loadJson(o.DotProto.Parser.parse(e), t, i)
  34855. }
  34856. ,
  34857. o.protoFromString = o.loadProto,
  34858. o.loadProtoFile = function(t, i, n) {
  34859. if (i && "object" == typeof i ? (n = i,
  34860. i = null) : i && "function" == typeof i || (i = null),
  34861. i)
  34862. return o.Util.fetch("string" == typeof t ? t : t.root + "/" + t.file, function(e) {
  34863. if (null !== e)
  34864. try {
  34865. i(null, o.loadProto(e, n, t))
  34866. } catch (e) {
  34867. i(e)
  34868. }
  34869. else
  34870. i(Error("Failed to fetch file"))
  34871. });
  34872. var e = o.Util.fetch("object" == typeof t ? t.root + "/" + t.file : t);
  34873. return null === e ? null : o.loadProto(e, n, t)
  34874. }
  34875. ,
  34876. o.protoFromFile = o.loadProtoFile,
  34877. o.newBuilder = function(e) {
  34878. return void 0 === (e = e || {}).convertFieldsToCamelCase && (e.convertFieldsToCamelCase = o.convertFieldsToCamelCase),
  34879. void 0 === e.populateAccessors && (e.populateAccessors = o.populateAccessors),
  34880. new o.Builder(e)
  34881. }
  34882. ,
  34883. o.loadJson = function(e, t, i) {
  34884. return ("string" == typeof t || t && "string" == typeof t.file && "string" == typeof t.root) && (i = t,
  34885. t = null),
  34886. t && "object" == typeof t || (t = o.newBuilder()),
  34887. "string" == typeof e && (e = JSON.parse(e)),
  34888. t.import(e, i),
  34889. t.resolveAll(),
  34890. t
  34891. }
  34892. ,
  34893. o.loadJsonFile = function(t, i, n) {
  34894. if (i && "object" == typeof i ? (n = i,
  34895. i = null) : i && "function" == typeof i || (i = null),
  34896. i)
  34897. return o.Util.fetch("string" == typeof t ? t : t.root + "/" + t.file, function(e) {
  34898. if (null !== e)
  34899. try {
  34900. i(null, o.loadJson(JSON.parse(e), n, t))
  34901. } catch (e) {
  34902. i(e)
  34903. }
  34904. else
  34905. i(Error("Failed to fetch file"))
  34906. });
  34907. var e = o.Util.fetch("object" == typeof t ? t.root + "/" + t.file : t);
  34908. return null === e ? null : o.loadJson(JSON.parse(e), n, t)
  34909. }
  34910. ,
  34911. o;
  34912. function l(e) {
  34913. var t = 0;
  34914. return {
  34915. next: function() {
  34916. return t < e.length ? {
  34917. done: !1,
  34918. value: e[t++]
  34919. } : {
  34920. done: !0
  34921. }
  34922. }
  34923. }
  34924. }
  34925. function c(e, t) {
  34926. if (!e.map)
  34927. throw Error("field is not a map");
  34928. if (this.field = e,
  34929. this.keyElem = new a.Element(e.keyType,null,!0,e.syntax),
  34930. this.valueElem = new a.Element(e.type,e.resolvedType,!1,e.syntax),
  34931. this.map = {},
  34932. Object.defineProperty(this, "size", {
  34933. get: function() {
  34934. return Object.keys(this.map).length
  34935. }
  34936. }),
  34937. t)
  34938. for (var i = Object.keys(t), n = 0; n < i.length; n++) {
  34939. var r = this.keyElem.valueFromString(i[n])
  34940. , o = this.valueElem.verifyValue(t[i[n]]);
  34941. this.map[this.keyElem.valueToString(r)] = {
  34942. key: r,
  34943. value: o
  34944. }
  34945. }
  34946. }
  34947. function h(e) {
  34948. this.ns = new s.Namespace(this,null,""),
  34949. this.ptr = this.ns,
  34950. this.resolved = !1,
  34951. this.result = null,
  34952. this.files = {},
  34953. this.importRoot = null,
  34954. this.options = e || {}
  34955. }
  34956. }
  34957. ,
  34958. "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)
  34959. }
  34960. ).call(this, p("_process"))
  34961. }
  34962. , {
  34963. _process: 203,
  34964. bytebuffer: 215,
  34965. fs: 197,
  34966. path: 197
  34967. }],
  34968. 215: [function(t, e, i) {
  34969. var n, r;
  34970. n = this,
  34971. r = function(l) {
  34972. "use strict";
  34973. function s(e) {
  34974. var t = 0;
  34975. return function() {
  34976. return t < e.length ? e.charCodeAt(t++) : null
  34977. }
  34978. }
  34979. function c() {
  34980. var e = []
  34981. , t = [];
  34982. return function() {
  34983. return 0 === arguments.length ? t.join("") + i.apply(String, e) : (1024 < e.length + arguments.length && (t.push(i.apply(String, e)),
  34984. e.length = 0),
  34985. void Array.prototype.push.apply(e, arguments))
  34986. }
  34987. }
  34988. function n(e, t, i, n, r) {
  34989. 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];
  34990. for (u += d,
  34991. o = p & (1 << -h) - 1,
  34992. p >>= -h,
  34993. h += s; 0 < h; o = 256 * o + e[t + u],
  34994. u += d,
  34995. h -= 8)
  34996. ;
  34997. for (a = o & (1 << -h) - 1,
  34998. o >>= -h,
  34999. h += n; 0 < h; a = 256 * a + e[t + u],
  35000. u += d,
  35001. h -= 8)
  35002. ;
  35003. if (0 === o)
  35004. o = 1 - c;
  35005. else {
  35006. if (o === l)
  35007. return a ? NaN : 1 / 0 * (p ? -1 : 1);
  35008. a += Math.pow(2, n),
  35009. o -= c
  35010. }
  35011. return (p ? -1 : 1) * a * Math.pow(2, o - n)
  35012. }
  35013. function r(e, t, i, n, r, o) {
  35014. 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;
  35015. for (t = Math.abs(t),
  35016. isNaN(t) || t === 1 / 0 ? (s = isNaN(t) ? 1 : 0,
  35017. a = h) : (a = Math.floor(Math.log(t) / Math.LN2),
  35018. t * (l = Math.pow(2, -a)) < 1 && (a--,
  35019. l *= 2),
  35020. 2 <= (t += 1 <= a + u ? d / l : d * Math.pow(2, 1 - u)) * l && (a++,
  35021. l /= 2),
  35022. h <= a + u ? (s = 0,
  35023. a = h) : 1 <= a + u ? (s = (t * l - 1) * Math.pow(2, r),
  35024. a += u) : (s = t * Math.pow(2, u - 1) * Math.pow(2, r),
  35025. a = 0)); 8 <= r; e[i + p] = 255 & s,
  35026. p += f,
  35027. s /= 256,
  35028. r -= 8)
  35029. ;
  35030. for (a = a << r | s,
  35031. c += r; 0 < c; e[i + p] = 255 & a,
  35032. p += f,
  35033. a /= 256,
  35034. c -= 8)
  35035. ;
  35036. e[i + p - f] |= 128 * g
  35037. }
  35038. var f = function(e, t, i) {
  35039. if (void 0 === e && (e = f.DEFAULT_CAPACITY),
  35040. void 0 === t && (t = f.DEFAULT_ENDIAN),
  35041. void 0 === i && (i = f.DEFAULT_NOASSERT),
  35042. !i) {
  35043. if ((e |= 0) < 0)
  35044. throw RangeError("Illegal capacity");
  35045. t = !!t,
  35046. i = !!i
  35047. }
  35048. this.buffer = 0 === e ? o : new ArrayBuffer(e),
  35049. this.view = 0 === e ? null : new Uint8Array(this.buffer),
  35050. this.offset = 0,
  35051. this.markedOffset = -1,
  35052. this.limit = e,
  35053. this.littleEndian = t,
  35054. this.noAssert = i
  35055. };
  35056. f.VERSION = "5.0.1",
  35057. f.LITTLE_ENDIAN = !0,
  35058. f.BIG_ENDIAN = !1,
  35059. f.DEFAULT_CAPACITY = 16,
  35060. f.DEFAULT_ENDIAN = f.BIG_ENDIAN,
  35061. f.DEFAULT_NOASSERT = !1,
  35062. f.Long = l || null;
  35063. var a = f.prototype;
  35064. a.__isByteBuffer__,
  35065. Object.defineProperty(a, "__isByteBuffer__", {
  35066. value: !0,
  35067. enumerable: !1,
  35068. configurable: !1
  35069. });
  35070. var o = new ArrayBuffer(0)
  35071. , i = String.fromCharCode;
  35072. f.accessor = function() {
  35073. return Uint8Array
  35074. }
  35075. ,
  35076. f.allocate = function(e, t, i) {
  35077. return new f(e,t,i)
  35078. }
  35079. ,
  35080. f.concat = function(e, t, i, n) {
  35081. "boolean" != typeof t && "string" == typeof t || (n = i,
  35082. i = t,
  35083. t = void 0);
  35084. for (var r, o = 0, a = 0, s = e.length; a < s; ++a)
  35085. f.isByteBuffer(e[a]) || (e[a] = f.wrap(e[a], t)),
  35086. 0 < (r = e[a].limit - e[a].offset) && (o += r);
  35087. if (0 === o)
  35088. return new f(0,i,n);
  35089. var l, c = new f(o,i,n);
  35090. for (a = 0; a < s; )
  35091. (r = (l = e[a++]).limit - l.offset) <= 0 || (c.view.set(l.view.subarray(l.offset, l.limit), c.offset),
  35092. c.offset += r);
  35093. return c.limit = c.offset,
  35094. c.offset = 0,
  35095. c
  35096. }
  35097. ,
  35098. f.isByteBuffer = function(e) {
  35099. return !0 === (e && e.__isByteBuffer__)
  35100. }
  35101. ,
  35102. f.type = function() {
  35103. return ArrayBuffer
  35104. }
  35105. ,
  35106. f.wrap = function(e, t, i, n) {
  35107. if ("string" != typeof t && (n = i,
  35108. i = t,
  35109. t = void 0),
  35110. "string" == typeof e)
  35111. switch (void 0 === t && (t = "utf8"),
  35112. t) {
  35113. case "base64":
  35114. return f.fromBase64(e, i);
  35115. case "hex":
  35116. return f.fromHex(e, i);
  35117. case "binary":
  35118. return f.fromBinary(e, i);
  35119. case "utf8":
  35120. return f.fromUTF8(e, i);
  35121. case "debug":
  35122. return f.fromDebug(e, i);
  35123. default:
  35124. throw Error("Unsupported encoding: " + t)
  35125. }
  35126. if (null === e || "object" != typeof e)
  35127. throw TypeError("Illegal buffer");
  35128. var r;
  35129. if (f.isByteBuffer(e))
  35130. return (r = a.clone.call(e)).markedOffset = -1,
  35131. r;
  35132. if (e instanceof Uint8Array)
  35133. r = new f(0,i,n),
  35134. 0 < e.length && (r.buffer = e.buffer,
  35135. r.offset = e.byteOffset,
  35136. r.limit = e.byteOffset + e.byteLength,
  35137. r.view = new Uint8Array(e.buffer));
  35138. else if (e instanceof ArrayBuffer)
  35139. r = new f(0,i,n),
  35140. 0 < e.byteLength && (r.buffer = e,
  35141. r.offset = 0,
  35142. r.limit = e.byteLength,
  35143. r.view = 0 < e.byteLength ? new Uint8Array(e) : null);
  35144. else {
  35145. if ("[object Array]" !== Object.prototype.toString.call(e))
  35146. throw TypeError("Illegal buffer");
  35147. (r = new f(e.length,i,n)).limit = e.length;
  35148. for (var o = 0; o < e.length; ++o)
  35149. r.view[o] = e[o]
  35150. }
  35151. return r
  35152. }
  35153. ,
  35154. a.writeBitSet = function(e, t) {
  35155. var i = void 0 === t;
  35156. if (i && (t = this.offset),
  35157. !this.noAssert) {
  35158. if (!(e instanceof Array))
  35159. throw TypeError("Illegal BitSet: Not an array");
  35160. if ("number" != typeof t || t % 1 != 0)
  35161. throw TypeError("Illegal offset: " + t + " (not an integer)");
  35162. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  35163. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  35164. }
  35165. var n, r = t, o = e.length, a = o >> 3, s = 0;
  35166. for (t += this.writeVarint32(o, t); a--; )
  35167. 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,
  35168. this.writeByte(n, t++);
  35169. if (s < o) {
  35170. var l = 0;
  35171. for (n = 0; s < o; )
  35172. n |= (1 & !!e[s++]) << l++;
  35173. this.writeByte(n, t++)
  35174. }
  35175. return i ? (this.offset = t,
  35176. this) : t - r
  35177. }
  35178. ,
  35179. a.readBitSet = function(e) {
  35180. var t = void 0 === e;
  35181. t && (e = this.offset);
  35182. var i, n = this.readVarint32(e), r = n.value, o = r >> 3, a = 0, s = [];
  35183. for (e += n.length; o--; )
  35184. i = this.readByte(e++),
  35185. s[a++] = !!(1 & i),
  35186. s[a++] = !!(2 & i),
  35187. s[a++] = !!(4 & i),
  35188. s[a++] = !!(8 & i),
  35189. s[a++] = !!(16 & i),
  35190. s[a++] = !!(32 & i),
  35191. s[a++] = !!(64 & i),
  35192. s[a++] = !!(128 & i);
  35193. if (a < r) {
  35194. var l = 0;
  35195. for (i = this.readByte(e++); a < r; )
  35196. s[a++] = !!(i >> l++ & 1)
  35197. }
  35198. return t && (this.offset = e),
  35199. s
  35200. }
  35201. ,
  35202. a.readBytes = function(e, t) {
  35203. var i = void 0 === t;
  35204. if (i && (t = this.offset),
  35205. !this.noAssert) {
  35206. if ("number" != typeof t || t % 1 != 0)
  35207. throw TypeError("Illegal offset: " + t + " (not an integer)");
  35208. if ((t >>>= 0) < 0 || t + e > this.buffer.byteLength)
  35209. throw RangeError("Illegal offset: 0 <= " + t + " (+" + e + ") <= " + this.buffer.byteLength)
  35210. }
  35211. var n = this.slice(t, t + e);
  35212. return i && (this.offset += e),
  35213. n
  35214. }
  35215. ,
  35216. a.writeBytes = a.append,
  35217. a.writeInt8 = function(e, t) {
  35218. var i = void 0 === t;
  35219. if (i && (t = this.offset),
  35220. !this.noAssert) {
  35221. if ("number" != typeof e || e % 1 != 0)
  35222. throw TypeError("Illegal value: " + e + " (not an integer)");
  35223. if (e |= 0,
  35224. "number" != typeof t || t % 1 != 0)
  35225. throw TypeError("Illegal offset: " + t + " (not an integer)");
  35226. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  35227. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  35228. }
  35229. t += 1;
  35230. var n = this.buffer.byteLength;
  35231. return n < t && this.resize((n *= 2) > t ? n : t),
  35232. t -= 1,
  35233. this.view[t] = e,
  35234. i && (this.offset += 1),
  35235. this
  35236. }
  35237. ,
  35238. a.writeByte = a.writeInt8,
  35239. a.readInt8 = function(e) {
  35240. var t = void 0 === e;
  35241. if (t && (e = this.offset),
  35242. !this.noAssert) {
  35243. if ("number" != typeof e || e % 1 != 0)
  35244. throw TypeError("Illegal offset: " + e + " (not an integer)");
  35245. if ((e >>>= 0) < 0 || e + 1 > this.buffer.byteLength)
  35246. throw RangeError("Illegal offset: 0 <= " + e + " (+1) <= " + this.buffer.byteLength)
  35247. }
  35248. var i = this.view[e];
  35249. return 128 == (128 & i) && (i = -(255 - i + 1)),
  35250. t && (this.offset += 1),
  35251. i
  35252. }
  35253. ,
  35254. a.readByte = a.readInt8,
  35255. a.writeUint8 = function(e, t) {
  35256. var i = void 0 === t;
  35257. if (i && (t = this.offset),
  35258. !this.noAssert) {
  35259. if ("number" != typeof e || e % 1 != 0)
  35260. throw TypeError("Illegal value: " + e + " (not an integer)");
  35261. if (e >>>= 0,
  35262. "number" != typeof t || t % 1 != 0)
  35263. throw TypeError("Illegal offset: " + t + " (not an integer)");
  35264. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  35265. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  35266. }
  35267. t += 1;
  35268. var n = this.buffer.byteLength;
  35269. return n < t && this.resize((n *= 2) > t ? n : t),
  35270. t -= 1,
  35271. this.view[t] = e,
  35272. i && (this.offset += 1),
  35273. this
  35274. }
  35275. ,
  35276. a.writeUInt8 = a.writeUint8,
  35277. a.readUint8 = function(e) {
  35278. var t = void 0 === e;
  35279. if (t && (e = this.offset),
  35280. !this.noAssert) {
  35281. if ("number" != typeof e || e % 1 != 0)
  35282. throw TypeError("Illegal offset: " + e + " (not an integer)");
  35283. if ((e >>>= 0) < 0 || e + 1 > this.buffer.byteLength)
  35284. throw RangeError("Illegal offset: 0 <= " + e + " (+1) <= " + this.buffer.byteLength)
  35285. }
  35286. var i = this.view[e];
  35287. return t && (this.offset += 1),
  35288. i
  35289. }
  35290. ,
  35291. a.readUInt8 = a.readUint8,
  35292. a.writeInt16 = function(e, t) {
  35293. var i = void 0 === t;
  35294. if (i && (t = this.offset),
  35295. !this.noAssert) {
  35296. if ("number" != typeof e || e % 1 != 0)
  35297. throw TypeError("Illegal value: " + e + " (not an integer)");
  35298. if (e |= 0,
  35299. "number" != typeof t || t % 1 != 0)
  35300. throw TypeError("Illegal offset: " + t + " (not an integer)");
  35301. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  35302. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  35303. }
  35304. t += 2;
  35305. var n = this.buffer.byteLength;
  35306. return n < t && this.resize((n *= 2) > t ? n : t),
  35307. t -= 2,
  35308. this.littleEndian ? (this.view[t + 1] = (65280 & e) >>> 8,
  35309. this.view[t] = 255 & e) : (this.view[t] = (65280 & e) >>> 8,
  35310. this.view[t + 1] = 255 & e),
  35311. i && (this.offset += 2),
  35312. this
  35313. }
  35314. ,
  35315. a.writeShort = a.writeInt16,
  35316. a.readInt16 = function(e) {
  35317. var t = void 0 === e;
  35318. if (t && (e = this.offset),
  35319. !this.noAssert) {
  35320. if ("number" != typeof e || e % 1 != 0)
  35321. throw TypeError("Illegal offset: " + e + " (not an integer)");
  35322. if ((e >>>= 0) < 0 || e + 2 > this.buffer.byteLength)
  35323. throw RangeError("Illegal offset: 0 <= " + e + " (+2) <= " + this.buffer.byteLength)
  35324. }
  35325. var i = 0;
  35326. return this.littleEndian ? (i = this.view[e],
  35327. i |= this.view[e + 1] << 8) : (i = this.view[e] << 8,
  35328. i |= this.view[e + 1]),
  35329. 32768 == (32768 & i) && (i = -(65535 - i + 1)),
  35330. t && (this.offset += 2),
  35331. i
  35332. }
  35333. ,
  35334. a.readShort = a.readInt16,
  35335. a.writeUint16 = function(e, t) {
  35336. var i = void 0 === t;
  35337. if (i && (t = this.offset),
  35338. !this.noAssert) {
  35339. if ("number" != typeof e || e % 1 != 0)
  35340. throw TypeError("Illegal value: " + e + " (not an integer)");
  35341. if (e >>>= 0,
  35342. "number" != typeof t || t % 1 != 0)
  35343. throw TypeError("Illegal offset: " + t + " (not an integer)");
  35344. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  35345. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  35346. }
  35347. t += 2;
  35348. var n = this.buffer.byteLength;
  35349. return n < t && this.resize((n *= 2) > t ? n : t),
  35350. t -= 2,
  35351. this.littleEndian ? (this.view[t + 1] = (65280 & e) >>> 8,
  35352. this.view[t] = 255 & e) : (this.view[t] = (65280 & e) >>> 8,
  35353. this.view[t + 1] = 255 & e),
  35354. i && (this.offset += 2),
  35355. this
  35356. }
  35357. ,
  35358. a.writeUInt16 = a.writeUint16,
  35359. a.readUint16 = function(e) {
  35360. var t = void 0 === e;
  35361. if (t && (e = this.offset),
  35362. !this.noAssert) {
  35363. if ("number" != typeof e || e % 1 != 0)
  35364. throw TypeError("Illegal offset: " + e + " (not an integer)");
  35365. if ((e >>>= 0) < 0 || e + 2 > this.buffer.byteLength)
  35366. throw RangeError("Illegal offset: 0 <= " + e + " (+2) <= " + this.buffer.byteLength)
  35367. }
  35368. var i = 0;
  35369. return this.littleEndian ? (i = this.view[e],
  35370. i |= this.view[e + 1] << 8) : (i = this.view[e] << 8,
  35371. i |= this.view[e + 1]),
  35372. t && (this.offset += 2),
  35373. i
  35374. }
  35375. ,
  35376. a.readUInt16 = a.readUint16,
  35377. a.writeInt32 = function(e, t) {
  35378. var i = void 0 === t;
  35379. if (i && (t = this.offset),
  35380. !this.noAssert) {
  35381. if ("number" != typeof e || e % 1 != 0)
  35382. throw TypeError("Illegal value: " + e + " (not an integer)");
  35383. if (e |= 0,
  35384. "number" != typeof t || t % 1 != 0)
  35385. throw TypeError("Illegal offset: " + t + " (not an integer)");
  35386. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  35387. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  35388. }
  35389. t += 4;
  35390. var n = this.buffer.byteLength;
  35391. return n < t && this.resize((n *= 2) > t ? n : t),
  35392. t -= 4,
  35393. this.littleEndian ? (this.view[t + 3] = e >>> 24 & 255,
  35394. this.view[t + 2] = e >>> 16 & 255,
  35395. this.view[t + 1] = e >>> 8 & 255,
  35396. this.view[t] = 255 & e) : (this.view[t] = e >>> 24 & 255,
  35397. this.view[t + 1] = e >>> 16 & 255,
  35398. this.view[t + 2] = e >>> 8 & 255,
  35399. this.view[t + 3] = 255 & e),
  35400. i && (this.offset += 4),
  35401. this
  35402. }
  35403. ,
  35404. a.writeInt = a.writeInt32,
  35405. a.readInt32 = function(e) {
  35406. var t = void 0 === e;
  35407. if (t && (e = this.offset),
  35408. !this.noAssert) {
  35409. if ("number" != typeof e || e % 1 != 0)
  35410. throw TypeError("Illegal offset: " + e + " (not an integer)");
  35411. if ((e >>>= 0) < 0 || e + 4 > this.buffer.byteLength)
  35412. throw RangeError("Illegal offset: 0 <= " + e + " (+4) <= " + this.buffer.byteLength)
  35413. }
  35414. var i = 0;
  35415. return this.littleEndian ? (i = this.view[e + 2] << 16,
  35416. i |= this.view[e + 1] << 8,
  35417. i |= this.view[e],
  35418. i += this.view[e + 3] << 24 >>> 0) : (i = this.view[e + 1] << 16,
  35419. i |= this.view[e + 2] << 8,
  35420. i |= this.view[e + 3],
  35421. i += this.view[e] << 24 >>> 0),
  35422. i |= 0,
  35423. t && (this.offset += 4),
  35424. i
  35425. }
  35426. ,
  35427. a.readInt = a.readInt32,
  35428. a.writeUint32 = function(e, t) {
  35429. var i = void 0 === t;
  35430. if (i && (t = this.offset),
  35431. !this.noAssert) {
  35432. if ("number" != typeof e || e % 1 != 0)
  35433. throw TypeError("Illegal value: " + e + " (not an integer)");
  35434. if (e >>>= 0,
  35435. "number" != typeof t || t % 1 != 0)
  35436. throw TypeError("Illegal offset: " + t + " (not an integer)");
  35437. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  35438. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  35439. }
  35440. t += 4;
  35441. var n = this.buffer.byteLength;
  35442. return n < t && this.resize((n *= 2) > t ? n : t),
  35443. t -= 4,
  35444. this.littleEndian ? (this.view[t + 3] = e >>> 24 & 255,
  35445. this.view[t + 2] = e >>> 16 & 255,
  35446. this.view[t + 1] = e >>> 8 & 255,
  35447. this.view[t] = 255 & e) : (this.view[t] = e >>> 24 & 255,
  35448. this.view[t + 1] = e >>> 16 & 255,
  35449. this.view[t + 2] = e >>> 8 & 255,
  35450. this.view[t + 3] = 255 & e),
  35451. i && (this.offset += 4),
  35452. this
  35453. }
  35454. ,
  35455. a.writeUInt32 = a.writeUint32,
  35456. a.readUint32 = function(e) {
  35457. var t = void 0 === e;
  35458. if (t && (e = this.offset),
  35459. !this.noAssert) {
  35460. if ("number" != typeof e || e % 1 != 0)
  35461. throw TypeError("Illegal offset: " + e + " (not an integer)");
  35462. if ((e >>>= 0) < 0 || e + 4 > this.buffer.byteLength)
  35463. throw RangeError("Illegal offset: 0 <= " + e + " (+4) <= " + this.buffer.byteLength)
  35464. }
  35465. var i = 0;
  35466. return this.littleEndian ? (i = this.view[e + 2] << 16,
  35467. i |= this.view[e + 1] << 8,
  35468. i |= this.view[e],
  35469. i += this.view[e + 3] << 24 >>> 0) : (i = this.view[e + 1] << 16,
  35470. i |= this.view[e + 2] << 8,
  35471. i |= this.view[e + 3],
  35472. i += this.view[e] << 24 >>> 0),
  35473. t && (this.offset += 4),
  35474. i
  35475. }
  35476. ,
  35477. a.readUInt32 = a.readUint32,
  35478. l && (a.writeInt64 = function(e, t) {
  35479. var i = void 0 === t;
  35480. if (i && (t = this.offset),
  35481. !this.noAssert) {
  35482. if ("number" == typeof e)
  35483. e = l.fromNumber(e);
  35484. else if ("string" == typeof e)
  35485. e = l.fromString(e);
  35486. else if (!(e && e instanceof l))
  35487. throw TypeError("Illegal value: " + e + " (not an integer or Long)");
  35488. if ("number" != typeof t || t % 1 != 0)
  35489. throw TypeError("Illegal offset: " + t + " (not an integer)");
  35490. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  35491. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  35492. }
  35493. "number" == typeof e ? e = l.fromNumber(e) : "string" == typeof e && (e = l.fromString(e)),
  35494. t += 8;
  35495. var n = this.buffer.byteLength;
  35496. n < t && this.resize((n *= 2) > t ? n : t),
  35497. t -= 8;
  35498. var r = e.low
  35499. , o = e.high;
  35500. return this.littleEndian ? (this.view[t + 3] = r >>> 24 & 255,
  35501. this.view[t + 2] = r >>> 16 & 255,
  35502. this.view[t + 1] = r >>> 8 & 255,
  35503. this.view[t] = 255 & r,
  35504. t += 4,
  35505. this.view[t + 3] = o >>> 24 & 255,
  35506. this.view[t + 2] = o >>> 16 & 255,
  35507. this.view[t + 1] = o >>> 8 & 255,
  35508. this.view[t] = 255 & o) : (this.view[t] = o >>> 24 & 255,
  35509. this.view[t + 1] = o >>> 16 & 255,
  35510. this.view[t + 2] = o >>> 8 & 255,
  35511. this.view[t + 3] = 255 & o,
  35512. t += 4,
  35513. this.view[t] = r >>> 24 & 255,
  35514. this.view[t + 1] = r >>> 16 & 255,
  35515. this.view[t + 2] = r >>> 8 & 255,
  35516. this.view[t + 3] = 255 & r),
  35517. i && (this.offset += 8),
  35518. this
  35519. }
  35520. ,
  35521. a.writeLong = a.writeInt64,
  35522. a.readInt64 = function(e) {
  35523. var t = void 0 === e;
  35524. if (t && (e = this.offset),
  35525. !this.noAssert) {
  35526. if ("number" != typeof e || e % 1 != 0)
  35527. throw TypeError("Illegal offset: " + e + " (not an integer)");
  35528. if ((e >>>= 0) < 0 || e + 8 > this.buffer.byteLength)
  35529. throw RangeError("Illegal offset: 0 <= " + e + " (+8) <= " + this.buffer.byteLength)
  35530. }
  35531. var i = 0
  35532. , n = 0;
  35533. this.littleEndian ? (i = this.view[e + 2] << 16,
  35534. i |= this.view[e + 1] << 8,
  35535. i |= this.view[e],
  35536. i += this.view[e + 3] << 24 >>> 0,
  35537. e += 4,
  35538. n = this.view[e + 2] << 16,
  35539. n |= this.view[e + 1] << 8,
  35540. n |= this.view[e],
  35541. n += this.view[e + 3] << 24 >>> 0) : (n = this.view[e + 1] << 16,
  35542. n |= this.view[e + 2] << 8,
  35543. n |= this.view[e + 3],
  35544. n += this.view[e] << 24 >>> 0,
  35545. e += 4,
  35546. i = this.view[e + 1] << 16,
  35547. i |= this.view[e + 2] << 8,
  35548. i |= this.view[e + 3],
  35549. i += this.view[e] << 24 >>> 0);
  35550. var r = new l(i,n,!1);
  35551. return t && (this.offset += 8),
  35552. r
  35553. }
  35554. ,
  35555. a.readLong = a.readInt64,
  35556. a.writeUint64 = function(e, t) {
  35557. var i = void 0 === t;
  35558. if (i && (t = this.offset),
  35559. !this.noAssert) {
  35560. if ("number" == typeof e)
  35561. e = l.fromNumber(e);
  35562. else if ("string" == typeof e)
  35563. e = l.fromString(e);
  35564. else if (!(e && e instanceof l))
  35565. throw TypeError("Illegal value: " + e + " (not an integer or Long)");
  35566. if ("number" != typeof t || t % 1 != 0)
  35567. throw TypeError("Illegal offset: " + t + " (not an integer)");
  35568. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  35569. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  35570. }
  35571. "number" == typeof e ? e = l.fromNumber(e) : "string" == typeof e && (e = l.fromString(e)),
  35572. t += 8;
  35573. var n = this.buffer.byteLength;
  35574. n < t && this.resize((n *= 2) > t ? n : t),
  35575. t -= 8;
  35576. var r = e.low
  35577. , o = e.high;
  35578. return this.littleEndian ? (this.view[t + 3] = r >>> 24 & 255,
  35579. this.view[t + 2] = r >>> 16 & 255,
  35580. this.view[t + 1] = r >>> 8 & 255,
  35581. this.view[t] = 255 & r,
  35582. t += 4,
  35583. this.view[t + 3] = o >>> 24 & 255,
  35584. this.view[t + 2] = o >>> 16 & 255,
  35585. this.view[t + 1] = o >>> 8 & 255,
  35586. this.view[t] = 255 & o) : (this.view[t] = o >>> 24 & 255,
  35587. this.view[t + 1] = o >>> 16 & 255,
  35588. this.view[t + 2] = o >>> 8 & 255,
  35589. this.view[t + 3] = 255 & o,
  35590. t += 4,
  35591. this.view[t] = r >>> 24 & 255,
  35592. this.view[t + 1] = r >>> 16 & 255,
  35593. this.view[t + 2] = r >>> 8 & 255,
  35594. this.view[t + 3] = 255 & r),
  35595. i && (this.offset += 8),
  35596. this
  35597. }
  35598. ,
  35599. a.writeUInt64 = a.writeUint64,
  35600. a.readUint64 = function(e) {
  35601. var t = void 0 === e;
  35602. if (t && (e = this.offset),
  35603. !this.noAssert) {
  35604. if ("number" != typeof e || e % 1 != 0)
  35605. throw TypeError("Illegal offset: " + e + " (not an integer)");
  35606. if ((e >>>= 0) < 0 || e + 8 > this.buffer.byteLength)
  35607. throw RangeError("Illegal offset: 0 <= " + e + " (+8) <= " + this.buffer.byteLength)
  35608. }
  35609. var i = 0
  35610. , n = 0;
  35611. this.littleEndian ? (i = this.view[e + 2] << 16,
  35612. i |= this.view[e + 1] << 8,
  35613. i |= this.view[e],
  35614. i += this.view[e + 3] << 24 >>> 0,
  35615. e += 4,
  35616. n = this.view[e + 2] << 16,
  35617. n |= this.view[e + 1] << 8,
  35618. n |= this.view[e],
  35619. n += this.view[e + 3] << 24 >>> 0) : (n = this.view[e + 1] << 16,
  35620. n |= this.view[e + 2] << 8,
  35621. n |= this.view[e + 3],
  35622. n += this.view[e] << 24 >>> 0,
  35623. e += 4,
  35624. i = this.view[e + 1] << 16,
  35625. i |= this.view[e + 2] << 8,
  35626. i |= this.view[e + 3],
  35627. i += this.view[e] << 24 >>> 0);
  35628. var r = new l(i,n,!0);
  35629. return t && (this.offset += 8),
  35630. r
  35631. }
  35632. ,
  35633. a.readUInt64 = a.readUint64),
  35634. a.writeFloat32 = function(e, t) {
  35635. var i = void 0 === t;
  35636. if (i && (t = this.offset),
  35637. !this.noAssert) {
  35638. if ("number" != typeof e)
  35639. throw TypeError("Illegal value: " + e + " (not a number)");
  35640. if ("number" != typeof t || t % 1 != 0)
  35641. throw TypeError("Illegal offset: " + t + " (not an integer)");
  35642. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  35643. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  35644. }
  35645. t += 4;
  35646. var n = this.buffer.byteLength;
  35647. return n < t && this.resize((n *= 2) > t ? n : t),
  35648. t -= 4,
  35649. r(this.view, e, t, this.littleEndian, 23, 4),
  35650. i && (this.offset += 4),
  35651. this
  35652. }
  35653. ,
  35654. a.writeFloat = a.writeFloat32,
  35655. a.readFloat32 = function(e) {
  35656. var t = void 0 === e;
  35657. if (t && (e = this.offset),
  35658. !this.noAssert) {
  35659. if ("number" != typeof e || e % 1 != 0)
  35660. throw TypeError("Illegal offset: " + e + " (not an integer)");
  35661. if ((e >>>= 0) < 0 || e + 4 > this.buffer.byteLength)
  35662. throw RangeError("Illegal offset: 0 <= " + e + " (+4) <= " + this.buffer.byteLength)
  35663. }
  35664. var i = n(this.view, e, this.littleEndian, 23, 4);
  35665. return t && (this.offset += 4),
  35666. i
  35667. }
  35668. ,
  35669. a.readFloat = a.readFloat32,
  35670. a.writeFloat64 = function(e, t) {
  35671. var i = void 0 === t;
  35672. if (i && (t = this.offset),
  35673. !this.noAssert) {
  35674. if ("number" != typeof e)
  35675. throw TypeError("Illegal value: " + e + " (not a number)");
  35676. if ("number" != typeof t || t % 1 != 0)
  35677. throw TypeError("Illegal offset: " + t + " (not an integer)");
  35678. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  35679. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  35680. }
  35681. t += 8;
  35682. var n = this.buffer.byteLength;
  35683. return n < t && this.resize((n *= 2) > t ? n : t),
  35684. t -= 8,
  35685. r(this.view, e, t, this.littleEndian, 52, 8),
  35686. i && (this.offset += 8),
  35687. this
  35688. }
  35689. ,
  35690. a.writeDouble = a.writeFloat64,
  35691. a.readFloat64 = function(e) {
  35692. var t = void 0 === e;
  35693. if (t && (e = this.offset),
  35694. !this.noAssert) {
  35695. if ("number" != typeof e || e % 1 != 0)
  35696. throw TypeError("Illegal offset: " + e + " (not an integer)");
  35697. if ((e >>>= 0) < 0 || e + 8 > this.buffer.byteLength)
  35698. throw RangeError("Illegal offset: 0 <= " + e + " (+8) <= " + this.buffer.byteLength)
  35699. }
  35700. var i = n(this.view, e, this.littleEndian, 52, 8);
  35701. return t && (this.offset += 8),
  35702. i
  35703. }
  35704. ,
  35705. a.readDouble = a.readFloat64,
  35706. f.MAX_VARINT32_BYTES = 5,
  35707. f.calculateVarint32 = function(e) {
  35708. return (e >>>= 0) < 128 ? 1 : e < 16384 ? 2 : e < 1 << 21 ? 3 : e < 1 << 28 ? 4 : 5
  35709. }
  35710. ,
  35711. f.zigZagEncode32 = function(e) {
  35712. return ((e |= 0) << 1 ^ e >> 31) >>> 0
  35713. }
  35714. ,
  35715. f.zigZagDecode32 = function(e) {
  35716. return e >>> 1 ^ -(1 & e) | 0
  35717. }
  35718. ,
  35719. a.writeVarint32 = function(e, t) {
  35720. var i = void 0 === t;
  35721. if (i && (t = this.offset),
  35722. !this.noAssert) {
  35723. if ("number" != typeof e || e % 1 != 0)
  35724. throw TypeError("Illegal value: " + e + " (not an integer)");
  35725. if (e |= 0,
  35726. "number" != typeof t || t % 1 != 0)
  35727. throw TypeError("Illegal offset: " + t + " (not an integer)");
  35728. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  35729. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  35730. }
  35731. var n, r = f.calculateVarint32(e);
  35732. t += r;
  35733. var o = this.buffer.byteLength;
  35734. for (o < t && this.resize((o *= 2) > t ? o : t),
  35735. t -= r,
  35736. e >>>= 0; 128 <= e; )
  35737. n = 127 & e | 128,
  35738. this.view[t++] = n,
  35739. e >>>= 7;
  35740. return this.view[t++] = e,
  35741. i ? (this.offset = t,
  35742. this) : r
  35743. }
  35744. ,
  35745. a.writeVarint32ZigZag = function(e, t) {
  35746. return this.writeVarint32(f.zigZagEncode32(e), t)
  35747. }
  35748. ,
  35749. a.readVarint32 = function(e) {
  35750. var t = void 0 === e;
  35751. if (t && (e = this.offset),
  35752. !this.noAssert) {
  35753. if ("number" != typeof e || e % 1 != 0)
  35754. throw TypeError("Illegal offset: " + e + " (not an integer)");
  35755. if ((e >>>= 0) < 0 || e + 1 > this.buffer.byteLength)
  35756. throw RangeError("Illegal offset: 0 <= " + e + " (+1) <= " + this.buffer.byteLength)
  35757. }
  35758. var i, n = 0, r = 0;
  35759. do {
  35760. if (!this.noAssert && e > this.limit) {
  35761. var o = Error("Truncated");
  35762. throw o.truncated = !0,
  35763. o
  35764. }
  35765. i = this.view[e++],
  35766. n < 5 && (r |= (127 & i) << 7 * n),
  35767. ++n
  35768. } while (0 != (128 & i));return r |= 0,
  35769. t ? (this.offset = e,
  35770. r) : {
  35771. value: r,
  35772. length: n
  35773. }
  35774. }
  35775. ,
  35776. a.readVarint32ZigZag = function(e) {
  35777. var t = this.readVarint32(e);
  35778. return "object" == typeof t ? t.value = f.zigZagDecode32(t.value) : t = f.zigZagDecode32(t),
  35779. t
  35780. }
  35781. ,
  35782. l && (f.MAX_VARINT64_BYTES = 10,
  35783. f.calculateVarint64 = function(e) {
  35784. "number" == typeof e ? e = l.fromNumber(e) : "string" == typeof e && (e = l.fromString(e));
  35785. var t = e.toInt() >>> 0
  35786. , i = e.shiftRightUnsigned(28).toInt() >>> 0
  35787. , n = e.shiftRightUnsigned(56).toInt() >>> 0;
  35788. 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
  35789. }
  35790. ,
  35791. f.zigZagEncode64 = function(e) {
  35792. return "number" == typeof e ? e = l.fromNumber(e, !1) : "string" == typeof e ? e = l.fromString(e, !1) : !1 !== e.unsigned && (e = e.toSigned()),
  35793. e.shiftLeft(1).xor(e.shiftRight(63)).toUnsigned()
  35794. }
  35795. ,
  35796. f.zigZagDecode64 = function(e) {
  35797. return "number" == typeof e ? e = l.fromNumber(e, !1) : "string" == typeof e ? e = l.fromString(e, !1) : !1 !== e.unsigned && (e = e.toSigned()),
  35798. e.shiftRightUnsigned(1).xor(e.and(l.ONE).toSigned().negate()).toSigned()
  35799. }
  35800. ,
  35801. a.writeVarint64 = function(e, t) {
  35802. var i = void 0 === t;
  35803. if (i && (t = this.offset),
  35804. !this.noAssert) {
  35805. if ("number" == typeof e)
  35806. e = l.fromNumber(e);
  35807. else if ("string" == typeof e)
  35808. e = l.fromString(e);
  35809. else if (!(e && e instanceof l))
  35810. throw TypeError("Illegal value: " + e + " (not an integer or Long)");
  35811. if ("number" != typeof t || t % 1 != 0)
  35812. throw TypeError("Illegal offset: " + t + " (not an integer)");
  35813. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  35814. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  35815. }
  35816. "number" == typeof e ? e = l.fromNumber(e, !1) : "string" == typeof e ? e = l.fromString(e, !1) : !1 !== e.unsigned && (e = e.toSigned());
  35817. var n = f.calculateVarint64(e)
  35818. , r = e.toInt() >>> 0
  35819. , o = e.shiftRightUnsigned(28).toInt() >>> 0
  35820. , a = e.shiftRightUnsigned(56).toInt() >>> 0;
  35821. t += n;
  35822. var s = this.buffer.byteLength;
  35823. switch (s < t && this.resize((s *= 2) > t ? s : t),
  35824. t -= n,
  35825. n) {
  35826. case 10:
  35827. this.view[t + 9] = a >>> 7 & 1;
  35828. case 9:
  35829. this.view[t + 8] = 9 !== n ? 128 | a : 127 & a;
  35830. case 8:
  35831. this.view[t + 7] = 8 !== n ? o >>> 21 | 128 : o >>> 21 & 127;
  35832. case 7:
  35833. this.view[t + 6] = 7 !== n ? o >>> 14 | 128 : o >>> 14 & 127;
  35834. case 6:
  35835. this.view[t + 5] = 6 !== n ? o >>> 7 | 128 : o >>> 7 & 127;
  35836. case 5:
  35837. this.view[t + 4] = 5 !== n ? 128 | o : 127 & o;
  35838. case 4:
  35839. this.view[t + 3] = 4 !== n ? r >>> 21 | 128 : r >>> 21 & 127;
  35840. case 3:
  35841. this.view[t + 2] = 3 !== n ? r >>> 14 | 128 : r >>> 14 & 127;
  35842. case 2:
  35843. this.view[t + 1] = 2 !== n ? r >>> 7 | 128 : r >>> 7 & 127;
  35844. case 1:
  35845. this.view[t] = 1 !== n ? 128 | r : 127 & r
  35846. }
  35847. return i ? (this.offset += n,
  35848. this) : n
  35849. }
  35850. ,
  35851. a.writeVarint64ZigZag = function(e, t) {
  35852. return this.writeVarint64(f.zigZagEncode64(e), t)
  35853. }
  35854. ,
  35855. a.readVarint64 = function(e) {
  35856. var t = void 0 === e;
  35857. if (t && (e = this.offset),
  35858. !this.noAssert) {
  35859. if ("number" != typeof e || e % 1 != 0)
  35860. throw TypeError("Illegal offset: " + e + " (not an integer)");
  35861. if ((e >>>= 0) < 0 || e + 1 > this.buffer.byteLength)
  35862. throw RangeError("Illegal offset: 0 <= " + e + " (+1) <= " + this.buffer.byteLength)
  35863. }
  35864. var i = e
  35865. , n = 0
  35866. , r = 0
  35867. , o = 0
  35868. , a = 0;
  35869. if (n = 127 & (a = this.view[e++]),
  35870. 128 & a && (n |= (127 & (a = this.view[e++])) << 7,
  35871. (128 & a || this.noAssert && void 0 === a) && (n |= (127 & (a = this.view[e++])) << 14,
  35872. (128 & a || this.noAssert && void 0 === a) && (n |= (127 & (a = this.view[e++])) << 21,
  35873. (128 & a || this.noAssert && void 0 === a) && (r = 127 & (a = this.view[e++]),
  35874. (128 & a || this.noAssert && void 0 === a) && (r |= (127 & (a = this.view[e++])) << 7,
  35875. (128 & a || this.noAssert && void 0 === a) && (r |= (127 & (a = this.view[e++])) << 14,
  35876. (128 & a || this.noAssert && void 0 === a) && (r |= (127 & (a = this.view[e++])) << 21,
  35877. (128 & a || this.noAssert && void 0 === a) && (o = 127 & (a = this.view[e++]),
  35878. (128 & a || this.noAssert && void 0 === a) && (o |= (127 & (a = this.view[e++])) << 7,
  35879. 128 & a || this.noAssert && void 0 === a))))))))))
  35880. throw Error("Buffer overrun");
  35881. var s = l.fromBits(n | r << 28, r >>> 4 | o << 24, !1);
  35882. return t ? (this.offset = e,
  35883. s) : {
  35884. value: s,
  35885. length: e - i
  35886. }
  35887. }
  35888. ,
  35889. a.readVarint64ZigZag = function(e) {
  35890. var t = this.readVarint64(e);
  35891. return t && t.value instanceof l ? t.value = f.zigZagDecode64(t.value) : t = f.zigZagDecode64(t),
  35892. t
  35893. }
  35894. ),
  35895. a.writeCString = function(e, t) {
  35896. var i = void 0 === t;
  35897. i && (t = this.offset);
  35898. var n, r = e.length;
  35899. if (!this.noAssert) {
  35900. if ("string" != typeof e)
  35901. throw TypeError("Illegal str: Not a string");
  35902. for (n = 0; n < r; ++n)
  35903. if (0 === e.charCodeAt(n))
  35904. throw RangeError("Illegal str: Contains NULL-characters");
  35905. if ("number" != typeof t || t % 1 != 0)
  35906. throw TypeError("Illegal offset: " + t + " (not an integer)");
  35907. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  35908. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  35909. }
  35910. r = d.calculateUTF16asUTF8(s(e))[1],
  35911. t += r + 1;
  35912. var o = this.buffer.byteLength;
  35913. return o < t && this.resize((o *= 2) > t ? o : t),
  35914. t -= r + 1,
  35915. d.encodeUTF16toUTF8(s(e), function(e) {
  35916. this.view[t++] = e
  35917. }
  35918. .bind(this)),
  35919. this.view[t++] = 0,
  35920. i ? (this.offset = t,
  35921. this) : r
  35922. }
  35923. ,
  35924. a.readCString = function(e) {
  35925. var t = void 0 === e;
  35926. if (t && (e = this.offset),
  35927. !this.noAssert) {
  35928. if ("number" != typeof e || e % 1 != 0)
  35929. throw TypeError("Illegal offset: " + e + " (not an integer)");
  35930. if ((e >>>= 0) < 0 || e + 1 > this.buffer.byteLength)
  35931. throw RangeError("Illegal offset: 0 <= " + e + " (+1) <= " + this.buffer.byteLength)
  35932. }
  35933. var i, n = e, r = -1;
  35934. return d.decodeUTF8toUTF16(function() {
  35935. if (0 === r)
  35936. return null;
  35937. if (e >= this.limit)
  35938. throw RangeError("Illegal range: Truncated data, " + e + " < " + this.limit);
  35939. return 0 === (r = this.view[e++]) ? null : r
  35940. }
  35941. .bind(this), i = c(), !0),
  35942. t ? (this.offset = e,
  35943. i()) : {
  35944. string: i(),
  35945. length: e - n
  35946. }
  35947. }
  35948. ,
  35949. a.writeIString = function(e, t) {
  35950. var i = void 0 === t;
  35951. if (i && (t = this.offset),
  35952. !this.noAssert) {
  35953. if ("string" != typeof e)
  35954. throw TypeError("Illegal str: Not a string");
  35955. if ("number" != typeof t || t % 1 != 0)
  35956. throw TypeError("Illegal offset: " + t + " (not an integer)");
  35957. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  35958. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  35959. }
  35960. var n, r = t;
  35961. n = d.calculateUTF16asUTF8(s(e), this.noAssert)[1],
  35962. t += 4 + n;
  35963. var o = this.buffer.byteLength;
  35964. if (o < t && this.resize((o *= 2) > t ? o : t),
  35965. t -= 4 + n,
  35966. this.littleEndian ? (this.view[t + 3] = n >>> 24 & 255,
  35967. this.view[t + 2] = n >>> 16 & 255,
  35968. this.view[t + 1] = n >>> 8 & 255,
  35969. this.view[t] = 255 & n) : (this.view[t] = n >>> 24 & 255,
  35970. this.view[t + 1] = n >>> 16 & 255,
  35971. this.view[t + 2] = n >>> 8 & 255,
  35972. this.view[t + 3] = 255 & n),
  35973. t += 4,
  35974. d.encodeUTF16toUTF8(s(e), function(e) {
  35975. this.view[t++] = e
  35976. }
  35977. .bind(this)),
  35978. t !== r + 4 + n)
  35979. throw RangeError("Illegal range: Truncated data, " + t + " == " + (t + 4 + n));
  35980. return i ? (this.offset = t,
  35981. this) : t - r
  35982. }
  35983. ,
  35984. a.readIString = function(e) {
  35985. var t = void 0 === e;
  35986. if (t && (e = this.offset),
  35987. !this.noAssert) {
  35988. if ("number" != typeof e || e % 1 != 0)
  35989. throw TypeError("Illegal offset: " + e + " (not an integer)");
  35990. if ((e >>>= 0) < 0 || e + 4 > this.buffer.byteLength)
  35991. throw RangeError("Illegal offset: 0 <= " + e + " (+4) <= " + this.buffer.byteLength)
  35992. }
  35993. var i = e
  35994. , n = this.readUint32(e)
  35995. , r = this.readUTF8String(n, f.METRICS_BYTES, e += 4);
  35996. return e += r.length,
  35997. t ? (this.offset = e,
  35998. r.string) : {
  35999. string: r.string,
  36000. length: e - i
  36001. }
  36002. }
  36003. ,
  36004. f.METRICS_CHARS = "c",
  36005. f.METRICS_BYTES = "b",
  36006. a.writeUTF8String = function(e, t) {
  36007. var i = void 0 === t;
  36008. if (i && (t = this.offset),
  36009. !this.noAssert) {
  36010. if ("number" != typeof t || t % 1 != 0)
  36011. throw TypeError("Illegal offset: " + t + " (not an integer)");
  36012. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  36013. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  36014. }
  36015. var n, r = t;
  36016. n = d.calculateUTF16asUTF8(s(e))[1],
  36017. t += n;
  36018. var o = this.buffer.byteLength;
  36019. return o < t && this.resize((o *= 2) > t ? o : t),
  36020. t -= n,
  36021. d.encodeUTF16toUTF8(s(e), function(e) {
  36022. this.view[t++] = e
  36023. }
  36024. .bind(this)),
  36025. i ? (this.offset = t,
  36026. this) : t - r
  36027. }
  36028. ,
  36029. a.writeString = a.writeUTF8String,
  36030. f.calculateUTF8Chars = function(e) {
  36031. return d.calculateUTF16asUTF8(s(e))[0]
  36032. }
  36033. ,
  36034. f.calculateUTF8Bytes = function(e) {
  36035. return d.calculateUTF16asUTF8(s(e))[1]
  36036. }
  36037. ,
  36038. f.calculateString = f.calculateUTF8Bytes,
  36039. a.readUTF8String = function(e, t, i) {
  36040. "number" == typeof t && (i = t,
  36041. t = void 0);
  36042. var n = void 0 === i;
  36043. if (n && (i = this.offset),
  36044. void 0 === t && (t = f.METRICS_CHARS),
  36045. !this.noAssert) {
  36046. if ("number" != typeof e || e % 1 != 0)
  36047. throw TypeError("Illegal length: " + e + " (not an integer)");
  36048. if (e |= 0,
  36049. "number" != typeof i || i % 1 != 0)
  36050. throw TypeError("Illegal offset: " + i + " (not an integer)");
  36051. if ((i >>>= 0) < 0 || i + 0 > this.buffer.byteLength)
  36052. throw RangeError("Illegal offset: 0 <= " + i + " (+0) <= " + this.buffer.byteLength)
  36053. }
  36054. var r, o = 0, a = i;
  36055. if (t === f.METRICS_CHARS) {
  36056. if (r = c(),
  36057. d.decodeUTF8(function() {
  36058. return o < e && i < this.limit ? this.view[i++] : null
  36059. }
  36060. .bind(this), function(e) {
  36061. ++o,
  36062. d.UTF8toUTF16(e, r)
  36063. }),
  36064. o !== e)
  36065. throw RangeError("Illegal range: Truncated data, " + o + " == " + e);
  36066. return n ? (this.offset = i,
  36067. r()) : {
  36068. string: r(),
  36069. length: i - a
  36070. }
  36071. }
  36072. if (t !== f.METRICS_BYTES)
  36073. throw TypeError("Unsupported metrics: " + t);
  36074. if (!this.noAssert) {
  36075. if ("number" != typeof i || i % 1 != 0)
  36076. throw TypeError("Illegal offset: " + i + " (not an integer)");
  36077. if ((i >>>= 0) < 0 || i + e > this.buffer.byteLength)
  36078. throw RangeError("Illegal offset: 0 <= " + i + " (+" + e + ") <= " + this.buffer.byteLength)
  36079. }
  36080. var s = i + e;
  36081. if (d.decodeUTF8toUTF16(function() {
  36082. return i < s ? this.view[i++] : null
  36083. }
  36084. .bind(this), r = c(), this.noAssert),
  36085. i !== s)
  36086. throw RangeError("Illegal range: Truncated data, " + i + " == " + s);
  36087. return n ? (this.offset = i,
  36088. r()) : {
  36089. string: r(),
  36090. length: i - a
  36091. }
  36092. }
  36093. ,
  36094. a.readString = a.readUTF8String,
  36095. a.writeVString = function(e, t) {
  36096. var i = void 0 === t;
  36097. if (i && (t = this.offset),
  36098. !this.noAssert) {
  36099. if ("string" != typeof e)
  36100. throw TypeError("Illegal str: Not a string");
  36101. if ("number" != typeof t || t % 1 != 0)
  36102. throw TypeError("Illegal offset: " + t + " (not an integer)");
  36103. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  36104. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  36105. }
  36106. var n, r, o = t;
  36107. n = d.calculateUTF16asUTF8(s(e), this.noAssert)[1],
  36108. r = f.calculateVarint32(n),
  36109. t += r + n;
  36110. var a = this.buffer.byteLength;
  36111. if (a < t && this.resize((a *= 2) > t ? a : t),
  36112. t -= r + n,
  36113. t += this.writeVarint32(n, t),
  36114. d.encodeUTF16toUTF8(s(e), function(e) {
  36115. this.view[t++] = e
  36116. }
  36117. .bind(this)),
  36118. t !== o + n + r)
  36119. throw RangeError("Illegal range: Truncated data, " + t + " == " + (t + n + r));
  36120. return i ? (this.offset = t,
  36121. this) : t - o
  36122. }
  36123. ,
  36124. a.readVString = function(e) {
  36125. var t = void 0 === e;
  36126. if (t && (e = this.offset),
  36127. !this.noAssert) {
  36128. if ("number" != typeof e || e % 1 != 0)
  36129. throw TypeError("Illegal offset: " + e + " (not an integer)");
  36130. if ((e >>>= 0) < 0 || e + 1 > this.buffer.byteLength)
  36131. throw RangeError("Illegal offset: 0 <= " + e + " (+1) <= " + this.buffer.byteLength)
  36132. }
  36133. var i = e
  36134. , n = this.readVarint32(e)
  36135. , r = this.readUTF8String(n.value, f.METRICS_BYTES, e += n.length);
  36136. return e += r.length,
  36137. t ? (this.offset = e,
  36138. r.string) : {
  36139. string: r.string,
  36140. length: e - i
  36141. }
  36142. }
  36143. ,
  36144. a.append = function(e, t, i) {
  36145. "number" != typeof t && "string" == typeof t || (i = t,
  36146. t = void 0);
  36147. var n = void 0 === i;
  36148. if (n && (i = this.offset),
  36149. !this.noAssert) {
  36150. if ("number" != typeof i || i % 1 != 0)
  36151. throw TypeError("Illegal offset: " + i + " (not an integer)");
  36152. if ((i >>>= 0) < 0 || i + 0 > this.buffer.byteLength)
  36153. throw RangeError("Illegal offset: 0 <= " + i + " (+0) <= " + this.buffer.byteLength)
  36154. }
  36155. e instanceof f || (e = f.wrap(e, t));
  36156. var r = e.limit - e.offset;
  36157. if (r <= 0)
  36158. return this;
  36159. i += r;
  36160. var o = this.buffer.byteLength;
  36161. return o < i && this.resize((o *= 2) > i ? o : i),
  36162. i -= r,
  36163. this.view.set(e.view.subarray(e.offset, e.limit), i),
  36164. e.offset += r,
  36165. n && (this.offset += r),
  36166. this
  36167. }
  36168. ,
  36169. a.appendTo = function(e, t) {
  36170. return e.append(this, t),
  36171. this
  36172. }
  36173. ,
  36174. a.assert = function(e) {
  36175. return this.noAssert = !e,
  36176. this
  36177. }
  36178. ,
  36179. a.capacity = function() {
  36180. return this.buffer.byteLength
  36181. }
  36182. ,
  36183. a.clear = function() {
  36184. return this.offset = 0,
  36185. this.limit = this.buffer.byteLength,
  36186. this.markedOffset = -1,
  36187. this
  36188. }
  36189. ,
  36190. a.clone = function(e) {
  36191. var t = new f(0,this.littleEndian,this.noAssert);
  36192. return e ? (t.buffer = new ArrayBuffer(this.buffer.byteLength),
  36193. t.view = new Uint8Array(t.buffer)) : (t.buffer = this.buffer,
  36194. t.view = this.view),
  36195. t.offset = this.offset,
  36196. t.markedOffset = this.markedOffset,
  36197. t.limit = this.limit,
  36198. t
  36199. }
  36200. ,
  36201. a.compact = function(e, t) {
  36202. if (void 0 === e && (e = this.offset),
  36203. void 0 === t && (t = this.limit),
  36204. !this.noAssert) {
  36205. if ("number" != typeof e || e % 1 != 0)
  36206. throw TypeError("Illegal begin: Not an integer");
  36207. if (e >>>= 0,
  36208. "number" != typeof t || t % 1 != 0)
  36209. throw TypeError("Illegal end: Not an integer");
  36210. if (t >>>= 0,
  36211. e < 0 || t < e || t > this.buffer.byteLength)
  36212. throw RangeError("Illegal range: 0 <= " + e + " <= " + t + " <= " + this.buffer.byteLength)
  36213. }
  36214. if (0 === e && t === this.buffer.byteLength)
  36215. return this;
  36216. var i = t - e;
  36217. if (0 == i)
  36218. return this.buffer = o,
  36219. this.view = null,
  36220. 0 <= this.markedOffset && (this.markedOffset -= e),
  36221. this.offset = 0,
  36222. this.limit = 0,
  36223. this;
  36224. var n = new ArrayBuffer(i)
  36225. , r = new Uint8Array(n);
  36226. return r.set(this.view.subarray(e, t)),
  36227. this.buffer = n,
  36228. this.view = r,
  36229. 0 <= this.markedOffset && (this.markedOffset -= e),
  36230. this.offset = 0,
  36231. this.limit = i,
  36232. this
  36233. }
  36234. ,
  36235. a.copy = function(e, t) {
  36236. if (void 0 === e && (e = this.offset),
  36237. void 0 === t && (t = this.limit),
  36238. !this.noAssert) {
  36239. if ("number" != typeof e || e % 1 != 0)
  36240. throw TypeError("Illegal begin: Not an integer");
  36241. if (e >>>= 0,
  36242. "number" != typeof t || t % 1 != 0)
  36243. throw TypeError("Illegal end: Not an integer");
  36244. if (t >>>= 0,
  36245. e < 0 || t < e || t > this.buffer.byteLength)
  36246. throw RangeError("Illegal range: 0 <= " + e + " <= " + t + " <= " + this.buffer.byteLength)
  36247. }
  36248. if (e === t)
  36249. return new f(0,this.littleEndian,this.noAssert);
  36250. var i = t - e
  36251. , n = new f(i,this.littleEndian,this.noAssert);
  36252. return n.offset = 0,
  36253. n.limit = i,
  36254. 0 <= n.markedOffset && (n.markedOffset -= e),
  36255. this.copyTo(n, 0, e, t),
  36256. n
  36257. }
  36258. ,
  36259. a.copyTo = function(e, t, i, n) {
  36260. var r, o;
  36261. if (!this.noAssert && !f.isByteBuffer(e))
  36262. throw TypeError("Illegal target: Not a ByteBuffer");
  36263. if (t = (o = void 0 === t) ? e.offset : 0 | t,
  36264. i = (r = void 0 === i) ? this.offset : 0 | i,
  36265. n = void 0 === n ? this.limit : 0 | n,
  36266. t < 0 || t > e.buffer.byteLength)
  36267. throw RangeError("Illegal target range: 0 <= " + t + " <= " + e.buffer.byteLength);
  36268. if (i < 0 || n > this.buffer.byteLength)
  36269. throw RangeError("Illegal source range: 0 <= " + i + " <= " + this.buffer.byteLength);
  36270. var a = n - i;
  36271. return 0 == a ? e : (e.ensureCapacity(t + a),
  36272. e.view.set(this.view.subarray(i, n), t),
  36273. r && (this.offset += a),
  36274. o && (e.offset += a),
  36275. this)
  36276. }
  36277. ,
  36278. a.ensureCapacity = function(e) {
  36279. var t = this.buffer.byteLength;
  36280. return t < e ? this.resize((t *= 2) > e ? t : e) : this
  36281. }
  36282. ,
  36283. a.fill = function(e, t, i) {
  36284. var n = void 0 === t;
  36285. if (n && (t = this.offset),
  36286. "string" == typeof e && 0 < e.length && (e = e.charCodeAt(0)),
  36287. void 0 === t && (t = this.offset),
  36288. void 0 === i && (i = this.limit),
  36289. !this.noAssert) {
  36290. if ("number" != typeof e || e % 1 != 0)
  36291. throw TypeError("Illegal value: " + e + " (not an integer)");
  36292. if (e |= 0,
  36293. "number" != typeof t || t % 1 != 0)
  36294. throw TypeError("Illegal begin: Not an integer");
  36295. if (t >>>= 0,
  36296. "number" != typeof i || i % 1 != 0)
  36297. throw TypeError("Illegal end: Not an integer");
  36298. if (i >>>= 0,
  36299. t < 0 || i < t || i > this.buffer.byteLength)
  36300. throw RangeError("Illegal range: 0 <= " + t + " <= " + i + " <= " + this.buffer.byteLength)
  36301. }
  36302. if (i <= t)
  36303. return this;
  36304. for (; t < i; )
  36305. this.view[t++] = e;
  36306. return n && (this.offset = t),
  36307. this
  36308. }
  36309. ,
  36310. a.flip = function() {
  36311. return this.limit = this.offset,
  36312. this.offset = 0,
  36313. this
  36314. }
  36315. ,
  36316. a.mark = function(e) {
  36317. if (e = void 0 === e ? this.offset : e,
  36318. !this.noAssert) {
  36319. if ("number" != typeof e || e % 1 != 0)
  36320. throw TypeError("Illegal offset: " + e + " (not an integer)");
  36321. if ((e >>>= 0) < 0 || e + 0 > this.buffer.byteLength)
  36322. throw RangeError("Illegal offset: 0 <= " + e + " (+0) <= " + this.buffer.byteLength)
  36323. }
  36324. return this.markedOffset = e,
  36325. this
  36326. }
  36327. ,
  36328. a.order = function(e) {
  36329. if (!this.noAssert && "boolean" != typeof e)
  36330. throw TypeError("Illegal littleEndian: Not a boolean");
  36331. return this.littleEndian = !!e,
  36332. this
  36333. }
  36334. ,
  36335. a.LE = function(e) {
  36336. return this.littleEndian = void 0 === e || !!e,
  36337. this
  36338. }
  36339. ,
  36340. a.BE = function(e) {
  36341. return this.littleEndian = void 0 !== e && !e,
  36342. this
  36343. }
  36344. ,
  36345. a.prepend = function(e, t, i) {
  36346. "number" != typeof t && "string" == typeof t || (i = t,
  36347. t = void 0);
  36348. var n = void 0 === i;
  36349. if (n && (i = this.offset),
  36350. !this.noAssert) {
  36351. if ("number" != typeof i || i % 1 != 0)
  36352. throw TypeError("Illegal offset: " + i + " (not an integer)");
  36353. if ((i >>>= 0) < 0 || i + 0 > this.buffer.byteLength)
  36354. throw RangeError("Illegal offset: 0 <= " + i + " (+0) <= " + this.buffer.byteLength)
  36355. }
  36356. e instanceof f || (e = f.wrap(e, t));
  36357. var r = e.limit - e.offset;
  36358. if (r <= 0)
  36359. return this;
  36360. var o = r - i;
  36361. if (0 < o) {
  36362. var a = new ArrayBuffer(this.buffer.byteLength + o)
  36363. , s = new Uint8Array(a);
  36364. s.set(this.view.subarray(i, this.buffer.byteLength), r),
  36365. this.buffer = a,
  36366. this.view = s,
  36367. this.offset += o,
  36368. 0 <= this.markedOffset && (this.markedOffset += o),
  36369. this.limit += o,
  36370. i += o
  36371. } else
  36372. new Uint8Array(this.buffer);
  36373. return this.view.set(e.view.subarray(e.offset, e.limit), i - r),
  36374. e.offset = e.limit,
  36375. n && (this.offset -= r),
  36376. this
  36377. }
  36378. ,
  36379. a.prependTo = function(e, t) {
  36380. return e.prepend(this, t),
  36381. this
  36382. }
  36383. ,
  36384. a.printDebug = function(e) {
  36385. "function" != typeof e && (e = console.log.bind(console)),
  36386. e(this.toString() + "\n-------------------------------------------------------------------\n" + this.toDebug(!0))
  36387. }
  36388. ,
  36389. a.remaining = function() {
  36390. return this.limit - this.offset
  36391. }
  36392. ,
  36393. a.reset = function() {
  36394. return 0 <= this.markedOffset ? (this.offset = this.markedOffset,
  36395. this.markedOffset = -1) : this.offset = 0,
  36396. this
  36397. }
  36398. ,
  36399. a.resize = function(e) {
  36400. if (!this.noAssert) {
  36401. if ("number" != typeof e || e % 1 != 0)
  36402. throw TypeError("Illegal capacity: " + e + " (not an integer)");
  36403. if ((e |= 0) < 0)
  36404. throw RangeError("Illegal capacity: 0 <= " + e)
  36405. }
  36406. if (this.buffer.byteLength < e) {
  36407. var t = new ArrayBuffer(e)
  36408. , i = new Uint8Array(t);
  36409. i.set(this.view),
  36410. this.buffer = t,
  36411. this.view = i
  36412. }
  36413. return this
  36414. }
  36415. ,
  36416. a.reverse = function(e, t) {
  36417. if (void 0 === e && (e = this.offset),
  36418. void 0 === t && (t = this.limit),
  36419. !this.noAssert) {
  36420. if ("number" != typeof e || e % 1 != 0)
  36421. throw TypeError("Illegal begin: Not an integer");
  36422. if (e >>>= 0,
  36423. "number" != typeof t || t % 1 != 0)
  36424. throw TypeError("Illegal end: Not an integer");
  36425. if (t >>>= 0,
  36426. e < 0 || t < e || t > this.buffer.byteLength)
  36427. throw RangeError("Illegal range: 0 <= " + e + " <= " + t + " <= " + this.buffer.byteLength)
  36428. }
  36429. return e === t || Array.prototype.reverse.call(this.view.subarray(e, t)),
  36430. this
  36431. }
  36432. ,
  36433. a.skip = function(e) {
  36434. if (!this.noAssert) {
  36435. if ("number" != typeof e || e % 1 != 0)
  36436. throw TypeError("Illegal length: " + e + " (not an integer)");
  36437. e |= 0
  36438. }
  36439. var t = this.offset + e;
  36440. if (!this.noAssert && (t < 0 || t > this.buffer.byteLength))
  36441. throw RangeError("Illegal length: 0 <= " + this.offset + " + " + e + " <= " + this.buffer.byteLength);
  36442. return this.offset = t,
  36443. this
  36444. }
  36445. ,
  36446. a.slice = function(e, t) {
  36447. if (void 0 === e && (e = this.offset),
  36448. void 0 === t && (t = this.limit),
  36449. !this.noAssert) {
  36450. if ("number" != typeof e || e % 1 != 0)
  36451. throw TypeError("Illegal begin: Not an integer");
  36452. if (e >>>= 0,
  36453. "number" != typeof t || t % 1 != 0)
  36454. throw TypeError("Illegal end: Not an integer");
  36455. if (t >>>= 0,
  36456. e < 0 || t < e || t > this.buffer.byteLength)
  36457. throw RangeError("Illegal range: 0 <= " + e + " <= " + t + " <= " + this.buffer.byteLength)
  36458. }
  36459. var i = this.clone();
  36460. return i.offset = e,
  36461. i.limit = t,
  36462. i
  36463. }
  36464. ,
  36465. a.toBuffer = function(e) {
  36466. var t = this.offset
  36467. , i = this.limit;
  36468. if (!this.noAssert) {
  36469. if ("number" != typeof t || t % 1 != 0)
  36470. throw TypeError("Illegal offset: Not an integer");
  36471. if (t >>>= 0,
  36472. "number" != typeof i || i % 1 != 0)
  36473. throw TypeError("Illegal limit: Not an integer");
  36474. if (i >>>= 0,
  36475. t < 0 || i < t || i > this.buffer.byteLength)
  36476. throw RangeError("Illegal range: 0 <= " + t + " <= " + i + " <= " + this.buffer.byteLength)
  36477. }
  36478. if (!e && 0 === t && i === this.buffer.byteLength)
  36479. return this.buffer;
  36480. if (t === i)
  36481. return o;
  36482. var n = new ArrayBuffer(i - t);
  36483. return new Uint8Array(n).set(new Uint8Array(this.buffer).subarray(t, i), 0),
  36484. n
  36485. }
  36486. ,
  36487. a.toArrayBuffer = a.toBuffer,
  36488. a.toString = function(e, t, i) {
  36489. if (void 0 === e)
  36490. return "ByteBufferAB(offset=" + this.offset + ",markedOffset=" + this.markedOffset + ",limit=" + this.limit + ",capacity=" + this.capacity() + ")";
  36491. switch ("number" == typeof e && (i = t = e = "utf8"),
  36492. e) {
  36493. case "utf8":
  36494. return this.toUTF8(t, i);
  36495. case "base64":
  36496. return this.toBase64(t, i);
  36497. case "hex":
  36498. return this.toHex(t, i);
  36499. case "binary":
  36500. return this.toBinary(t, i);
  36501. case "debug":
  36502. return this.toDebug();
  36503. case "columns":
  36504. return this.toColumns();
  36505. default:
  36506. throw Error("Unsupported encoding: " + e)
  36507. }
  36508. }
  36509. ;
  36510. var h = function() {
  36511. 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)
  36512. a[r[t]] = t;
  36513. return e.encode = function(e, t) {
  36514. for (var i, n; null !== (i = e()); )
  36515. t(r[i >> 2 & 63]),
  36516. n = (3 & i) << 4,
  36517. null !== (i = e()) ? (t(r[63 & ((n |= i >> 4 & 15) | i >> 4 & 15)]),
  36518. n = (15 & i) << 2,
  36519. null !== (i = e()) ? (t(r[63 & (n | i >> 6 & 3)]),
  36520. t(r[63 & i])) : (t(r[63 & n]),
  36521. t(61))) : (t(r[63 & n]),
  36522. t(61),
  36523. t(61))
  36524. }
  36525. ,
  36526. e.decode = function(e, t) {
  36527. function i(e) {
  36528. throw Error("Illegal character code: " + e)
  36529. }
  36530. for (var n, r, o; null !== (n = e()); )
  36531. if (void 0 === (r = a[n]) && i(n),
  36532. null !== (n = e()) && (void 0 === (o = a[n]) && i(n),
  36533. t(r << 2 >>> 0 | (48 & o) >> 4),
  36534. null !== (n = e()))) {
  36535. if (void 0 === (r = a[n])) {
  36536. if (61 === n)
  36537. break;
  36538. i(n)
  36539. }
  36540. if (t((15 & o) << 4 >>> 0 | (60 & r) >> 2),
  36541. null !== (n = e())) {
  36542. if (void 0 === (o = a[n])) {
  36543. if (61 === n)
  36544. break;
  36545. i(n)
  36546. }
  36547. t((3 & r) << 6 >>> 0 | o)
  36548. }
  36549. }
  36550. }
  36551. ,
  36552. e.test = function(e) {
  36553. return /^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/.test(e)
  36554. }
  36555. ,
  36556. e
  36557. }();
  36558. a.toBase64 = function(e, t) {
  36559. if (void 0 === e && (e = this.offset),
  36560. void 0 === t && (t = this.limit),
  36561. t |= 0,
  36562. (e |= 0) < 0 || t > this.capacity || t < e)
  36563. throw RangeError("begin, end");
  36564. var i;
  36565. return h.encode(function() {
  36566. return e < t ? this.view[e++] : null
  36567. }
  36568. .bind(this), i = c()),
  36569. i()
  36570. }
  36571. ,
  36572. f.fromBase64 = function(e, t) {
  36573. if ("string" != typeof e)
  36574. throw TypeError("str");
  36575. var i = new f(e.length / 4 * 3,t)
  36576. , n = 0;
  36577. return h.decode(s(e), function(e) {
  36578. i.view[n++] = e
  36579. }),
  36580. i.limit = n,
  36581. i
  36582. }
  36583. ,
  36584. f.btoa = function(e) {
  36585. return f.fromBinary(e).toBase64()
  36586. }
  36587. ,
  36588. f.atob = function(e) {
  36589. return f.fromBase64(e).toBinary()
  36590. }
  36591. ,
  36592. a.toBinary = function(e, t) {
  36593. if (void 0 === e && (e = this.offset),
  36594. void 0 === t && (t = this.limit),
  36595. t |= 0,
  36596. (e |= 0) < 0 || t > this.capacity() || t < e)
  36597. throw RangeError("begin, end");
  36598. if (e === t)
  36599. return "";
  36600. for (var i = [], n = []; e < t; )
  36601. i.push(this.view[e++]),
  36602. 1024 <= i.length && (n.push(String.fromCharCode.apply(String, i)),
  36603. i = []);
  36604. return n.join("") + String.fromCharCode.apply(String, i)
  36605. }
  36606. ,
  36607. f.fromBinary = function(e, t) {
  36608. if ("string" != typeof e)
  36609. throw TypeError("str");
  36610. for (var i, n = 0, r = e.length, o = new f(r,t); n < r; ) {
  36611. if (255 < (i = e.charCodeAt(n)))
  36612. throw RangeError("illegal char code: " + i);
  36613. o.view[n++] = i
  36614. }
  36615. return o.limit = r,
  36616. o
  36617. }
  36618. ,
  36619. a.toDebug = function(e) {
  36620. for (var t, i = -1, n = this.buffer.byteLength, r = "", o = "", a = ""; i < n; ) {
  36621. if (-1 !== i && (r += (t = this.view[i]) < 16 ? "0" + t.toString(16).toUpperCase() : t.toString(16).toUpperCase(),
  36622. e && (o += 32 < t && t < 127 ? String.fromCharCode(t) : ".")),
  36623. ++i,
  36624. e && 0 < i && i % 16 == 0 && i !== n) {
  36625. for (; r.length < 51; )
  36626. r += " ";
  36627. a += r + o + "\n",
  36628. r = o = ""
  36629. }
  36630. 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 ? " " : ""
  36631. }
  36632. if (e && " " !== r) {
  36633. for (; r.length < 51; )
  36634. r += " ";
  36635. a += r + o + "\n"
  36636. }
  36637. return e ? a : r
  36638. }
  36639. ,
  36640. f.fromDebug = function(e, t, i) {
  36641. 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; ) {
  36642. switch (n = e.charAt(s++)) {
  36643. case "!":
  36644. if (!i) {
  36645. if (h || u || d) {
  36646. p = !0;
  36647. break
  36648. }
  36649. h = u = d = !0
  36650. }
  36651. a.offset = a.markedOffset = a.limit = l,
  36652. c = !1;
  36653. break;
  36654. case "|":
  36655. if (!i) {
  36656. if (h || d) {
  36657. p = !0;
  36658. break
  36659. }
  36660. h = d = !0
  36661. }
  36662. a.offset = a.limit = l,
  36663. c = !1;
  36664. break;
  36665. case "[":
  36666. if (!i) {
  36667. if (h || u) {
  36668. p = !0;
  36669. break
  36670. }
  36671. h = u = !0
  36672. }
  36673. a.offset = a.markedOffset = l,
  36674. c = !1;
  36675. break;
  36676. case "<":
  36677. if (!i) {
  36678. if (h) {
  36679. p = !0;
  36680. break
  36681. }
  36682. h = !0
  36683. }
  36684. a.offset = l,
  36685. c = !1;
  36686. break;
  36687. case "]":
  36688. if (!i) {
  36689. if (d || u) {
  36690. p = !0;
  36691. break
  36692. }
  36693. d = u = !0
  36694. }
  36695. a.limit = a.markedOffset = l,
  36696. c = !1;
  36697. break;
  36698. case ">":
  36699. if (!i) {
  36700. if (d) {
  36701. p = !0;
  36702. break
  36703. }
  36704. d = !0
  36705. }
  36706. a.limit = l,
  36707. c = !1;
  36708. break;
  36709. case "'":
  36710. if (!i) {
  36711. if (u) {
  36712. p = !0;
  36713. break
  36714. }
  36715. u = !0
  36716. }
  36717. a.markedOffset = l,
  36718. c = !1;
  36719. break;
  36720. case " ":
  36721. c = !1;
  36722. break;
  36723. default:
  36724. if (!i && c) {
  36725. p = !0;
  36726. break
  36727. }
  36728. if (r = parseInt(n + e.charAt(s++), 16),
  36729. !i && (isNaN(r) || r < 0 || 255 < r))
  36730. throw TypeError("Illegal str: Not a debug encoded string");
  36731. a.view[l++] = r,
  36732. c = !0
  36733. }
  36734. if (p)
  36735. throw TypeError("Illegal str: Invalid symbol at " + s)
  36736. }
  36737. if (!i) {
  36738. if (!h || !d)
  36739. throw TypeError("Illegal str: Missing offset or limit");
  36740. if (l < a.buffer.byteLength)
  36741. throw TypeError("Illegal str: Not a debug encoded string (is it hex?) " + l + " < " + o)
  36742. }
  36743. return a
  36744. }
  36745. ,
  36746. a.toHex = function(e, t) {
  36747. if (e = void 0 === e ? this.offset : e,
  36748. t = void 0 === t ? this.limit : t,
  36749. !this.noAssert) {
  36750. if ("number" != typeof e || e % 1 != 0)
  36751. throw TypeError("Illegal begin: Not an integer");
  36752. if (e >>>= 0,
  36753. "number" != typeof t || t % 1 != 0)
  36754. throw TypeError("Illegal end: Not an integer");
  36755. if (t >>>= 0,
  36756. e < 0 || t < e || t > this.buffer.byteLength)
  36757. throw RangeError("Illegal range: 0 <= " + e + " <= " + t + " <= " + this.buffer.byteLength)
  36758. }
  36759. for (var i, n = new Array(t - e); e < t; )
  36760. (i = this.view[e++]) < 16 ? n.push("0", i.toString(16)) : n.push(i.toString(16));
  36761. return n.join("")
  36762. }
  36763. ,
  36764. f.fromHex = function(e, t, i) {
  36765. if (!i) {
  36766. if ("string" != typeof e)
  36767. throw TypeError("Illegal str: Not a string");
  36768. if (e.length % 2 != 0)
  36769. throw TypeError("Illegal str: Length not a multiple of 2")
  36770. }
  36771. for (var n, r = e.length, o = new f(r / 2 | 0,t), a = 0, s = 0; a < r; a += 2) {
  36772. if (n = parseInt(e.substring(a, a + 2), 16),
  36773. !i && (!isFinite(n) || n < 0 || 255 < n))
  36774. throw TypeError("Illegal str: Contains non-hex characters");
  36775. o.view[s++] = n
  36776. }
  36777. return o.limit = s,
  36778. o
  36779. }
  36780. ;
  36781. var u, d = u = {
  36782. MAX_CODEPOINT: 1114111,
  36783. encodeUTF8: function(e, t) {
  36784. var i = null;
  36785. for ("number" == typeof e && (i = e,
  36786. e = function() {
  36787. return null
  36788. }
  36789. ); null !== i || null !== (i = e()); )
  36790. i < 128 ? t(127 & i) : (i < 2048 ? t(i >> 6 & 31 | 192) : (i < 65536 ? t(i >> 12 & 15 | 224) : (t(i >> 18 & 7 | 240),
  36791. t(i >> 12 & 63 | 128)),
  36792. t(i >> 6 & 63 | 128)),
  36793. t(63 & i | 128)),
  36794. i = null
  36795. },
  36796. decodeUTF8: function(e, t) {
  36797. for (var i, n, r, o, a = function(e) {
  36798. e = e.slice(0, e.indexOf(null));
  36799. var t = Error(e.toString());
  36800. throw t.name = "TruncatedError",
  36801. t.bytes = e,
  36802. t
  36803. }; null !== (i = e()); )
  36804. if (0 == (128 & i))
  36805. t(i);
  36806. else if (192 == (224 & i))
  36807. null === (n = e()) && a([i, n]),
  36808. t((31 & i) << 6 | 63 & n);
  36809. else if (224 == (240 & i))
  36810. null !== (n = e()) && null !== (r = e()) || a([i, n, r]),
  36811. t((15 & i) << 12 | (63 & n) << 6 | 63 & r);
  36812. else {
  36813. if (240 != (248 & i))
  36814. throw RangeError("Illegal starting byte: " + i);
  36815. null !== (n = e()) && null !== (r = e()) && null !== (o = e()) || a([i, n, r, o]),
  36816. t((7 & i) << 18 | (63 & n) << 12 | (63 & r) << 6 | 63 & o)
  36817. }
  36818. },
  36819. UTF16toUTF8: function(e, t) {
  36820. for (var i, n = null; null !== (i = null !== n ? n : e()); )
  36821. 55296 <= i && i <= 57343 && null !== (n = e()) && 56320 <= n && n <= 57343 ? (t(1024 * (i - 55296) + n - 56320 + 65536),
  36822. n = null) : t(i);
  36823. null !== n && t(n)
  36824. },
  36825. UTF8toUTF16: function(e, t) {
  36826. var i = null;
  36827. for ("number" == typeof e && (i = e,
  36828. e = function() {
  36829. return null
  36830. }
  36831. ); null !== i || null !== (i = e()); )
  36832. i <= 65535 ? t(i) : (t(55296 + ((i -= 65536) >> 10)),
  36833. t(i % 1024 + 56320)),
  36834. i = null
  36835. },
  36836. encodeUTF16toUTF8: function(e, t) {
  36837. u.UTF16toUTF8(e, function(e) {
  36838. u.encodeUTF8(e, t)
  36839. })
  36840. },
  36841. decodeUTF8toUTF16: function(e, t) {
  36842. u.decodeUTF8(e, function(e) {
  36843. u.UTF8toUTF16(e, t)
  36844. })
  36845. },
  36846. calculateCodePoint: function(e) {
  36847. return e < 128 ? 1 : e < 2048 ? 2 : e < 65536 ? 3 : 4
  36848. },
  36849. calculateUTF8: function(e) {
  36850. for (var t, i = 0; null !== (t = e()); )
  36851. i += t < 128 ? 1 : t < 2048 ? 2 : t < 65536 ? 3 : 4;
  36852. return i
  36853. },
  36854. calculateUTF16asUTF8: function(e) {
  36855. var t = 0
  36856. , i = 0;
  36857. return u.UTF16toUTF8(e, function(e) {
  36858. ++t,
  36859. i += e < 128 ? 1 : e < 2048 ? 2 : e < 65536 ? 3 : 4
  36860. }),
  36861. [t, i]
  36862. }
  36863. };
  36864. return a.toUTF8 = function(t, i) {
  36865. if (void 0 === t && (t = this.offset),
  36866. void 0 === i && (i = this.limit),
  36867. !this.noAssert) {
  36868. if ("number" != typeof t || t % 1 != 0)
  36869. throw TypeError("Illegal begin: Not an integer");
  36870. if (t >>>= 0,
  36871. "number" != typeof i || i % 1 != 0)
  36872. throw TypeError("Illegal end: Not an integer");
  36873. if (i >>>= 0,
  36874. t < 0 || i < t || i > this.buffer.byteLength)
  36875. throw RangeError("Illegal range: 0 <= " + t + " <= " + i + " <= " + this.buffer.byteLength)
  36876. }
  36877. var e;
  36878. try {
  36879. d.decodeUTF8toUTF16(function() {
  36880. return t < i ? this.view[t++] : null
  36881. }
  36882. .bind(this), e = c())
  36883. } catch (e) {
  36884. if (t !== i)
  36885. throw RangeError("Illegal range: Truncated data, " + t + " != " + i)
  36886. }
  36887. return e()
  36888. }
  36889. ,
  36890. f.fromUTF8 = function(e, t, i) {
  36891. if (!i && "string" != typeof e)
  36892. throw TypeError("Illegal str: Not a string");
  36893. var n = new f(d.calculateUTF16asUTF8(s(e), !0)[1],t,i)
  36894. , r = 0;
  36895. return d.encodeUTF16toUTF8(s(e), function(e) {
  36896. n.view[r++] = e
  36897. }),
  36898. n.limit = r,
  36899. n
  36900. }
  36901. ,
  36902. f
  36903. }
  36904. ,
  36905. "function" == typeof define && define.amd ? define(["long"], r) : "function" == typeof t && "object" == typeof e && e && e.exports ? e.exports = function() {
  36906. var e;
  36907. try {
  36908. e = t("long")
  36909. } catch (e) {}
  36910. return r(e)
  36911. }() : (n.dcodeIO = n.dcodeIO || {}).ByteBuffer = r(n.dcodeIO.Long)
  36912. }
  36913. , {
  36914. long: 216
  36915. }],
  36916. 216: [function(e, t, i) {
  36917. var n, r;
  36918. n = this,
  36919. r = function() {
  36920. "use strict";
  36921. function n(e, t, i) {
  36922. this.low = 0 | e,
  36923. this.high = 0 | t,
  36924. this.unsigned = !!i
  36925. }
  36926. function p(e) {
  36927. return !0 === (e && e.__isLong__)
  36928. }
  36929. function e(e, t) {
  36930. var i, n, r;
  36931. return t ? (r = 0 <= (e >>>= 0) && e < 256) && (n = a[e]) ? n : (i = g(e, (0 | e) < 0 ? -1 : 0, !0),
  36932. r && (a[e] = i),
  36933. i) : (r = -128 <= (e |= 0) && e < 128) && (n = o[e]) ? n : (i = g(e, e < 0 ? -1 : 0, !1),
  36934. r && (o[e] = i),
  36935. i)
  36936. }
  36937. function f(e, t) {
  36938. if (isNaN(e) || !isFinite(e))
  36939. return t ? l : y;
  36940. if (t) {
  36941. if (e < 0)
  36942. return l;
  36943. if (r <= e)
  36944. return I
  36945. } else {
  36946. if (e <= -s)
  36947. return E;
  36948. if (s <= e + 1)
  36949. return C
  36950. }
  36951. return e < 0 ? f(-e, t).neg() : g(e % i | 0, e / i | 0, t)
  36952. }
  36953. function g(e, t, i) {
  36954. return new n(e,t,i)
  36955. }
  36956. function h(e, t, i) {
  36957. if (0 === e.length)
  36958. throw Error("empty string");
  36959. if ("NaN" === e || "Infinity" === e || "+Infinity" === e || "-Infinity" === e)
  36960. return y;
  36961. if (t = "number" == typeof t ? (i = t,
  36962. !1) : !!t,
  36963. (i = i || 10) < 2 || 36 < i)
  36964. throw RangeError("radix");
  36965. var n;
  36966. if (0 < (n = e.indexOf("-")))
  36967. throw Error("interior hyphen");
  36968. if (0 === n)
  36969. return h(e.substring(1), t, i).neg();
  36970. for (var r = f(u(i, 8)), o = y, a = 0; a < e.length; a += 8) {
  36971. var s = Math.min(8, e.length - a)
  36972. , l = parseInt(e.substring(a, a + s), i);
  36973. if (s < 8) {
  36974. var c = f(u(i, s));
  36975. o = o.mul(c).add(f(l))
  36976. } else
  36977. o = (o = o.mul(r)).add(f(l))
  36978. }
  36979. return o.unsigned = t,
  36980. o
  36981. }
  36982. function m(e) {
  36983. return e instanceof n ? e : "number" == typeof e ? f(e) : "string" == typeof e ? h(e) : g(e.low, e.high, e.unsigned)
  36984. }
  36985. Object.defineProperty(n.prototype, "__isLong__", {
  36986. value: !0,
  36987. enumerable: !1,
  36988. configurable: !1
  36989. }),
  36990. n.isLong = p;
  36991. var o = {}
  36992. , a = {};
  36993. n.fromInt = e,
  36994. n.fromNumber = f,
  36995. n.fromBits = g;
  36996. var u = Math.pow;
  36997. n.fromString = h,
  36998. n.fromValue = m;
  36999. var i = 4294967296
  37000. , r = 0x10000000000000000
  37001. , s = r / 2
  37002. , v = e(1 << 24)
  37003. , y = e(0);
  37004. n.ZERO = y;
  37005. var l = e(0, !0);
  37006. n.UZERO = l;
  37007. var c = e(1);
  37008. n.ONE = c;
  37009. var d = e(1, !0);
  37010. n.UONE = d;
  37011. var A = e(-1);
  37012. n.NEG_ONE = A;
  37013. var C = g(-1, 2147483647, !1);
  37014. n.MAX_VALUE = C;
  37015. var I = g(-1, -1, !0);
  37016. n.MAX_UNSIGNED_VALUE = I;
  37017. var E = g(0, -2147483648, !1);
  37018. n.MIN_VALUE = E;
  37019. var t = n.prototype;
  37020. return t.toInt = function() {
  37021. return this.unsigned ? this.low >>> 0 : this.low
  37022. }
  37023. ,
  37024. t.toNumber = function() {
  37025. return this.unsigned ? (this.high >>> 0) * i + (this.low >>> 0) : this.high * i + (this.low >>> 0)
  37026. }
  37027. ,
  37028. t.toString = function(e) {
  37029. if ((e = e || 10) < 2 || 36 < e)
  37030. throw RangeError("radix");
  37031. if (this.isZero())
  37032. return "0";
  37033. if (this.isNegative()) {
  37034. if (this.eq(E)) {
  37035. var t = f(e)
  37036. , i = this.div(t)
  37037. , n = i.mul(t).sub(this);
  37038. return i.toString(e) + n.toInt().toString(e)
  37039. }
  37040. return "-" + this.neg().toString(e)
  37041. }
  37042. for (var r = f(u(e, 6), this.unsigned), o = this, a = ""; ; ) {
  37043. var s = o.div(r)
  37044. , l = (o.sub(s.mul(r)).toInt() >>> 0).toString(e);
  37045. if ((o = s).isZero())
  37046. return l + a;
  37047. for (; l.length < 6; )
  37048. l = "0" + l;
  37049. a = "" + l + a
  37050. }
  37051. }
  37052. ,
  37053. t.getHighBits = function() {
  37054. return this.high
  37055. }
  37056. ,
  37057. t.getHighBitsUnsigned = function() {
  37058. return this.high >>> 0
  37059. }
  37060. ,
  37061. t.getLowBits = function() {
  37062. return this.low
  37063. }
  37064. ,
  37065. t.getLowBitsUnsigned = function() {
  37066. return this.low >>> 0
  37067. }
  37068. ,
  37069. t.getNumBitsAbs = function() {
  37070. if (this.isNegative())
  37071. return this.eq(E) ? 64 : this.neg().getNumBitsAbs();
  37072. for (var e = 0 != this.high ? this.high : this.low, t = 31; 0 < t && 0 == (e & 1 << t); t--)
  37073. ;
  37074. return 0 != this.high ? t + 33 : t + 1
  37075. }
  37076. ,
  37077. t.isZero = function() {
  37078. return 0 === this.high && 0 === this.low
  37079. }
  37080. ,
  37081. t.isNegative = function() {
  37082. return !this.unsigned && this.high < 0
  37083. }
  37084. ,
  37085. t.isPositive = function() {
  37086. return this.unsigned || 0 <= this.high
  37087. }
  37088. ,
  37089. t.isOdd = function() {
  37090. return 1 == (1 & this.low)
  37091. }
  37092. ,
  37093. t.isEven = function() {
  37094. return 0 == (1 & this.low)
  37095. }
  37096. ,
  37097. t.equals = function(e) {
  37098. return p(e) || (e = m(e)),
  37099. (this.unsigned === e.unsigned || this.high >>> 31 != 1 || e.high >>> 31 != 1) && this.high === e.high && this.low === e.low
  37100. }
  37101. ,
  37102. t.eq = t.equals,
  37103. t.notEquals = function(e) {
  37104. return !this.eq(e)
  37105. }
  37106. ,
  37107. t.neq = t.notEquals,
  37108. t.lessThan = function(e) {
  37109. return this.comp(e) < 0
  37110. }
  37111. ,
  37112. t.lt = t.lessThan,
  37113. t.lessThanOrEqual = function(e) {
  37114. return this.comp(e) <= 0
  37115. }
  37116. ,
  37117. t.lte = t.lessThanOrEqual,
  37118. t.greaterThan = function(e) {
  37119. return 0 < this.comp(e)
  37120. }
  37121. ,
  37122. t.gt = t.greaterThan,
  37123. t.greaterThanOrEqual = function(e) {
  37124. return 0 <= this.comp(e)
  37125. }
  37126. ,
  37127. t.gte = t.greaterThanOrEqual,
  37128. t.compare = function(e) {
  37129. if (p(e) || (e = m(e)),
  37130. this.eq(e))
  37131. return 0;
  37132. var t = this.isNegative()
  37133. , i = e.isNegative();
  37134. 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
  37135. }
  37136. ,
  37137. t.comp = t.compare,
  37138. t.negate = function() {
  37139. return !this.unsigned && this.eq(E) ? E : this.not().add(c)
  37140. }
  37141. ,
  37142. t.neg = t.negate,
  37143. t.add = function(e) {
  37144. p(e) || (e = m(e));
  37145. var t = this.high >>> 16
  37146. , i = 65535 & this.high
  37147. , n = this.low >>> 16
  37148. , r = 65535 & this.low
  37149. , o = e.high >>> 16
  37150. , a = 65535 & e.high
  37151. , s = e.low >>> 16
  37152. , l = 0
  37153. , c = 0
  37154. , h = 0
  37155. , u = 0;
  37156. return h += (u += r + (65535 & e.low)) >>> 16,
  37157. c += (h += n + s) >>> 16,
  37158. l += (c += i + a) >>> 16,
  37159. l += t + o,
  37160. g((h &= 65535) << 16 | (u &= 65535), (l &= 65535) << 16 | (c &= 65535), this.unsigned)
  37161. }
  37162. ,
  37163. t.subtract = function(e) {
  37164. return p(e) || (e = m(e)),
  37165. this.add(e.neg())
  37166. }
  37167. ,
  37168. t.sub = t.subtract,
  37169. t.multiply = function(e) {
  37170. if (this.isZero())
  37171. return y;
  37172. if (p(e) || (e = m(e)),
  37173. e.isZero())
  37174. return y;
  37175. if (this.eq(E))
  37176. return e.isOdd() ? E : y;
  37177. if (e.eq(E))
  37178. return this.isOdd() ? E : y;
  37179. if (this.isNegative())
  37180. return e.isNegative() ? this.neg().mul(e.neg()) : this.neg().mul(e).neg();
  37181. if (e.isNegative())
  37182. return this.mul(e.neg()).neg();
  37183. if (this.lt(v) && e.lt(v))
  37184. return f(this.toNumber() * e.toNumber(), this.unsigned);
  37185. var t = this.high >>> 16
  37186. , i = 65535 & this.high
  37187. , n = this.low >>> 16
  37188. , r = 65535 & this.low
  37189. , o = e.high >>> 16
  37190. , a = 65535 & e.high
  37191. , s = e.low >>> 16
  37192. , l = 65535 & e.low
  37193. , c = 0
  37194. , h = 0
  37195. , u = 0
  37196. , d = 0;
  37197. return u += (d += r * l) >>> 16,
  37198. h += (u += n * l) >>> 16,
  37199. u &= 65535,
  37200. h += (u += r * s) >>> 16,
  37201. c += (h += i * l) >>> 16,
  37202. h &= 65535,
  37203. c += (h += n * s) >>> 16,
  37204. h &= 65535,
  37205. c += (h += r * a) >>> 16,
  37206. c += t * l + i * s + n * a + r * o,
  37207. g((u &= 65535) << 16 | (d &= 65535), (c &= 65535) << 16 | (h &= 65535), this.unsigned)
  37208. }
  37209. ,
  37210. t.mul = t.multiply,
  37211. t.divide = function(e) {
  37212. if (p(e) || (e = m(e)),
  37213. e.isZero())
  37214. throw Error("division by zero");
  37215. if (this.isZero())
  37216. return this.unsigned ? l : y;
  37217. var t, i, n;
  37218. if (this.unsigned) {
  37219. if (e.unsigned || (e = e.toUnsigned()),
  37220. e.gt(this))
  37221. return l;
  37222. if (e.gt(this.shru(1)))
  37223. return d;
  37224. n = l
  37225. } else {
  37226. if (this.eq(E))
  37227. 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)),
  37228. n = t.add(i.div(e)));
  37229. if (e.eq(E))
  37230. return this.unsigned ? l : y;
  37231. if (this.isNegative())
  37232. return e.isNegative() ? this.neg().div(e.neg()) : this.neg().div(e).neg();
  37233. if (e.isNegative())
  37234. return this.div(e.neg()).neg();
  37235. n = y
  37236. }
  37237. for (i = this; i.gte(e); ) {
  37238. t = Math.max(1, Math.floor(i.toNumber() / e.toNumber()));
  37239. 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); )
  37240. s = (a = f(t -= o, this.unsigned)).mul(e);
  37241. a.isZero() && (a = c),
  37242. n = n.add(a),
  37243. i = i.sub(s)
  37244. }
  37245. return n
  37246. }
  37247. ,
  37248. t.div = t.divide,
  37249. t.modulo = function(e) {
  37250. return p(e) || (e = m(e)),
  37251. this.sub(this.div(e).mul(e))
  37252. }
  37253. ,
  37254. t.mod = t.modulo,
  37255. t.not = function() {
  37256. return g(~this.low, ~this.high, this.unsigned)
  37257. }
  37258. ,
  37259. t.and = function(e) {
  37260. return p(e) || (e = m(e)),
  37261. g(this.low & e.low, this.high & e.high, this.unsigned)
  37262. }
  37263. ,
  37264. t.or = function(e) {
  37265. return p(e) || (e = m(e)),
  37266. g(this.low | e.low, this.high | e.high, this.unsigned)
  37267. }
  37268. ,
  37269. t.xor = function(e) {
  37270. return p(e) || (e = m(e)),
  37271. g(this.low ^ e.low, this.high ^ e.high, this.unsigned)
  37272. }
  37273. ,
  37274. t.shiftLeft = function(e) {
  37275. return p(e) && (e = e.toInt()),
  37276. 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)
  37277. }
  37278. ,
  37279. t.shl = t.shiftLeft,
  37280. t.shiftRight = function(e) {
  37281. return p(e) && (e = e.toInt()),
  37282. 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)
  37283. }
  37284. ,
  37285. t.shr = t.shiftRight,
  37286. t.shiftRightUnsigned = function(e) {
  37287. if (p(e) && (e = e.toInt()),
  37288. 0 === (e &= 63))
  37289. return this;
  37290. var t = this.high;
  37291. return e < 32 ? g(this.low >>> e | t << 32 - e, t >>> e, this.unsigned) : g(32 === e ? t : t >>> e - 32, 0, this.unsigned)
  37292. }
  37293. ,
  37294. t.shru = t.shiftRightUnsigned,
  37295. t.toSigned = function() {
  37296. return this.unsigned ? g(this.low, this.high, !1) : this
  37297. }
  37298. ,
  37299. t.toUnsigned = function() {
  37300. return this.unsigned ? this : g(this.low, this.high, !0)
  37301. }
  37302. ,
  37303. t.toBytes = function(e) {
  37304. return e ? this.toBytesLE() : this.toBytesBE()
  37305. }
  37306. ,
  37307. t.toBytesLE = function() {
  37308. var e = this.high
  37309. , t = this.low;
  37310. return [255 & t, t >>> 8 & 255, t >>> 16 & 255, t >>> 24 & 255, 255 & e, e >>> 8 & 255, e >>> 16 & 255, e >>> 24 & 255]
  37311. }
  37312. ,
  37313. t.toBytesBE = function() {
  37314. var e = this.high
  37315. , t = this.low;
  37316. return [e >>> 24 & 255, e >>> 16 & 255, e >>> 8 & 255, 255 & e, t >>> 24 & 255, t >>> 16 & 255, t >>> 8 & 255, 255 & t]
  37317. }
  37318. ,
  37319. n
  37320. }
  37321. ,
  37322. "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()
  37323. }
  37324. , {}],
  37325. 217: [function(e, t, i) {
  37326. 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 = {
  37327. REVISION: "75"
  37328. };
  37329. function Ii(e, t) {
  37330. return e.distance - t.distance
  37331. }
  37332. function Ei(e, t, i, n) {
  37333. if (!1 !== e.visible && (e.raycast(t, i),
  37334. !0 === n))
  37335. for (var r = e.children, o = 0, a = r.length; o < a; o++)
  37336. Ei(r[o], t, i, !0)
  37337. }
  37338. function _i(e, t, i) {
  37339. return i < 0 && (i += 1),
  37340. 1 < i && (i -= 1),
  37341. i < 1 / 6 ? e + 6 * (t - e) * i : i < .5 ? t : i < 2 / 3 ? e + 6 * (t - e) * (2 / 3 - i) : e
  37342. }
  37343. function bi(e, t, i, n, r, o, a) {
  37344. return Ci.Triangle.barycoordFromPoint(e, t, i, n, Vt),
  37345. r.multiplyScalar(Vt.x),
  37346. o.multiplyScalar(Vt.y),
  37347. a.multiplyScalar(Vt.z),
  37348. r.add(o).add(a),
  37349. r.clone()
  37350. }
  37351. function wi(e, t, i, n, r, o, a) {
  37352. var s = e.material;
  37353. if (null === (s.side === Ci.BackSide ? i.intersectTriangle(o, r, n, !0, a) : i.intersectTriangle(n, r, o, s.side !== Ci.DoubleSide, a)))
  37354. return null;
  37355. Ut.copy(a),
  37356. Ut.applyMatrix4(e.matrixWorld);
  37357. var l = t.ray.origin.distanceTo(Ut);
  37358. return l < t.near || l > t.far ? null : {
  37359. distance: l,
  37360. point: Ut.clone(),
  37361. object: e
  37362. }
  37363. }
  37364. function Ti(e, t, i, n, r, o, a, s) {
  37365. Mt.fromArray(n, 3 * o),
  37366. Rt.fromArray(n, 3 * a),
  37367. Pt.fromArray(n, 3 * s);
  37368. var l = wi(e, t, i, Mt, Rt, Pt, kt);
  37369. return l && (r && (Nt.fromArray(r, 2 * o),
  37370. Ft.fromArray(r, 2 * a),
  37371. Bt.fromArray(r, 2 * s),
  37372. l.uv = bi(kt, Mt, Rt, Pt, Nt, Ft, Bt)),
  37373. l.face = new Ci.Face3(o,a,s,Ci.Triangle.normal(Mt, Rt, Pt)),
  37374. l.faceIndex = o),
  37375. l
  37376. }
  37377. function xi() {}
  37378. function Si(e, t, i, n, r, o) {
  37379. var a, s, l, c, h, u, d, p, f, g, m, v, y, A, C, I, E;
  37380. if (s = e[o[t]].x,
  37381. l = e[o[t]].y,
  37382. c = e[o[i]].x,
  37383. h = e[o[i]].y,
  37384. u = e[o[n]].x,
  37385. d = e[o[n]].y,
  37386. Number.EPSILON > (c - s) * (d - l) - (h - l) * (u - s))
  37387. return !1;
  37388. for (g = u - c,
  37389. m = d - h,
  37390. v = s - u,
  37391. y = l - d,
  37392. A = c - s,
  37393. C = h - l,
  37394. a = 0; a < r; a++)
  37395. if (p = e[o[a]].x,
  37396. f = e[o[a]].y,
  37397. !(p === s && f === l || p === c && f === h || p === u && f === d) && (I = A * (f - l) - C * (p - s),
  37398. E = v * (f - d) - y * (p - u),
  37399. g * (f - h) - m * (p - c) >= -Number.EPSILON && E >= -Number.EPSILON && I >= -Number.EPSILON))
  37400. return !1;
  37401. return !0
  37402. }
  37403. function Mi(e) {
  37404. switch (e) {
  37405. case Ci.LinearEncoding:
  37406. return ["Linear", "( value )"];
  37407. case Ci.sRGBEncoding:
  37408. return ["sRGB", "( value )"];
  37409. case Ci.RGBEEncoding:
  37410. return ["RGBE", "( value )"];
  37411. case Ci.RGBM7Encoding:
  37412. return ["RGBM", "( value, 7.0 )"];
  37413. case Ci.RGBM16Encoding:
  37414. return ["RGBM", "( value, 16.0 )"];
  37415. case Ci.RGBDEncoding:
  37416. return ["RGBD", "( value, 256.0 )"];
  37417. case Ci.GammaEncoding:
  37418. return ["Gamma", "( value, float( GAMMA_FACTOR ) )"];
  37419. default:
  37420. throw new Error("unsupported encoding: " + e)
  37421. }
  37422. }
  37423. function Ri(e, t) {
  37424. var i = Mi(t);
  37425. return "vec4 " + e + "( vec4 value ) { return " + i[0] + "ToLinear" + i[1] + "; }"
  37426. }
  37427. function Pi(e) {
  37428. return "" !== e
  37429. }
  37430. function Oi(e, t) {
  37431. 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)
  37432. }
  37433. function Li(e) {
  37434. return e.replace(/#include +<([\w\d.]+)>/g, function(e, t) {
  37435. var i = Ci.ShaderChunk[t];
  37436. if (void 0 === i)
  37437. throw new Error("Can not resolve #include <" + t + ">");
  37438. return Li(i)
  37439. })
  37440. }
  37441. function Di(e) {
  37442. return e.replace(/for \( int i \= (\d+)\; i < (\d+)\; i \+\+ \) \{([\s\S]+?)(?=\})\}/g, function(e, t, i, n) {
  37443. for (var r = "", o = parseInt(t); o < parseInt(i); o++)
  37444. r += n.replace(/\[ i \]/g, "[ " + o + " ]");
  37445. return r
  37446. })
  37447. }
  37448. function Ni(e, t, i, n) {
  37449. gi.set(t, i, n).unproject(mi);
  37450. var r = fi[e];
  37451. if (void 0 !== r)
  37452. for (var o = 0, a = r.length; o < a; o++)
  37453. pi.vertices[r[o]].copy(gi)
  37454. }
  37455. "function" == typeof define && define.amd ? define("three", Ci) : void 0 !== i && void 0 !== t && (t.exports = Ci),
  37456. void 0 === Number.EPSILON && (Number.EPSILON = Math.pow(2, -52)),
  37457. void 0 === Math.sign && (Math.sign = function(e) {
  37458. return e < 0 ? -1 : 0 < e ? 1 : +e
  37459. }
  37460. ),
  37461. void 0 === Function.prototype.name && void 0 !== Object.defineProperty && Object.defineProperty(Function.prototype, "name", {
  37462. get: function() {
  37463. return this.toString().match(/^\s*function\s*(\S*)\s*\(/)[1]
  37464. }
  37465. }),
  37466. void 0 === Object.assign && Object.defineProperty(Object, "assign", {
  37467. writable: !0,
  37468. configurable: !0,
  37469. value: function(e) {
  37470. "use strict";
  37471. if (null == e)
  37472. throw new TypeError("Cannot convert first argument to object");
  37473. for (var t = Object(e), i = 1, n = arguments.length; i !== n; ++i) {
  37474. var r = arguments[i];
  37475. if (null != r) {
  37476. r = Object(r);
  37477. for (var o = Object.keys(r), a = 0, s = o.length; a !== s; ++a) {
  37478. var l = o[a]
  37479. , c = Object.getOwnPropertyDescriptor(r, l);
  37480. void 0 !== c && c.enumerable && (t[l] = r[l])
  37481. }
  37482. }
  37483. }
  37484. return t
  37485. }
  37486. }),
  37487. Ci.MOUSE = {
  37488. LEFT: 0,
  37489. MIDDLE: 1,
  37490. RIGHT: 2
  37491. },
  37492. Ci.CullFaceNone = 0,
  37493. Ci.CullFaceBack = 1,
  37494. Ci.CullFaceFront = 2,
  37495. Ci.CullFaceFrontBack = 3,
  37496. Ci.FrontFaceDirectionCW = 0,
  37497. Ci.FrontFaceDirectionCCW = 1,
  37498. Ci.BasicShadowMap = 0,
  37499. Ci.PCFShadowMap = 1,
  37500. Ci.PCFSoftShadowMap = 2,
  37501. Ci.FrontSide = 0,
  37502. Ci.BackSide = 1,
  37503. Ci.DoubleSide = 2,
  37504. Ci.FlatShading = 1,
  37505. Ci.SmoothShading = 2,
  37506. Ci.NoColors = 0,
  37507. Ci.FaceColors = 1,
  37508. Ci.VertexColors = 2,
  37509. Ci.NoBlending = 0,
  37510. Ci.NormalBlending = 1,
  37511. Ci.AdditiveBlending = 2,
  37512. Ci.SubtractiveBlending = 3,
  37513. Ci.MultiplyBlending = 4,
  37514. Ci.CustomBlending = 5,
  37515. Ci.AddEquation = 100,
  37516. Ci.SubtractEquation = 101,
  37517. Ci.ReverseSubtractEquation = 102,
  37518. Ci.MinEquation = 103,
  37519. Ci.MaxEquation = 104,
  37520. Ci.ZeroFactor = 200,
  37521. Ci.OneFactor = 201,
  37522. Ci.SrcColorFactor = 202,
  37523. Ci.OneMinusSrcColorFactor = 203,
  37524. Ci.SrcAlphaFactor = 204,
  37525. Ci.OneMinusSrcAlphaFactor = 205,
  37526. Ci.DstAlphaFactor = 206,
  37527. Ci.OneMinusDstAlphaFactor = 207,
  37528. Ci.DstColorFactor = 208,
  37529. Ci.OneMinusDstColorFactor = 209,
  37530. Ci.SrcAlphaSaturateFactor = 210,
  37531. Ci.NeverDepth = 0,
  37532. Ci.AlwaysDepth = 1,
  37533. Ci.LessDepth = 2,
  37534. Ci.LessEqualDepth = 3,
  37535. Ci.EqualDepth = 4,
  37536. Ci.GreaterEqualDepth = 5,
  37537. Ci.GreaterDepth = 6,
  37538. Ci.NotEqualDepth = 7,
  37539. Ci.MultiplyOperation = 0,
  37540. Ci.MixOperation = 1,
  37541. Ci.AddOperation = 2,
  37542. Ci.NoToneMapping = 0,
  37543. Ci.LinearToneMapping = 1,
  37544. Ci.ReinhardToneMapping = 2,
  37545. Ci.Uncharted2ToneMapping = 3,
  37546. Ci.CineonToneMapping = 4,
  37547. Ci.UVMapping = 300,
  37548. Ci.CubeReflectionMapping = 301,
  37549. Ci.CubeRefractionMapping = 302,
  37550. Ci.EquirectangularReflectionMapping = 303,
  37551. Ci.EquirectangularRefractionMapping = 304,
  37552. Ci.SphericalReflectionMapping = 305,
  37553. Ci.CubeUVReflectionMapping = 306,
  37554. Ci.CubeUVRefractionMapping = 307,
  37555. Ci.RepeatWrapping = 1e3,
  37556. Ci.ClampToEdgeWrapping = 1001,
  37557. Ci.MirroredRepeatWrapping = 1002,
  37558. Ci.NearestFilter = 1003,
  37559. Ci.NearestMipMapNearestFilter = 1004,
  37560. Ci.NearestMipMapLinearFilter = 1005,
  37561. Ci.LinearFilter = 1006,
  37562. Ci.LinearMipMapNearestFilter = 1007,
  37563. Ci.LinearMipMapLinearFilter = 1008,
  37564. Ci.UnsignedByteType = 1009,
  37565. Ci.ByteType = 1010,
  37566. Ci.ShortType = 1011,
  37567. Ci.UnsignedShortType = 1012,
  37568. Ci.IntType = 1013,
  37569. Ci.UnsignedIntType = 1014,
  37570. Ci.FloatType = 1015,
  37571. Ci.HalfFloatType = 1025,
  37572. Ci.UnsignedShort4444Type = 1016,
  37573. Ci.UnsignedShort5551Type = 1017,
  37574. Ci.UnsignedShort565Type = 1018,
  37575. Ci.AlphaFormat = 1019,
  37576. Ci.RGBFormat = 1020,
  37577. Ci.RGBAFormat = 1021,
  37578. Ci.LuminanceFormat = 1022,
  37579. Ci.LuminanceAlphaFormat = 1023,
  37580. Ci.RGBEFormat = Ci.RGBAFormat,
  37581. Ci.RGB_S3TC_DXT1_Format = 2001,
  37582. Ci.RGBA_S3TC_DXT1_Format = 2002,
  37583. Ci.RGBA_S3TC_DXT3_Format = 2003,
  37584. Ci.RGBA_S3TC_DXT5_Format = 2004,
  37585. Ci.RGB_PVRTC_4BPPV1_Format = 2100,
  37586. Ci.RGB_PVRTC_2BPPV1_Format = 2101,
  37587. Ci.RGBA_PVRTC_4BPPV1_Format = 2102,
  37588. Ci.RGBA_PVRTC_2BPPV1_Format = 2103,
  37589. Ci.RGB_ETC1_Format = 2151,
  37590. Ci.LoopOnce = 2200,
  37591. Ci.LoopRepeat = 2201,
  37592. Ci.LoopPingPong = 2202,
  37593. Ci.InterpolateDiscrete = 2300,
  37594. Ci.InterpolateLinear = 2301,
  37595. Ci.InterpolateSmooth = 2302,
  37596. Ci.ZeroCurvatureEnding = 2400,
  37597. Ci.ZeroSlopeEnding = 2401,
  37598. Ci.WrapAroundEnding = 2402,
  37599. Ci.TrianglesDrawMode = 0,
  37600. Ci.TriangleStripDrawMode = 1,
  37601. Ci.TriangleFanDrawMode = 2,
  37602. Ci.LinearEncoding = 3e3,
  37603. Ci.sRGBEncoding = 3001,
  37604. Ci.GammaEncoding = 3007,
  37605. Ci.RGBEEncoding = 3002,
  37606. Ci.LogLuvEncoding = 3003,
  37607. Ci.RGBM7Encoding = 3004,
  37608. Ci.RGBM16Encoding = 3005,
  37609. Ci.RGBDEncoding = 3006,
  37610. Ci.Color = function(e) {
  37611. return 3 === arguments.length ? this.fromArray(arguments) : this.set(e)
  37612. }
  37613. ,
  37614. Ci.Color.prototype = {
  37615. constructor: Ci.Color,
  37616. r: 1,
  37617. g: 1,
  37618. b: 1,
  37619. set: function(e) {
  37620. return e instanceof Ci.Color ? this.copy(e) : "number" == typeof e ? this.setHex(e) : "string" == typeof e && this.setStyle(e),
  37621. this
  37622. },
  37623. setScalar: function(e) {
  37624. this.r = e,
  37625. this.g = e,
  37626. this.b = e
  37627. },
  37628. setHex: function(e) {
  37629. return e = Math.floor(e),
  37630. this.r = (e >> 16 & 255) / 255,
  37631. this.g = (e >> 8 & 255) / 255,
  37632. this.b = (255 & e) / 255,
  37633. this
  37634. },
  37635. setRGB: function(e, t, i) {
  37636. return this.r = e,
  37637. this.g = t,
  37638. this.b = i,
  37639. this
  37640. },
  37641. setHSL: function(e, t, i) {
  37642. if (e = Ci.Math.euclideanModulo(e, 1),
  37643. t = Ci.Math.clamp(t, 0, 1),
  37644. i = Ci.Math.clamp(i, 0, 1),
  37645. 0 === t)
  37646. this.r = this.g = this.b = i;
  37647. else {
  37648. var n = i <= .5 ? i * (1 + t) : i + t - i * t
  37649. , r = 2 * i - n;
  37650. this.r = _i(r, n, e + 1 / 3),
  37651. this.g = _i(r, n, e),
  37652. this.b = _i(r, n, e - 1 / 3)
  37653. }
  37654. return this
  37655. },
  37656. setStyle: function(t) {
  37657. function e(e) {
  37658. void 0 !== e && parseFloat(e) < 1 && console.warn("THREE.Color: Alpha component of " + t + " will be ignored.")
  37659. }
  37660. var i;
  37661. if (i = /^((?:rgb|hsl)a?)\(\s*([^\)]*)\)/.exec(t)) {
  37662. var n, r = i[1], o = i[2];
  37663. switch (r) {
  37664. case "rgb":
  37665. case "rgba":
  37666. if (n = /^(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(o))
  37667. return this.r = Math.min(255, parseInt(n[1], 10)) / 255,
  37668. this.g = Math.min(255, parseInt(n[2], 10)) / 255,
  37669. this.b = Math.min(255, parseInt(n[3], 10)) / 255,
  37670. e(n[5]),
  37671. this;
  37672. if (n = /^(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(o))
  37673. return this.r = Math.min(100, parseInt(n[1], 10)) / 100,
  37674. this.g = Math.min(100, parseInt(n[2], 10)) / 100,
  37675. this.b = Math.min(100, parseInt(n[3], 10)) / 100,
  37676. e(n[5]),
  37677. this;
  37678. break;
  37679. case "hsl":
  37680. case "hsla":
  37681. if (n = /^([0-9]*\.?[0-9]+)\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(o)) {
  37682. var a = parseFloat(n[1]) / 360
  37683. , s = parseInt(n[2], 10) / 100
  37684. , l = parseInt(n[3], 10) / 100;
  37685. return e(n[5]),
  37686. this.setHSL(a, s, l)
  37687. }
  37688. }
  37689. } else if (i = /^\#([A-Fa-f0-9]+)$/.exec(t)) {
  37690. var c, h = (c = i[1]).length;
  37691. if (3 === h)
  37692. return this.r = parseInt(c.charAt(0) + c.charAt(0), 16) / 255,
  37693. this.g = parseInt(c.charAt(1) + c.charAt(1), 16) / 255,
  37694. this.b = parseInt(c.charAt(2) + c.charAt(2), 16) / 255,
  37695. this;
  37696. if (6 === h)
  37697. return this.r = parseInt(c.charAt(0) + c.charAt(1), 16) / 255,
  37698. this.g = parseInt(c.charAt(2) + c.charAt(3), 16) / 255,
  37699. this.b = parseInt(c.charAt(4) + c.charAt(5), 16) / 255,
  37700. this
  37701. }
  37702. t && 0 < t.length && (void 0 !== (c = Ci.ColorKeywords[t]) ? this.setHex(c) : console.warn("THREE.Color: Unknown color " + t));
  37703. return this
  37704. },
  37705. clone: function() {
  37706. return new this.constructor(this.r,this.g,this.b)
  37707. },
  37708. copy: function(e) {
  37709. return this.r = e.r,
  37710. this.g = e.g,
  37711. this.b = e.b,
  37712. this
  37713. },
  37714. copyGammaToLinear: function(e, t) {
  37715. return void 0 === t && (t = 2),
  37716. this.r = Math.pow(e.r, t),
  37717. this.g = Math.pow(e.g, t),
  37718. this.b = Math.pow(e.b, t),
  37719. this
  37720. },
  37721. copyLinearToGamma: function(e, t) {
  37722. void 0 === t && (t = 2);
  37723. var i = 0 < t ? 1 / t : 1;
  37724. return this.r = Math.pow(e.r, i),
  37725. this.g = Math.pow(e.g, i),
  37726. this.b = Math.pow(e.b, i),
  37727. this
  37728. },
  37729. convertGammaToLinear: function() {
  37730. var e = this.r
  37731. , t = this.g
  37732. , i = this.b;
  37733. return this.r = e * e,
  37734. this.g = t * t,
  37735. this.b = i * i,
  37736. this
  37737. },
  37738. convertLinearToGamma: function() {
  37739. return this.r = Math.sqrt(this.r),
  37740. this.g = Math.sqrt(this.g),
  37741. this.b = Math.sqrt(this.b),
  37742. this
  37743. },
  37744. getHex: function() {
  37745. return 255 * this.r << 16 ^ 255 * this.g << 8 ^ 255 * this.b << 0
  37746. },
  37747. getHexString: function() {
  37748. return ("000000" + this.getHex().toString(16)).slice(-6)
  37749. },
  37750. getHSL: function(e) {
  37751. var t, i, n = e || {
  37752. h: 0,
  37753. s: 0,
  37754. l: 0
  37755. }, 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;
  37756. if (l === s)
  37757. i = t = 0;
  37758. else {
  37759. var h = s - l;
  37760. switch (i = c <= .5 ? h / (s + l) : h / (2 - s - l),
  37761. s) {
  37762. case r:
  37763. t = (o - a) / h + (o < a ? 6 : 0);
  37764. break;
  37765. case o:
  37766. t = (a - r) / h + 2;
  37767. break;
  37768. case a:
  37769. t = (r - o) / h + 4
  37770. }
  37771. t /= 6
  37772. }
  37773. return n.h = t,
  37774. n.s = i,
  37775. n.l = c,
  37776. n
  37777. },
  37778. getStyle: function() {
  37779. return "rgb(" + (255 * this.r | 0) + "," + (255 * this.g | 0) + "," + (255 * this.b | 0) + ")"
  37780. },
  37781. offsetHSL: function(e, t, i) {
  37782. var n = this.getHSL();
  37783. return n.h += e,
  37784. n.s += t,
  37785. n.l += i,
  37786. this.setHSL(n.h, n.s, n.l),
  37787. this
  37788. },
  37789. add: function(e) {
  37790. return this.r += e.r,
  37791. this.g += e.g,
  37792. this.b += e.b,
  37793. this
  37794. },
  37795. addColors: function(e, t) {
  37796. return this.r = e.r + t.r,
  37797. this.g = e.g + t.g,
  37798. this.b = e.b + t.b,
  37799. this
  37800. },
  37801. addScalar: function(e) {
  37802. return this.r += e,
  37803. this.g += e,
  37804. this.b += e,
  37805. this
  37806. },
  37807. multiply: function(e) {
  37808. return this.r *= e.r,
  37809. this.g *= e.g,
  37810. this.b *= e.b,
  37811. this
  37812. },
  37813. multiplyScalar: function(e) {
  37814. return this.r *= e,
  37815. this.g *= e,
  37816. this.b *= e,
  37817. this
  37818. },
  37819. lerp: function(e, t) {
  37820. return this.r += (e.r - this.r) * t,
  37821. this.g += (e.g - this.g) * t,
  37822. this.b += (e.b - this.b) * t,
  37823. this
  37824. },
  37825. equals: function(e) {
  37826. return e.r === this.r && e.g === this.g && e.b === this.b
  37827. },
  37828. fromArray: function(e, t) {
  37829. return void 0 === t && (t = 0),
  37830. this.r = e[t],
  37831. this.g = e[t + 1],
  37832. this.b = e[t + 2],
  37833. this
  37834. },
  37835. toArray: function(e, t) {
  37836. return void 0 === e && (e = []),
  37837. void 0 === t && (t = 0),
  37838. e[t] = this.r,
  37839. e[t + 1] = this.g,
  37840. e[t + 2] = this.b,
  37841. e
  37842. }
  37843. },
  37844. Ci.ColorKeywords = {
  37845. aliceblue: 15792383,
  37846. antiquewhite: 16444375,
  37847. aqua: 65535,
  37848. aquamarine: 8388564,
  37849. azure: 15794175,
  37850. beige: 16119260,
  37851. bisque: 16770244,
  37852. black: 0,
  37853. blanchedalmond: 16772045,
  37854. blue: 255,
  37855. blueviolet: 9055202,
  37856. brown: 10824234,
  37857. burlywood: 14596231,
  37858. cadetblue: 6266528,
  37859. chartreuse: 8388352,
  37860. chocolate: 13789470,
  37861. coral: 16744272,
  37862. cornflowerblue: 6591981,
  37863. cornsilk: 16775388,
  37864. crimson: 14423100,
  37865. cyan: 65535,
  37866. darkblue: 139,
  37867. darkcyan: 35723,
  37868. darkgoldenrod: 12092939,
  37869. darkgray: 11119017,
  37870. darkgreen: 25600,
  37871. darkgrey: 11119017,
  37872. darkkhaki: 12433259,
  37873. darkmagenta: 9109643,
  37874. darkolivegreen: 5597999,
  37875. darkorange: 16747520,
  37876. darkorchid: 10040012,
  37877. darkred: 9109504,
  37878. darksalmon: 15308410,
  37879. darkseagreen: 9419919,
  37880. darkslateblue: 4734347,
  37881. darkslategray: 3100495,
  37882. darkslategrey: 3100495,
  37883. darkturquoise: 52945,
  37884. darkviolet: 9699539,
  37885. deeppink: 16716947,
  37886. deepskyblue: 49151,
  37887. dimgray: 6908265,
  37888. dimgrey: 6908265,
  37889. dodgerblue: 2003199,
  37890. firebrick: 11674146,
  37891. floralwhite: 16775920,
  37892. forestgreen: 2263842,
  37893. fuchsia: 16711935,
  37894. gainsboro: 14474460,
  37895. ghostwhite: 16316671,
  37896. gold: 16766720,
  37897. goldenrod: 14329120,
  37898. gray: 8421504,
  37899. green: 32768,
  37900. greenyellow: 11403055,
  37901. grey: 8421504,
  37902. honeydew: 15794160,
  37903. hotpink: 16738740,
  37904. indianred: 13458524,
  37905. indigo: 4915330,
  37906. ivory: 16777200,
  37907. khaki: 15787660,
  37908. lavender: 15132410,
  37909. lavenderblush: 16773365,
  37910. lawngreen: 8190976,
  37911. lemonchiffon: 16775885,
  37912. lightblue: 11393254,
  37913. lightcoral: 15761536,
  37914. lightcyan: 14745599,
  37915. lightgoldenrodyellow: 16448210,
  37916. lightgray: 13882323,
  37917. lightgreen: 9498256,
  37918. lightgrey: 13882323,
  37919. lightpink: 16758465,
  37920. lightsalmon: 16752762,
  37921. lightseagreen: 2142890,
  37922. lightskyblue: 8900346,
  37923. lightslategray: 7833753,
  37924. lightslategrey: 7833753,
  37925. lightsteelblue: 11584734,
  37926. lightyellow: 16777184,
  37927. lime: 65280,
  37928. limegreen: 3329330,
  37929. linen: 16445670,
  37930. magenta: 16711935,
  37931. maroon: 8388608,
  37932. mediumaquamarine: 6737322,
  37933. mediumblue: 205,
  37934. mediumorchid: 12211667,
  37935. mediumpurple: 9662683,
  37936. mediumseagreen: 3978097,
  37937. mediumslateblue: 8087790,
  37938. mediumspringgreen: 64154,
  37939. mediumturquoise: 4772300,
  37940. mediumvioletred: 13047173,
  37941. midnightblue: 1644912,
  37942. mintcream: 16121850,
  37943. mistyrose: 16770273,
  37944. moccasin: 16770229,
  37945. navajowhite: 16768685,
  37946. navy: 128,
  37947. oldlace: 16643558,
  37948. olive: 8421376,
  37949. olivedrab: 7048739,
  37950. orange: 16753920,
  37951. orangered: 16729344,
  37952. orchid: 14315734,
  37953. palegoldenrod: 15657130,
  37954. palegreen: 10025880,
  37955. paleturquoise: 11529966,
  37956. palevioletred: 14381203,
  37957. papayawhip: 16773077,
  37958. peachpuff: 16767673,
  37959. peru: 13468991,
  37960. pink: 16761035,
  37961. plum: 14524637,
  37962. powderblue: 11591910,
  37963. purple: 8388736,
  37964. red: 16711680,
  37965. rosybrown: 12357519,
  37966. royalblue: 4286945,
  37967. saddlebrown: 9127187,
  37968. salmon: 16416882,
  37969. sandybrown: 16032864,
  37970. seagreen: 3050327,
  37971. seashell: 16774638,
  37972. sienna: 10506797,
  37973. silver: 12632256,
  37974. skyblue: 8900331,
  37975. slateblue: 6970061,
  37976. slategray: 7372944,
  37977. slategrey: 7372944,
  37978. snow: 16775930,
  37979. springgreen: 65407,
  37980. steelblue: 4620980,
  37981. tan: 13808780,
  37982. teal: 32896,
  37983. thistle: 14204888,
  37984. tomato: 16737095,
  37985. turquoise: 4251856,
  37986. violet: 15631086,
  37987. wheat: 16113331,
  37988. white: 16777215,
  37989. whitesmoke: 16119285,
  37990. yellow: 16776960,
  37991. yellowgreen: 10145074
  37992. },
  37993. Ci.Quaternion = function(e, t, i, n) {
  37994. this._x = e || 0,
  37995. this._y = t || 0,
  37996. this._z = i || 0,
  37997. this._w = void 0 !== n ? n : 1
  37998. }
  37999. ,
  38000. Ci.Quaternion.prototype = {
  38001. constructor: Ci.Quaternion,
  38002. get x() {
  38003. return this._x
  38004. },
  38005. set x(e) {
  38006. this._x = e,
  38007. this.onChangeCallback()
  38008. },
  38009. get y() {
  38010. return this._y
  38011. },
  38012. set y(e) {
  38013. this._y = e,
  38014. this.onChangeCallback()
  38015. },
  38016. get z() {
  38017. return this._z
  38018. },
  38019. set z(e) {
  38020. this._z = e,
  38021. this.onChangeCallback()
  38022. },
  38023. get w() {
  38024. return this._w
  38025. },
  38026. set w(e) {
  38027. this._w = e,
  38028. this.onChangeCallback()
  38029. },
  38030. set: function(e, t, i, n) {
  38031. return this._x = e,
  38032. this._y = t,
  38033. this._z = i,
  38034. this._w = n,
  38035. this.onChangeCallback(),
  38036. this
  38037. },
  38038. clone: function() {
  38039. return new this.constructor(this._x,this._y,this._z,this._w)
  38040. },
  38041. toObject:function(){//add
  38042. return {x:this.x, y:this.y,z:this.z, w:this.w};
  38043. },
  38044. copy: function(e) {
  38045. return this._x = e.x,
  38046. this._y = e.y,
  38047. this._z = e.z,
  38048. this._w = e.w,
  38049. this.onChangeCallback(),
  38050. this
  38051. },
  38052. setFromEuler: function(e, t) {
  38053. if (e instanceof Ci.Euler == 0)
  38054. throw new Error("THREE.Quaternion: .setFromEuler() now expects a Euler rotation rather than a Vector3 and order.");
  38055. var i = Math.cos(e._x / 2)
  38056. , n = Math.cos(e._y / 2)
  38057. , r = Math.cos(e._z / 2)
  38058. , o = Math.sin(e._x / 2)
  38059. , a = Math.sin(e._y / 2)
  38060. , s = Math.sin(e._z / 2)
  38061. , l = e.order;
  38062. return "XYZ" === l ? (this._x = o * n * r + i * a * s,
  38063. this._y = i * a * r - o * n * s,
  38064. this._z = i * n * s + o * a * r,
  38065. this._w = i * n * r - o * a * s) : "YXZ" === l ? (this._x = o * n * r + i * a * s,
  38066. this._y = i * a * r - o * n * s,
  38067. this._z = i * n * s - o * a * r,
  38068. this._w = i * n * r + o * a * s) : "ZXY" === l ? (this._x = o * n * r - i * a * s,
  38069. this._y = i * a * r + o * n * s,
  38070. this._z = i * n * s + o * a * r,
  38071. this._w = i * n * r - o * a * s) : "ZYX" === l ? (this._x = o * n * r - i * a * s,
  38072. this._y = i * a * r + o * n * s,
  38073. this._z = i * n * s - o * a * r,
  38074. this._w = i * n * r + o * a * s) : "YZX" === l ? (this._x = o * n * r + i * a * s,
  38075. this._y = i * a * r + o * n * s,
  38076. this._z = i * n * s - o * a * r,
  38077. this._w = i * n * r - o * a * s) : "XZY" === l && (this._x = o * n * r - i * a * s,
  38078. this._y = i * a * r - o * n * s,
  38079. this._z = i * n * s + o * a * r,
  38080. this._w = i * n * r + o * a * s),
  38081. !1 !== t && this.onChangeCallback(),
  38082. this
  38083. },
  38084. setFromAxisAngle: function(e, t) {
  38085. var i = t / 2
  38086. , n = Math.sin(i);
  38087. return this._x = e.x * n,
  38088. this._y = e.y * n,
  38089. this._z = e.z * n,
  38090. this._w = Math.cos(i),
  38091. this.onChangeCallback(),
  38092. this
  38093. },
  38094. setFromRotationMatrix: function(e) {
  38095. 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;
  38096. return 0 < d ? (t = .5 / Math.sqrt(d + 1),
  38097. this._w = .25 / t,
  38098. this._x = (h - l) * t,
  38099. this._y = (o - c) * t,
  38100. this._z = (a - r) * t) : s < n && u < n ? (t = 2 * Math.sqrt(1 + n - s - u),
  38101. this._w = (h - l) / t,
  38102. this._x = .25 * t,
  38103. this._y = (r + a) / t,
  38104. this._z = (o + c) / t) : u < s ? (t = 2 * Math.sqrt(1 + s - n - u),
  38105. this._w = (o - c) / t,
  38106. this._x = (r + a) / t,
  38107. this._y = .25 * t,
  38108. this._z = (l + h) / t) : (t = 2 * Math.sqrt(1 + u - n - s),
  38109. this._w = (a - r) / t,
  38110. this._x = (o + c) / t,
  38111. this._y = (l + h) / t,
  38112. this._z = .25 * t),
  38113. this.onChangeCallback(),
  38114. this
  38115. },
  38116. setFromUnitVectors: function(e, t) {
  38117. return void 0 === Be && (Be = new Ci.Vector3),
  38118. (Ve = e.dot(t) + 1) < 1e-6 ? (Ve = 0,
  38119. 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),
  38120. this._x = Be.x,
  38121. this._y = Be.y,
  38122. this._z = Be.z,
  38123. this._w = Ve,
  38124. this.normalize(),
  38125. this
  38126. },
  38127. inverse: function() {
  38128. return this.conjugate().normalize(),
  38129. this
  38130. },
  38131. conjugate: function() {
  38132. return this._x *= -1,
  38133. this._y *= -1,
  38134. this._z *= -1,
  38135. this.onChangeCallback(),
  38136. this
  38137. },
  38138. dot: function(e) {
  38139. return this._x * e._x + this._y * e._y + this._z * e._z + this._w * e._w
  38140. },
  38141. lengthSq: function() {
  38142. return this._x * this._x + this._y * this._y + this._z * this._z + this._w * this._w
  38143. },
  38144. length: function() {
  38145. return Math.sqrt(this._x * this._x + this._y * this._y + this._z * this._z + this._w * this._w)
  38146. },
  38147. normalize: function() {
  38148. var e = this.length();
  38149. return 0 === e ? (this._x = 0,
  38150. this._y = 0,
  38151. this._z = 0,
  38152. this._w = 1) : (e = 1 / e,
  38153. this._x = this._x * e,
  38154. this._y = this._y * e,
  38155. this._z = this._z * e,
  38156. this._w = this._w * e),
  38157. this.onChangeCallback(),
  38158. this
  38159. },
  38160. multiply: function(e, t) {
  38161. return void 0 !== t ? (console.warn("THREE.Quaternion: .multiply() now only accepts one argument. Use .multiplyQuaternions( a, b ) instead."),
  38162. this.multiplyQuaternions(e, t)) : this.multiplyQuaternions(this, e)
  38163. },
  38164. multiplyQuaternions: function(e, t) {
  38165. var i = e._x
  38166. , n = e._y
  38167. , r = e._z
  38168. , o = e._w
  38169. , a = t._x
  38170. , s = t._y
  38171. , l = t._z
  38172. , c = t._w;
  38173. return this._x = i * c + o * a + n * l - r * s,
  38174. this._y = n * c + o * s + r * a - i * l,
  38175. this._z = r * c + o * l + i * s - n * a,
  38176. this._w = o * c - i * a - n * s - r * l,
  38177. this.onChangeCallback(),
  38178. this
  38179. },
  38180. slerp: function(e, t) {
  38181. if (0 === t)
  38182. return this;
  38183. if (1 === t)
  38184. return this.copy(e);
  38185. var i = this._x
  38186. , n = this._y
  38187. , r = this._z
  38188. , o = this._w
  38189. , a = o * e._w + i * e._x + n * e._y + r * e._z;
  38190. if (a < 0 ? (this._w = -e._w,
  38191. this._x = -e._x,
  38192. this._y = -e._y,
  38193. this._z = -e._z,
  38194. a = -a) : this.copy(e),
  38195. 1 <= a)
  38196. return this._w = o,
  38197. this._x = i,
  38198. this._y = n,
  38199. this._z = r,
  38200. this;
  38201. var s = Math.sqrt(1 - a * a);
  38202. if (Math.abs(s) < .001)
  38203. return this._w = .5 * (o + this._w),
  38204. this._x = .5 * (i + this._x),
  38205. this._y = .5 * (n + this._y),
  38206. this._z = .5 * (r + this._z),
  38207. this;
  38208. var l = Math.atan2(s, a)
  38209. , c = Math.sin((1 - t) * l) / s
  38210. , h = Math.sin(t * l) / s;
  38211. return this._w = o * c + this._w * h,
  38212. this._x = i * c + this._x * h,
  38213. this._y = n * c + this._y * h,
  38214. this._z = r * c + this._z * h,
  38215. this.onChangeCallback(),
  38216. this
  38217. },
  38218. equals: function(e) {
  38219. return e._x === this._x && e._y === this._y && e._z === this._z && e._w === this._w
  38220. },
  38221. fromArray: function(e, t) {
  38222. return void 0 === t && (t = 0),
  38223. this._x = e[t],
  38224. this._y = e[t + 1],
  38225. this._z = e[t + 2],
  38226. this._w = e[t + 3],
  38227. this.onChangeCallback(),
  38228. this
  38229. },
  38230. toArray: function(e, t) {
  38231. return void 0 === e && (e = []),
  38232. void 0 === t && (t = 0),
  38233. e[t] = this._x,
  38234. e[t + 1] = this._y,
  38235. e[t + 2] = this._z,
  38236. e[t + 3] = this._w,
  38237. e
  38238. },
  38239. onChange: function(e) {
  38240. return this.onChangeCallback = e,
  38241. this
  38242. },
  38243. onChangeCallback: function() {}
  38244. },
  38245. Object.assign(Ci.Quaternion, {
  38246. slerp: function(e, t, i, n) {
  38247. return i.copy(e).slerp(t, n)
  38248. },
  38249. slerpFlat: function(e, t, i, n, r, o, a) {
  38250. var s = i[n + 0]
  38251. , l = i[n + 1]
  38252. , c = i[n + 2]
  38253. , h = i[n + 3]
  38254. , u = r[o + 0]
  38255. , d = r[o + 1]
  38256. , p = r[o + 2]
  38257. , f = r[o + 3];
  38258. if (h !== f || s !== u || l !== d || c !== p) {
  38259. var g = 1 - a
  38260. , m = s * u + l * d + c * p + h * f
  38261. , v = 0 <= m ? 1 : -1
  38262. , y = 1 - m * m;
  38263. if (y > Number.EPSILON) {
  38264. var A = Math.sqrt(y)
  38265. , C = Math.atan2(A, m * v);
  38266. g = Math.sin(g * C) / A,
  38267. a = Math.sin(a * C) / A
  38268. }
  38269. var I = a * v;
  38270. if (s = s * g + u * I,
  38271. l = l * g + d * I,
  38272. c = c * g + p * I,
  38273. h = h * g + f * I,
  38274. g === 1 - a) {
  38275. var E = 1 / Math.sqrt(s * s + l * l + c * c + h * h);
  38276. s *= E,
  38277. l *= E,
  38278. c *= E,
  38279. h *= E
  38280. }
  38281. }
  38282. e[t] = s,
  38283. e[t + 1] = l,
  38284. e[t + 2] = c,
  38285. e[t + 3] = h
  38286. }
  38287. }),
  38288. Ci.Vector2 = function(e, t) {
  38289. this.x = e || 0,
  38290. this.y = t || 0
  38291. }
  38292. ,
  38293. Ci.Vector2.prototype = {
  38294. constructor: Ci.Vector2,
  38295. get width() {
  38296. return this.x
  38297. },
  38298. set width(e) {
  38299. this.x = e
  38300. },
  38301. get height() {
  38302. return this.y
  38303. },
  38304. set height(e) {
  38305. this.y = e
  38306. },
  38307. set: function(e, t) {
  38308. return this.x = e,
  38309. this.y = t,
  38310. this
  38311. },
  38312. setScalar: function(e) {
  38313. return this.x = e,
  38314. this.y = e,
  38315. this
  38316. },
  38317. setX: function(e) {
  38318. return this.x = e,
  38319. this
  38320. },
  38321. setY: function(e) {
  38322. return this.y = e,
  38323. this
  38324. },
  38325. setComponent: function(e, t) {
  38326. switch (e) {
  38327. case 0:
  38328. this.x = t;
  38329. break;
  38330. case 1:
  38331. this.y = t;
  38332. break;
  38333. default:
  38334. throw new Error("index is out of range: " + e)
  38335. }
  38336. },
  38337. getComponent: function(e) {
  38338. switch (e) {
  38339. case 0:
  38340. return this.x;
  38341. case 1:
  38342. return this.y;
  38343. default:
  38344. throw new Error("index is out of range: " + e)
  38345. }
  38346. },
  38347. clone: function() {
  38348. return new this.constructor(this.x,this.y)
  38349. },
  38350. copy: function(e) {
  38351. return this.x = e.x,
  38352. this.y = e.y,
  38353. this
  38354. },
  38355. add: function(e, t) {
  38356. return void 0 !== t ? (console.warn("THREE.Vector2: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),
  38357. this.addVectors(e, t)) : (this.x += e.x,
  38358. this.y += e.y,
  38359. this)
  38360. },
  38361. addScalar: function(e) {
  38362. return this.x += e,
  38363. this.y += e,
  38364. this
  38365. },
  38366. addVectors: function(e, t) {
  38367. return this.x = e.x + t.x,
  38368. this.y = e.y + t.y,
  38369. this
  38370. },
  38371. addScaledVector: function(e, t) {
  38372. return this.x += e.x * t,
  38373. this.y += e.y * t,
  38374. this
  38375. },
  38376. sub: function(e, t) {
  38377. return void 0 !== t ? (console.warn("THREE.Vector2: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),
  38378. this.subVectors(e, t)) : (this.x -= e.x,
  38379. this.y -= e.y,
  38380. this)
  38381. },
  38382. subScalar: function(e) {
  38383. return this.x -= e,
  38384. this.y -= e,
  38385. this
  38386. },
  38387. subVectors: function(e, t) {
  38388. return this.x = e.x - t.x,
  38389. this.y = e.y - t.y,
  38390. this
  38391. },
  38392. multiply: function(e) {
  38393. return this.x *= e.x,
  38394. this.y *= e.y,
  38395. this
  38396. },
  38397. multiplyScalar: function(e) {
  38398. return isFinite(e) ? (this.x *= e,
  38399. this.y *= e) : (this.x = 0,
  38400. this.y = 0),
  38401. this
  38402. },
  38403. divide: function(e) {
  38404. return this.x /= e.x,
  38405. this.y /= e.y,
  38406. this
  38407. },
  38408. divideScalar: function(e) {
  38409. return this.multiplyScalar(1 / e)
  38410. },
  38411. min: function(e) {
  38412. return this.x = Math.min(this.x, e.x),
  38413. this.y = Math.min(this.y, e.y),
  38414. this
  38415. },
  38416. max: function(e) {
  38417. return this.x = Math.max(this.x, e.x),
  38418. this.y = Math.max(this.y, e.y),
  38419. this
  38420. },
  38421. clamp: function(e, t) {
  38422. return this.x = Math.max(e.x, Math.min(t.x, this.x)),
  38423. this.y = Math.max(e.y, Math.min(t.y, this.y)),
  38424. this
  38425. },
  38426. clampScalar: function(e, t) {
  38427. return void 0 === Ne && (Ne = new Ci.Vector2,
  38428. Fe = new Ci.Vector2),
  38429. Ne.set(e, e),
  38430. Fe.set(t, t),
  38431. this.clamp(Ne, Fe)
  38432. },
  38433. clampLength: function(e, t) {
  38434. var i = this.length();
  38435. return this.multiplyScalar(Math.max(e, Math.min(t, i)) / i),
  38436. this
  38437. },
  38438. floor: function() {
  38439. return this.x = Math.floor(this.x),
  38440. this.y = Math.floor(this.y),
  38441. this
  38442. },
  38443. ceil: function() {
  38444. return this.x = Math.ceil(this.x),
  38445. this.y = Math.ceil(this.y),
  38446. this
  38447. },
  38448. round: function() {
  38449. return this.x = Math.round(this.x),
  38450. this.y = Math.round(this.y),
  38451. this
  38452. },
  38453. roundToZero: function() {
  38454. return this.x = this.x < 0 ? Math.ceil(this.x) : Math.floor(this.x),
  38455. this.y = this.y < 0 ? Math.ceil(this.y) : Math.floor(this.y),
  38456. this
  38457. },
  38458. negate: function() {
  38459. return this.x = -this.x,
  38460. this.y = -this.y,
  38461. this
  38462. },
  38463. dot: function(e) {
  38464. return this.x * e.x + this.y * e.y
  38465. },
  38466. lengthSq: function() {
  38467. return this.x * this.x + this.y * this.y
  38468. },
  38469. length: function() {
  38470. return Math.sqrt(this.x * this.x + this.y * this.y)
  38471. },
  38472. lengthManhattan: function() {
  38473. return Math.abs(this.x) + Math.abs(this.y)
  38474. },
  38475. normalize: function() {
  38476. return this.divideScalar(this.length())
  38477. },
  38478. angle: function() {
  38479. var e = Math.atan2(this.y, this.x);
  38480. return e < 0 && (e += 2 * Math.PI),
  38481. e
  38482. },
  38483. distanceTo: function(e) {
  38484. return Math.sqrt(this.distanceToSquared(e))
  38485. },
  38486. distanceToSquared: function(e) {
  38487. var t = this.x - e.x
  38488. , i = this.y - e.y;
  38489. return t * t + i * i
  38490. },
  38491. setLength: function(e) {
  38492. return this.multiplyScalar(e / this.length())
  38493. },
  38494. lerp: function(e, t) {
  38495. return this.x += (e.x - this.x) * t,
  38496. this.y += (e.y - this.y) * t,
  38497. this
  38498. },
  38499. lerpVectors: function(e, t, i) {
  38500. return this.subVectors(t, e).multiplyScalar(i).add(e),
  38501. this
  38502. },
  38503. equals: function(e) {
  38504. return e.x === this.x && e.y === this.y
  38505. },
  38506. fromArray: function(e, t) {
  38507. return void 0 === t && (t = 0),
  38508. this.x = e[t],
  38509. this.y = e[t + 1],
  38510. this
  38511. },
  38512. toArray: function(e, t) {
  38513. return void 0 === e && (e = []),
  38514. void 0 === t && (t = 0),
  38515. e[t] = this.x,
  38516. e[t + 1] = this.y,
  38517. e
  38518. },
  38519. fromAttribute: function(e, t, i) {
  38520. return void 0 === i && (i = 0),
  38521. t = t * e.itemSize + i,
  38522. this.x = e.array[t],
  38523. this.y = e.array[t + 1],
  38524. this
  38525. },
  38526. rotateAround: function(e, t) {
  38527. var i = Math.cos(t)
  38528. , n = Math.sin(t)
  38529. , r = this.x - e.x
  38530. , o = this.y - e.y;
  38531. return this.x = r * i - o * n + e.x,
  38532. this.y = r * n + o * i + e.y,
  38533. this
  38534. }
  38535. },
  38536. Ci.Vector3 = function(e, t, i) {
  38537. this.x = e || 0,
  38538. this.y = t || 0,
  38539. this.z = i || 0
  38540. }
  38541. ,
  38542. Ci.Vector3.prototype = {
  38543. constructor: Ci.Vector3,
  38544. set: function(e, t, i) {
  38545. return this.x = e,
  38546. this.y = t,
  38547. this.z = i,
  38548. this
  38549. },
  38550. setScalar: function(e) {
  38551. return this.x = e,
  38552. this.y = e,
  38553. this.z = e,
  38554. this
  38555. },
  38556. setX: function(e) {
  38557. return this.x = e,
  38558. this
  38559. },
  38560. setY: function(e) {
  38561. return this.y = e,
  38562. this
  38563. },
  38564. setZ: function(e) {
  38565. return this.z = e,
  38566. this
  38567. },
  38568. setComponent: function(e, t) {
  38569. switch (e) {
  38570. case 0:
  38571. this.x = t;
  38572. break;
  38573. case 1:
  38574. this.y = t;
  38575. break;
  38576. case 2:
  38577. this.z = t;
  38578. break;
  38579. default:
  38580. throw new Error("index is out of range: " + e)
  38581. }
  38582. },
  38583. getComponent: function(e) {
  38584. switch (e) {
  38585. case 0:
  38586. return this.x;
  38587. case 1:
  38588. return this.y;
  38589. case 2:
  38590. return this.z;
  38591. default:
  38592. throw new Error("index is out of range: " + e)
  38593. }
  38594. },
  38595. clone: function() {
  38596. return new this.constructor(this.x,this.y,this.z)
  38597. },
  38598. copy: function(e) {
  38599. return this.x = e.x,
  38600. this.y = e.y,
  38601. this.z = e.z,
  38602. this
  38603. },
  38604. add: function(e, t) {
  38605. return void 0 !== t ? (console.warn("THREE.Vector3: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),
  38606. this.addVectors(e, t)) : (this.x += e.x,
  38607. this.y += e.y,
  38608. this.z += e.z,
  38609. this)
  38610. },
  38611. addScalar: function(e) {
  38612. return this.x += e,
  38613. this.y += e,
  38614. this.z += e,
  38615. this
  38616. },
  38617. addVectors: function(e, t) {
  38618. return this.x = e.x + t.x,
  38619. this.y = e.y + t.y,
  38620. this.z = e.z + t.z,
  38621. this
  38622. },
  38623. addScaledVector: function(e, t) {
  38624. return this.x += e.x * t,
  38625. this.y += e.y * t,
  38626. this.z += e.z * t,
  38627. this
  38628. },
  38629. sub: function(e, t) {
  38630. return void 0 !== t ? (console.warn("THREE.Vector3: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),
  38631. this.subVectors(e, t)) : (this.x -= e.x,
  38632. this.y -= e.y,
  38633. this.z -= e.z,
  38634. this)
  38635. },
  38636. subScalar: function(e) {
  38637. return this.x -= e,
  38638. this.y -= e,
  38639. this.z -= e,
  38640. this
  38641. },
  38642. subVectors: function(e, t) {
  38643. return this.x = e.x - t.x,
  38644. this.y = e.y - t.y,
  38645. this.z = e.z - t.z,
  38646. this
  38647. },
  38648. multiply: function(e, t) {
  38649. return void 0 !== t ? (console.warn("THREE.Vector3: .multiply() now only accepts one argument. Use .multiplyVectors( a, b ) instead."),
  38650. this.multiplyVectors(e, t)) : (this.x *= e.x,
  38651. this.y *= e.y,
  38652. this.z *= e.z,
  38653. this)
  38654. },
  38655. multiplyScalar: function(e) {
  38656. return isFinite(e) ? (this.x *= e,
  38657. this.y *= e,
  38658. this.z *= e) : (this.x = 0,
  38659. this.y = 0,
  38660. this.z = 0),
  38661. this
  38662. },
  38663. multiplyVectors: function(e, t) {
  38664. return this.x = e.x * t.x,
  38665. this.y = e.y * t.y,
  38666. this.z = e.z * t.z,
  38667. this
  38668. },
  38669. applyEuler: function(e) {
  38670. return e instanceof Ci.Euler == 0 && console.error("THREE.Vector3: .applyEuler() now expects an Euler rotation rather than a Vector3 and order."),
  38671. void 0 === De && (De = new Ci.Quaternion),
  38672. this.applyQuaternion(De.setFromEuler(e)),
  38673. this
  38674. },
  38675. applyAxisAngle: function(e, t) {
  38676. return void 0 === Le && (Le = new Ci.Quaternion),
  38677. this.applyQuaternion(Le.setFromAxisAngle(e, t)),
  38678. this
  38679. },
  38680. applyMatrix3: function(e) {
  38681. var t = this.x
  38682. , i = this.y
  38683. , n = this.z
  38684. , r = e.elements;
  38685. return this.x = r[0] * t + r[3] * i + r[6] * n,
  38686. this.y = r[1] * t + r[4] * i + r[7] * n,
  38687. this.z = r[2] * t + r[5] * i + r[8] * n,
  38688. this
  38689. },
  38690. applyMatrix4: function(e) {
  38691. var t = this.x
  38692. , i = this.y
  38693. , n = this.z
  38694. , r = e.elements;
  38695. return this.x = r[0] * t + r[4] * i + r[8] * n + r[12],
  38696. this.y = r[1] * t + r[5] * i + r[9] * n + r[13],
  38697. this.z = r[2] * t + r[6] * i + r[10] * n + r[14],
  38698. this
  38699. },
  38700. applyProjection: function(e) {
  38701. var t = this.x
  38702. , i = this.y
  38703. , n = this.z
  38704. , r = e.elements
  38705. , o = 1 / (r[3] * t + r[7] * i + r[11] * n + r[15]);
  38706. return this.x = (r[0] * t + r[4] * i + r[8] * n + r[12]) * o,
  38707. this.y = (r[1] * t + r[5] * i + r[9] * n + r[13]) * o,
  38708. this.z = (r[2] * t + r[6] * i + r[10] * n + r[14]) * o,
  38709. this
  38710. },
  38711. applyQuaternion: function(e) {
  38712. var t = this.x
  38713. , i = this.y
  38714. , n = this.z
  38715. , r = e.x
  38716. , o = e.y
  38717. , a = e.z
  38718. , s = e.w
  38719. , l = s * t + o * n - a * i
  38720. , c = s * i + a * t - r * n
  38721. , h = s * n + r * i - o * t
  38722. , u = -r * t - o * i - a * n;
  38723. return this.x = l * s + u * -r + c * -a - h * -o,
  38724. this.y = c * s + u * -o + h * -r - l * -a,
  38725. this.z = h * s + u * -a + l * -o - c * -r,
  38726. this
  38727. },
  38728. project: function(e) {
  38729. return void 0 === Oe && (Oe = new Ci.Matrix4),
  38730. Oe.multiplyMatrices(e.projectionMatrix, Oe.getInverse(e.matrixWorld)),
  38731. this.applyProjection(Oe)
  38732. },
  38733. unproject: function(e) {
  38734. return void 0 === Pe && (Pe = new Ci.Matrix4),
  38735. Pe.multiplyMatrices(e.matrixWorld, Pe.getInverse(e.projectionMatrix)),
  38736. this.applyProjection(Pe)
  38737. },
  38738. transformDirection: function(e) {
  38739. var t = this.x
  38740. , i = this.y
  38741. , n = this.z
  38742. , r = e.elements;
  38743. return this.x = r[0] * t + r[4] * i + r[8] * n,
  38744. this.y = r[1] * t + r[5] * i + r[9] * n,
  38745. this.z = r[2] * t + r[6] * i + r[10] * n,
  38746. this.normalize(),
  38747. this
  38748. },
  38749. divide: function(e) {
  38750. return this.x /= e.x,
  38751. this.y /= e.y,
  38752. this.z /= e.z,
  38753. this
  38754. },
  38755. divideScalar: function(e) {
  38756. return this.multiplyScalar(1 / e)
  38757. },
  38758. min: function(e) {
  38759. return this.x = Math.min(this.x, e.x),
  38760. this.y = Math.min(this.y, e.y),
  38761. this.z = Math.min(this.z, e.z),
  38762. this
  38763. },
  38764. max: function(e) {
  38765. return this.x = Math.max(this.x, e.x),
  38766. this.y = Math.max(this.y, e.y),
  38767. this.z = Math.max(this.z, e.z),
  38768. this
  38769. },
  38770. clamp: function(e, t) {
  38771. return this.x = Math.max(e.x, Math.min(t.x, this.x)),
  38772. this.y = Math.max(e.y, Math.min(t.y, this.y)),
  38773. this.z = Math.max(e.z, Math.min(t.z, this.z)),
  38774. this
  38775. },
  38776. clampScalar: function(e, t) {
  38777. return void 0 === Me && (Me = new Ci.Vector3,
  38778. Re = new Ci.Vector3),
  38779. Me.set(e, e, e),
  38780. Re.set(t, t, t),
  38781. this.clamp(Me, Re)
  38782. },
  38783. clampLength: function(e, t) {
  38784. var i = this.length();
  38785. return this.multiplyScalar(Math.max(e, Math.min(t, i)) / i),
  38786. this
  38787. },
  38788. floor: function() {
  38789. return this.x = Math.floor(this.x),
  38790. this.y = Math.floor(this.y),
  38791. this.z = Math.floor(this.z),
  38792. this
  38793. },
  38794. ceil: function() {
  38795. return this.x = Math.ceil(this.x),
  38796. this.y = Math.ceil(this.y),
  38797. this.z = Math.ceil(this.z),
  38798. this
  38799. },
  38800. round: function() {
  38801. return this.x = Math.round(this.x),
  38802. this.y = Math.round(this.y),
  38803. this.z = Math.round(this.z),
  38804. this
  38805. },
  38806. roundToZero: function() {
  38807. return this.x = this.x < 0 ? Math.ceil(this.x) : Math.floor(this.x),
  38808. this.y = this.y < 0 ? Math.ceil(this.y) : Math.floor(this.y),
  38809. this.z = this.z < 0 ? Math.ceil(this.z) : Math.floor(this.z),
  38810. this
  38811. },
  38812. negate: function() {
  38813. return this.x = -this.x,
  38814. this.y = -this.y,
  38815. this.z = -this.z,
  38816. this
  38817. },
  38818. dot: function(e) {
  38819. return this.x * e.x + this.y * e.y + this.z * e.z
  38820. },
  38821. lengthSq: function() {
  38822. return this.x * this.x + this.y * this.y + this.z * this.z
  38823. },
  38824. length: function() {
  38825. return Math.sqrt(this.x * this.x + this.y * this.y + this.z * this.z)
  38826. },
  38827. lengthManhattan: function() {
  38828. return Math.abs(this.x) + Math.abs(this.y) + Math.abs(this.z)
  38829. },
  38830. normalize: function() {
  38831. return this.divideScalar(this.length())
  38832. },
  38833. setLength: function(e) {
  38834. return this.multiplyScalar(e / this.length())
  38835. },
  38836. lerp: function(e, t) {
  38837. return this.x += (e.x - this.x) * t,
  38838. this.y += (e.y - this.y) * t,
  38839. this.z += (e.z - this.z) * t,
  38840. this
  38841. },
  38842. lerpVectors: function(e, t, i) {
  38843. return this.subVectors(t, e).multiplyScalar(i).add(e),
  38844. this
  38845. },
  38846. cross: function(e, t) {
  38847. if (void 0 !== t)
  38848. return console.warn("THREE.Vector3: .cross() now only accepts one argument. Use .crossVectors( a, b ) instead."),
  38849. this.crossVectors(e, t);
  38850. var i = this.x
  38851. , n = this.y
  38852. , r = this.z;
  38853. return this.x = n * e.z - r * e.y,
  38854. this.y = r * e.x - i * e.z,
  38855. this.z = i * e.y - n * e.x,
  38856. this
  38857. },
  38858. crossVectors: function(e, t) {
  38859. var i = e.x
  38860. , n = e.y
  38861. , r = e.z
  38862. , o = t.x
  38863. , a = t.y
  38864. , s = t.z;
  38865. return this.x = n * s - r * a,
  38866. this.y = r * o - i * s,
  38867. this.z = i * a - n * o,
  38868. this
  38869. },
  38870. projectOnVector: function(e) {
  38871. return void 0 === xe && (xe = new Ci.Vector3),
  38872. xe.copy(e).normalize(),
  38873. Se = this.dot(xe),
  38874. this.copy(xe).multiplyScalar(Se)
  38875. },
  38876. projectOnPlane: function(e) {
  38877. return void 0 === Te && (Te = new Ci.Vector3),
  38878. Te.copy(this).projectOnVector(e),
  38879. this.sub(Te)
  38880. },
  38881. reflect: function(e) {
  38882. return void 0 === we && (we = new Ci.Vector3),
  38883. this.sub(we.copy(e).multiplyScalar(2 * this.dot(e)))
  38884. },
  38885. angleTo: function(e) {
  38886. var t = this.dot(e) / Math.sqrt(this.lengthSq() * e.lengthSq());
  38887. return Math.acos(Ci.Math.clamp(t, -1, 1))
  38888. },
  38889. distanceTo: function(e) {
  38890. return Math.sqrt(this.distanceToSquared(e))
  38891. },
  38892. distanceToSquared: function(e) {
  38893. var t = this.x - e.x
  38894. , i = this.y - e.y
  38895. , n = this.z - e.z;
  38896. return t * t + i * i + n * n
  38897. },
  38898. setFromSpherical: function(e) {
  38899. var t = Math.sin(e.phi) * e.radius;
  38900. return this.x = t * Math.sin(e.theta),
  38901. this.y = Math.cos(e.phi) * e.radius,
  38902. this.z = t * Math.cos(e.theta),
  38903. this
  38904. },
  38905. setFromMatrixPosition: function(e) {
  38906. return this.setFromMatrixColumn(e, 3)
  38907. },
  38908. setFromMatrixScale: function(e) {
  38909. var t = this.setFromMatrixColumn(e, 0).length()
  38910. , i = this.setFromMatrixColumn(e, 1).length()
  38911. , n = this.setFromMatrixColumn(e, 2).length();
  38912. return this.x = t,
  38913. this.y = i,
  38914. this.z = n,
  38915. this
  38916. },
  38917. setFromMatrixColumn: function(e, t) {
  38918. return "number" == typeof e && (console.warn("THREE.Vector3: setFromMatrixColumn now expects ( matrix, index )."),
  38919. t = e = t),
  38920. this.fromArray(e.elements, 4 * t)
  38921. },
  38922. equals: function(e) {
  38923. return e.x === this.x && e.y === this.y && e.z === this.z
  38924. },
  38925. fromArray: function(e, t) {
  38926. return void 0 === t && (t = 0),
  38927. this.x = e[t],
  38928. this.y = e[t + 1],
  38929. this.z = e[t + 2],
  38930. this
  38931. },
  38932. toArray: function(e, t) {
  38933. return void 0 === e && (e = []),
  38934. void 0 === t && (t = 0),
  38935. e[t] = this.x,
  38936. e[t + 1] = this.y,
  38937. e[t + 2] = this.z,
  38938. e
  38939. },
  38940. fromAttribute: function(e, t, i) {
  38941. return void 0 === i && (i = 0),
  38942. t = t * e.itemSize + i,
  38943. this.x = e.array[t],
  38944. this.y = e.array[t + 1],
  38945. this.z = e.array[t + 2],
  38946. this
  38947. }
  38948. },
  38949. Ci.Vector4 = function(e, t, i, n) {
  38950. this.x = e || 0,
  38951. this.y = t || 0,
  38952. this.z = i || 0,
  38953. this.w = void 0 !== n ? n : 1
  38954. }
  38955. ,
  38956. Ci.Vector4.prototype = {
  38957. constructor: Ci.Vector4,
  38958. set: function(e, t, i, n) {
  38959. return this.x = e,
  38960. this.y = t,
  38961. this.z = i,
  38962. this.w = n,
  38963. this
  38964. },
  38965. setScalar: function(e) {
  38966. return this.x = e,
  38967. this.y = e,
  38968. this.z = e,
  38969. this.w = e,
  38970. this
  38971. },
  38972. setX: function(e) {
  38973. return this.x = e,
  38974. this
  38975. },
  38976. setY: function(e) {
  38977. return this.y = e,
  38978. this
  38979. },
  38980. setZ: function(e) {
  38981. return this.z = e,
  38982. this
  38983. },
  38984. setW: function(e) {
  38985. return this.w = e,
  38986. this
  38987. },
  38988. setComponent: function(e, t) {
  38989. switch (e) {
  38990. case 0:
  38991. this.x = t;
  38992. break;
  38993. case 1:
  38994. this.y = t;
  38995. break;
  38996. case 2:
  38997. this.z = t;
  38998. break;
  38999. case 3:
  39000. this.w = t;
  39001. break;
  39002. default:
  39003. throw new Error("index is out of range: " + e)
  39004. }
  39005. },
  39006. getComponent: function(e) {
  39007. switch (e) {
  39008. case 0:
  39009. return this.x;
  39010. case 1:
  39011. return this.y;
  39012. case 2:
  39013. return this.z;
  39014. case 3:
  39015. return this.w;
  39016. default:
  39017. throw new Error("index is out of range: " + e)
  39018. }
  39019. },
  39020. clone: function() {
  39021. return new this.constructor(this.x,this.y,this.z,this.w)
  39022. },
  39023. copy: function(e) {
  39024. return this.x = e.x,
  39025. this.y = e.y,
  39026. this.z = e.z,
  39027. this.w = void 0 !== e.w ? e.w : 1,
  39028. this
  39029. },
  39030. add: function(e, t) {
  39031. return void 0 !== t ? (console.warn("THREE.Vector4: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),
  39032. this.addVectors(e, t)) : (this.x += e.x,
  39033. this.y += e.y,
  39034. this.z += e.z,
  39035. this.w += e.w,
  39036. this)
  39037. },
  39038. addScalar: function(e) {
  39039. return this.x += e,
  39040. this.y += e,
  39041. this.z += e,
  39042. this.w += e,
  39043. this
  39044. },
  39045. addVectors: function(e, t) {
  39046. return this.x = e.x + t.x,
  39047. this.y = e.y + t.y,
  39048. this.z = e.z + t.z,
  39049. this.w = e.w + t.w,
  39050. this
  39051. },
  39052. addScaledVector: function(e, t) {
  39053. return this.x += e.x * t,
  39054. this.y += e.y * t,
  39055. this.z += e.z * t,
  39056. this.w += e.w * t,
  39057. this
  39058. },
  39059. sub: function(e, t) {
  39060. return void 0 !== t ? (console.warn("THREE.Vector4: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),
  39061. this.subVectors(e, t)) : (this.x -= e.x,
  39062. this.y -= e.y,
  39063. this.z -= e.z,
  39064. this.w -= e.w,
  39065. this)
  39066. },
  39067. subScalar: function(e) {
  39068. return this.x -= e,
  39069. this.y -= e,
  39070. this.z -= e,
  39071. this.w -= e,
  39072. this
  39073. },
  39074. subVectors: function(e, t) {
  39075. return this.x = e.x - t.x,
  39076. this.y = e.y - t.y,
  39077. this.z = e.z - t.z,
  39078. this.w = e.w - t.w,
  39079. this
  39080. },
  39081. multiplyScalar: function(e) {
  39082. return isFinite(e) ? (this.x *= e,
  39083. this.y *= e,
  39084. this.z *= e,
  39085. this.w *= e) : (this.x = 0,
  39086. this.y = 0,
  39087. this.z = 0,
  39088. this.w = 0),
  39089. this
  39090. },
  39091. applyMatrix4: function(e) {
  39092. var t = this.x
  39093. , i = this.y
  39094. , n = this.z
  39095. , r = this.w
  39096. , o = e.elements;
  39097. return this.x = o[0] * t + o[4] * i + o[8] * n + o[12] * r,
  39098. this.y = o[1] * t + o[5] * i + o[9] * n + o[13] * r,
  39099. this.z = o[2] * t + o[6] * i + o[10] * n + o[14] * r,
  39100. this.w = o[3] * t + o[7] * i + o[11] * n + o[15] * r,
  39101. this
  39102. },
  39103. divideScalar: function(e) {
  39104. return this.multiplyScalar(1 / e)
  39105. },
  39106. setAxisAngleFromQuaternion: function(e) {
  39107. this.w = 2 * Math.acos(e.w);
  39108. var t = Math.sqrt(1 - e.w * e.w);
  39109. return t < 1e-4 ? (this.x = 1,
  39110. this.y = 0,
  39111. this.z = 0) : (this.x = e.x / t,
  39112. this.y = e.y / t,
  39113. this.z = e.z / t),
  39114. this
  39115. },
  39116. setAxisAngleFromRotationMatrix: function(e) {
  39117. 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];
  39118. if (Math.abs(s - c) < .01 && Math.abs(l - d) < .01 && Math.abs(u - p) < .01) {
  39119. if (Math.abs(s + c) < .1 && Math.abs(l + d) < .1 && Math.abs(u + p) < .1 && Math.abs(a + h + f - 3) < .1)
  39120. return this.set(1, 0, 0, 0),
  39121. this;
  39122. t = Math.PI;
  39123. var g = (a + 1) / 2
  39124. , m = (h + 1) / 2
  39125. , v = (f + 1) / 2
  39126. , y = (s + c) / 4
  39127. , A = (l + d) / 4
  39128. , C = (u + p) / 4;
  39129. return m < g && v < g ? r = g < .01 ? (i = 0,
  39130. n = .707106781) : (n = y / (i = Math.sqrt(g)),
  39131. A / i) : v < m ? r = m < .01 ? (n = 0,
  39132. i = .707106781) : (i = y / (n = Math.sqrt(m)),
  39133. C / n) : v < .01 ? (n = i = .707106781,
  39134. r = 0) : (i = A / (r = Math.sqrt(v)),
  39135. n = C / r),
  39136. this.set(i, n, r, t),
  39137. this
  39138. }
  39139. var I = Math.sqrt((p - u) * (p - u) + (l - d) * (l - d) + (c - s) * (c - s));
  39140. return Math.abs(I) < .001 && (I = 1),
  39141. this.x = (p - u) / I,
  39142. this.y = (l - d) / I,
  39143. this.z = (c - s) / I,
  39144. this.w = Math.acos((a + h + f - 1) / 2),
  39145. this
  39146. },
  39147. min: function(e) {
  39148. return this.x = Math.min(this.x, e.x),
  39149. this.y = Math.min(this.y, e.y),
  39150. this.z = Math.min(this.z, e.z),
  39151. this.w = Math.min(this.w, e.w),
  39152. this
  39153. },
  39154. max: function(e) {
  39155. return this.x = Math.max(this.x, e.x),
  39156. this.y = Math.max(this.y, e.y),
  39157. this.z = Math.max(this.z, e.z),
  39158. this.w = Math.max(this.w, e.w),
  39159. this
  39160. },
  39161. clamp: function(e, t) {
  39162. return this.x = Math.max(e.x, Math.min(t.x, this.x)),
  39163. this.y = Math.max(e.y, Math.min(t.y, this.y)),
  39164. this.z = Math.max(e.z, Math.min(t.z, this.z)),
  39165. this.w = Math.max(e.w, Math.min(t.w, this.w)),
  39166. this
  39167. },
  39168. clampScalar: function(e, t) {
  39169. return void 0 === _e && (_e = new Ci.Vector4,
  39170. be = new Ci.Vector4),
  39171. _e.set(e, e, e, e),
  39172. be.set(t, t, t, t),
  39173. this.clamp(_e, be)
  39174. },
  39175. floor: function() {
  39176. return this.x = Math.floor(this.x),
  39177. this.y = Math.floor(this.y),
  39178. this.z = Math.floor(this.z),
  39179. this.w = Math.floor(this.w),
  39180. this
  39181. },
  39182. ceil: function() {
  39183. return this.x = Math.ceil(this.x),
  39184. this.y = Math.ceil(this.y),
  39185. this.z = Math.ceil(this.z),
  39186. this.w = Math.ceil(this.w),
  39187. this
  39188. },
  39189. round: function() {
  39190. return this.x = Math.round(this.x),
  39191. this.y = Math.round(this.y),
  39192. this.z = Math.round(this.z),
  39193. this.w = Math.round(this.w),
  39194. this
  39195. },
  39196. roundToZero: function() {
  39197. return this.x = this.x < 0 ? Math.ceil(this.x) : Math.floor(this.x),
  39198. this.y = this.y < 0 ? Math.ceil(this.y) : Math.floor(this.y),
  39199. this.z = this.z < 0 ? Math.ceil(this.z) : Math.floor(this.z),
  39200. this.w = this.w < 0 ? Math.ceil(this.w) : Math.floor(this.w),
  39201. this
  39202. },
  39203. negate: function() {
  39204. return this.x = -this.x,
  39205. this.y = -this.y,
  39206. this.z = -this.z,
  39207. this.w = -this.w,
  39208. this
  39209. },
  39210. dot: function(e) {
  39211. return this.x * e.x + this.y * e.y + this.z * e.z + this.w * e.w
  39212. },
  39213. lengthSq: function() {
  39214. return this.x * this.x + this.y * this.y + this.z * this.z + this.w * this.w
  39215. },
  39216. length: function() {
  39217. return Math.sqrt(this.x * this.x + this.y * this.y + this.z * this.z + this.w * this.w)
  39218. },
  39219. lengthManhattan: function() {
  39220. return Math.abs(this.x) + Math.abs(this.y) + Math.abs(this.z) + Math.abs(this.w)
  39221. },
  39222. normalize: function() {
  39223. return this.divideScalar(this.length())
  39224. },
  39225. setLength: function(e) {
  39226. return this.multiplyScalar(e / this.length())
  39227. },
  39228. lerp: function(e, t) {
  39229. return this.x += (e.x - this.x) * t,
  39230. this.y += (e.y - this.y) * t,
  39231. this.z += (e.z - this.z) * t,
  39232. this.w += (e.w - this.w) * t,
  39233. this
  39234. },
  39235. lerpVectors: function(e, t, i) {
  39236. return this.subVectors(t, e).multiplyScalar(i).add(e),
  39237. this
  39238. },
  39239. equals: function(e) {
  39240. return e.x === this.x && e.y === this.y && e.z === this.z && e.w === this.w
  39241. },
  39242. fromArray: function(e, t) {
  39243. return void 0 === t && (t = 0),
  39244. this.x = e[t],
  39245. this.y = e[t + 1],
  39246. this.z = e[t + 2],
  39247. this.w = e[t + 3],
  39248. this
  39249. },
  39250. toArray: function(e, t) {
  39251. return void 0 === e && (e = []),
  39252. void 0 === t && (t = 0),
  39253. e[t] = this.x,
  39254. e[t + 1] = this.y,
  39255. e[t + 2] = this.z,
  39256. e[t + 3] = this.w,
  39257. e
  39258. },
  39259. fromAttribute: function(e, t, i) {
  39260. return void 0 === i && (i = 0),
  39261. t = t * e.itemSize + i,
  39262. this.x = e.array[t],
  39263. this.y = e.array[t + 1],
  39264. this.z = e.array[t + 2],
  39265. this.w = e.array[t + 3],
  39266. this
  39267. }
  39268. },
  39269. Ci.Euler = function(e, t, i, n) {
  39270. this._x = e || 0,
  39271. this._y = t || 0,
  39272. this._z = i || 0,
  39273. this._order = n || Ci.Euler.DefaultOrder
  39274. }
  39275. ,
  39276. Ci.Euler.RotationOrders = ["XYZ", "YZX", "ZXY", "XZY", "YXZ", "ZYX"],
  39277. Ci.Euler.DefaultOrder = "XYZ",
  39278. Ci.Euler.prototype = {
  39279. constructor: Ci.Euler,
  39280. get x() {
  39281. return this._x
  39282. },
  39283. set x(e) {
  39284. this._x = e,
  39285. this.onChangeCallback()
  39286. },
  39287. get y() {
  39288. return this._y
  39289. },
  39290. set y(e) {
  39291. this._y = e,
  39292. this.onChangeCallback()
  39293. },
  39294. get z() {
  39295. return this._z
  39296. },
  39297. set z(e) {
  39298. this._z = e,
  39299. this.onChangeCallback()
  39300. },
  39301. get order() {
  39302. return this._order
  39303. },
  39304. set order(e) {
  39305. this._order = e,
  39306. this.onChangeCallback()
  39307. },
  39308. set: function(e, t, i, n) {
  39309. return this._x = e,
  39310. this._y = t,
  39311. this._z = i,
  39312. this._order = n || this._order,
  39313. this.onChangeCallback(),
  39314. this
  39315. },
  39316. clone: function() {
  39317. return new this.constructor(this._x,this._y,this._z,this._order)
  39318. },
  39319. copy: function(e) {
  39320. return this._x = e._x,
  39321. this._y = e._y,
  39322. this._z = e._z,
  39323. this._order = e._order,
  39324. this.onChangeCallback(),
  39325. this
  39326. },
  39327. toObject: function() {//xzw
  39328. return {x:this.x,y:this.y,z:this.z}
  39329. },
  39330. setFromRotationMatrix: function(e, t, i) {
  39331. var n = Ci.Math.clamp
  39332. , r = e.elements
  39333. , o = r[0]
  39334. , a = r[4]
  39335. , s = r[8]
  39336. , l = r[1]
  39337. , c = r[5]
  39338. , h = r[9]
  39339. , u = r[2]
  39340. , d = r[6]
  39341. , p = r[10];
  39342. return "XYZ" === (t = t || this._order) ? (this._y = Math.asin(n(s, -1, 1)),
  39343. Math.abs(s) < .99999 ? (this._x = Math.atan2(-h, p),
  39344. this._z = Math.atan2(-a, o)) : (this._x = Math.atan2(d, c),
  39345. this._z = 0)) : "YXZ" === t ? (this._x = Math.asin(-n(h, -1, 1)),
  39346. Math.abs(h) < .99999 ? (this._y = Math.atan2(s, p),
  39347. this._z = Math.atan2(l, c)) : (this._y = Math.atan2(-u, o),
  39348. this._z = 0)) : "ZXY" === t ? (this._x = Math.asin(n(d, -1, 1)),
  39349. Math.abs(d) < .99999 ? (this._y = Math.atan2(-u, p),
  39350. this._z = Math.atan2(-a, c)) : (this._y = 0,
  39351. this._z = Math.atan2(l, o))) : "ZYX" === t ? (this._y = Math.asin(-n(u, -1, 1)),
  39352. Math.abs(u) < .99999 ? (this._x = Math.atan2(d, p),
  39353. this._z = Math.atan2(l, o)) : (this._x = 0,
  39354. this._z = Math.atan2(-a, c))) : "YZX" === t ? (this._z = Math.asin(n(l, -1, 1)),
  39355. Math.abs(l) < .99999 ? (this._x = Math.atan2(-h, c),
  39356. this._y = Math.atan2(-u, o)) : (this._x = 0,
  39357. this._y = Math.atan2(s, p))) : "XZY" === t ? (this._z = Math.asin(-n(a, -1, 1)),
  39358. Math.abs(a) < .99999 ? (this._x = Math.atan2(d, c),
  39359. this._y = Math.atan2(s, o)) : (this._x = Math.atan2(-h, p),
  39360. this._y = 0)) : console.warn("THREE.Euler: .setFromRotationMatrix() given unsupported order: " + t),
  39361. this._order = t,
  39362. !1 !== i && this.onChangeCallback(),
  39363. this
  39364. },
  39365. setFromQuaternion: function(e, t, i) {
  39366. return void 0 === Ee && (Ee = new Ci.Matrix4),
  39367. Ee.makeRotationFromQuaternion(e),
  39368. this.setFromRotationMatrix(Ee, t, i),
  39369. this
  39370. },
  39371. setFromVector3: function(e, t) {
  39372. return this.set(e.x, e.y, e.z, t || this._order)
  39373. },
  39374. reorder: (Ie = new Ci.Quaternion,
  39375. function(e) {
  39376. Ie.setFromEuler(this),
  39377. this.setFromQuaternion(Ie, e)
  39378. }
  39379. ),
  39380. equals: function(e) {
  39381. return e._x === this._x && e._y === this._y && e._z === this._z && e._order === this._order
  39382. },
  39383. fromArray: function(e) {
  39384. return this._x = e[0],
  39385. this._y = e[1],
  39386. this._z = e[2],
  39387. void 0 !== e[3] && (this._order = e[3]),
  39388. this.onChangeCallback(),
  39389. this
  39390. },
  39391. toArray: function(e, t) {
  39392. return void 0 === e && (e = []),
  39393. void 0 === t && (t = 0),
  39394. e[t] = this._x,
  39395. e[t + 1] = this._y,
  39396. e[t + 2] = this._z,
  39397. e[t + 3] = this._order,
  39398. e
  39399. },
  39400. toVector3: function(e) {
  39401. return e ? e.set(this._x, this._y, this._z) : new Ci.Vector3(this._x,this._y,this._z)
  39402. },
  39403. onChange: function(e) {
  39404. return this.onChangeCallback = e,
  39405. this
  39406. },
  39407. onChangeCallback: function() {}
  39408. },
  39409. Ci.Line3 = function(e, t) {
  39410. this.start = void 0 !== e ? e : new Ci.Vector3,
  39411. this.end = void 0 !== t ? t : new Ci.Vector3
  39412. }
  39413. ,
  39414. Ci.Line3.prototype = {
  39415. constructor: Ci.Line3,
  39416. set: function(e, t) {
  39417. return this.start.copy(e),
  39418. this.end.copy(t),
  39419. this
  39420. },
  39421. clone: function() {
  39422. return (new this.constructor).copy(this)
  39423. },
  39424. copy: function(e) {
  39425. return this.start.copy(e.start),
  39426. this.end.copy(e.end),
  39427. this
  39428. },
  39429. center: function(e) {
  39430. return (e || new Ci.Vector3).addVectors(this.start, this.end).multiplyScalar(.5)
  39431. },
  39432. delta: function(e) {
  39433. return (e || new Ci.Vector3).subVectors(this.end, this.start)
  39434. },
  39435. distanceSq: function() {
  39436. return this.start.distanceToSquared(this.end)
  39437. },
  39438. distance: function() {
  39439. return this.start.distanceTo(this.end)
  39440. },
  39441. at: function(e, t) {
  39442. var i = t || new Ci.Vector3;
  39443. return this.delta(i).multiplyScalar(e).add(this.start)
  39444. },
  39445. closestPointToPointParameter: (Ae = new Ci.Vector3,
  39446. Ce = new Ci.Vector3,
  39447. function(e, t) {
  39448. Ae.subVectors(e, this.start),
  39449. Ce.subVectors(this.end, this.start);
  39450. var i = Ce.dot(Ce)
  39451. , n = Ce.dot(Ae) / i;
  39452. return t && (n = Ci.Math.clamp(n, 0, 1)),
  39453. n
  39454. }
  39455. ),
  39456. closestPointToPoint: function(e, t, i) {
  39457. var n = this.closestPointToPointParameter(e, t)
  39458. , r = i || new Ci.Vector3;
  39459. return this.delta(r).multiplyScalar(n).add(this.start)
  39460. },
  39461. applyMatrix4: function(e) {
  39462. return this.start.applyMatrix4(e),
  39463. this.end.applyMatrix4(e),
  39464. this
  39465. },
  39466. equals: function(e) {
  39467. return e.start.equals(this.start) && e.end.equals(this.end)
  39468. }
  39469. },
  39470. Ci.Box2 = function(e, t) {
  39471. this.min = void 0 !== e ? e : new Ci.Vector2(1 / 0,1 / 0),
  39472. this.max = void 0 !== t ? t : new Ci.Vector2(-1 / 0,-1 / 0)
  39473. }
  39474. ,
  39475. Ci.Box2.prototype = {
  39476. constructor: Ci.Box2,
  39477. set: function(e, t) {
  39478. return this.min.copy(e),
  39479. this.max.copy(t),
  39480. this
  39481. },
  39482. setFromPoints: function(e) {
  39483. this.makeEmpty();
  39484. for (var t = 0, i = e.length; t < i; t++)
  39485. this.expandByPoint(e[t]);
  39486. return this
  39487. },
  39488. setFromCenterAndSize: (ye = new Ci.Vector2,
  39489. function(e, t) {
  39490. var i = ye.copy(t).multiplyScalar(.5);
  39491. return this.min.copy(e).sub(i),
  39492. this.max.copy(e).add(i),
  39493. this
  39494. }
  39495. ),
  39496. clone: function() {
  39497. return (new this.constructor).copy(this)
  39498. },
  39499. copy: function(e) {
  39500. return this.min.copy(e.min),
  39501. this.max.copy(e.max),
  39502. this
  39503. },
  39504. makeEmpty: function() {
  39505. return this.min.x = this.min.y = 1 / 0,
  39506. this.max.x = this.max.y = -1 / 0,
  39507. this
  39508. },
  39509. isEmpty: function() {
  39510. return this.max.x < this.min.x || this.max.y < this.min.y
  39511. },
  39512. center: function(e) {
  39513. return (e || new Ci.Vector2).addVectors(this.min, this.max).multiplyScalar(.5)
  39514. },
  39515. size: function(e) {
  39516. return (e || new Ci.Vector2).subVectors(this.max, this.min)
  39517. },
  39518. expandByPoint: function(e) {
  39519. return this.min.min(e),
  39520. this.max.max(e),
  39521. this
  39522. },
  39523. expandByVector: function(e) {
  39524. return this.min.sub(e),
  39525. this.max.add(e),
  39526. this
  39527. },
  39528. expandByScalar: function(e) {
  39529. return this.min.addScalar(-e),
  39530. this.max.addScalar(e),
  39531. this
  39532. },
  39533. containsPoint: function(e) {
  39534. return !(e.x < this.min.x || e.x > this.max.x || e.y < this.min.y || e.y > this.max.y)
  39535. },
  39536. containsBox: function(e) {
  39537. 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
  39538. },
  39539. getParameter: function(e, t) {
  39540. 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))
  39541. },
  39542. intersectsBox: function(e) {
  39543. 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)
  39544. },
  39545. clampPoint: function(e, t) {
  39546. return (t || new Ci.Vector2).copy(e).clamp(this.min, this.max)
  39547. },
  39548. distanceToPoint: (ve = new Ci.Vector2,
  39549. function(e) {
  39550. return ve.copy(e).clamp(this.min, this.max).sub(e).length()
  39551. }
  39552. ),
  39553. intersect: function(e) {
  39554. return this.min.max(e.min),
  39555. this.max.min(e.max),
  39556. this
  39557. },
  39558. union: function(e) {
  39559. return this.min.min(e.min),
  39560. this.max.max(e.max),
  39561. this
  39562. },
  39563. translate: function(e) {
  39564. return this.min.add(e),
  39565. this.max.add(e),
  39566. this
  39567. },
  39568. equals: function(e) {
  39569. return e.min.equals(this.min) && e.max.equals(this.max)
  39570. }
  39571. },
  39572. Ci.Box3 = function(e, t) {
  39573. this.min = void 0 !== e ? e : new Ci.Vector3(1 / 0,1 / 0,1 / 0),
  39574. this.max = void 0 !== t ? t : new Ci.Vector3(-1 / 0,-1 / 0,-1 / 0)
  39575. }
  39576. ,
  39577. Ci.Box3.prototype = {
  39578. constructor: Ci.Box3,
  39579. set: function(e, t) {
  39580. return this.min.copy(e),
  39581. this.max.copy(t),
  39582. this
  39583. },
  39584. setFromArray: function(e) {
  39585. this.makeEmpty();
  39586. 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) {
  39587. var c = e[s]
  39588. , h = e[s + 1]
  39589. , u = e[s + 2];
  39590. c < t && (t = c),
  39591. h < i && (i = h),
  39592. u < n && (n = u),
  39593. r < c && (r = c),
  39594. o < h && (o = h),
  39595. a < u && (a = u)
  39596. }
  39597. this.min.set(t, i, n),
  39598. this.max.set(r, o, a)
  39599. },
  39600. setFromPoints: function(e) {
  39601. this.makeEmpty();
  39602. for (var t = 0, i = e.length; t < i; t++)
  39603. this.expandByPoint(e[t]);
  39604. return this
  39605. },
  39606. setFromCenterAndSize: (me = new Ci.Vector3,
  39607. function(e, t) {
  39608. var i = me.copy(t).multiplyScalar(.5);
  39609. return this.min.copy(e).sub(i),
  39610. this.max.copy(e).add(i),
  39611. this
  39612. }
  39613. ),
  39614. setFromObject: function(e) {
  39615. void 0 === ge && (ge = new Ci.Box3);
  39616. var i = this;
  39617. return this.makeEmpty(),
  39618. e.updateMatrixWorld(!0),
  39619. e.traverse(function(e) {
  39620. var t = e.geometry;
  39621. void 0 !== t && (null === t.boundingBox && t.computeBoundingBox(),
  39622. !1 === t.boundingBox.isEmpty() && (ge.copy(t.boundingBox),
  39623. ge.applyMatrix4(e.matrixWorld),
  39624. i.union(ge)))
  39625. }),
  39626. this
  39627. },
  39628. clone: function() {
  39629. return (new this.constructor).copy(this)
  39630. },
  39631. copy: function(e) {
  39632. return this.min.copy(e.min),
  39633. this.max.copy(e.max),
  39634. this
  39635. },
  39636. makeEmpty: function() {
  39637. return this.min.x = this.min.y = this.min.z = 1 / 0,
  39638. this.max.x = this.max.y = this.max.z = -1 / 0,
  39639. this
  39640. },
  39641. isEmpty: function() {
  39642. return this.max.x < this.min.x || this.max.y < this.min.y || this.max.z < this.min.z
  39643. },
  39644. center: function(e) {
  39645. return (e || new Ci.Vector3).addVectors(this.min, this.max).multiplyScalar(.5)
  39646. },
  39647. size: function(e) {
  39648. return (e || new Ci.Vector3).subVectors(this.max, this.min)
  39649. },
  39650. expandByPoint: function(e) {
  39651. return this.min.min(e),
  39652. this.max.max(e),
  39653. this
  39654. },
  39655. expandByVector: function(e) {
  39656. return this.min.sub(e),
  39657. this.max.add(e),
  39658. this
  39659. },
  39660. expandByScalar: function(e) {
  39661. return this.min.addScalar(-e),
  39662. this.max.addScalar(e),
  39663. this
  39664. },
  39665. containsPoint: function(e) {
  39666. 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)
  39667. },
  39668. containsBox: function(e) {
  39669. 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
  39670. },
  39671. getParameter: function(e, t) {
  39672. 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))
  39673. },
  39674. intersectsBox: function(e) {
  39675. 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)
  39676. },
  39677. intersectsSphere: function(e) {
  39678. return void 0 === fe && (fe = new Ci.Vector3),
  39679. this.clampPoint(e.center, fe),
  39680. fe.distanceToSquared(e.center) <= e.radius * e.radius
  39681. },
  39682. intersectsPlane: function(e) {
  39683. var t, i;
  39684. return i = 0 < e.normal.x ? (t = e.normal.x * this.min.x,
  39685. e.normal.x * this.max.x) : (t = e.normal.x * this.max.x,
  39686. e.normal.x * this.min.x),
  39687. 0 < e.normal.y ? (t += e.normal.y * this.min.y,
  39688. i += e.normal.y * this.max.y) : (t += e.normal.y * this.max.y,
  39689. i += e.normal.y * this.min.y),
  39690. 0 < e.normal.z ? (t += e.normal.z * this.min.z,
  39691. i += e.normal.z * this.max.z) : (t += e.normal.z * this.max.z,
  39692. i += e.normal.z * this.min.z),
  39693. t <= e.constant && i >= e.constant
  39694. },
  39695. clampPoint: function(e, t) {
  39696. return (t || new Ci.Vector3).copy(e).clamp(this.min, this.max)
  39697. },
  39698. distanceToPoint: (pe = new Ci.Vector3,
  39699. function(e) {
  39700. return pe.copy(e).clamp(this.min, this.max).sub(e).length()
  39701. }
  39702. ),
  39703. getBoundingSphere: (de = new Ci.Vector3,
  39704. function(e) {
  39705. var t = e || new Ci.Sphere;
  39706. return t.center = this.center(),
  39707. t.radius = .5 * this.size(de).length(),
  39708. t
  39709. }
  39710. ),
  39711. intersect: function(e) {
  39712. return this.min.max(e.min),
  39713. this.max.min(e.max),
  39714. this
  39715. },
  39716. union: function(e) {
  39717. return this.min.min(e.min),
  39718. this.max.max(e.max),
  39719. this
  39720. },
  39721. 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],
  39722. function(e) {
  39723. return ue[0].set(this.min.x, this.min.y, this.min.z).applyMatrix4(e),
  39724. ue[1].set(this.min.x, this.min.y, this.max.z).applyMatrix4(e),
  39725. ue[2].set(this.min.x, this.max.y, this.min.z).applyMatrix4(e),
  39726. ue[3].set(this.min.x, this.max.y, this.max.z).applyMatrix4(e),
  39727. ue[4].set(this.max.x, this.min.y, this.min.z).applyMatrix4(e),
  39728. ue[5].set(this.max.x, this.min.y, this.max.z).applyMatrix4(e),
  39729. ue[6].set(this.max.x, this.max.y, this.min.z).applyMatrix4(e),
  39730. ue[7].set(this.max.x, this.max.y, this.max.z).applyMatrix4(e),
  39731. this.makeEmpty(),
  39732. this.setFromPoints(ue),
  39733. this
  39734. }
  39735. ),
  39736. translate: function(e) {
  39737. return this.min.add(e),
  39738. this.max.add(e),
  39739. this
  39740. },
  39741. equals: function(e) {
  39742. return e.min.equals(this.min) && e.max.equals(this.max)
  39743. }
  39744. },
  39745. Ci.Matrix3 = function() {
  39746. this.elements = new Float32Array([1, 0, 0, 0, 1, 0, 0, 0, 1]),
  39747. 0 < arguments.length && console.error("THREE.Matrix3: the constructor no longer reads arguments. use .set() instead.")
  39748. }
  39749. ,
  39750. Ci.Matrix3.prototype = {
  39751. constructor: Ci.Matrix3,
  39752. set: function(e, t, i, n, r, o, a, s, l) {
  39753. var c = this.elements;
  39754. return c[0] = e,
  39755. c[1] = n,
  39756. c[2] = a,
  39757. c[3] = t,
  39758. c[4] = r,
  39759. c[5] = s,
  39760. c[6] = i,
  39761. c[7] = o,
  39762. c[8] = l,
  39763. this
  39764. },
  39765. identity: function() {
  39766. return this.set(1, 0, 0, 0, 1, 0, 0, 0, 1),
  39767. this
  39768. },
  39769. clone: function() {
  39770. return (new this.constructor).fromArray(this.elements)
  39771. },
  39772. copy: function(e) {
  39773. var t = e.elements;
  39774. return this.set(t[0], t[3], t[6], t[1], t[4], t[7], t[2], t[5], t[8]),
  39775. this
  39776. },
  39777. setFromMatrix4: function(e) {
  39778. var t = e.elements;
  39779. return this.set(t[0], t[4], t[8], t[1], t[5], t[9], t[2], t[6], t[10]),
  39780. this
  39781. },
  39782. applyToVector3Array: function(e, t, i) {
  39783. void 0 === he && (he = new Ci.Vector3),
  39784. void 0 === t && (t = 0),
  39785. void 0 === i && (i = e.length);
  39786. for (var n = 0, r = t; n < i; n += 3,
  39787. r += 3)
  39788. he.fromArray(e, r),
  39789. he.applyMatrix3(this),
  39790. he.toArray(e, r);
  39791. return e
  39792. },
  39793. applyToBuffer: function(e, t, i) {
  39794. void 0 === ce && (ce = new Ci.Vector3),
  39795. void 0 === t && (t = 0),
  39796. void 0 === i && (i = e.length / e.itemSize);
  39797. for (var n = 0, r = t; n < i; n++,
  39798. r++)
  39799. ce.x = e.getX(r),
  39800. ce.y = e.getY(r),
  39801. ce.z = e.getZ(r),
  39802. ce.applyMatrix3(this),
  39803. e.setXYZ(ce.x, ce.y, ce.z);
  39804. return e
  39805. },
  39806. multiplyScalar: function(e) {
  39807. var t = this.elements;
  39808. return t[0] *= e,
  39809. t[3] *= e,
  39810. t[6] *= e,
  39811. t[1] *= e,
  39812. t[4] *= e,
  39813. t[7] *= e,
  39814. t[2] *= e,
  39815. t[5] *= e,
  39816. t[8] *= e,
  39817. this
  39818. },
  39819. determinant: function() {
  39820. var e = this.elements
  39821. , t = e[0]
  39822. , i = e[1]
  39823. , n = e[2]
  39824. , r = e[3]
  39825. , o = e[4]
  39826. , a = e[5]
  39827. , s = e[6]
  39828. , l = e[7]
  39829. , c = e[8];
  39830. return t * o * c - t * a * l - i * r * c + i * a * s + n * r * l - n * o * s
  39831. },
  39832. getInverse: function(e, t) {
  39833. e instanceof Ci.Matrix4 && console.warn("THREE.Matrix3.getInverse no longer takes a Matrix4 argument.");
  39834. var i = e.elements
  39835. , n = this.elements
  39836. , r = i[0]
  39837. , o = i[1]
  39838. , a = i[2]
  39839. , s = i[3]
  39840. , l = i[4]
  39841. , c = i[5]
  39842. , h = i[6]
  39843. , u = i[7]
  39844. , d = i[8]
  39845. , p = d * l - c * u
  39846. , f = c * h - d * s
  39847. , g = u * s - l * h
  39848. , m = r * p + o * f + a * g;
  39849. if (0 != m)
  39850. return n[0] = p,
  39851. n[1] = a * u - d * o,
  39852. n[2] = c * o - a * l,
  39853. n[3] = f,
  39854. n[4] = d * r - a * h,
  39855. n[5] = a * s - c * r,
  39856. n[6] = g,
  39857. n[7] = o * h - u * r,
  39858. n[8] = l * r - o * s,
  39859. this.multiplyScalar(1 / m);
  39860. var v = "THREE.Matrix3.getInverse(): can't invert matrix, determinant is 0";
  39861. if (t)
  39862. throw new Error(v);
  39863. return this.identity()/* console.warn(v), *///许钟文删 boxHelper报的
  39864. },
  39865. transpose: function() {
  39866. var e, t = this.elements;
  39867. return e = t[1],
  39868. t[1] = t[3],
  39869. t[3] = e,
  39870. e = t[2],
  39871. t[2] = t[6],
  39872. t[6] = e,
  39873. e = t[5],
  39874. t[5] = t[7],
  39875. t[7] = e,
  39876. this
  39877. },
  39878. flattenToArrayOffset: function(e, t) {
  39879. var i = this.elements;
  39880. return e[t] = i[0],
  39881. e[t + 1] = i[1],
  39882. e[t + 2] = i[2],
  39883. e[t + 3] = i[3],
  39884. e[t + 4] = i[4],
  39885. e[t + 5] = i[5],
  39886. e[t + 6] = i[6],
  39887. e[t + 7] = i[7],
  39888. e[t + 8] = i[8],
  39889. e
  39890. },
  39891. getNormalMatrix: function(e) {
  39892. return this.setFromMatrix4(e).getInverse(this).transpose()
  39893. },
  39894. transposeIntoArray: function(e) {
  39895. var t = this.elements;
  39896. return e[0] = t[0],
  39897. e[1] = t[3],
  39898. e[2] = t[6],
  39899. e[3] = t[1],
  39900. e[4] = t[4],
  39901. e[5] = t[7],
  39902. e[6] = t[2],
  39903. e[7] = t[5],
  39904. e[8] = t[8],
  39905. this
  39906. },
  39907. fromArray: function(e) {
  39908. return this.elements.set(e),
  39909. this
  39910. },
  39911. toArray: function() {
  39912. var e = this.elements;
  39913. return [e[0], e[1], e[2], e[3], e[4], e[5], e[6], e[7], e[8]]
  39914. }
  39915. },
  39916. Ci.Matrix4 = function() {
  39917. this.elements = new Float32Array([1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1]),
  39918. 0 < arguments.length && console.error("THREE.Matrix4: the constructor no longer reads arguments. use .set() instead.")
  39919. }
  39920. ,
  39921. Ci.Matrix4.prototype = {
  39922. constructor: Ci.Matrix4,
  39923. set: function(e, t, i, n, r, o, a, s, l, c, h, u, d, p, f, g) {
  39924. var m = this.elements;
  39925. return m[0] = e,
  39926. m[4] = t,
  39927. m[8] = i,
  39928. m[12] = n,
  39929. m[1] = r,
  39930. m[5] = o,
  39931. m[9] = a,
  39932. m[13] = s,
  39933. m[2] = l,
  39934. m[6] = c,
  39935. m[10] = h,
  39936. m[14] = u,
  39937. m[3] = d,
  39938. m[7] = p,
  39939. m[11] = f,
  39940. m[15] = g,
  39941. this
  39942. },
  39943. identity: function() {
  39944. return this.set(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1),
  39945. this
  39946. },
  39947. clone: function() {
  39948. return (new Ci.Matrix4).fromArray(this.elements)
  39949. },
  39950. copy: function(e) {
  39951. return this.elements.set(e.elements),
  39952. this
  39953. },
  39954. copyPosition: function(e) {
  39955. var t = this.elements
  39956. , i = e.elements;
  39957. return t[12] = i[12],
  39958. t[13] = i[13],
  39959. t[14] = i[14],
  39960. this
  39961. },
  39962. extractBasis: function(e, t, i) {
  39963. return e.setFromMatrixColumn(this, 0),
  39964. t.setFromMatrixColumn(this, 1),
  39965. i.setFromMatrixColumn(this, 2),
  39966. this
  39967. },
  39968. makeBasis: function(e, t, i) {
  39969. 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),
  39970. this
  39971. },
  39972. extractRotation: function(e) {
  39973. void 0 === le && (le = new Ci.Vector3);
  39974. var t = this.elements
  39975. , i = e.elements
  39976. , n = 1 / le.setFromMatrixColumn(e, 0).length()
  39977. , r = 1 / le.setFromMatrixColumn(e, 1).length()
  39978. , o = 1 / le.setFromMatrixColumn(e, 2).length();
  39979. return t[0] = i[0] * n,
  39980. t[1] = i[1] * n,
  39981. t[2] = i[2] * n,
  39982. t[4] = i[4] * r,
  39983. t[5] = i[5] * r,
  39984. t[6] = i[6] * r,
  39985. t[8] = i[8] * o,
  39986. t[9] = i[9] * o,
  39987. t[10] = i[10] * o,
  39988. this
  39989. },
  39990. makeRotationFromEuler: function(e) {
  39991. e instanceof Ci.Euler == 0 && console.error("THREE.Matrix: .makeRotationFromEuler() now expects a Euler rotation rather than a Vector3 and order.");
  39992. var t = this.elements
  39993. , i = e.x
  39994. , n = e.y
  39995. , r = e.z
  39996. , o = Math.cos(i)
  39997. , a = Math.sin(i)
  39998. , s = Math.cos(n)
  39999. , l = Math.sin(n)
  40000. , c = Math.cos(r)
  40001. , h = Math.sin(r);
  40002. if ("XYZ" === e.order) {
  40003. var u = o * c
  40004. , d = o * h
  40005. , p = a * c
  40006. , f = a * h;
  40007. t[0] = s * c,
  40008. t[4] = -s * h,
  40009. t[8] = l,
  40010. t[1] = d + p * l,
  40011. t[5] = u - f * l,
  40012. t[9] = -a * s,
  40013. t[2] = f - u * l,
  40014. t[6] = p + d * l,
  40015. t[10] = o * s
  40016. } else if ("YXZ" === e.order) {
  40017. var g = s * c
  40018. , m = s * h
  40019. , v = l * c
  40020. , y = l * h;
  40021. t[0] = g + y * a,
  40022. t[4] = v * a - m,
  40023. t[8] = o * l,
  40024. t[1] = o * h,
  40025. t[5] = o * c,
  40026. t[9] = -a,
  40027. t[2] = m * a - v,
  40028. t[6] = y + g * a,
  40029. t[10] = o * s
  40030. } else if ("ZXY" === e.order) {
  40031. g = s * c,
  40032. m = s * h,
  40033. v = l * c,
  40034. y = l * h;
  40035. t[0] = g - y * a,
  40036. t[4] = -o * h,
  40037. t[8] = v + m * a,
  40038. t[1] = m + v * a,
  40039. t[5] = o * c,
  40040. t[9] = y - g * a,
  40041. t[2] = -o * l,
  40042. t[6] = a,
  40043. t[10] = o * s
  40044. } else if ("ZYX" === e.order) {
  40045. u = o * c,
  40046. d = o * h,
  40047. p = a * c,
  40048. f = a * h;
  40049. t[0] = s * c,
  40050. t[4] = p * l - d,
  40051. t[8] = u * l + f,
  40052. t[1] = s * h,
  40053. t[5] = f * l + u,
  40054. t[9] = d * l - p,
  40055. t[2] = -l,
  40056. t[6] = a * s,
  40057. t[10] = o * s
  40058. } else if ("YZX" === e.order) {
  40059. var A = o * s
  40060. , C = o * l
  40061. , I = a * s
  40062. , E = a * l;
  40063. t[0] = s * c,
  40064. t[4] = E - A * h,
  40065. t[8] = I * h + C,
  40066. t[1] = h,
  40067. t[5] = o * c,
  40068. t[9] = -a * c,
  40069. t[2] = -l * c,
  40070. t[6] = C * h + I,
  40071. t[10] = A - E * h
  40072. } else if ("XZY" === e.order) {
  40073. A = o * s,
  40074. C = o * l,
  40075. I = a * s,
  40076. E = a * l;
  40077. t[0] = s * c,
  40078. t[4] = -h,
  40079. t[8] = l * c,
  40080. t[1] = A * h + E,
  40081. t[5] = o * c,
  40082. t[9] = C * h - I,
  40083. t[2] = I * h - C,
  40084. t[6] = a * c,
  40085. t[10] = E * h + A
  40086. }
  40087. return t[3] = 0,
  40088. t[7] = 0,
  40089. t[11] = 0,
  40090. t[12] = 0,
  40091. t[13] = 0,
  40092. t[14] = 0,
  40093. t[15] = 1,
  40094. this
  40095. },
  40096. makeRotationFromQuaternion: function(e) {
  40097. var t = this.elements
  40098. , i = e.x
  40099. , n = e.y
  40100. , r = e.z
  40101. , o = e.w
  40102. , a = i + i
  40103. , s = n + n
  40104. , l = r + r
  40105. , c = i * a
  40106. , h = i * s
  40107. , u = i * l
  40108. , d = n * s
  40109. , p = n * l
  40110. , f = r * l
  40111. , g = o * a
  40112. , m = o * s
  40113. , v = o * l;
  40114. return t[0] = 1 - (d + f),
  40115. t[4] = h - v,
  40116. t[8] = u + m,
  40117. t[1] = h + v,
  40118. t[5] = 1 - (c + f),
  40119. t[9] = p - g,
  40120. t[2] = u - m,
  40121. t[6] = p + g,
  40122. t[10] = 1 - (c + d),
  40123. t[3] = 0,
  40124. t[7] = 0,
  40125. t[11] = 0,
  40126. t[12] = 0,
  40127. t[13] = 0,
  40128. t[14] = 0,
  40129. t[15] = 1,
  40130. this
  40131. },
  40132. lookAt: function(e, t, i) {
  40133. void 0 === oe && (oe = new Ci.Vector3),
  40134. void 0 === ae && (ae = new Ci.Vector3),
  40135. void 0 === se && (se = new Ci.Vector3);
  40136. var n = this.elements;
  40137. return se.subVectors(e, t).normalize(),
  40138. 0 === se.lengthSq() && (se.z = 1),
  40139. oe.crossVectors(i, se).normalize(),
  40140. 0 === oe.lengthSq() && (se.x += 1e-4,
  40141. oe.crossVectors(i, se).normalize()),
  40142. ae.crossVectors(se, oe),
  40143. n[0] = oe.x,
  40144. n[4] = ae.x,
  40145. n[8] = se.x,
  40146. n[1] = oe.y,
  40147. n[5] = ae.y,
  40148. n[9] = se.y,
  40149. n[2] = oe.z,
  40150. n[6] = ae.z,
  40151. n[10] = se.z,
  40152. this
  40153. },
  40154. multiply: function(e, t) {
  40155. return void 0 !== t ? (console.warn("THREE.Matrix4: .multiply() now only accepts one argument. Use .multiplyMatrices( a, b ) instead."),
  40156. this.multiplyMatrices(e, t)) : this.multiplyMatrices(this, e)
  40157. },
  40158. multiplyMatrices: function(e, t) {
  40159. var i = e.elements
  40160. , n = t.elements
  40161. , r = this.elements
  40162. , o = i[0]
  40163. , a = i[4]
  40164. , s = i[8]
  40165. , l = i[12]
  40166. , c = i[1]
  40167. , h = i[5]
  40168. , u = i[9]
  40169. , d = i[13]
  40170. , p = i[2]
  40171. , f = i[6]
  40172. , g = i[10]
  40173. , m = i[14]
  40174. , v = i[3]
  40175. , y = i[7]
  40176. , A = i[11]
  40177. , C = i[15]
  40178. , I = n[0]
  40179. , E = n[4]
  40180. , _ = n[8]
  40181. , b = n[12]
  40182. , w = n[1]
  40183. , T = n[5]
  40184. , x = n[9]
  40185. , S = n[13]
  40186. , M = n[2]
  40187. , R = n[6]
  40188. , P = n[10]
  40189. , O = n[14]
  40190. , L = n[3]
  40191. , D = n[7]
  40192. , N = n[11]
  40193. , F = n[15];
  40194. return r[0] = o * I + a * w + s * M + l * L,
  40195. r[4] = o * E + a * T + s * R + l * D,
  40196. r[8] = o * _ + a * x + s * P + l * N,
  40197. r[12] = o * b + a * S + s * O + l * F,
  40198. r[1] = c * I + h * w + u * M + d * L,
  40199. r[5] = c * E + h * T + u * R + d * D,
  40200. r[9] = c * _ + h * x + u * P + d * N,
  40201. r[13] = c * b + h * S + u * O + d * F,
  40202. r[2] = p * I + f * w + g * M + m * L,
  40203. r[6] = p * E + f * T + g * R + m * D,
  40204. r[10] = p * _ + f * x + g * P + m * N,
  40205. r[14] = p * b + f * S + g * O + m * F,
  40206. r[3] = v * I + y * w + A * M + C * L,
  40207. r[7] = v * E + y * T + A * R + C * D,
  40208. r[11] = v * _ + y * x + A * P + C * N,
  40209. r[15] = v * b + y * S + A * O + C * F,
  40210. this
  40211. },
  40212. multiplyToArray: function(e, t, i) {
  40213. var n = this.elements;
  40214. return this.multiplyMatrices(e, t),
  40215. i[0] = n[0],
  40216. i[1] = n[1],
  40217. i[2] = n[2],
  40218. i[3] = n[3],
  40219. i[4] = n[4],
  40220. i[5] = n[5],
  40221. i[6] = n[6],
  40222. i[7] = n[7],
  40223. i[8] = n[8],
  40224. i[9] = n[9],
  40225. i[10] = n[10],
  40226. i[11] = n[11],
  40227. i[12] = n[12],
  40228. i[13] = n[13],
  40229. i[14] = n[14],
  40230. i[15] = n[15],
  40231. this
  40232. },
  40233. multiplyScalar: function(e) {
  40234. var t = this.elements;
  40235. return t[0] *= e,
  40236. t[4] *= e,
  40237. t[8] *= e,
  40238. t[12] *= e,
  40239. t[1] *= e,
  40240. t[5] *= e,
  40241. t[9] *= e,
  40242. t[13] *= e,
  40243. t[2] *= e,
  40244. t[6] *= e,
  40245. t[10] *= e,
  40246. t[14] *= e,
  40247. t[3] *= e,
  40248. t[7] *= e,
  40249. t[11] *= e,
  40250. t[15] *= e,
  40251. this
  40252. },
  40253. applyToVector3Array: function(e, t, i) {
  40254. void 0 === re && (re = new Ci.Vector3),
  40255. void 0 === t && (t = 0),
  40256. void 0 === i && (i = e.length);
  40257. for (var n = 0, r = t; n < i; n += 3,
  40258. r += 3)
  40259. re.fromArray(e, r),
  40260. re.applyMatrix4(this),
  40261. re.toArray(e, r);
  40262. return e
  40263. },
  40264. applyToBuffer: function(e, t, i) {
  40265. void 0 === ne && (ne = new Ci.Vector3),
  40266. void 0 === t && (t = 0),
  40267. void 0 === i && (i = e.length / e.itemSize);
  40268. for (var n = 0, r = t; n < i; n++,
  40269. r++)
  40270. ne.x = e.getX(r),
  40271. ne.y = e.getY(r),
  40272. ne.z = e.getZ(r),
  40273. ne.applyMatrix4(this),
  40274. e.setXYZ(ne.x, ne.y, ne.z);
  40275. return e
  40276. },
  40277. determinant: function() {
  40278. var e = this.elements
  40279. , t = e[0]
  40280. , i = e[4]
  40281. , n = e[8]
  40282. , r = e[12]
  40283. , o = e[1]
  40284. , a = e[5]
  40285. , s = e[9]
  40286. , l = e[13]
  40287. , c = e[2]
  40288. , h = e[6]
  40289. , u = e[10]
  40290. , d = e[14];
  40291. 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)
  40292. },
  40293. transpose: function() {
  40294. var e, t = this.elements;
  40295. return e = t[1],
  40296. t[1] = t[4],
  40297. t[4] = e,
  40298. e = t[2],
  40299. t[2] = t[8],
  40300. t[8] = e,
  40301. e = t[6],
  40302. t[6] = t[9],
  40303. t[9] = e,
  40304. e = t[3],
  40305. t[3] = t[12],
  40306. t[12] = e,
  40307. e = t[7],
  40308. t[7] = t[13],
  40309. t[13] = e,
  40310. e = t[11],
  40311. t[11] = t[14],
  40312. t[14] = e,
  40313. this
  40314. },
  40315. flattenToArrayOffset: function(e, t) {
  40316. var i = this.elements;
  40317. return e[t] = i[0],
  40318. e[t + 1] = i[1],
  40319. e[t + 2] = i[2],
  40320. e[t + 3] = i[3],
  40321. e[t + 4] = i[4],
  40322. e[t + 5] = i[5],
  40323. e[t + 6] = i[6],
  40324. e[t + 7] = i[7],
  40325. e[t + 8] = i[8],
  40326. e[t + 9] = i[9],
  40327. e[t + 10] = i[10],
  40328. e[t + 11] = i[11],
  40329. e[t + 12] = i[12],
  40330. e[t + 13] = i[13],
  40331. e[t + 14] = i[14],
  40332. e[t + 15] = i[15],
  40333. e
  40334. },
  40335. getPosition: function() {
  40336. return void 0 === ie && (ie = new Ci.Vector3),
  40337. console.warn("THREE.Matrix4: .getPosition() has been removed. Use Vector3.setFromMatrixPosition( matrix ) instead."),
  40338. ie.setFromMatrixColumn(this, 3)
  40339. },
  40340. setPosition: function(e) {
  40341. var t = this.elements;
  40342. return t[12] = e.x,
  40343. t[13] = e.y,
  40344. t[14] = e.z,
  40345. this
  40346. },
  40347. getInverse: function(e, t) {
  40348. var i = this.elements
  40349. , n = e.elements
  40350. , r = n[0]
  40351. , o = n[1]
  40352. , a = n[2]
  40353. , s = n[3]
  40354. , l = n[4]
  40355. , c = n[5]
  40356. , h = n[6]
  40357. , u = n[7]
  40358. , d = n[8]
  40359. , p = n[9]
  40360. , f = n[10]
  40361. , g = n[11]
  40362. , m = n[12]
  40363. , v = n[13]
  40364. , y = n[14]
  40365. , A = n[15]
  40366. , C = p * y * u - v * f * u + v * h * g - c * y * g - p * h * A + c * f * A
  40367. , I = m * f * u - d * y * u - m * h * g + l * y * g + d * h * A - l * f * A
  40368. , E = d * v * u - m * p * u + m * c * g - l * v * g - d * c * A + l * p * A
  40369. , _ = m * p * h - d * v * h - m * c * f + l * v * f + d * c * y - l * p * y
  40370. , b = r * C + o * I + a * E + s * _;
  40371. if (0 != b)
  40372. return i[0] = C,
  40373. i[1] = v * f * s - p * y * s - v * a * g + o * y * g + p * a * A - o * f * A,
  40374. i[2] = c * y * s - v * h * s + v * a * u - o * y * u - c * a * A + o * h * A,
  40375. i[3] = p * h * s - c * f * s - p * a * u + o * f * u + c * a * g - o * h * g,
  40376. i[4] = I,
  40377. i[5] = d * y * s - m * f * s + m * a * g - r * y * g - d * a * A + r * f * A,
  40378. i[6] = m * h * s - l * y * s - m * a * u + r * y * u + l * a * A - r * h * A,
  40379. i[7] = l * f * s - d * h * s + d * a * u - r * f * u - l * a * g + r * h * g,
  40380. i[8] = E,
  40381. i[9] = m * p * s - d * v * s - m * o * g + r * v * g + d * o * A - r * p * A,
  40382. i[10] = l * v * s - m * c * s + m * o * u - r * v * u - l * o * A + r * c * A,
  40383. i[11] = d * c * s - l * p * s - d * o * u + r * p * u + l * o * g - r * c * g,
  40384. i[12] = _,
  40385. i[13] = d * v * a - m * p * a + m * o * f - r * v * f - d * o * y + r * p * y,
  40386. i[14] = m * c * a - l * v * a - m * o * h + r * v * h + l * o * y - r * c * y,
  40387. i[15] = l * p * a - d * c * a + d * o * h - r * p * h - l * o * f + r * c * f,
  40388. this.multiplyScalar(1 / b);
  40389. var w = "THREE.Matrix4.getInverse(): can't invert matrix, determinant is 0";
  40390. if (t)
  40391. throw new Error(w);
  40392. return console.warn(w),
  40393. this.identity()
  40394. },
  40395. scale: function(e) {
  40396. var t = this.elements
  40397. , i = e.x
  40398. , n = e.y
  40399. , r = e.z;
  40400. return t[0] *= i,
  40401. t[4] *= n,
  40402. t[8] *= r,
  40403. t[1] *= i,
  40404. t[5] *= n,
  40405. t[9] *= r,
  40406. t[2] *= i,
  40407. t[6] *= n,
  40408. t[10] *= r,
  40409. t[3] *= i,
  40410. t[7] *= n,
  40411. t[11] *= r,
  40412. this
  40413. },
  40414. getMaxScaleOnAxis: function() {
  40415. var e = this.elements
  40416. , t = e[0] * e[0] + e[1] * e[1] + e[2] * e[2]
  40417. , i = e[4] * e[4] + e[5] * e[5] + e[6] * e[6]
  40418. , n = e[8] * e[8] + e[9] * e[9] + e[10] * e[10];
  40419. return Math.sqrt(Math.max(t, i, n))
  40420. },
  40421. makeTranslation: function(e, t, i) {
  40422. return this.set(1, 0, 0, e, 0, 1, 0, t, 0, 0, 1, i, 0, 0, 0, 1),
  40423. this
  40424. },
  40425. makeRotationX: function(e) {
  40426. var t = Math.cos(e)
  40427. , i = Math.sin(e);
  40428. return this.set(1, 0, 0, 0, 0, t, -i, 0, 0, i, t, 0, 0, 0, 0, 1),
  40429. this
  40430. },
  40431. makeRotationY: function(e) {
  40432. var t = Math.cos(e)
  40433. , i = Math.sin(e);
  40434. return this.set(t, 0, i, 0, 0, 1, 0, 0, -i, 0, t, 0, 0, 0, 0, 1),
  40435. this
  40436. },
  40437. makeRotationZ: function(e) {
  40438. var t = Math.cos(e)
  40439. , i = Math.sin(e);
  40440. return this.set(t, -i, 0, 0, i, t, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1),
  40441. this
  40442. },
  40443. makeRotationAxis: function(e, t) {
  40444. var i = Math.cos(t)
  40445. , n = Math.sin(t)
  40446. , r = 1 - i
  40447. , o = e.x
  40448. , a = e.y
  40449. , s = e.z
  40450. , l = r * o
  40451. , c = r * a;
  40452. 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),
  40453. this
  40454. },
  40455. makeScale: function(e, t, i) {
  40456. return this.set(e, 0, 0, 0, 0, t, 0, 0, 0, 0, i, 0, 0, 0, 0, 1),
  40457. this
  40458. },
  40459. compose: function(e, t, i) {
  40460. return this.makeRotationFromQuaternion(t),
  40461. this.scale(i),
  40462. this.setPosition(e),
  40463. this
  40464. },
  40465. decompose: function(e, t, i) {
  40466. void 0 === ee && (ee = new Ci.Vector3),
  40467. void 0 === te && (te = new Ci.Matrix4);
  40468. var n = this.elements
  40469. , r = ee.set(n[0], n[1], n[2]).length()
  40470. , o = ee.set(n[4], n[5], n[6]).length()
  40471. , a = ee.set(n[8], n[9], n[10]).length();
  40472. this.determinant() < 0 && (r = -r),
  40473. e.x = n[12],
  40474. e.y = n[13],
  40475. e.z = n[14],
  40476. te.elements.set(this.elements);
  40477. var s = 1 / r
  40478. , l = 1 / o
  40479. , c = 1 / a;
  40480. return te.elements[0] *= s,
  40481. te.elements[1] *= s,
  40482. te.elements[2] *= s,
  40483. te.elements[4] *= l,
  40484. te.elements[5] *= l,
  40485. te.elements[6] *= l,
  40486. te.elements[8] *= c,
  40487. te.elements[9] *= c,
  40488. te.elements[10] *= c,
  40489. t.setFromRotationMatrix(te),
  40490. i.x = r,
  40491. i.y = o,
  40492. i.z = a,
  40493. this
  40494. },
  40495. makeFrustum: function(e, t, i, n, r, o) {
  40496. var a = this.elements
  40497. , s = 2 * r / (t - e)
  40498. , l = 2 * r / (n - i)
  40499. , c = (t + e) / (t - e)
  40500. , h = (n + i) / (n - i)
  40501. , u = -(o + r) / (o - r)
  40502. , d = -2 * o * r / (o - r);
  40503. return a[0] = s,
  40504. a[4] = 0,
  40505. a[8] = c,
  40506. a[12] = 0,
  40507. a[1] = 0,
  40508. a[5] = l,
  40509. a[9] = h,
  40510. a[13] = 0,
  40511. a[2] = 0,
  40512. a[6] = 0,
  40513. a[10] = u,
  40514. a[14] = d,
  40515. a[3] = 0,
  40516. a[7] = 0,
  40517. a[11] = -1,
  40518. a[15] = 0,
  40519. this
  40520. },
  40521. makePerspective: function(e, t, i, n) {
  40522. var r = i * Math.tan(Ci.Math.degToRad(.5 * e))
  40523. , o = -r
  40524. , a = o * t
  40525. , s = r * t;
  40526. return this.makeFrustum(a, s, o, r, i, n)
  40527. },
  40528. makeOrthographic: function(e, t, i, n, r, o) {
  40529. var a = this.elements
  40530. , s = 1 / (t - e)
  40531. , l = 1 / (i - n)
  40532. , c = 1 / (o - r)
  40533. , h = (t + e) * s
  40534. , u = (i + n) * l
  40535. , d = (o + r) * c;
  40536. return a[0] = 2 * s,
  40537. a[4] = 0,
  40538. a[8] = 0,
  40539. a[12] = -h,
  40540. a[1] = 0,
  40541. a[5] = 2 * l,
  40542. a[9] = 0,
  40543. a[13] = -u,
  40544. a[2] = 0,
  40545. a[6] = 0,
  40546. a[10] = -2 * c,
  40547. a[14] = -d,
  40548. a[3] = 0,
  40549. a[7] = 0,
  40550. a[11] = 0,
  40551. a[15] = 1,
  40552. this
  40553. },
  40554. equals: function(e) {
  40555. for (var t = this.elements, i = e.elements, n = 0; n < 16; n++)
  40556. if (t[n] !== i[n])
  40557. return !1;
  40558. return !0
  40559. },
  40560. fromArray: function(e) {
  40561. return this.elements.set(e),
  40562. this
  40563. },
  40564. toArray: function() {
  40565. var e = this.elements;
  40566. 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]]
  40567. }
  40568. },
  40569. Ci.Ray = function(e, t) {
  40570. this.origin = void 0 !== e ? e : new Ci.Vector3,
  40571. this.direction = void 0 !== t ? t : new Ci.Vector3
  40572. }
  40573. ,
  40574. Ci.Ray.prototype = {
  40575. constructor: Ci.Ray,
  40576. set: function(e, t) {
  40577. return this.origin.copy(e),
  40578. this.direction.copy(t),
  40579. this
  40580. },
  40581. clone: function() {
  40582. return (new this.constructor).copy(this)
  40583. },
  40584. copy: function(e) {
  40585. return this.origin.copy(e.origin),
  40586. this.direction.copy(e.direction),
  40587. this
  40588. },
  40589. at: function(e, t) {
  40590. return (t || new Ci.Vector3).copy(this.direction).multiplyScalar(e).add(this.origin)
  40591. },
  40592. lookAt: function(e) {
  40593. this.direction.copy(e).sub(this.origin).normalize()
  40594. },
  40595. recast: ($ = new Ci.Vector3,
  40596. function(e) {
  40597. return this.origin.copy(this.at(e, $)),
  40598. this
  40599. }
  40600. ),
  40601. closestPointToPoint: function(e, t) {
  40602. var i = t || new Ci.Vector3;
  40603. i.subVectors(e, this.origin);
  40604. var n = i.dot(this.direction);
  40605. return n < 0 ? i.copy(this.origin) : i.copy(this.direction).multiplyScalar(n).add(this.origin)
  40606. },
  40607. distanceToPoint: function(e) {
  40608. return Math.sqrt(this.distanceSqToPoint(e))
  40609. },
  40610. distanceSqToPoint: (J = new Ci.Vector3,
  40611. function(e) {
  40612. var t = J.subVectors(e, this.origin).dot(this.direction);
  40613. return t < 0 ? this.origin.distanceToSquared(e) : (J.copy(this.direction).multiplyScalar(t).add(this.origin),
  40614. J.distanceToSquared(e))
  40615. }
  40616. ),
  40617. distanceSqToSegment: (Z = new Ci.Vector3,
  40618. K = new Ci.Vector3,
  40619. Q = new Ci.Vector3,
  40620. function(e, t, i, n) {
  40621. Z.copy(e).add(t).multiplyScalar(.5),
  40622. K.copy(t).sub(e).normalize(),
  40623. Q.copy(this.origin).sub(Z);
  40624. 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);
  40625. if (0 < p)
  40626. if (o = c * h - u,
  40627. s = l * p,
  40628. 0 <= (r = c * u - h))
  40629. if (-s <= o)
  40630. if (o <= s) {
  40631. var f = 1 / p;
  40632. a = (r *= f) * (r + c * (o *= f) + 2 * h) + o * (c * r + o + 2 * u) + d
  40633. } else
  40634. o = l,
  40635. a = -(r = Math.max(0, -(c * o + h))) * r + o * (o + 2 * u) + d;
  40636. else
  40637. o = -l,
  40638. a = -(r = Math.max(0, -(c * o + h))) * r + o * (o + 2 * u) + d;
  40639. else
  40640. 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,
  40641. (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;
  40642. else
  40643. o = 0 < c ? -l : l,
  40644. a = -(r = Math.max(0, -(c * o + h))) * r + o * (o + 2 * u) + d;
  40645. return i && i.copy(this.direction).multiplyScalar(r).add(this.origin),
  40646. n && n.copy(K).multiplyScalar(o).add(Z),
  40647. a
  40648. }
  40649. ),
  40650. intersectSphere: (X = new Ci.Vector3,
  40651. function(e, t) {
  40652. X.subVectors(e.center, this.origin);
  40653. var i = X.dot(this.direction)
  40654. , n = X.dot(X) - i * i
  40655. , r = e.radius * e.radius;
  40656. if (r < n)
  40657. return null;
  40658. var o = Math.sqrt(r - n)
  40659. , a = i - o
  40660. , s = i + o;
  40661. return a < 0 && s < 0 ? null : a < 0 ? this.at(s, t) : this.at(a, t)
  40662. }
  40663. ),
  40664. intersectsSphere: function(e) {
  40665. return this.distanceToPoint(e.center) <= e.radius
  40666. },
  40667. distanceToPlane: function(e) {
  40668. var t = e.normal.dot(this.direction);
  40669. if (0 === t)
  40670. return 0 === e.distanceToPoint(this.origin) ? 0 : null;
  40671. var i = -(this.origin.dot(e.normal) + e.constant) / t;
  40672. return 0 <= i ? i : null
  40673. },
  40674. intersectPlane: function(e, t) {
  40675. var i = this.distanceToPlane(e);
  40676. return null === i ? null : this.at(i, t)
  40677. },
  40678. intersectsPlane: function(e) {
  40679. var t = e.distanceToPoint(this.origin);
  40680. return 0 === t || e.normal.dot(this.direction) * t < 0
  40681. },
  40682. intersectBox: function(e, t) {
  40683. 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;
  40684. return n = 0 <= l ? (i = (e.min.x - u.x) * l,
  40685. (e.max.x - u.x) * l) : (i = (e.max.x - u.x) * l,
  40686. (e.min.x - u.x) * l),
  40687. (o = 0 <= c ? (r = (e.min.y - u.y) * c,
  40688. (e.max.y - u.y) * c) : (r = (e.max.y - u.y) * c,
  40689. (e.min.y - u.y) * c)) < i || n < r ? null : ((i < r || i != i) && (i = r),
  40690. (o < n || n != n) && (n = o),
  40691. (s = 0 <= h ? (a = (e.min.z - u.z) * h,
  40692. (e.max.z - u.z) * h) : (a = (e.max.z - u.z) * h,
  40693. (e.min.z - u.z) * h)) < i || n < a ? null : ((i < a || i != i) && (i = a),
  40694. (s < n || n != n) && (n = s),
  40695. n < 0 ? null : this.at(0 <= i ? i : n, t)))
  40696. },
  40697. intersectsBox: (q = new Ci.Vector3,
  40698. function(e) {
  40699. return null !== this.intersectBox(e, q)
  40700. }
  40701. ),
  40702. intersectTriangle: (G = new Ci.Vector3,
  40703. W = new Ci.Vector3,
  40704. j = new Ci.Vector3,
  40705. Y = new Ci.Vector3,
  40706. function(e, t, i, n, r) {
  40707. W.subVectors(t, e),
  40708. j.subVectors(i, e),
  40709. Y.crossVectors(W, j);
  40710. var o, a = this.direction.dot(Y);
  40711. if (0 < a) {
  40712. if (n)
  40713. return null;
  40714. o = 1
  40715. } else {
  40716. if (!(a < 0))
  40717. return null;
  40718. o = -1,
  40719. a = -a
  40720. }
  40721. G.subVectors(this.origin, e);
  40722. var s = o * this.direction.dot(j.crossVectors(G, j));
  40723. if (s < 0)
  40724. return null;
  40725. var l = o * this.direction.dot(W.cross(G));
  40726. if (l < 0)
  40727. return null;
  40728. if (a < s + l)
  40729. return null;
  40730. var c = -o * G.dot(Y);
  40731. return c < 0 ? null : this.at(c / a, r)
  40732. }
  40733. ),
  40734. applyMatrix4: function(e) {
  40735. return this.direction.add(this.origin).applyMatrix4(e),
  40736. this.origin.applyMatrix4(e),
  40737. this.direction.sub(this.origin),
  40738. this.direction.normalize(),
  40739. this
  40740. },
  40741. equals: function(e) {
  40742. return e.origin.equals(this.origin) && e.direction.equals(this.direction)
  40743. }
  40744. },
  40745. Ci.Sphere = function(e, t) {
  40746. this.center = void 0 !== e ? e : new Ci.Vector3,
  40747. this.radius = void 0 !== t ? t : 0
  40748. }
  40749. ,
  40750. Ci.Sphere.prototype = {
  40751. constructor: Ci.Sphere,
  40752. set: function(e, t) {
  40753. return this.center.copy(e),
  40754. this.radius = t,
  40755. this
  40756. },
  40757. setFromPoints: (z = new Ci.Box3,
  40758. function(e, t) {
  40759. var i = this.center;
  40760. void 0 !== t ? i.copy(t) : z.setFromPoints(e).center(i);
  40761. for (var n = 0, r = 0, o = e.length; r < o; r++)
  40762. n = Math.max(n, i.distanceToSquared(e[r]));
  40763. return this.radius = Math.sqrt(n),
  40764. this
  40765. }
  40766. ),
  40767. clone: function() {
  40768. return (new this.constructor).copy(this)
  40769. },
  40770. copy: function(e) {
  40771. return this.center.copy(e.center),
  40772. this.radius = e.radius,
  40773. this
  40774. },
  40775. empty: function() {
  40776. return this.radius <= 0
  40777. },
  40778. containsPoint: function(e) {
  40779. return e.distanceToSquared(this.center) <= this.radius * this.radius
  40780. },
  40781. distanceToPoint: function(e) {
  40782. return e.distanceTo(this.center) - this.radius
  40783. },
  40784. intersectsSphere: function(e) {
  40785. var t = this.radius + e.radius;
  40786. return e.center.distanceToSquared(this.center) <= t * t
  40787. },
  40788. intersectsBox: function(e) {
  40789. return e.intersectsSphere(this)
  40790. },
  40791. intersectsPlane: function(e) {
  40792. return Math.abs(this.center.dot(e.normal) - e.constant) <= this.radius
  40793. },
  40794. clampPoint: function(e, t) {
  40795. var i = this.center.distanceToSquared(e)
  40796. , n = t || new Ci.Vector3;
  40797. return n.copy(e),
  40798. i > this.radius * this.radius && (n.sub(this.center).normalize(),
  40799. n.multiplyScalar(this.radius).add(this.center)),
  40800. n
  40801. },
  40802. getBoundingBox: function(e) {
  40803. var t = e || new Ci.Box3;
  40804. return t.set(this.center, this.center),
  40805. t.expandByScalar(this.radius),
  40806. t
  40807. },
  40808. applyMatrix4: function(e) {
  40809. return this.center.applyMatrix4(e),
  40810. this.radius = this.radius * e.getMaxScaleOnAxis(),
  40811. this
  40812. },
  40813. translate: function(e) {
  40814. return this.center.add(e),
  40815. this
  40816. },
  40817. equals: function(e) {
  40818. return e.center.equals(this.center) && e.radius === this.radius
  40819. }
  40820. },
  40821. Ci.Frustum = function(e, t, i, n, r, o) {
  40822. 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]
  40823. }
  40824. ,
  40825. Ci.Frustum.prototype = {
  40826. constructor: Ci.Frustum,
  40827. set: function(e, t, i, n, r, o) {
  40828. var a = this.planes;
  40829. return a[0].copy(e),
  40830. a[1].copy(t),
  40831. a[2].copy(i),
  40832. a[3].copy(n),
  40833. a[4].copy(r),
  40834. a[5].copy(o),
  40835. this
  40836. },
  40837. clone: function() {
  40838. return (new this.constructor).copy(this)
  40839. },
  40840. copy: function(e) {
  40841. for (var t = this.planes, i = 0; i < 6; i++)
  40842. t[i].copy(e.planes[i]);
  40843. return this
  40844. },
  40845. setFromMatrix: function(e) {
  40846. var t = this.planes
  40847. , i = e.elements
  40848. , n = i[0]
  40849. , r = i[1]
  40850. , o = i[2]
  40851. , a = i[3]
  40852. , s = i[4]
  40853. , l = i[5]
  40854. , c = i[6]
  40855. , h = i[7]
  40856. , u = i[8]
  40857. , d = i[9]
  40858. , p = i[10]
  40859. , f = i[11]
  40860. , g = i[12]
  40861. , m = i[13]
  40862. , v = i[14]
  40863. , y = i[15];
  40864. return t[0].setComponents(a - n, h - s, f - u, y - g).normalize(),
  40865. t[1].setComponents(a + n, h + s, f + u, y + g).normalize(),
  40866. t[2].setComponents(a + r, h + l, f + d, y + m).normalize(),
  40867. t[3].setComponents(a - r, h - l, f - d, y - m).normalize(),
  40868. t[4].setComponents(a - o, h - c, f - p, y - v).normalize(),
  40869. t[5].setComponents(a + o, h + c, f + p, y + v).normalize(),
  40870. this
  40871. },
  40872. intersectsObject: (H = new Ci.Sphere,
  40873. function(e) {
  40874. var t = e.geometry;
  40875. return null === t.boundingSphere && t.computeBoundingSphere(),
  40876. H.copy(t.boundingSphere),
  40877. H.applyMatrix4(e.matrixWorld),
  40878. this.intersectsSphere(H)
  40879. }
  40880. ),
  40881. intersectsSphere: function(e) {
  40882. for (var t = this.planes, i = e.center, n = -e.radius, r = 0; r < 6; r++) {
  40883. if (t[r].distanceToPoint(i) < n)
  40884. return !1
  40885. }
  40886. return !0
  40887. },
  40888. intersectsBox: (k = new Ci.Vector3,
  40889. U = new Ci.Vector3,
  40890. function(e) {
  40891. for (var t = this.planes, i = 0; i < 6; i++) {
  40892. var n = t[i];
  40893. k.x = 0 < n.normal.x ? e.min.x : e.max.x,
  40894. U.x = 0 < n.normal.x ? e.max.x : e.min.x,
  40895. k.y = 0 < n.normal.y ? e.min.y : e.max.y,
  40896. U.y = 0 < n.normal.y ? e.max.y : e.min.y,
  40897. k.z = 0 < n.normal.z ? e.min.z : e.max.z,
  40898. U.z = 0 < n.normal.z ? e.max.z : e.min.z;
  40899. var r = n.distanceToPoint(k)
  40900. , o = n.distanceToPoint(U);
  40901. if (r < 0 && o < 0)
  40902. return !1
  40903. }
  40904. return !0
  40905. }
  40906. ),
  40907. containsPoint: function(e) {
  40908. for (var t = this.planes, i = 0; i < 6; i++)
  40909. if (t[i].distanceToPoint(e) < 0)
  40910. return !1;
  40911. return !0
  40912. }
  40913. },
  40914. Ci.Plane = function(e, t) {
  40915. this.normal = void 0 !== e ? e : new Ci.Vector3(1,0,0),
  40916. this.constant = void 0 !== t ? t : 0
  40917. }
  40918. ,
  40919. Ci.Plane.prototype = {
  40920. constructor: Ci.Plane,
  40921. set: function(e, t) {
  40922. return this.normal.copy(e),
  40923. this.constant = t,
  40924. this
  40925. },
  40926. setComponents: function(e, t, i, n) {
  40927. return this.normal.set(e, t, i),
  40928. this.constant = n,
  40929. this
  40930. },
  40931. setFromNormalAndCoplanarPoint: function(e, t) {
  40932. return this.normal.copy(e),
  40933. this.constant = -t.dot(this.normal),
  40934. this
  40935. },
  40936. setFromCoplanarPoints: (B = new Ci.Vector3,
  40937. V = new Ci.Vector3,
  40938. function(e, t, i) {
  40939. var n = B.subVectors(i, t).cross(V.subVectors(e, t)).normalize();
  40940. return this.setFromNormalAndCoplanarPoint(n, e),
  40941. this
  40942. }
  40943. ),
  40944. clone: function() {
  40945. return (new this.constructor).copy(this)
  40946. },
  40947. copy: function(e) {
  40948. return this.normal.copy(e.normal),
  40949. this.constant = e.constant,
  40950. this
  40951. },
  40952. normalize: function() {
  40953. var e = 1 / this.normal.length();
  40954. return this.normal.multiplyScalar(e),
  40955. this.constant *= e,
  40956. this
  40957. },
  40958. negate: function() {
  40959. return this.constant *= -1,
  40960. this.normal.negate(),
  40961. this
  40962. },
  40963. distanceToPoint: function(e) {
  40964. return this.normal.dot(e) + this.constant
  40965. },
  40966. distanceToSphere: function(e) {
  40967. return this.distanceToPoint(e.center) - e.radius
  40968. },
  40969. projectPoint: function(e, t) {
  40970. return this.orthoPoint(e, t).sub(e).negate()
  40971. },
  40972. orthoPoint: function(e, t) {
  40973. var i = this.distanceToPoint(e);
  40974. return (t || new Ci.Vector3).copy(this.normal).multiplyScalar(i)
  40975. },
  40976. intersectLine: (F = new Ci.Vector3,
  40977. function(e, t) {
  40978. var i = t || new Ci.Vector3
  40979. , n = e.delta(F)
  40980. , r = this.normal.dot(n);
  40981. if (0 !== r) {
  40982. var o = -(e.start.dot(this.normal) + this.constant) / r;
  40983. if (!(o < 0 || 1 < o))
  40984. return i.copy(n).multiplyScalar(o).add(e.start)
  40985. } else if (0 === this.distanceToPoint(e.start))
  40986. return i.copy(e.start)
  40987. }
  40988. ),
  40989. intersectsLine: function(e) {
  40990. var t = this.distanceToPoint(e.start)
  40991. , i = this.distanceToPoint(e.end);
  40992. return t < 0 && 0 < i || i < 0 && 0 < t
  40993. },
  40994. intersectsBox: function(e) {
  40995. return e.intersectsPlane(this)
  40996. },
  40997. intersectsSphere: function(e) {
  40998. return e.intersectsPlane(this)
  40999. },
  41000. coplanarPoint: function(e) {
  41001. return (e || new Ci.Vector3).copy(this.normal).multiplyScalar(-this.constant)
  41002. },
  41003. applyMatrix4: (L = new Ci.Vector3,
  41004. D = new Ci.Vector3,
  41005. N = new Ci.Matrix3,
  41006. function(e, t) {
  41007. var i = t || N.getNormalMatrix(e)
  41008. , n = L.copy(this.normal).applyMatrix3(i)
  41009. , r = this.coplanarPoint(D);
  41010. return r.applyMatrix4(e),
  41011. this.setFromNormalAndCoplanarPoint(n, r),
  41012. this
  41013. }
  41014. ),
  41015. translate: function(e) {
  41016. return this.constant = this.constant - e.dot(this.normal),
  41017. this
  41018. },
  41019. equals: function(e) {
  41020. return e.normal.equals(this.normal) && e.constant === this.constant
  41021. }
  41022. },
  41023. Ci.Spherical = function(e, t, i) {
  41024. return this.radius = void 0 !== e ? e : 1,
  41025. this.phi = void 0 !== t ? t : 0,
  41026. this.theta = void 0 !== i ? i : 0,
  41027. this
  41028. }
  41029. ,
  41030. Ci.Spherical.prototype = {
  41031. constructor: Ci.Spherical,
  41032. set: function(e, t, i) {
  41033. this.radius = e,
  41034. this.phi = t,
  41035. this.theta = i
  41036. },
  41037. clone: function() {
  41038. return (new this.constructor).copy(this)
  41039. },
  41040. copy: function(e) {
  41041. return this.radius.copy(e.radius),
  41042. this.phi.copy(e.phi),
  41043. this.theta.copy(e.theta),
  41044. this
  41045. },
  41046. makeSafe: function() {
  41047. this.phi = Math.max(1e-6, Math.min(Math.PI - 1e-6, this.phi))
  41048. },
  41049. setFromVector3: function(e) {
  41050. return this.radius = e.length(),
  41051. 0 === this.radius ? (this.theta = 0,
  41052. this.phi = 0) : (this.theta = Math.atan2(e.x, e.z),
  41053. this.phi = Math.acos(Ci.Math.clamp(e.y / this.radius, -1, 1))),
  41054. this
  41055. }
  41056. },
  41057. Ci.Math = {
  41058. generateUUID: (R = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split(""),
  41059. P = new Array(36),
  41060. O = 0,
  41061. function() {
  41062. for (var e = 0; e < 36; e++)
  41063. 8 === e || 13 === e || 18 === e || 23 === e ? P[e] = "-" : 14 === e ? P[e] = "4" : (O <= 2 && (O = 33554432 + 16777216 * Math.random() | 0),
  41064. M = 15 & O,
  41065. O >>= 4,
  41066. P[e] = R[19 === e ? 3 & M | 8 : M]);
  41067. return P.join("")
  41068. }
  41069. ),
  41070. clamp: function(e, t, i) {
  41071. return Math.max(t, Math.min(i, e))
  41072. },
  41073. euclideanModulo: function(e, t) {
  41074. return (e % t + t) % t
  41075. },
  41076. mapLinear: function(e, t, i, n, r) {
  41077. return n + (e - t) * (r - n) / (i - t)
  41078. },
  41079. smoothstep: function(e, t, i) {
  41080. return e <= t ? 0 : i <= e ? 1 : (e = (e - t) / (i - t)) * e * (3 - 2 * e)
  41081. },
  41082. smootherstep: function(e, t, i) {
  41083. return e <= t ? 0 : i <= e ? 1 : (e = (e - t) / (i - t)) * e * e * (e * (6 * e - 15) + 10)
  41084. },
  41085. random16: function() {
  41086. return console.warn("THREE.Math.random16() has been deprecated. Use Math.random() instead."),
  41087. Math.random()
  41088. },
  41089. randInt: function(e, t) {
  41090. return e + Math.floor(Math.random() * (t - e + 1))
  41091. },
  41092. randFloat: function(e, t) {
  41093. return e + Math.random() * (t - e)
  41094. },
  41095. randFloatSpread: function(e) {
  41096. return e * (.5 - Math.random())
  41097. },
  41098. degToRad: (S = Math.PI / 180,
  41099. function(e) {
  41100. return e * S
  41101. }
  41102. ),
  41103. radToDeg: (x = 180 / Math.PI,
  41104. function(e) {
  41105. return e * x
  41106. }
  41107. ),
  41108. isPowerOfTwo: function(e) {
  41109. return 0 == (e & e - 1) && 0 !== e
  41110. },
  41111. nearestPowerOfTwo: function(e) {
  41112. return Math.pow(2, Math.round(Math.log(e) / Math.LN2))
  41113. },
  41114. nextPowerOfTwo: function(e) {
  41115. return e--,
  41116. e |= e >> 1,
  41117. e |= e >> 2,
  41118. e |= e >> 4,
  41119. e |= e >> 8,
  41120. e |= e >> 16,
  41121. ++e
  41122. }
  41123. },
  41124. Ci.Spline = function(e) {
  41125. function t(e, t, i, n, r, o, a) {
  41126. var s = .5 * (i - e)
  41127. , l = .5 * (n - t);
  41128. return (2 * (t - i) + s + l) * a + (-3 * (t - i) - 2 * s - l) * o + s * r + t
  41129. }
  41130. this.points = e;
  41131. var i, n, r, o, a, s, l, c, h, u = [], d = {
  41132. x: 0,
  41133. y: 0,
  41134. z: 0
  41135. };
  41136. this.initFromArray = function(e) {
  41137. this.points = [];
  41138. for (var t = 0; t < e.length; t++)
  41139. this.points[t] = {
  41140. x: e[t][0],
  41141. y: e[t][1],
  41142. z: e[t][2]
  41143. }
  41144. }
  41145. ,
  41146. this.getPoint = function(e) {
  41147. return i = (this.points.length - 1) * e,
  41148. n = Math.floor(i),
  41149. r = i - n,
  41150. u[0] = 0 === n ? n : n - 1,
  41151. u[1] = n,
  41152. u[2] = n > this.points.length - 2 ? this.points.length - 1 : n + 1,
  41153. u[3] = n > this.points.length - 3 ? this.points.length - 1 : n + 2,
  41154. s = this.points[u[0]],
  41155. l = this.points[u[1]],
  41156. c = this.points[u[2]],
  41157. h = this.points[u[3]],
  41158. a = r * (o = r * r),
  41159. d.x = t(s.x, l.x, c.x, h.x, r, o, a),
  41160. d.y = t(s.y, l.y, c.y, h.y, r, o, a),
  41161. d.z = t(s.z, l.z, c.z, h.z, r, o, a),
  41162. d
  41163. }
  41164. ,
  41165. this.getControlPointsArray = function() {
  41166. var e, t, i = this.points.length, n = [];
  41167. for (e = 0; e < i; e++)
  41168. t = this.points[e],
  41169. n[e] = [t.x, t.y, t.z];
  41170. return n
  41171. }
  41172. ,
  41173. this.getLength = function(e) {
  41174. var t, i, n, r, o = 0, a = 0, s = 0, l = new Ci.Vector3, c = new Ci.Vector3, h = [], u = 0;
  41175. for (h[0] = 0,
  41176. e = e || 100,
  41177. n = this.points.length * e,
  41178. l.copy(this.points[0]),
  41179. t = 1; t < n; t++)
  41180. i = t / n,
  41181. r = this.getPoint(i),
  41182. c.copy(r),
  41183. u += c.distanceTo(l),
  41184. l.copy(r),
  41185. o = (this.points.length - 1) * i,
  41186. (a = Math.floor(o)) !== s && (h[a] = u,
  41187. s = a);
  41188. return h[h.length] = u,
  41189. {
  41190. chunks: h,
  41191. total: u
  41192. }
  41193. }
  41194. ,
  41195. this.reparametrizeByArcLength = function(e) {
  41196. var t, i, n, r, o, a, s, l, c = [], h = new Ci.Vector3, u = this.getLength();
  41197. for (c.push(h.copy(this.points[0]).clone()),
  41198. t = 1; t < this.points.length; t++) {
  41199. for (a = u.chunks[t] - u.chunks[t - 1],
  41200. s = Math.ceil(e * a / u.total),
  41201. r = (t - 1) / (this.points.length - 1),
  41202. o = t / (this.points.length - 1),
  41203. i = 1; i < s - 1; i++)
  41204. n = r + i * (1 / s) * (o - r),
  41205. l = this.getPoint(n),
  41206. c.push(h.copy(l).clone());
  41207. c.push(h.copy(this.points[t]).clone())
  41208. }
  41209. this.points = c
  41210. }
  41211. }
  41212. ,
  41213. Ci.Triangle = function(e, t, i) {
  41214. this.a = void 0 !== e ? e : new Ci.Vector3,
  41215. this.b = void 0 !== t ? t : new Ci.Vector3,
  41216. this.c = void 0 !== i ? i : new Ci.Vector3
  41217. }
  41218. ,
  41219. Ci.Triangle.normal = (T = new Ci.Vector3,
  41220. function(e, t, i, n) {
  41221. var r = n || new Ci.Vector3;
  41222. r.subVectors(i, t),
  41223. T.subVectors(e, t),
  41224. r.cross(T);
  41225. var o = r.lengthSq();
  41226. return 0 < o ? r.multiplyScalar(1 / Math.sqrt(o)) : r.set(0, 0, 0)
  41227. }
  41228. ),
  41229. Ci.Triangle.barycoordFromPoint = (_ = new Ci.Vector3,
  41230. b = new Ci.Vector3,
  41231. w = new Ci.Vector3,
  41232. function(e, t, i, n, r) {
  41233. _.subVectors(n, t),
  41234. b.subVectors(i, t),
  41235. w.subVectors(e, t);
  41236. var o = _.dot(_)
  41237. , a = _.dot(b)
  41238. , s = _.dot(w)
  41239. , l = b.dot(b)
  41240. , c = b.dot(w)
  41241. , h = o * l - a * a
  41242. , u = r || new Ci.Vector3;
  41243. if (0 == h)
  41244. return u.set(-2, -1, -1);
  41245. var d = 1 / h
  41246. , p = (l * s - a * c) * d
  41247. , f = (o * c - a * s) * d;
  41248. return u.set(1 - p - f, f, p)
  41249. }
  41250. ),
  41251. Ci.Triangle.containsPoint = (E = new Ci.Vector3,
  41252. function(e, t, i, n) {
  41253. var r = Ci.Triangle.barycoordFromPoint(e, t, i, n, E);
  41254. return 0 <= r.x && 0 <= r.y && r.x + r.y <= 1
  41255. }
  41256. ),
  41257. Ci.Triangle.prototype = {
  41258. constructor: Ci.Triangle,
  41259. set: function(e, t, i) {
  41260. return this.a.copy(e),
  41261. this.b.copy(t),
  41262. this.c.copy(i),
  41263. this
  41264. },
  41265. setFromPointsAndIndices: function(e, t, i, n) {
  41266. return this.a.copy(e[t]),
  41267. this.b.copy(e[i]),
  41268. this.c.copy(e[n]),
  41269. this
  41270. },
  41271. clone: function() {
  41272. return (new this.constructor).copy(this)
  41273. },
  41274. copy: function(e) {
  41275. return this.a.copy(e.a),
  41276. this.b.copy(e.b),
  41277. this.c.copy(e.c),
  41278. this
  41279. },
  41280. area: (C = new Ci.Vector3,
  41281. I = new Ci.Vector3,
  41282. function() {
  41283. return C.subVectors(this.c, this.b),
  41284. I.subVectors(this.a, this.b),
  41285. .5 * C.cross(I).length()
  41286. }
  41287. ),
  41288. midpoint: function(e) {
  41289. return (e || new Ci.Vector3).addVectors(this.a, this.b).add(this.c).multiplyScalar(1 / 3)
  41290. },
  41291. normal: function(e) {
  41292. return Ci.Triangle.normal(this.a, this.b, this.c, e)
  41293. },
  41294. plane: function(e) {
  41295. return (e || new Ci.Plane).setFromCoplanarPoints(this.a, this.b, this.c)
  41296. },
  41297. barycoordFromPoint: function(e, t) {
  41298. return Ci.Triangle.barycoordFromPoint(e, this.a, this.b, this.c, t)
  41299. },
  41300. containsPoint: function(e) {
  41301. return Ci.Triangle.containsPoint(e, this.a, this.b, this.c)
  41302. },
  41303. equals: function(e) {
  41304. return e.a.equals(this.a) && e.b.equals(this.b) && e.c.equals(this.c)
  41305. }
  41306. },
  41307. Ci.Interpolant = function(e, t, i, n) {
  41308. this.parameterPositions = e,
  41309. this._cachedIndex = 0,
  41310. this.resultBuffer = void 0 !== n ? n : new t.constructor(i),
  41311. this.sampleValues = t,
  41312. this.valueSize = i
  41313. }
  41314. ,
  41315. Ci.Interpolant.prototype = {
  41316. constructor: Ci.Interpolant,
  41317. evaluate: function(e) {
  41318. var t = this.parameterPositions
  41319. , i = this._cachedIndex
  41320. , n = t[i]
  41321. , r = t[i - 1];
  41322. e: {
  41323. t: {
  41324. var o;
  41325. i: {
  41326. n: if (!(e < n)) {
  41327. for (var a = i + 2; ; ) {
  41328. if (void 0 === n) {
  41329. if (e < r)
  41330. break n;
  41331. return i = t.length,
  41332. this._cachedIndex = i,
  41333. this.afterEnd_(i - 1, e, r)
  41334. }
  41335. if (i === a)
  41336. break;
  41337. if (r = n,
  41338. e < (n = t[++i]))
  41339. break t
  41340. }
  41341. o = t.length;
  41342. break i
  41343. }
  41344. if (r <= e)
  41345. break e;
  41346. var s = t[1];
  41347. e < s && (i = 2,
  41348. r = s);
  41349. for (a = i - 2; ; ) {
  41350. if (void 0 === r)
  41351. return this._cachedIndex = 0,
  41352. this.beforeStart_(0, e, n);
  41353. if (i === a)
  41354. break;
  41355. if (n = r,
  41356. (r = t[--i - 1]) <= e)
  41357. break t
  41358. }
  41359. o = i,
  41360. i = 0
  41361. }
  41362. for (; i < o; ) {
  41363. var l = i + o >>> 1;
  41364. e < t[l] ? o = l : i = 1 + l
  41365. }
  41366. if (n = t[i],
  41367. void 0 === (r = t[i - 1]))
  41368. return this._cachedIndex = 0,
  41369. this.beforeStart_(0, e, n);
  41370. if (void 0 === n)
  41371. return i = t.length,
  41372. this._cachedIndex = i,
  41373. this.afterEnd_(i - 1, r, e)
  41374. }
  41375. this._cachedIndex = i,
  41376. this.intervalChanged_(i, r, n)
  41377. }
  41378. return this.interpolate_(i, r, e, n)
  41379. },
  41380. settings: null,
  41381. DefaultSettings_: {},
  41382. getSettings_: function() {
  41383. return this.settings || this.DefaultSettings_
  41384. },
  41385. copySampleValue_: function(e) {
  41386. for (var t = this.resultBuffer, i = this.sampleValues, n = this.valueSize, r = e * n, o = 0; o !== n; ++o)
  41387. t[o] = i[r + o];
  41388. return t
  41389. },
  41390. interpolate_: function(e, t, i, n) {
  41391. throw new Error("call to abstract method")
  41392. },
  41393. intervalChanged_: function(e, t, i) {}
  41394. },
  41395. Object.assign(Ci.Interpolant.prototype, {
  41396. beforeStart_: Ci.Interpolant.prototype.copySampleValue_,
  41397. afterEnd_: Ci.Interpolant.prototype.copySampleValue_
  41398. }),
  41399. Ci.CubicInterpolant = function(e, t, i, n) {
  41400. Ci.Interpolant.call(this, e, t, i, n),
  41401. this._weightPrev = -0,
  41402. this._offsetPrev = -0,
  41403. this._weightNext = -0,
  41404. this._offsetNext = -0
  41405. }
  41406. ,
  41407. Ci.CubicInterpolant.prototype = Object.assign(Object.create(Ci.Interpolant.prototype), {
  41408. constructor: Ci.CubicInterpolant,
  41409. DefaultSettings_: {
  41410. endingStart: Ci.ZeroCurvatureEnding,
  41411. endingEnd: Ci.ZeroCurvatureEnding
  41412. },
  41413. intervalChanged_: function(e, t, i) {
  41414. var n = this.parameterPositions
  41415. , r = e - 2
  41416. , o = e + 1
  41417. , a = n[r]
  41418. , s = n[o];
  41419. if (void 0 === a)
  41420. switch (this.getSettings_().endingStart) {
  41421. case Ci.ZeroSlopeEnding:
  41422. r = e,
  41423. a = 2 * t - i;
  41424. break;
  41425. case Ci.WrapAroundEnding:
  41426. a = t + n[r = n.length - 2] - n[r + 1];
  41427. break;
  41428. default:
  41429. r = e,
  41430. a = i
  41431. }
  41432. if (void 0 === s)
  41433. switch (this.getSettings_().endingEnd) {
  41434. case Ci.ZeroSlopeEnding:
  41435. o = e,
  41436. s = 2 * i - t;
  41437. break;
  41438. case Ci.WrapAroundEnding:
  41439. s = i + n[o = 1] - n[0];
  41440. break;
  41441. default:
  41442. o = e - 1,
  41443. s = t
  41444. }
  41445. var l = .5 * (i - t)
  41446. , c = this.valueSize;
  41447. this._weightPrev = l / (t - a),
  41448. this._weightNext = l / (s - i),
  41449. this._offsetPrev = r * c,
  41450. this._offsetNext = o * c
  41451. },
  41452. interpolate_: function(e, t, i, n) {
  41453. 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)
  41454. r[C] = m * o[c + C] + v * o[l + C] + y * o[s + C] + A * o[h + C];
  41455. return r
  41456. }
  41457. }),
  41458. Ci.DiscreteInterpolant = function(e, t, i, n) {
  41459. Ci.Interpolant.call(this, e, t, i, n)
  41460. }
  41461. ,
  41462. Ci.DiscreteInterpolant.prototype = Object.assign(Object.create(Ci.Interpolant.prototype), {
  41463. constructor: Ci.DiscreteInterpolant,
  41464. interpolate_: function(e, t, i, n) {
  41465. return this.copySampleValue_(e - 1)
  41466. }
  41467. }),
  41468. Ci.LinearInterpolant = function(e, t, i, n) {
  41469. Ci.Interpolant.call(this, e, t, i, n)
  41470. }
  41471. ,
  41472. Ci.LinearInterpolant.prototype = Object.assign(Object.create(Ci.Interpolant.prototype), {
  41473. constructor: Ci.LinearInterpolant,
  41474. interpolate_: function(e, t, i, n) {
  41475. 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)
  41476. r[u] = o[l + u] * h + o[s + u] * c;
  41477. return r
  41478. }
  41479. }),
  41480. Ci.QuaternionLinearInterpolant = function(e, t, i, n) {
  41481. Ci.Interpolant.call(this, e, t, i, n)
  41482. }
  41483. ,
  41484. Ci.QuaternionLinearInterpolant.prototype = Object.assign(Object.create(Ci.Interpolant.prototype), {
  41485. constructor: Ci.QuaternionLinearInterpolant,
  41486. interpolate_: function(e, t, i, n) {
  41487. 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)
  41488. Ci.Quaternion.slerpFlat(r, 0, o, s - a, o, s, l);
  41489. return r
  41490. }
  41491. }),
  41492. Ci.Clock = function(e) {
  41493. this.autoStart = void 0 === e || e,
  41494. this.startTime = 0,
  41495. this.oldTime = 0,
  41496. this.elapsedTime = 0,
  41497. this.running = !1
  41498. }
  41499. ,
  41500. Ci.Clock.prototype = {
  41501. constructor: Ci.Clock,
  41502. start: function() {
  41503. this.startTime = performance.now(),
  41504. this.oldTime = this.startTime,
  41505. this.running = !0
  41506. },
  41507. stop: function() {
  41508. this.getElapsedTime(),
  41509. this.running = !1
  41510. },
  41511. getElapsedTime: function() {
  41512. return this.getDelta(),
  41513. this.elapsedTime
  41514. },
  41515. getDelta: function() {
  41516. var e = 0;
  41517. if (this.autoStart && !this.running && this.start(),
  41518. this.running) {
  41519. var t = performance.now();
  41520. e = .001 * (t - this.oldTime),
  41521. this.oldTime = t,
  41522. this.elapsedTime += e
  41523. }
  41524. return e
  41525. }
  41526. },
  41527. Ci.EventDispatcher = function() {}
  41528. ,
  41529. Ci.EventDispatcher.prototype = {
  41530. constructor: Ci.EventDispatcher,
  41531. apply: function(e) {
  41532. e.addEventListener = Ci.EventDispatcher.prototype.addEventListener,
  41533. e.hasEventListener = Ci.EventDispatcher.prototype.hasEventListener,
  41534. e.removeEventListener = Ci.EventDispatcher.prototype.removeEventListener,
  41535. e.dispatchEvent = Ci.EventDispatcher.prototype.dispatchEvent
  41536. },
  41537. addEventListener: function(e, t) {
  41538. void 0 === this._listeners && (this._listeners = {});
  41539. var i = this._listeners;
  41540. void 0 === i[e] && (i[e] = []),
  41541. -1 === i[e].indexOf(t) && i[e].push(t)
  41542. },
  41543. hasEventListener: function(e, t) {
  41544. if (void 0 === this._listeners)
  41545. return !1;
  41546. var i = this._listeners;
  41547. return void 0 !== i[e] && -1 !== i[e].indexOf(t)
  41548. },
  41549. removeEventListener: function(e, t) {
  41550. if (void 0 !== this._listeners) {
  41551. var i = this._listeners[e];
  41552. if (void 0 !== i) {
  41553. var n = i.indexOf(t);
  41554. -1 !== n && i.splice(n, 1)
  41555. }
  41556. }
  41557. },
  41558. dispatchEvent: function(e) {
  41559. if (void 0 !== this._listeners) {
  41560. var t = this._listeners[e.type];
  41561. if (void 0 !== t) {
  41562. e.target = this;
  41563. for (var i = [], n = t.length, r = 0; r < n; r++)
  41564. i[r] = t[r];
  41565. for (r = 0; r < n; r++)
  41566. i[r].call(this, e)
  41567. }
  41568. }
  41569. }
  41570. },
  41571. Ci.Layers = function() {
  41572. this.mask = 1
  41573. }
  41574. ,
  41575. Ci.Layers.prototype = {
  41576. constructor: Ci.Layers,
  41577. set: function(e) {
  41578. this.mask = 1 << e
  41579. },
  41580. enable: function(e) {
  41581. this.mask |= 1 << e
  41582. },
  41583. toggle: function(e) {
  41584. this.mask ^= 1 << e
  41585. },
  41586. disable: function(e) {
  41587. this.mask &= ~(1 << e)
  41588. },
  41589. test: function(e) {
  41590. return 0 != (this.mask & e.mask)
  41591. }
  41592. },
  41593. (A = Ci).Raycaster = function(e, t, i, n) {
  41594. this.ray = new A.Ray(e,t),
  41595. this.near = i || 0,
  41596. this.far = n || 1 / 0,
  41597. this.params = {
  41598. Mesh: {},
  41599. Line: {},
  41600. LOD: {},
  41601. Points: {
  41602. threshold: 1
  41603. },
  41604. Sprite: {}
  41605. },
  41606. Object.defineProperties(this.params, {
  41607. PointCloud: {
  41608. get: function() {
  41609. return console.warn("THREE.Raycaster: params.PointCloud has been renamed to params.Points."),
  41610. this.Points
  41611. }
  41612. }
  41613. })
  41614. }
  41615. ,
  41616. A.Raycaster.prototype = {
  41617. constructor: A.Raycaster,
  41618. linePrecision: 1,
  41619. set: function(e, t) {
  41620. this.ray.set(e, t)
  41621. },
  41622. setFromCamera: function(e, t) {
  41623. t instanceof A.PerspectiveCamera ? (this.ray.origin.setFromMatrixPosition(t.matrixWorld),
  41624. 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),
  41625. this.ray.direction.set(0, 0, -1).transformDirection(t.matrixWorld)) : console.error("THREE.Raycaster: Unsupported camera type.")
  41626. },
  41627. intersectObject: function(e, t) {
  41628. var i = [];
  41629. return Ei(e, this, i, t),
  41630. i.sort(Ii),
  41631. i
  41632. },
  41633. intersectObjects: function(e, t) {
  41634. var i = [];
  41635. if (!1 === Array.isArray(e))
  41636. return console.warn("THREE.Raycaster.intersectObjects: objects is not an Array."),
  41637. i;
  41638. for (var n = 0, r = e.length; n < r; n++)
  41639. Ei(e[n], this, i, t);
  41640. return i.sort(Ii),
  41641. i
  41642. }
  41643. },
  41644. Ci.Object3D = function() {
  41645. Object.defineProperty(this, "id", {
  41646. value: Ci.Object3DIdCount++
  41647. }),
  41648. this.uuid = Ci.Math.generateUUID(),
  41649. this.name = "",
  41650. this.type = "Object3D",
  41651. this.parent = null,
  41652. this.children = [],
  41653. this.up = Ci.Object3D.DefaultUp.clone();
  41654. var e = new Ci.Vector3
  41655. , t = new Ci.Euler
  41656. , i = new Ci.Quaternion
  41657. , n = new Ci.Vector3(1,1,1);
  41658. t.onChange(function() {
  41659. i.setFromEuler(t, !1)
  41660. }),
  41661. i.onChange(function() {
  41662. t.setFromQuaternion(i, void 0, !1)
  41663. }),
  41664. Object.defineProperties(this, {
  41665. position: {
  41666. enumerable: !0,
  41667. value: e
  41668. },
  41669. rotation: {
  41670. enumerable: !0,
  41671. value: t
  41672. },
  41673. quaternion: {
  41674. enumerable: !0,
  41675. value: i
  41676. },
  41677. scale: {
  41678. enumerable: !0,
  41679. value: n
  41680. },
  41681. modelViewMatrix: {
  41682. value: new Ci.Matrix4
  41683. },
  41684. normalMatrix: {
  41685. value: new Ci.Matrix3
  41686. }
  41687. }),
  41688. this.rotationAutoUpdate = !0,
  41689. this.matrix = new Ci.Matrix4,
  41690. this.matrixWorld = new Ci.Matrix4,
  41691. this.matrixAutoUpdate = Ci.Object3D.DefaultMatrixAutoUpdate,
  41692. this.matrixWorldNeedsUpdate = !1,
  41693. this.layers = new Ci.Layers,
  41694. this.visible = !0,
  41695. this.castShadow = !1,
  41696. this.receiveShadow = !1,
  41697. this.frustumCulled = !0,
  41698. this.renderOrder = 0,
  41699. this.userData = {}
  41700. }
  41701. ,
  41702. Ci.Object3D.DefaultUp = new Ci.Vector3(0,1,0),
  41703. Ci.Object3D.DefaultMatrixAutoUpdate = !0,
  41704. Ci.Object3D.prototype = {
  41705. constructor: Ci.Object3D,
  41706. applyMatrix: function(e) {
  41707. this.matrix.multiplyMatrices(e, this.matrix),
  41708. this.matrix.decompose(this.position, this.quaternion, this.scale)
  41709. },
  41710. setRotationFromAxisAngle: function(e, t) {
  41711. this.quaternion.setFromAxisAngle(e, t)
  41712. },
  41713. setRotationFromEuler: function(e) {
  41714. this.quaternion.setFromEuler(e, !0)
  41715. },
  41716. setRotationFromMatrix: function(e) {
  41717. this.quaternion.setFromRotationMatrix(e)
  41718. },
  41719. setRotationFromQuaternion: function(e) {
  41720. this.quaternion.copy(e)
  41721. },
  41722. rotateOnAxis: (y = new Ci.Quaternion,
  41723. function(e, t) {
  41724. return y.setFromAxisAngle(e, t),
  41725. this.quaternion.multiply(y),
  41726. this
  41727. }
  41728. ),
  41729. rotateX: (v = new Ci.Vector3(1,0,0),
  41730. function(e) {
  41731. return this.rotateOnAxis(v, e)
  41732. }
  41733. ),
  41734. rotateY: (m = new Ci.Vector3(0,1,0),
  41735. function(e) {
  41736. return this.rotateOnAxis(m, e)
  41737. }
  41738. ),
  41739. rotateZ: (g = new Ci.Vector3(0,0,1),
  41740. function(e) {
  41741. return this.rotateOnAxis(g, e)
  41742. }
  41743. ),
  41744. translateOnAxis: (f = new Ci.Vector3,
  41745. function(e, t) {
  41746. return f.copy(e).applyQuaternion(this.quaternion),
  41747. this.position.add(f.multiplyScalar(t)),
  41748. this
  41749. }
  41750. ),
  41751. translateX: (p = new Ci.Vector3(1,0,0),
  41752. function(e) {
  41753. return this.translateOnAxis(p, e)
  41754. }
  41755. ),
  41756. translateY: (d = new Ci.Vector3(0,1,0),
  41757. function(e) {
  41758. return this.translateOnAxis(d, e)
  41759. }
  41760. ),
  41761. translateZ: (u = new Ci.Vector3(0,0,1),
  41762. function(e) {
  41763. return this.translateOnAxis(u, e)
  41764. }
  41765. ),
  41766. localToWorld: function(e) {
  41767. return e.applyMatrix4(this.matrixWorld)
  41768. },
  41769. worldToLocal: (h = new Ci.Matrix4,
  41770. function(e) {
  41771. return e.applyMatrix4(h.getInverse(this.matrixWorld))
  41772. }
  41773. ),
  41774. lookAt: (c = new Ci.Matrix4,
  41775. function(e) {
  41776. c.lookAt(e, this.position, this.up),
  41777. this.quaternion.setFromRotationMatrix(c)
  41778. }
  41779. ),
  41780. add: function(e) {
  41781. if (1 < arguments.length) {
  41782. for (var t = 0; t < arguments.length; t++)
  41783. this.add(arguments[t]);
  41784. return this
  41785. }
  41786. 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),
  41787. e.parent = this,
  41788. e.dispatchEvent({
  41789. type: "added"
  41790. }),
  41791. this.children.push(e)) : console.error("THREE.Object3D.add: object not an instance of THREE.Object3D.", e),
  41792. this
  41793. },
  41794. remove: function(e) {
  41795. if (1 < arguments.length)
  41796. for (var t = 0; t < arguments.length; t++)
  41797. this.remove(arguments[t]);
  41798. var i = this.children.indexOf(e);
  41799. -1 !== i && (e.parent = null,
  41800. e.dispatchEvent({
  41801. type: "removed"
  41802. }),
  41803. this.children.splice(i, 1))
  41804. },
  41805. getObjectById: function(e) {
  41806. return this.getObjectByProperty("id", e)
  41807. },
  41808. getObjectByName: function(e) {
  41809. return this.getObjectByProperty("name", e)
  41810. },
  41811. getObjectByProperty: function(e, t) {
  41812. if (this[e] === t)
  41813. return this;
  41814. for (var i = 0, n = this.children.length; i < n; i++) {
  41815. var r = this.children[i].getObjectByProperty(e, t);
  41816. if (void 0 !== r)
  41817. return r
  41818. }
  41819. },
  41820. getWorldPosition: function(e) {
  41821. var t = e || new Ci.Vector3;
  41822. return this.updateMatrixWorld(!0),
  41823. t.setFromMatrixPosition(this.matrixWorld)
  41824. },
  41825. getWorldQuaternion: (s = new Ci.Vector3,
  41826. l = new Ci.Vector3,
  41827. function(e) {
  41828. var t = e || new Ci.Quaternion;
  41829. return this.updateMatrixWorld(!0),
  41830. this.matrixWorld.decompose(s, t, l),
  41831. t
  41832. }
  41833. ),
  41834. getWorldRotation: (a = new Ci.Quaternion,
  41835. function(e) {
  41836. var t = e || new Ci.Euler;
  41837. return this.getWorldQuaternion(a),
  41838. t.setFromQuaternion(a, this.rotation.order, !1)
  41839. }
  41840. ),
  41841. getWorldScale: (r = new Ci.Vector3,
  41842. o = new Ci.Quaternion,
  41843. function(e) {
  41844. var t = e || new Ci.Vector3;
  41845. return this.updateMatrixWorld(!0),
  41846. this.matrixWorld.decompose(r, o, t),
  41847. t
  41848. }
  41849. ),
  41850. getWorldDirection: (n = new Ci.Quaternion,
  41851. function(e) {
  41852. var t = e || new Ci.Vector3;
  41853. return this.getWorldQuaternion(n),
  41854. t.set(0, 0, 1).applyQuaternion(n)
  41855. }
  41856. ),
  41857. raycast: function() {},
  41858. traverse: function(e) {
  41859. e(this);
  41860. for (var t = this.children, i = 0, n = t.length; i < n; i++)
  41861. t[i].traverse(e)
  41862. },
  41863. traverseVisible: function(e) {
  41864. if (!1 !== this.visible) {
  41865. e(this);
  41866. for (var t = this.children, i = 0, n = t.length; i < n; i++)
  41867. t[i].traverseVisible(e)
  41868. }
  41869. },
  41870. traverseAncestors: function(e) {
  41871. var t = this.parent;
  41872. null !== t && (e(t),
  41873. t.traverseAncestors(e))
  41874. },
  41875. updateMatrix: function() {
  41876. this.matrix.compose(this.position, this.quaternion, this.scale),
  41877. this.matrixWorldNeedsUpdate = !0
  41878. },
  41879. updateMatrixWorld: function(e) {
  41880. !0 === this.matrixAutoUpdate && this.updateMatrix(),
  41881. !0 !== this.matrixWorldNeedsUpdate && !0 !== e || (null === this.parent ? this.matrixWorld.copy(this.matrix) : this.matrixWorld.multiplyMatrices(this.parent.matrixWorld, this.matrix),
  41882. e = !(this.matrixWorldNeedsUpdate = !1));
  41883. for (var t = 0, i = this.children.length; t < i; t++)
  41884. this.children[t].updateMatrixWorld(e)
  41885. },
  41886. toJSON: function(e) {
  41887. function t(e) {
  41888. var t = [];
  41889. for (var i in e) {
  41890. var n = e[i];
  41891. delete n.metadata,
  41892. t.push(n)
  41893. }
  41894. return t
  41895. }
  41896. var i = void 0 === e
  41897. , n = {};
  41898. i && (e = {
  41899. geometries: {},
  41900. materials: {},
  41901. textures: {},
  41902. images: {}
  41903. },
  41904. n.metadata = {
  41905. version: 4.4,
  41906. type: "Object",
  41907. generator: "Object3D.toJSON"
  41908. });
  41909. var r = {};
  41910. if (r.uuid = this.uuid,
  41911. r.type = this.type,
  41912. "" !== this.name && (r.name = this.name),
  41913. "{}" !== JSON.stringify(this.userData) && (r.userData = this.userData),
  41914. !0 === this.castShadow && (r.castShadow = !0),
  41915. !0 === this.receiveShadow && (r.receiveShadow = !0),
  41916. !1 === this.visible && (r.visible = !1),
  41917. r.matrix = this.matrix.toArray(),
  41918. void 0 !== this.geometry && (void 0 === e.geometries[this.geometry.uuid] && (e.geometries[this.geometry.uuid] = this.geometry.toJSON(e)),
  41919. r.geometry = this.geometry.uuid),
  41920. void 0 !== this.material && (void 0 === e.materials[this.material.uuid] && (e.materials[this.material.uuid] = this.material.toJSON(e)),
  41921. r.material = this.material.uuid),
  41922. 0 < this.children.length) {
  41923. r.children = [];
  41924. for (var o = 0; o < this.children.length; o++)
  41925. r.children.push(this.children[o].toJSON(e).object)
  41926. }
  41927. if (i) {
  41928. var a = t(e.geometries)
  41929. , s = t(e.materials)
  41930. , l = t(e.textures)
  41931. , c = t(e.images);
  41932. 0 < a.length && (n.geometries = a),
  41933. 0 < s.length && (n.materials = s),
  41934. 0 < l.length && (n.textures = l),
  41935. 0 < c.length && (n.images = c)
  41936. }
  41937. return n.object = r,
  41938. n
  41939. },
  41940. clone: function(e) {
  41941. return (new this.constructor).copy(this, e)
  41942. },
  41943. copy: function(e, t) {
  41944. if (void 0 === t && (t = !0),
  41945. this.name = e.name,
  41946. this.up.copy(e.up),
  41947. this.position.copy(e.position),
  41948. this.quaternion.copy(e.quaternion),
  41949. this.scale.copy(e.scale),
  41950. this.rotationAutoUpdate = e.rotationAutoUpdate,
  41951. this.matrix.copy(e.matrix),
  41952. this.matrixWorld.copy(e.matrixWorld),
  41953. this.matrixAutoUpdate = e.matrixAutoUpdate,
  41954. this.matrixWorldNeedsUpdate = e.matrixWorldNeedsUpdate,
  41955. this.visible = e.visible,
  41956. this.castShadow = e.castShadow,
  41957. this.receiveShadow = e.receiveShadow,
  41958. this.frustumCulled = e.frustumCulled,
  41959. this.renderOrder = e.renderOrder,
  41960. this.userData = JSON.parse(JSON.stringify(e.userData)),
  41961. !0 === t)
  41962. for (var i = 0; i < e.children.length; i++) {
  41963. var n = e.children[i];
  41964. this.add(n.clone())
  41965. }
  41966. return this
  41967. }
  41968. },
  41969. Ci.EventDispatcher.prototype.apply(Ci.Object3D.prototype),
  41970. Ci.Object3DIdCount = 0,
  41971. Ci.Face3 = function(e, t, i, n, r, o) {
  41972. this.a = e,
  41973. this.b = t,
  41974. this.c = i,
  41975. this.normal = n instanceof Ci.Vector3 ? n : new Ci.Vector3,
  41976. this.vertexNormals = Array.isArray(n) ? n : [],
  41977. this.color = r instanceof Ci.Color ? r : new Ci.Color,
  41978. this.vertexColors = Array.isArray(r) ? r : [],
  41979. this.materialIndex = void 0 !== o ? o : 0
  41980. }
  41981. ,
  41982. Ci.Face3.prototype = {
  41983. constructor: Ci.Face3,
  41984. clone: function() {
  41985. return (new this.constructor).copy(this)
  41986. },
  41987. copy: function(e) {
  41988. this.a = e.a,
  41989. this.b = e.b,
  41990. this.c = e.c,
  41991. this.normal.copy(e.normal),
  41992. this.color.copy(e.color),
  41993. this.materialIndex = e.materialIndex;
  41994. for (var t = 0, i = e.vertexNormals.length; t < i; t++)
  41995. this.vertexNormals[t] = e.vertexNormals[t].clone();
  41996. for (t = 0,
  41997. i = e.vertexColors.length; t < i; t++)
  41998. this.vertexColors[t] = e.vertexColors[t].clone();
  41999. return this
  42000. }
  42001. },
  42002. Ci.BufferAttribute = function(e, t) {
  42003. this.uuid = Ci.Math.generateUUID(),
  42004. this.array = e,
  42005. this.itemSize = t,
  42006. this.dynamic = !1,
  42007. this.updateRange = {
  42008. offset: 0,
  42009. count: -1
  42010. },
  42011. this.version = 0
  42012. }
  42013. ,
  42014. Ci.BufferAttribute.prototype = {
  42015. constructor: Ci.BufferAttribute,
  42016. get count() {
  42017. return this.array.length / this.itemSize
  42018. },
  42019. set needsUpdate(e) {
  42020. !0 === e && this.version++
  42021. },
  42022. setDynamic: function(e) {
  42023. return this.dynamic = e,
  42024. this
  42025. },
  42026. copy: function(e) {
  42027. return this.array = new e.array.constructor(e.array),
  42028. this.itemSize = e.itemSize,
  42029. this.dynamic = e.dynamic,
  42030. this
  42031. },
  42032. copyAt: function(e, t, i) {
  42033. e *= this.itemSize,
  42034. i *= t.itemSize;
  42035. for (var n = 0, r = this.itemSize; n < r; n++)
  42036. this.array[e + n] = t.array[i + n];
  42037. return this
  42038. },
  42039. copyArray: function(e) {
  42040. return this.array.set(e),
  42041. this
  42042. },
  42043. copyColorsArray: function(e) {
  42044. for (var t = this.array, i = 0, n = 0, r = e.length; n < r; n++) {
  42045. var o = e[n];
  42046. void 0 === o && (console.warn("THREE.BufferAttribute.copyColorsArray(): color is undefined", n),
  42047. o = new Ci.Color),
  42048. t[i++] = o.r,
  42049. t[i++] = o.g,
  42050. t[i++] = o.b
  42051. }
  42052. return this
  42053. },
  42054. copyIndicesArray: function(e) {
  42055. for (var t = this.array, i = 0, n = 0, r = e.length; n < r; n++) {
  42056. var o = e[n];
  42057. t[i++] = o.a,
  42058. t[i++] = o.b,
  42059. t[i++] = o.c
  42060. }
  42061. return this
  42062. },
  42063. copyVector2sArray: function(e) {
  42064. for (var t = this.array, i = 0, n = 0, r = e.length; n < r; n++) {
  42065. var o = e[n];
  42066. void 0 === o && (console.warn("THREE.BufferAttribute.copyVector2sArray(): vector is undefined", n),
  42067. o = new Ci.Vector2),
  42068. t[i++] = o.x,
  42069. t[i++] = o.y
  42070. }
  42071. return this
  42072. },
  42073. copyVector3sArray: function(e) {
  42074. for (var t = this.array, i = 0, n = 0, r = e.length; n < r; n++) {
  42075. var o = e[n];
  42076. void 0 === o && (console.warn("THREE.BufferAttribute.copyVector3sArray(): vector is undefined", n),
  42077. o = new Ci.Vector3),
  42078. t[i++] = o.x,
  42079. t[i++] = o.y,
  42080. t[i++] = o.z
  42081. }
  42082. return this
  42083. },
  42084. copyVector4sArray: function(e) {
  42085. for (var t = this.array, i = 0, n = 0, r = e.length; n < r; n++) {
  42086. var o = e[n];
  42087. void 0 === o && (console.warn("THREE.BufferAttribute.copyVector4sArray(): vector is undefined", n),
  42088. o = new Ci.Vector4),
  42089. t[i++] = o.x,
  42090. t[i++] = o.y,
  42091. t[i++] = o.z,
  42092. t[i++] = o.w
  42093. }
  42094. return this
  42095. },
  42096. set: function(e, t) {
  42097. return void 0 === t && (t = 0),
  42098. this.array.set(e, t),
  42099. this
  42100. },
  42101. getX: function(e) {
  42102. return this.array[e * this.itemSize]
  42103. },
  42104. setX: function(e, t) {
  42105. return this.array[e * this.itemSize] = t,
  42106. this
  42107. },
  42108. getY: function(e) {
  42109. return this.array[e * this.itemSize + 1]
  42110. },
  42111. setY: function(e, t) {
  42112. return this.array[e * this.itemSize + 1] = t,
  42113. this
  42114. },
  42115. getZ: function(e) {
  42116. return this.array[e * this.itemSize + 2]
  42117. },
  42118. setZ: function(e, t) {
  42119. return this.array[e * this.itemSize + 2] = t,
  42120. this
  42121. },
  42122. getW: function(e) {
  42123. return this.array[e * this.itemSize + 3]
  42124. },
  42125. setW: function(e, t) {
  42126. return this.array[e * this.itemSize + 3] = t,
  42127. this
  42128. },
  42129. setXY: function(e, t, i) {
  42130. return e *= this.itemSize,
  42131. this.array[e + 0] = t,
  42132. this.array[e + 1] = i,
  42133. this
  42134. },
  42135. setXYZ: function(e, t, i, n) {
  42136. return e *= this.itemSize,
  42137. this.array[e + 0] = t,
  42138. this.array[e + 1] = i,
  42139. this.array[e + 2] = n,
  42140. this
  42141. },
  42142. setXYZW: function(e, t, i, n, r) {
  42143. return e *= this.itemSize,
  42144. this.array[e + 0] = t,
  42145. this.array[e + 1] = i,
  42146. this.array[e + 2] = n,
  42147. this.array[e + 3] = r,
  42148. this
  42149. },
  42150. clone: function() {
  42151. return (new this.constructor).copy(this)
  42152. }
  42153. },
  42154. Ci.Int8Attribute = function(e, t) {
  42155. return new Ci.BufferAttribute(new Int8Array(e),t)
  42156. }
  42157. ,
  42158. Ci.Uint8Attribute = function(e, t) {
  42159. return new Ci.BufferAttribute(new Uint8Array(e),t)
  42160. }
  42161. ,
  42162. Ci.Uint8ClampedAttribute = function(e, t) {
  42163. return new Ci.BufferAttribute(new Uint8ClampedArray(e),t)
  42164. }
  42165. ,
  42166. Ci.Int16Attribute = function(e, t) {
  42167. return new Ci.BufferAttribute(new Int16Array(e),t)
  42168. }
  42169. ,
  42170. Ci.Uint16Attribute = function(e, t) {
  42171. return new Ci.BufferAttribute(new Uint16Array(e),t)
  42172. }
  42173. ,
  42174. Ci.Int32Attribute = function(e, t) {
  42175. return new Ci.BufferAttribute(new Int32Array(e),t)
  42176. }
  42177. ,
  42178. Ci.Uint32Attribute = function(e, t) {
  42179. return new Ci.BufferAttribute(new Uint32Array(e),t)
  42180. }
  42181. ,
  42182. Ci.Float32Attribute = function(e, t) {
  42183. return new Ci.BufferAttribute(new Float32Array(e),t)
  42184. }
  42185. ,
  42186. Ci.Float64Attribute = function(e, t) {
  42187. return new Ci.BufferAttribute(new Float64Array(e),t)
  42188. }
  42189. ,
  42190. Ci.DynamicBufferAttribute = function(e, t) {
  42191. return console.warn("THREE.DynamicBufferAttribute has been removed. Use new THREE.BufferAttribute().setDynamic( true ) instead."),
  42192. new Ci.BufferAttribute(e,t).setDynamic(!0)
  42193. }
  42194. ,
  42195. Ci.InstancedBufferAttribute = function(e, t, i) {
  42196. Ci.BufferAttribute.call(this, e, t),
  42197. this.meshPerAttribute = i || 1
  42198. }
  42199. ,
  42200. Ci.InstancedBufferAttribute.prototype = Object.create(Ci.BufferAttribute.prototype),
  42201. Ci.InstancedBufferAttribute.prototype.constructor = Ci.InstancedBufferAttribute,
  42202. Ci.InstancedBufferAttribute.prototype.copy = function(e) {
  42203. return Ci.BufferAttribute.prototype.copy.call(this, e),
  42204. this.meshPerAttribute = e.meshPerAttribute,
  42205. this
  42206. }
  42207. ,
  42208. Ci.InterleavedBuffer = function(e, t) {
  42209. this.uuid = Ci.Math.generateUUID(),
  42210. this.array = e,
  42211. this.stride = t,
  42212. this.dynamic = !1,
  42213. this.updateRange = {
  42214. offset: 0,
  42215. count: -1
  42216. },
  42217. this.version = 0
  42218. }
  42219. ,
  42220. Ci.InterleavedBuffer.prototype = {
  42221. constructor: Ci.InterleavedBuffer,
  42222. get length() {
  42223. return this.array.length
  42224. },
  42225. get count() {
  42226. return this.array.length / this.stride
  42227. },
  42228. set needsUpdate(e) {
  42229. !0 === e && this.version++
  42230. },
  42231. setDynamic: function(e) {
  42232. return this.dynamic = e,
  42233. this
  42234. },
  42235. copy: function(e) {
  42236. return this.array = new e.array.constructor(e.array),
  42237. this.stride = e.stride,
  42238. this.dynamic = e.dynamic,
  42239. this
  42240. },
  42241. copyAt: function(e, t, i) {
  42242. e *= this.stride,
  42243. i *= t.stride;
  42244. for (var n = 0, r = this.stride; n < r; n++)
  42245. this.array[e + n] = t.array[i + n];
  42246. return this
  42247. },
  42248. set: function(e, t) {
  42249. return void 0 === t && (t = 0),
  42250. this.array.set(e, t),
  42251. this
  42252. },
  42253. clone: function() {
  42254. return (new this.constructor).copy(this)
  42255. }
  42256. },
  42257. Ci.InstancedInterleavedBuffer = function(e, t, i) {
  42258. Ci.InterleavedBuffer.call(this, e, t),
  42259. this.meshPerAttribute = i || 1
  42260. }
  42261. ,
  42262. Ci.InstancedInterleavedBuffer.prototype = Object.create(Ci.InterleavedBuffer.prototype),
  42263. Ci.InstancedInterleavedBuffer.prototype.constructor = Ci.InstancedInterleavedBuffer,
  42264. Ci.InstancedInterleavedBuffer.prototype.copy = function(e) {
  42265. return Ci.InterleavedBuffer.prototype.copy.call(this, e),
  42266. this.meshPerAttribute = e.meshPerAttribute,
  42267. this
  42268. }
  42269. ,
  42270. Ci.InterleavedBufferAttribute = function(e, t, i) {
  42271. this.uuid = Ci.Math.generateUUID(),
  42272. this.data = e,
  42273. this.itemSize = t,
  42274. this.offset = i
  42275. }
  42276. ,
  42277. Ci.InterleavedBufferAttribute.prototype = {
  42278. constructor: Ci.InterleavedBufferAttribute,
  42279. get length() {
  42280. return console.warn("THREE.BufferAttribute: .length has been deprecated. Please use .count."),
  42281. this.array.length
  42282. },
  42283. get count() {
  42284. return this.data.count
  42285. },
  42286. setX: function(e, t) {
  42287. return this.data.array[e * this.data.stride + this.offset] = t,
  42288. this
  42289. },
  42290. setY: function(e, t) {
  42291. return this.data.array[e * this.data.stride + this.offset + 1] = t,
  42292. this
  42293. },
  42294. setZ: function(e, t) {
  42295. return this.data.array[e * this.data.stride + this.offset + 2] = t,
  42296. this
  42297. },
  42298. setW: function(e, t) {
  42299. return this.data.array[e * this.data.stride + this.offset + 3] = t,
  42300. this
  42301. },
  42302. getX: function(e) {
  42303. return this.data.array[e * this.data.stride + this.offset]
  42304. },
  42305. getY: function(e) {
  42306. return this.data.array[e * this.data.stride + this.offset + 1]
  42307. },
  42308. getZ: function(e) {
  42309. return this.data.array[e * this.data.stride + this.offset + 2]
  42310. },
  42311. getW: function(e) {
  42312. return this.data.array[e * this.data.stride + this.offset + 3]
  42313. },
  42314. setXY: function(e, t, i) {
  42315. return e = e * this.data.stride + this.offset,
  42316. this.data.array[e + 0] = t,
  42317. this.data.array[e + 1] = i,
  42318. this
  42319. },
  42320. setXYZ: function(e, t, i, n) {
  42321. return e = e * this.data.stride + this.offset,
  42322. this.data.array[e + 0] = t,
  42323. this.data.array[e + 1] = i,
  42324. this.data.array[e + 2] = n,
  42325. this
  42326. },
  42327. setXYZW: function(e, t, i, n, r) {
  42328. return e = e * this.data.stride + this.offset,
  42329. this.data.array[e + 0] = t,
  42330. this.data.array[e + 1] = i,
  42331. this.data.array[e + 2] = n,
  42332. this.data.array[e + 3] = r,
  42333. this
  42334. }
  42335. },
  42336. Ci.Geometry = function() {
  42337. Object.defineProperty(this, "id", {
  42338. value: Ci.GeometryIdCount++
  42339. }),
  42340. this.uuid = Ci.Math.generateUUID(),
  42341. this.name = "",
  42342. this.type = "Geometry",
  42343. this.vertices = [],
  42344. this.colors = [],
  42345. this.faces = [],
  42346. this.faceVertexUvs = [[]],
  42347. this.morphTargets = [],
  42348. this.morphNormals = [],
  42349. this.skinWeights = [],
  42350. this.skinIndices = [],
  42351. this.lineDistances = [],
  42352. this.boundingBox = null,
  42353. this.boundingSphere = null,
  42354. this.verticesNeedUpdate = !1,
  42355. this.elementsNeedUpdate = !1,
  42356. this.uvsNeedUpdate = !1,
  42357. this.normalsNeedUpdate = !1,
  42358. this.colorsNeedUpdate = !1,
  42359. this.lineDistancesNeedUpdate = !1,
  42360. this.groupsNeedUpdate = !1
  42361. }
  42362. ,
  42363. Ci.Geometry.prototype = {
  42364. constructor: Ci.Geometry,
  42365. applyMatrix: function(e) {
  42366. for (var t = (new Ci.Matrix3).getNormalMatrix(e), i = 0, n = this.vertices.length; i < n; i++) {
  42367. this.vertices[i].applyMatrix4(e)
  42368. }
  42369. for (i = 0,
  42370. n = this.faces.length; i < n; i++) {
  42371. var r = this.faces[i];
  42372. r.normal.applyMatrix3(t).normalize();
  42373. for (var o = 0, a = r.vertexNormals.length; o < a; o++)
  42374. r.vertexNormals[o].applyMatrix3(t).normalize()
  42375. }
  42376. return null !== this.boundingBox && this.computeBoundingBox(),
  42377. null !== this.boundingSphere && this.computeBoundingSphere(),
  42378. this.verticesNeedUpdate = !0,
  42379. this.normalsNeedUpdate = !0,
  42380. this
  42381. },
  42382. rotateX: function(e) {
  42383. return void 0 === mt && (mt = new Ci.Matrix4),
  42384. mt.makeRotationX(e),
  42385. this.applyMatrix(mt),
  42386. this
  42387. },
  42388. rotateY: function(e) {
  42389. return void 0 === gt && (gt = new Ci.Matrix4),
  42390. gt.makeRotationY(e),
  42391. this.applyMatrix(gt),
  42392. this
  42393. },
  42394. rotateZ: function(e) {
  42395. return void 0 === ft && (ft = new Ci.Matrix4),
  42396. ft.makeRotationZ(e),
  42397. this.applyMatrix(ft),
  42398. this
  42399. },
  42400. translate: function(e, t, i) {
  42401. return void 0 === pt && (pt = new Ci.Matrix4),
  42402. pt.makeTranslation(e, t, i),
  42403. this.applyMatrix(pt),
  42404. this
  42405. },
  42406. scale: function(e, t, i) {
  42407. return void 0 === dt && (dt = new Ci.Matrix4),
  42408. dt.makeScale(e, t, i),
  42409. this.applyMatrix(dt),
  42410. this
  42411. },
  42412. lookAt: function(e) {
  42413. void 0 === ut && (ut = new Ci.Object3D),
  42414. ut.lookAt(e),
  42415. ut.updateMatrix(),
  42416. this.applyMatrix(ut.matrix)
  42417. },
  42418. fromBufferGeometry: function(e) {
  42419. function t(e, t, i, n) {
  42420. var r = void 0 !== l ? [d[e].clone(), d[t].clone(), d[i].clone()] : []
  42421. , o = void 0 !== c ? [s.colors[e].clone(), s.colors[t].clone(), s.colors[i].clone()] : []
  42422. , a = new Ci.Face3(e,t,i,r,o,n);
  42423. s.faces.push(a),
  42424. void 0 !== h && s.faceVertexUvs[0].push([p[e].clone(), p[t].clone(), p[i].clone()]),
  42425. void 0 !== u && s.faceVertexUvs[1].push([f[e].clone(), f[t].clone(), f[i].clone()])
  42426. }
  42427. var s = this
  42428. , i = null !== e.index ? e.index.array : void 0
  42429. , n = e.attributes
  42430. , r = n.position.array
  42431. , l = void 0 !== n.normal ? n.normal.array : void 0
  42432. , c = void 0 !== n.color ? n.color.array : void 0
  42433. , h = void 0 !== n.uv ? n.uv.array : void 0
  42434. , u = void 0 !== n.uv2 ? n.uv2.array : void 0;
  42435. void 0 !== u && (this.faceVertexUvs[1] = []);
  42436. for (var d = [], p = [], f = [], o = 0, a = 0; o < r.length; o += 3,
  42437. a += 2)
  42438. s.vertices.push(new Ci.Vector3(r[o],r[o + 1],r[o + 2])),
  42439. void 0 !== l && d.push(new Ci.Vector3(l[o],l[o + 1],l[o + 2])),
  42440. void 0 !== c && s.colors.push(new Ci.Color(c[o],c[o + 1],c[o + 2])),
  42441. void 0 !== h && p.push(new Ci.Vector2(h[a],h[a + 1])),
  42442. void 0 !== u && f.push(new Ci.Vector2(u[a],u[a + 1]));
  42443. if (void 0 !== i) {
  42444. var g = e.groups;
  42445. if (0 < g.length)
  42446. for (o = 0; o < g.length; o++)
  42447. for (var m = g[o], v = m.start, y = (a = v,
  42448. v + m.count); a < y; a += 3)
  42449. t(i[a], i[a + 1], i[a + 2], m.materialIndex);
  42450. else
  42451. for (o = 0; o < i.length; o += 3)
  42452. t(i[o], i[o + 1], i[o + 2])
  42453. } else
  42454. for (o = 0; o < r.length / 3; o += 3)
  42455. t(o, o + 1, o + 2);
  42456. return this.computeFaceNormals(),
  42457. null !== e.boundingBox && (this.boundingBox = e.boundingBox.clone()),
  42458. null !== e.boundingSphere && (this.boundingSphere = e.boundingSphere.clone()),
  42459. this
  42460. },
  42461. center: function() {
  42462. this.computeBoundingBox();
  42463. var e = this.boundingBox.center().negate();
  42464. return this.translate(e.x, e.y, e.z),
  42465. e
  42466. },
  42467. normalize: function() {
  42468. this.computeBoundingSphere();
  42469. var e = this.boundingSphere.center
  42470. , t = this.boundingSphere.radius
  42471. , i = 0 === t ? 1 : 1 / t
  42472. , n = new Ci.Matrix4;
  42473. 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),
  42474. this.applyMatrix(n),
  42475. this
  42476. },
  42477. computeFaceNormals: function() {
  42478. for (var e = new Ci.Vector3, t = new Ci.Vector3, i = 0, n = this.faces.length; i < n; i++) {
  42479. var r = this.faces[i]
  42480. , o = this.vertices[r.a]
  42481. , a = this.vertices[r.b]
  42482. , s = this.vertices[r.c];
  42483. e.subVectors(s, a),
  42484. t.subVectors(o, a),
  42485. e.cross(t),
  42486. e.normalize(),
  42487. r.normal.copy(e)
  42488. }
  42489. },
  42490. computeVertexNormals: function(e) {
  42491. var t, i, n, r, o, a;
  42492. for (void 0 === e && (e = !0),
  42493. a = new Array(this.vertices.length),
  42494. t = 0,
  42495. i = this.vertices.length; t < i; t++)
  42496. a[t] = new Ci.Vector3;
  42497. if (e) {
  42498. var s, l, c, h = new Ci.Vector3, u = new Ci.Vector3;
  42499. for (n = 0,
  42500. r = this.faces.length; n < r; n++)
  42501. o = this.faces[n],
  42502. s = this.vertices[o.a],
  42503. l = this.vertices[o.b],
  42504. c = this.vertices[o.c],
  42505. h.subVectors(c, l),
  42506. u.subVectors(s, l),
  42507. h.cross(u),
  42508. a[o.a].add(h),
  42509. a[o.b].add(h),
  42510. a[o.c].add(h)
  42511. } else
  42512. for (n = 0,
  42513. r = this.faces.length; n < r; n++)
  42514. a[(o = this.faces[n]).a].add(o.normal),
  42515. a[o.b].add(o.normal),
  42516. a[o.c].add(o.normal);
  42517. for (t = 0,
  42518. i = this.vertices.length; t < i; t++)
  42519. a[t].normalize();
  42520. for (n = 0,
  42521. r = this.faces.length; n < r; n++) {
  42522. var d = (o = this.faces[n]).vertexNormals;
  42523. 3 === d.length ? (d[0].copy(a[o.a]),
  42524. d[1].copy(a[o.b]),
  42525. d[2].copy(a[o.c])) : (d[0] = a[o.a].clone(),
  42526. d[1] = a[o.b].clone(),
  42527. d[2] = a[o.c].clone())
  42528. }
  42529. 0 < this.faces.length && (this.normalsNeedUpdate = !0)
  42530. },
  42531. computeMorphNormals: function() {
  42532. var e, t, i, n, r;
  42533. for (i = 0,
  42534. n = this.faces.length; i < n; i++)
  42535. for ((r = this.faces[i]).__originalFaceNormal ? r.__originalFaceNormal.copy(r.normal) : r.__originalFaceNormal = r.normal.clone(),
  42536. r.__originalVertexNormals || (r.__originalVertexNormals = []),
  42537. e = 0,
  42538. t = r.vertexNormals.length; e < t; e++)
  42539. r.__originalVertexNormals[e] ? r.__originalVertexNormals[e].copy(r.vertexNormals[e]) : r.__originalVertexNormals[e] = r.vertexNormals[e].clone();
  42540. var o = new Ci.Geometry;
  42541. for (o.faces = this.faces,
  42542. e = 0,
  42543. t = this.morphTargets.length; e < t; e++) {
  42544. if (!this.morphNormals[e]) {
  42545. this.morphNormals[e] = {},
  42546. this.morphNormals[e].faceNormals = [],
  42547. this.morphNormals[e].vertexNormals = [];
  42548. var a = this.morphNormals[e].faceNormals
  42549. , s = this.morphNormals[e].vertexNormals;
  42550. for (i = 0,
  42551. n = this.faces.length; i < n; i++)
  42552. l = new Ci.Vector3,
  42553. c = {
  42554. a: new Ci.Vector3,
  42555. b: new Ci.Vector3,
  42556. c: new Ci.Vector3
  42557. },
  42558. a.push(l),
  42559. s.push(c)
  42560. }
  42561. var l, c, h = this.morphNormals[e];
  42562. for (o.vertices = this.morphTargets[e].vertices,
  42563. o.computeFaceNormals(),
  42564. o.computeVertexNormals(),
  42565. i = 0,
  42566. n = this.faces.length; i < n; i++)
  42567. r = this.faces[i],
  42568. l = h.faceNormals[i],
  42569. c = h.vertexNormals[i],
  42570. l.copy(r.normal),
  42571. c.a.copy(r.vertexNormals[0]),
  42572. c.b.copy(r.vertexNormals[1]),
  42573. c.c.copy(r.vertexNormals[2])
  42574. }
  42575. for (i = 0,
  42576. n = this.faces.length; i < n; i++)
  42577. (r = this.faces[i]).normal = r.__originalFaceNormal,
  42578. r.vertexNormals = r.__originalVertexNormals
  42579. },
  42580. computeTangents: function() {
  42581. console.warn("THREE.Geometry: .computeTangents() has been removed.")
  42582. },
  42583. computeLineDistances: function() {
  42584. for (var e = 0, t = this.vertices, i = 0, n = t.length; i < n; i++)
  42585. 0 < i && (e += t[i].distanceTo(t[i - 1])),
  42586. this.lineDistances[i] = e
  42587. },
  42588. computeBoundingBox: function() {
  42589. null === this.boundingBox && (this.boundingBox = new Ci.Box3),
  42590. this.boundingBox.setFromPoints(this.vertices)
  42591. },
  42592. computeBoundingSphere: function() {
  42593. null === this.boundingSphere && (this.boundingSphere = new Ci.Sphere),
  42594. this.boundingSphere.setFromPoints(this.vertices)
  42595. },
  42596. merge: function(e, t, i) {
  42597. if (e instanceof Ci.Geometry != 0) {
  42598. 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];
  42599. void 0 === i && (i = 0),
  42600. void 0 !== t && (n = (new Ci.Matrix3).getNormalMatrix(t));
  42601. for (var u = 0, d = a.length; u < d; u++) {
  42602. var p = a[u].clone();
  42603. void 0 !== t && p.applyMatrix4(t),
  42604. o.push(p)
  42605. }
  42606. for (u = 0,
  42607. d = l.length; u < d; u++) {
  42608. var f, g, m, v = l[u], y = v.vertexNormals, A = v.vertexColors;
  42609. (f = new Ci.Face3(v.a + r,v.b + r,v.c + r)).normal.copy(v.normal),
  42610. void 0 !== n && f.normal.applyMatrix3(n).normalize();
  42611. for (var C = 0, I = y.length; C < I; C++)
  42612. g = y[C].clone(),
  42613. void 0 !== n && g.applyMatrix3(n).normalize(),
  42614. f.vertexNormals.push(g);
  42615. f.color.copy(v.color);
  42616. for (C = 0,
  42617. I = A.length; C < I; C++)
  42618. m = A[C],
  42619. f.vertexColors.push(m.clone());
  42620. f.materialIndex = v.materialIndex + i,
  42621. s.push(f)
  42622. }
  42623. for (u = 0,
  42624. d = h.length; u < d; u++) {
  42625. var E = h[u]
  42626. , _ = [];
  42627. if (void 0 !== E) {
  42628. for (C = 0,
  42629. I = E.length; C < I; C++)
  42630. _.push(E[C].clone());
  42631. c.push(_)
  42632. }
  42633. }
  42634. } else
  42635. console.error("THREE.Geometry.merge(): geometry not an instance of THREE.Geometry.", e)
  42636. },
  42637. mergeMesh: function(e) {
  42638. return e instanceof Ci.Mesh == 0 ? void console.error("THREE.Geometry.mergeMesh(): mesh not an instance of THREE.Mesh.", e) : (e.matrixAutoUpdate && e.updateMatrix(),
  42639. void this.merge(e.geometry, e.matrix))
  42640. },
  42641. mergeVertices: function() {
  42642. var e, t, i, n, r, o, a, s, l = {}, c = [], h = [], u = Math.pow(10, 4);
  42643. for (i = 0,
  42644. n = this.vertices.length; i < n; i++)
  42645. e = this.vertices[i],
  42646. void 0 === l[t = Math.round(e.x * u) + "_" + Math.round(e.y * u) + "_" + Math.round(e.z * u)] ? (l[t] = i,
  42647. c.push(this.vertices[i]),
  42648. h[i] = c.length - 1) : h[i] = h[l[t]];
  42649. var d = [];
  42650. for (i = 0,
  42651. n = this.faces.length; i < n; i++) {
  42652. (r = this.faces[i]).a = h[r.a],
  42653. r.b = h[r.b],
  42654. r.c = h[r.c],
  42655. o = [r.a, r.b, r.c];
  42656. for (var p = 0; p < 3; p++)
  42657. if (o[p] === o[(p + 1) % 3]) {
  42658. p,
  42659. d.push(i);
  42660. break
  42661. }
  42662. }
  42663. for (i = d.length - 1; 0 <= i; i--) {
  42664. var f = d[i];
  42665. for (this.faces.splice(f, 1),
  42666. a = 0,
  42667. s = this.faceVertexUvs.length; a < s; a++)
  42668. this.faceVertexUvs[a].splice(f, 1)
  42669. }
  42670. var g = this.vertices.length - c.length;
  42671. return this.vertices = c,
  42672. g
  42673. },
  42674. sortFacesByMaterialIndex: function() {
  42675. for (var e = this.faces, t = e.length, i = 0; i < t; i++)
  42676. e[i]._id = i;
  42677. e.sort(function(e, t) {
  42678. return e.materialIndex - t.materialIndex
  42679. });
  42680. var n, r, o = this.faceVertexUvs[0], a = this.faceVertexUvs[1];
  42681. o && o.length === t && (n = []),
  42682. a && a.length === t && (r = []);
  42683. for (i = 0; i < t; i++) {
  42684. var s = e[i]._id;
  42685. n && n.push(o[s]),
  42686. r && r.push(a[s])
  42687. }
  42688. n && (this.faceVertexUvs[0] = n),
  42689. r && (this.faceVertexUvs[1] = r)
  42690. },
  42691. toJSON: function() {
  42692. function e(e, t, i) {
  42693. return i ? e | 1 << t : e & ~(1 << t)
  42694. }
  42695. function t(e) {
  42696. var t = e.x.toString() + e.y.toString() + e.z.toString();
  42697. return void 0 !== d[t] || (d[t] = u.length / 3,
  42698. u.push(e.x, e.y, e.z)),
  42699. d[t]
  42700. }
  42701. function i(e) {
  42702. var t = e.r.toString() + e.g.toString() + e.b.toString();
  42703. return void 0 !== f[t] || (f[t] = p.length,
  42704. p.push(e.getHex())),
  42705. f[t]
  42706. }
  42707. function n(e) {
  42708. var t = e.x.toString() + e.y.toString();
  42709. return void 0 !== m[t] || (m[t] = g.length / 2,
  42710. g.push(e.x, e.y)),
  42711. m[t]
  42712. }
  42713. var r = {
  42714. metadata: {
  42715. version: 4.4,
  42716. type: "Geometry",
  42717. generator: "Geometry.toJSON"
  42718. }
  42719. };
  42720. if (r.uuid = this.uuid,
  42721. r.type = this.type,
  42722. "" !== this.name && (r.name = this.name),
  42723. void 0 !== this.parameters) {
  42724. var o = this.parameters;
  42725. for (var a in o)
  42726. void 0 !== o[a] && (r[a] = o[a]);
  42727. return r
  42728. }
  42729. for (var s = [], l = 0; l < this.vertices.length; l++) {
  42730. var c = this.vertices[l];
  42731. s.push(c.x, c.y, c.z)
  42732. }
  42733. var h = []
  42734. , u = []
  42735. , d = {}
  42736. , p = []
  42737. , f = {}
  42738. , g = []
  42739. , m = {};
  42740. for (l = 0; l < this.faces.length; l++) {
  42741. var v = this.faces[l]
  42742. , y = void 0 !== this.faceVertexUvs[0][l]
  42743. , A = 0 < v.normal.length()
  42744. , C = 0 < v.vertexNormals.length
  42745. , I = 1 !== v.color.r || 1 !== v.color.g || 1 !== v.color.b
  42746. , E = 0 < v.vertexColors.length
  42747. , _ = 0;
  42748. 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),
  42749. h.push(_),
  42750. h.push(v.a, v.b, v.c),
  42751. h.push(v.materialIndex),
  42752. y) {
  42753. var b = this.faceVertexUvs[0][l];
  42754. h.push(n(b[0]), n(b[1]), n(b[2]))
  42755. }
  42756. if (A && h.push(t(v.normal)),
  42757. C) {
  42758. var w = v.vertexNormals;
  42759. h.push(t(w[0]), t(w[1]), t(w[2]))
  42760. }
  42761. if (I && h.push(i(v.color)),
  42762. E) {
  42763. var T = v.vertexColors;
  42764. h.push(i(T[0]), i(T[1]), i(T[2]))
  42765. }
  42766. }
  42767. return r.data = {},
  42768. r.data.vertices = s,
  42769. r.data.normals = u,
  42770. 0 < p.length && (r.data.colors = p),
  42771. 0 < g.length && (r.data.uvs = [g]),
  42772. r.data.faces = h,
  42773. r
  42774. },
  42775. clone: function() {
  42776. return (new Ci.Geometry).copy(this)
  42777. },
  42778. copy: function(e) {
  42779. this.vertices = [],
  42780. this.faces = [],
  42781. this.faceVertexUvs = [[]];
  42782. for (var t = e.vertices, i = 0, n = t.length; i < n; i++)
  42783. this.vertices.push(t[i].clone());
  42784. var r = e.faces;
  42785. for (i = 0,
  42786. n = r.length; i < n; i++)
  42787. this.faces.push(r[i].clone());
  42788. for (i = 0,
  42789. n = e.faceVertexUvs.length; i < n; i++) {
  42790. var o = e.faceVertexUvs[i];
  42791. void 0 === this.faceVertexUvs[i] && (this.faceVertexUvs[i] = []);
  42792. for (var a = 0, s = o.length; a < s; a++) {
  42793. for (var l = o[a], c = [], h = 0, u = l.length; h < u; h++) {
  42794. var d = l[h];
  42795. c.push(d.clone())
  42796. }
  42797. this.faceVertexUvs[i].push(c)
  42798. }
  42799. }
  42800. return this
  42801. },
  42802. dispose: function() {
  42803. this.dispatchEvent({
  42804. type: "dispose"
  42805. })
  42806. }
  42807. },
  42808. Ci.EventDispatcher.prototype.apply(Ci.Geometry.prototype),
  42809. Ci.GeometryIdCount = 0,
  42810. Ci.DirectGeometry = function() {
  42811. Object.defineProperty(this, "id", {
  42812. value: Ci.GeometryIdCount++
  42813. }),
  42814. this.uuid = Ci.Math.generateUUID(),
  42815. this.name = "",
  42816. this.type = "DirectGeometry",
  42817. this.indices = [],
  42818. this.vertices = [],
  42819. this.normals = [],
  42820. this.colors = [],
  42821. this.uvs = [],
  42822. this.uvs2 = [],
  42823. this.groups = [],
  42824. this.morphTargets = {},
  42825. this.skinWeights = [],
  42826. this.skinIndices = [],
  42827. this.boundingBox = null,
  42828. this.boundingSphere = null,
  42829. this.verticesNeedUpdate = !1,
  42830. this.normalsNeedUpdate = !1,
  42831. this.colorsNeedUpdate = !1,
  42832. this.uvsNeedUpdate = !1,
  42833. this.groupsNeedUpdate = !1
  42834. }
  42835. ,
  42836. Ci.DirectGeometry.prototype = {
  42837. constructor: Ci.DirectGeometry,
  42838. computeBoundingBox: Ci.Geometry.prototype.computeBoundingBox,
  42839. computeBoundingSphere: Ci.Geometry.prototype.computeBoundingSphere,
  42840. computeFaceNormals: function() {
  42841. console.warn("THREE.DirectGeometry: computeFaceNormals() is not a method of this type of geometry.")
  42842. },
  42843. computeVertexNormals: function() {
  42844. console.warn("THREE.DirectGeometry: computeVertexNormals() is not a method of this type of geometry.")
  42845. },
  42846. computeGroups: function(e) {
  42847. for (var t, i, n = [], r = e.faces, o = 0; o < r.length; o++) {
  42848. var a = r[o];
  42849. a.materialIndex !== i && (i = a.materialIndex,
  42850. void 0 !== t && (t.count = 3 * o - t.start,
  42851. n.push(t)),
  42852. t = {
  42853. start: 3 * o,
  42854. materialIndex: i
  42855. })
  42856. }
  42857. void 0 !== t && (t.count = 3 * o - t.start,
  42858. n.push(t)),
  42859. this.groups = n
  42860. },
  42861. fromGeometry: function(e) {
  42862. 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;
  42863. if (0 < l) {
  42864. t = [];
  42865. for (var c = 0; c < l; c++)
  42866. t[c] = [];
  42867. this.morphTargets.position = t
  42868. }
  42869. var h, u = e.morphNormals, d = u.length;
  42870. if (0 < d) {
  42871. h = [];
  42872. for (c = 0; c < d; c++)
  42873. h[c] = [];
  42874. this.morphTargets.normal = h
  42875. }
  42876. var p = e.skinIndices
  42877. , f = e.skinWeights
  42878. , g = p.length === n.length
  42879. , m = f.length === n.length;
  42880. for (c = 0; c < i.length; c++) {
  42881. var v = i[c];
  42882. this.vertices.push(n[v.a], n[v.b], n[v.c]);
  42883. var y = v.vertexNormals;
  42884. if (3 === y.length)
  42885. this.normals.push(y[0], y[1], y[2]);
  42886. else {
  42887. var A = v.normal;
  42888. this.normals.push(A, A, A)
  42889. }
  42890. var C, I = v.vertexColors;
  42891. if (3 === I.length)
  42892. this.colors.push(I[0], I[1], I[2]);
  42893. else {
  42894. var E = v.color;
  42895. this.colors.push(E, E, E)
  42896. }
  42897. if (!0 === o)
  42898. void 0 !== (C = r[0][c]) ? this.uvs.push(C[0], C[1], C[2]) : (console.warn("THREE.DirectGeometry.fromGeometry(): Undefined vertexUv ", c),
  42899. this.uvs.push(new Ci.Vector2, new Ci.Vector2, new Ci.Vector2));
  42900. if (!0 === a)
  42901. void 0 !== (C = r[1][c]) ? this.uvs2.push(C[0], C[1], C[2]) : (console.warn("THREE.DirectGeometry.fromGeometry(): Undefined vertexUv2 ", c),
  42902. this.uvs2.push(new Ci.Vector2, new Ci.Vector2, new Ci.Vector2));
  42903. for (var _ = 0; _ < l; _++) {
  42904. var b = s[_].vertices;
  42905. t[_].push(b[v.a], b[v.b], b[v.c])
  42906. }
  42907. for (_ = 0; _ < d; _++) {
  42908. var w = u[_].vertexNormals[c];
  42909. h[_].push(w.a, w.b, w.c)
  42910. }
  42911. g && this.skinIndices.push(p[v.a], p[v.b], p[v.c]),
  42912. m && this.skinWeights.push(f[v.a], f[v.b], f[v.c])
  42913. }
  42914. return this.computeGroups(e),
  42915. this.verticesNeedUpdate = e.verticesNeedUpdate,
  42916. this.normalsNeedUpdate = e.normalsNeedUpdate,
  42917. this.colorsNeedUpdate = e.colorsNeedUpdate,
  42918. this.uvsNeedUpdate = e.uvsNeedUpdate,
  42919. this.groupsNeedUpdate = e.groupsNeedUpdate,
  42920. this
  42921. },
  42922. dispose: function() {
  42923. this.dispatchEvent({
  42924. type: "dispose"
  42925. })
  42926. }
  42927. },
  42928. Ci.EventDispatcher.prototype.apply(Ci.DirectGeometry.prototype),
  42929. Ci.BufferGeometry = function() {
  42930. Object.defineProperty(this, "id", {
  42931. value: Ci.GeometryIdCount++
  42932. }),
  42933. this.uuid = Ci.Math.generateUUID(),
  42934. this.name = "",
  42935. this.type = "BufferGeometry",
  42936. this.index = null,
  42937. this.attributes = {},
  42938. this.morphAttributes = {},
  42939. this.groups = [],
  42940. this.boundingBox = null,
  42941. this.boundingSphere = null,
  42942. this.drawRange = {
  42943. start: 0,
  42944. count: 1 / 0
  42945. }
  42946. }
  42947. ,
  42948. Ci.BufferGeometry.prototype = {
  42949. constructor: Ci.BufferGeometry,
  42950. getIndex: function() {
  42951. return this.index
  42952. },
  42953. setIndex: function(e) {
  42954. this.index = e
  42955. },
  42956. addAttribute: function(e, t) {
  42957. return t instanceof Ci.BufferAttribute == 0 && t instanceof Ci.InterleavedBufferAttribute == 0 ? (console.warn("THREE.BufferGeometry: .addAttribute() now expects ( name, attribute )."),
  42958. void this.addAttribute(e, new Ci.BufferAttribute(t,arguments[2]))) : "index" === e ? (console.warn("THREE.BufferGeometry.addAttribute: Use .setIndex() for index attribute."),
  42959. void this.setIndex(t)) : (this.attributes[e] = t,
  42960. this)
  42961. },
  42962. getAttribute: function(e) {
  42963. return this.attributes[e]
  42964. },
  42965. removeAttribute: function(e) {
  42966. return delete this.attributes[e],
  42967. this
  42968. },
  42969. addGroup: function(e, t, i) {
  42970. this.groups.push({
  42971. start: e,
  42972. count: t,
  42973. materialIndex: void 0 !== i ? i : 0
  42974. })
  42975. },
  42976. clearGroups: function() {
  42977. this.groups = []
  42978. },
  42979. setDrawRange: function(e, t) {
  42980. this.drawRange.start = e,
  42981. this.drawRange.count = t
  42982. },
  42983. applyMatrix: function(e) {
  42984. var t = this.attributes.position;
  42985. void 0 !== t && (e.applyToVector3Array(t.array),
  42986. t.needsUpdate = !0);
  42987. var i = this.attributes.normal;
  42988. void 0 !== i && ((new Ci.Matrix3).getNormalMatrix(e).applyToVector3Array(i.array),
  42989. i.needsUpdate = !0);
  42990. return null !== this.boundingBox && this.computeBoundingBox(),
  42991. null !== this.boundingSphere && this.computeBoundingSphere(),
  42992. this
  42993. },
  42994. rotateX: function(e) {
  42995. return void 0 === ht && (ht = new Ci.Matrix4),
  42996. ht.makeRotationX(e),
  42997. this.applyMatrix(ht),
  42998. this
  42999. },
  43000. rotateY: function(e) {
  43001. return void 0 === ct && (ct = new Ci.Matrix4),
  43002. ct.makeRotationY(e),
  43003. this.applyMatrix(ct),
  43004. this
  43005. },
  43006. rotateZ: function(e) {
  43007. return void 0 === lt && (lt = new Ci.Matrix4),
  43008. lt.makeRotationZ(e),
  43009. this.applyMatrix(lt),
  43010. this
  43011. },
  43012. translate: function(e, t, i) {
  43013. return void 0 === st && (st = new Ci.Matrix4),
  43014. st.makeTranslation(e, t, i),
  43015. this.applyMatrix(st),
  43016. this
  43017. },
  43018. scale: function(e, t, i) {
  43019. return void 0 === at && (at = new Ci.Matrix4),
  43020. at.makeScale(e, t, i),
  43021. this.applyMatrix(at),
  43022. this
  43023. },
  43024. lookAt: function(e) {
  43025. void 0 === ot && (ot = new Ci.Object3D),
  43026. ot.lookAt(e),
  43027. ot.updateMatrix(),
  43028. this.applyMatrix(ot.matrix)
  43029. },
  43030. center: function() {
  43031. this.computeBoundingBox();
  43032. var e = this.boundingBox.center().negate();
  43033. return this.translate(e.x, e.y, e.z),
  43034. e
  43035. },
  43036. setFromObject: function(e) {
  43037. var t = e.geometry;
  43038. if (e instanceof Ci.Points || e instanceof Ci.Line) {
  43039. var i = new Ci.Float32Attribute(3 * t.vertices.length,3)
  43040. , n = new Ci.Float32Attribute(3 * t.colors.length,3);
  43041. if (this.addAttribute("position", i.copyVector3sArray(t.vertices)),
  43042. this.addAttribute("color", n.copyColorsArray(t.colors)),
  43043. t.lineDistances && t.lineDistances.length === t.vertices.length) {
  43044. var r = new Ci.Float32Attribute(t.lineDistances.length,1);
  43045. this.addAttribute("lineDistance", r.copyArray(t.lineDistances))
  43046. }
  43047. null !== t.boundingSphere && (this.boundingSphere = t.boundingSphere.clone()),
  43048. null !== t.boundingBox && (this.boundingBox = t.boundingBox.clone())
  43049. } else
  43050. e instanceof Ci.Mesh && t instanceof Ci.Geometry && this.fromGeometry(t);
  43051. return this
  43052. },
  43053. updateFromObject: function(e) {
  43054. var t, i = e.geometry;
  43055. if (e instanceof Ci.Mesh) {
  43056. var n = i.__directGeometry;
  43057. if (void 0 === n)
  43058. return this.fromGeometry(i);
  43059. n.verticesNeedUpdate = i.verticesNeedUpdate,
  43060. n.normalsNeedUpdate = i.normalsNeedUpdate,
  43061. n.colorsNeedUpdate = i.colorsNeedUpdate,
  43062. n.uvsNeedUpdate = i.uvsNeedUpdate,
  43063. n.groupsNeedUpdate = i.groupsNeedUpdate,
  43064. i.verticesNeedUpdate = !1,
  43065. i.normalsNeedUpdate = !1,
  43066. i.colorsNeedUpdate = !1,
  43067. i.uvsNeedUpdate = !1,
  43068. i.groupsNeedUpdate = !1,
  43069. i = n
  43070. }
  43071. !0 === i.verticesNeedUpdate && (void 0 !== (t = this.attributes.position) && (t.copyVector3sArray(i.vertices),
  43072. t.needsUpdate = !0),
  43073. i.verticesNeedUpdate = !1);
  43074. !0 === i.normalsNeedUpdate && (void 0 !== (t = this.attributes.normal) && (t.copyVector3sArray(i.normals),
  43075. t.needsUpdate = !0),
  43076. i.normalsNeedUpdate = !1);
  43077. !0 === i.colorsNeedUpdate && (void 0 !== (t = this.attributes.color) && (t.copyColorsArray(i.colors),
  43078. t.needsUpdate = !0),
  43079. i.colorsNeedUpdate = !1);
  43080. i.uvsNeedUpdate && (void 0 !== (t = this.attributes.uv) && (t.copyVector2sArray(i.uvs),
  43081. t.needsUpdate = !0),
  43082. i.uvsNeedUpdate = !1);
  43083. i.lineDistancesNeedUpdate && (void 0 !== (t = this.attributes.lineDistance) && (t.copyArray(i.lineDistances),
  43084. t.needsUpdate = !0),
  43085. i.lineDistancesNeedUpdate = !1);
  43086. return i.groupsNeedUpdate && (i.computeGroups(e.geometry),
  43087. this.groups = i.groups,
  43088. i.groupsNeedUpdate = !1),
  43089. this
  43090. },
  43091. fromGeometry: function(e) {
  43092. return e.__directGeometry = (new Ci.DirectGeometry).fromGeometry(e),
  43093. this.fromDirectGeometry(e.__directGeometry)
  43094. },
  43095. fromDirectGeometry: function(e) {
  43096. var t = new Float32Array(3 * e.vertices.length);
  43097. if (this.addAttribute("position", new Ci.BufferAttribute(t,3).copyVector3sArray(e.vertices)),
  43098. 0 < e.normals.length) {
  43099. var i = new Float32Array(3 * e.normals.length);
  43100. this.addAttribute("normal", new Ci.BufferAttribute(i,3).copyVector3sArray(e.normals))
  43101. }
  43102. if (0 < e.colors.length) {
  43103. var n = new Float32Array(3 * e.colors.length);
  43104. this.addAttribute("color", new Ci.BufferAttribute(n,3).copyColorsArray(e.colors))
  43105. }
  43106. if (0 < e.uvs.length) {
  43107. var r = new Float32Array(2 * e.uvs.length);
  43108. this.addAttribute("uv", new Ci.BufferAttribute(r,2).copyVector2sArray(e.uvs))
  43109. }
  43110. if (0 < e.uvs2.length) {
  43111. var o = new Float32Array(2 * e.uvs2.length);
  43112. this.addAttribute("uv2", new Ci.BufferAttribute(o,2).copyVector2sArray(e.uvs2))
  43113. }
  43114. if (0 < e.indices.length) {
  43115. var a = new (65535 < e.vertices.length ? Uint32Array : Uint16Array)(3 * e.indices.length);
  43116. this.setIndex(new Ci.BufferAttribute(a,1).copyIndicesArray(e.indices))
  43117. }
  43118. for (var s in this.groups = e.groups,
  43119. e.morphTargets) {
  43120. for (var l = [], c = e.morphTargets[s], h = 0, u = c.length; h < u; h++) {
  43121. var d = c[h]
  43122. , p = new Ci.Float32Attribute(3 * d.length,3);
  43123. l.push(p.copyVector3sArray(d))
  43124. }
  43125. this.morphAttributes[s] = l
  43126. }
  43127. if (0 < e.skinIndices.length) {
  43128. var f = new Ci.Float32Attribute(4 * e.skinIndices.length,4);
  43129. this.addAttribute("skinIndex", f.copyVector4sArray(e.skinIndices))
  43130. }
  43131. if (0 < e.skinWeights.length) {
  43132. var g = new Ci.Float32Attribute(4 * e.skinWeights.length,4);
  43133. this.addAttribute("skinWeight", g.copyVector4sArray(e.skinWeights))
  43134. }
  43135. return null !== e.boundingSphere && (this.boundingSphere = e.boundingSphere.clone()),
  43136. null !== e.boundingBox && (this.boundingBox = e.boundingBox.clone()),
  43137. this
  43138. },
  43139. computeBoundingBox: (new Ci.Vector3,
  43140. function() {
  43141. null === this.boundingBox && (this.boundingBox = new Ci.Box3);
  43142. var e = this.attributes.position.array;
  43143. e && this.boundingBox.setFromArray(e),
  43144. void 0 !== e && 0 !== e.length || (this.boundingBox.min.set(0, 0, 0),
  43145. this.boundingBox.max.set(0, 0, 0)),
  43146. (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)
  43147. }
  43148. ),
  43149. computeBoundingSphere: (nt = new Ci.Box3,
  43150. rt = new Ci.Vector3,
  43151. function() {
  43152. null === this.boundingSphere && (this.boundingSphere = new Ci.Sphere);
  43153. var e = this.attributes.position.array;
  43154. if (e) {
  43155. var t = this.boundingSphere.center;
  43156. nt.setFromArray(e),
  43157. nt.center(t);
  43158. for (var i = 0, n = 0, r = e.length; n < r; n += 3)
  43159. rt.fromArray(e, n),
  43160. i = Math.max(i, t.distanceToSquared(rt));
  43161. this.boundingSphere.radius = Math.sqrt(i),
  43162. isNaN(this.boundingSphere.radius) && console.error('THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.', this)
  43163. }
  43164. }
  43165. ),
  43166. computeFaceNormals: function() {},
  43167. computeVertexNormals: function() {
  43168. var e = this.index
  43169. , t = this.attributes
  43170. , i = this.groups;
  43171. if (t.position) {
  43172. var n = t.position.array;
  43173. if (void 0 === t.normal)
  43174. this.addAttribute("normal", new Ci.BufferAttribute(new Float32Array(n.length),3));
  43175. else
  43176. for (var r = t.normal.array, o = 0, a = r.length; o < a; o++)
  43177. r[o] = 0;
  43178. 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;
  43179. if (e) {
  43180. var m = e.array;
  43181. 0 === i.length && this.addGroup(0, m.length);
  43182. for (var v = 0, y = i.length; v < y; ++v) {
  43183. var A = i[v]
  43184. , C = A.start;
  43185. for (o = C,
  43186. a = C + A.count; o < a; o += 3)
  43187. s = 3 * m[o + 0],
  43188. l = 3 * m[o + 1],
  43189. c = 3 * m[o + 2],
  43190. u.fromArray(n, s),
  43191. d.fromArray(n, l),
  43192. p.fromArray(n, c),
  43193. f.subVectors(p, d),
  43194. g.subVectors(u, d),
  43195. f.cross(g),
  43196. h[s] += f.x,
  43197. h[1 + s] += f.y,
  43198. h[2 + s] += f.z,
  43199. h[l] += f.x,
  43200. h[1 + l] += f.y,
  43201. h[2 + l] += f.z,
  43202. h[c] += f.x,
  43203. h[1 + c] += f.y,
  43204. h[2 + c] += f.z
  43205. }
  43206. } else
  43207. for (o = 0,
  43208. a = n.length; o < a; o += 9)
  43209. u.fromArray(n, o),
  43210. d.fromArray(n, o + 3),
  43211. p.fromArray(n, o + 6),
  43212. f.subVectors(p, d),
  43213. g.subVectors(u, d),
  43214. f.cross(g),
  43215. h[o] = f.x,
  43216. h[o + 1] = f.y,
  43217. h[o + 2] = f.z,
  43218. h[o + 3] = f.x,
  43219. h[o + 4] = f.y,
  43220. h[o + 5] = f.z,
  43221. h[o + 6] = f.x,
  43222. h[o + 7] = f.y,
  43223. h[o + 8] = f.z;
  43224. this.normalizeNormals(),
  43225. t.normal.needsUpdate = !0
  43226. }
  43227. },
  43228. merge: function(e, t) {
  43229. if (e instanceof Ci.BufferGeometry != 0) {
  43230. void 0 === t && (t = 0);
  43231. var i = this.attributes;
  43232. for (var n in i)
  43233. if (void 0 !== e.attributes[n])
  43234. for (var r = i[n].array, o = e.attributes[n], a = o.array, s = 0, l = o.itemSize * t; s < a.length; s++,
  43235. l++)
  43236. r[l] = a[s];
  43237. return this
  43238. }
  43239. console.error("THREE.BufferGeometry.merge(): geometry not an instance of THREE.BufferGeometry.", e)
  43240. },
  43241. normalizeNormals: function() {
  43242. for (var e, t, i, n, r = this.attributes.normal.array, o = 0, a = r.length; o < a; o += 3)
  43243. e = r[o],
  43244. t = r[o + 1],
  43245. i = r[o + 2],
  43246. n = 1 / Math.sqrt(e * e + t * t + i * i),
  43247. r[o] *= n,
  43248. r[o + 1] *= n,
  43249. r[o + 2] *= n
  43250. },
  43251. toNonIndexed: function() {
  43252. if (null === this.index)
  43253. return console.warn("THREE.BufferGeometry.toNonIndexed(): Geometry is already non-indexed."),
  43254. this;
  43255. var e = new Ci.BufferGeometry
  43256. , t = this.index.array
  43257. , i = this.attributes;
  43258. for (var n in i) {
  43259. 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++) {
  43260. l = t[h] * a;
  43261. for (var d = 0; d < a; d++)
  43262. s[c++] = o[l++]
  43263. }
  43264. e.addAttribute(n, new Ci.BufferAttribute(s,a))
  43265. }
  43266. return e
  43267. },
  43268. toJSON: function() {
  43269. var e = {
  43270. metadata: {
  43271. version: 4.4,
  43272. type: "BufferGeometry",
  43273. generator: "BufferGeometry.toJSON"
  43274. }
  43275. };
  43276. if (e.uuid = this.uuid,
  43277. e.type = this.type,
  43278. "" !== this.name && (e.name = this.name),
  43279. void 0 !== this.parameters) {
  43280. var t = this.parameters;
  43281. for (var i in t)
  43282. void 0 !== t[i] && (e[i] = t[i]);
  43283. return e
  43284. }
  43285. e.data = {
  43286. attributes: {}
  43287. };
  43288. var n = this.index;
  43289. if (null !== n) {
  43290. var r = Array.prototype.slice.call(n.array);
  43291. e.data.index = {
  43292. type: n.array.constructor.name,
  43293. array: r
  43294. }
  43295. }
  43296. var o = this.attributes;
  43297. for (var i in o) {
  43298. var a = o[i];
  43299. r = Array.prototype.slice.call(a.array);
  43300. e.data.attributes[i] = {
  43301. itemSize: a.itemSize,
  43302. type: a.array.constructor.name,
  43303. array: r
  43304. }
  43305. }
  43306. var s = this.groups;
  43307. 0 < s.length && (e.data.groups = JSON.parse(JSON.stringify(s)));
  43308. var l = this.boundingSphere;
  43309. return null !== l && (e.data.boundingSphere = {
  43310. center: l.center.toArray(),
  43311. radius: l.radius
  43312. }),
  43313. e
  43314. },
  43315. clone: function() {
  43316. return (new Ci.BufferGeometry).copy(this)
  43317. },
  43318. copy: function(e) {
  43319. var t = e.index;
  43320. null !== t && this.setIndex(t.clone());
  43321. var i = e.attributes;
  43322. for (var n in i) {
  43323. var r = i[n];
  43324. this.addAttribute(n, r.clone())
  43325. }
  43326. for (var o = e.groups, a = 0, s = o.length; a < s; a++) {
  43327. var l = o[a];
  43328. this.addGroup(l.start, l.count)
  43329. }
  43330. return this
  43331. },
  43332. dispose: function() {
  43333. this.dispatchEvent({
  43334. type: "dispose"
  43335. })
  43336. }
  43337. },
  43338. Ci.EventDispatcher.prototype.apply(Ci.BufferGeometry.prototype),
  43339. Ci.BufferGeometry.MaxIndex = 65535,
  43340. Ci.InstancedBufferGeometry = function() {
  43341. Ci.BufferGeometry.call(this),
  43342. this.type = "InstancedBufferGeometry",
  43343. this.maxInstancedCount = void 0
  43344. }
  43345. ,
  43346. Ci.InstancedBufferGeometry.prototype = Object.create(Ci.BufferGeometry.prototype),
  43347. Ci.InstancedBufferGeometry.prototype.constructor = Ci.InstancedBufferGeometry,
  43348. Ci.InstancedBufferGeometry.prototype.addGroup = function(e, t, i) {
  43349. this.groups.push({
  43350. start: e,
  43351. count: t,
  43352. instances: i
  43353. })
  43354. }
  43355. ,
  43356. Ci.InstancedBufferGeometry.prototype.copy = function(e) {
  43357. var t = e.index;
  43358. null !== t && this.setIndex(t.clone());
  43359. var i = e.attributes;
  43360. for (var n in i) {
  43361. var r = i[n];
  43362. this.addAttribute(n, r.clone())
  43363. }
  43364. for (var o = e.groups, a = 0, s = o.length; a < s; a++) {
  43365. var l = o[a];
  43366. this.addGroup(l.start, l.count, l.instances)
  43367. }
  43368. return this
  43369. }
  43370. ,
  43371. Ci.EventDispatcher.prototype.apply(Ci.InstancedBufferGeometry.prototype),
  43372. Ci.Uniform = function(e, t) {
  43373. this.type = e,
  43374. this.value = t,
  43375. this.dynamic = !1
  43376. }
  43377. ,
  43378. Ci.Uniform.prototype = {
  43379. constructor: Ci.Uniform,
  43380. onUpdate: function(e) {
  43381. return this.dynamic = !0,
  43382. this.onUpdateCallback = e,
  43383. this
  43384. }
  43385. },
  43386. Ci.AnimationClip = function(e, t, i) {
  43387. this.name = e || Ci.Math.generateUUID(),
  43388. this.tracks = i,
  43389. this.duration = void 0 !== t ? t : -1,
  43390. this.duration < 0 && this.resetDuration(),
  43391. this.trim(),
  43392. this.optimize()
  43393. }
  43394. ,
  43395. Ci.AnimationClip.prototype = {
  43396. constructor: Ci.AnimationClip,
  43397. resetDuration: function() {
  43398. for (var e = 0, t = 0, i = this.tracks.length; t !== i; ++t) {
  43399. var n = this.tracks[t];
  43400. e = Math.max(e, n.times[n.times.length - 1])
  43401. }
  43402. this.duration = e
  43403. },
  43404. trim: function() {
  43405. for (var e = 0; e < this.tracks.length; e++)
  43406. this.tracks[e].trim(0, this.duration);
  43407. return this
  43408. },
  43409. optimize: function() {
  43410. for (var e = 0; e < this.tracks.length; e++)
  43411. this.tracks[e].optimize();
  43412. return this
  43413. }
  43414. },
  43415. Object.assign(Ci.AnimationClip, {
  43416. parse: function(e) {
  43417. for (var t = [], i = e.tracks, n = 1 / (e.fps || 1), r = 0, o = i.length; r !== o; ++r)
  43418. t.push(Ci.KeyframeTrack.parse(i[r]).scale(n));
  43419. return new Ci.AnimationClip(e.name,e.duration,t)
  43420. },
  43421. toJSON: function(e) {
  43422. for (var t = [], i = e.tracks, n = {
  43423. name: e.name,
  43424. duration: e.duration,
  43425. tracks: t
  43426. }, r = 0, o = i.length; r !== o; ++r)
  43427. t.push(Ci.KeyframeTrack.toJSON(i[r]));
  43428. return n
  43429. },
  43430. CreateFromMorphTargetSequence: function(e, t, i) {
  43431. for (var n = t.length, r = [], o = 0; o < n; o++) {
  43432. var a = []
  43433. , s = [];
  43434. a.push((o + n - 1) % n, o, (o + 1) % n),
  43435. s.push(0, 1, 0);
  43436. var l = Ci.AnimationUtils.getKeyframeOrder(a);
  43437. a = Ci.AnimationUtils.sortedArray(a, 1, l),
  43438. s = Ci.AnimationUtils.sortedArray(s, 1, l),
  43439. 0 === a[0] && (a.push(n),
  43440. s.push(s[0])),
  43441. r.push(new Ci.NumberKeyframeTrack(".morphTargetInfluences[" + t[o].name + "]",a,s).scale(1 / i))
  43442. }
  43443. return new Ci.AnimationClip(e,-1,r)
  43444. },
  43445. findByName: function(e, t) {
  43446. for (var i = 0; i < e.length; i++)
  43447. if (e[i].name === t)
  43448. return e[i];
  43449. return null
  43450. },
  43451. CreateClipsFromMorphTargetSequences: function(e, t) {
  43452. for (var i = {}, n = /^([\w-]*?)([\d]+)$/, r = 0, o = e.length; r < o; r++) {
  43453. var a = e[r]
  43454. , s = a.name.match(n);
  43455. if (s && 1 < s.length) {
  43456. var l = i[h = s[1]];
  43457. l || (i[h] = l = []),
  43458. l.push(a)
  43459. }
  43460. }
  43461. var c = [];
  43462. for (var h in i)
  43463. c.push(Ci.AnimationClip.CreateFromMorphTargetSequence(h, i[h], t));
  43464. return c
  43465. },
  43466. parseAnimation: function(e, t, i) {
  43467. if (!e)
  43468. return console.error(" no animation in JSONLoader data"),
  43469. null;
  43470. function n(e, t, i, n, r) {
  43471. if (0 !== i.length) {
  43472. var o = []
  43473. , a = [];
  43474. Ci.AnimationUtils.flattenJSON(i, o, a, n),
  43475. 0 !== o.length && r.push(new e(t,o,a))
  43476. }
  43477. }
  43478. for (var r = [], o = e.name || "default", a = e.length || -1, s = e.fps || 30, l = e.hierarchy || [], c = 0; c < l.length; c++) {
  43479. var h = l[c].keys;
  43480. if (h && 0 != h.length)
  43481. if (h[0].morphTargets) {
  43482. for (var u = {}, d = 0; d < h.length; d++)
  43483. if (h[d].morphTargets)
  43484. for (var p = 0; p < h[d].morphTargets.length; p++)
  43485. u[h[d].morphTargets[p]] = -1;
  43486. for (var f in u) {
  43487. var g = []
  43488. , m = [];
  43489. for (p = 0; p !== h[d].morphTargets.length; ++p) {
  43490. var v = h[d];
  43491. g.push(v.time),
  43492. m.push(v.morphTarget === f ? 1 : 0)
  43493. }
  43494. r.push(new Ci.NumberKeyframeTrack(".morphTargetInfluence[" + f + "]",g,m))
  43495. }
  43496. a = u.length * (s || 1)
  43497. } else {
  43498. var y = ".bones[" + t[c].name + "]";
  43499. n(Ci.VectorKeyframeTrack, y + ".position", h, "pos", r),
  43500. n(Ci.QuaternionKeyframeTrack, y + ".quaternion", h, "rot", r),
  43501. n(Ci.VectorKeyframeTrack, y + ".scale", h, "scl", r)
  43502. }
  43503. }
  43504. return 0 === r.length ? null : new Ci.AnimationClip(o,a,r)
  43505. }
  43506. }),
  43507. Ci.AnimationMixer = function(e) {
  43508. this._root = e,
  43509. this._initMemoryManager(),
  43510. this._accuIndex = 0,
  43511. this.time = 0,
  43512. this.timeScale = 1
  43513. }
  43514. ,
  43515. Ci.AnimationMixer.prototype = {
  43516. constructor: Ci.AnimationMixer,
  43517. clipAction: function(e, t) {
  43518. var i, n = (t || this._root).uuid, r = "string" == typeof e ? e : e.name, o = e !== r ? e : null, a = this._actionsByClip[r];
  43519. if (void 0 !== a) {
  43520. var s = a.actionByRoot[n];
  43521. if (void 0 !== s)
  43522. return s;
  43523. if (o = (i = a.knownActions[0])._clip,
  43524. e !== r && e !== o)
  43525. throw new Error("Different clips with the same name detected!")
  43526. }
  43527. if (null === o)
  43528. return null;
  43529. var l = new Ci.AnimationMixer._Action(this,o,t);
  43530. return this._bindAction(l, i),
  43531. this._addInactiveAction(l, r, n),
  43532. l
  43533. },
  43534. existingAction: function(e, t) {
  43535. var i = (t || this._root).uuid
  43536. , n = "string" == typeof e ? e : e.name
  43537. , r = this._actionsByClip[n];
  43538. return void 0 !== r && r.actionByRoot[i] || null
  43539. },
  43540. stopAllAction: function() {
  43541. var e = this._actions
  43542. , t = this._nActiveActions
  43543. , i = this._bindings
  43544. , n = this._nActiveBindings;
  43545. this._nActiveActions = 0;
  43546. for (var r = this._nActiveBindings = 0; r !== t; ++r)
  43547. e[r].reset();
  43548. for (r = 0; r !== n; ++r)
  43549. i[r].useCount = 0;
  43550. return this
  43551. },
  43552. update: function(e) {
  43553. e *= this.timeScale;
  43554. 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) {
  43555. var s = t[a];
  43556. s.enabled && s._update(n, e, r, o)
  43557. }
  43558. var l = this._bindings
  43559. , c = this._nActiveBindings;
  43560. for (a = 0; a !== c; ++a)
  43561. l[a].apply(o);
  43562. return this
  43563. },
  43564. getRoot: function() {
  43565. return this._root
  43566. },
  43567. uncacheClip: function(e) {
  43568. var t = this._actions
  43569. , i = e.name
  43570. , n = this._actionsByClip
  43571. , r = n[i];
  43572. if (void 0 !== r) {
  43573. for (var o = r.knownActions, a = 0, s = o.length; a !== s; ++a) {
  43574. var l = o[a];
  43575. this._deactivateAction(l);
  43576. var c = l._cacheIndex
  43577. , h = t[t.length - 1];
  43578. l._cacheIndex = null,
  43579. l._byClipCacheIndex = null,
  43580. t[h._cacheIndex = c] = h,
  43581. t.pop(),
  43582. this._removeInactiveBindingsForAction(l)
  43583. }
  43584. delete n[i]
  43585. }
  43586. },
  43587. uncacheRoot: function(e) {
  43588. var t = e.uuid
  43589. , i = this._actionsByClip;
  43590. for (var n in i) {
  43591. var r = i[n].actionByRoot[t];
  43592. void 0 !== r && (this._deactivateAction(r),
  43593. this._removeInactiveAction(r))
  43594. }
  43595. var o = this._bindingsByRootAndName[t];
  43596. if (void 0 !== o)
  43597. for (var a in o) {
  43598. var s = o[a];
  43599. s.restoreOriginalState(),
  43600. this._removeInactiveBinding(s)
  43601. }
  43602. },
  43603. uncacheAction: function(e, t) {
  43604. var i = this.existingAction(e, t);
  43605. null !== i && (this._deactivateAction(i),
  43606. this._removeInactiveAction(i))
  43607. }
  43608. },
  43609. Ci.EventDispatcher.prototype.apply(Ci.AnimationMixer.prototype),
  43610. Ci.AnimationMixer._Action = function(e, t, i) {
  43611. this._mixer = e,
  43612. this._clip = t,
  43613. this._localRoot = i || null;
  43614. for (var n = t.tracks, r = n.length, o = new Array(r), a = {
  43615. endingStart: Ci.ZeroCurvatureEnding,
  43616. endingEnd: Ci.ZeroCurvatureEnding
  43617. }, s = 0; s !== r; ++s) {
  43618. var l = n[s].createInterpolant(null);
  43619. (o[s] = l).settings = a
  43620. }
  43621. this._interpolantSettings = a,
  43622. this._interpolants = o,
  43623. this._propertyBindings = new Array(r),
  43624. this._cacheIndex = null,
  43625. this._byClipCacheIndex = null,
  43626. this._timeScaleInterpolant = null,
  43627. this._weightInterpolant = null,
  43628. this.loop = Ci.LoopRepeat,
  43629. this._loopCount = -1,
  43630. this._startTime = null,
  43631. this.time = 0,
  43632. this.timeScale = 1,
  43633. this._effectiveTimeScale = 1,
  43634. this.weight = 1,
  43635. this._effectiveWeight = 1,
  43636. this.repetitions = 1 / 0,
  43637. this.paused = !1,
  43638. this.enabled = !0,
  43639. this.clampWhenFinished = !1,
  43640. this.zeroSlopeAtStart = !0,
  43641. this.zeroSlopeAtEnd = !0
  43642. }
  43643. ,
  43644. Ci.AnimationMixer._Action.prototype = {
  43645. constructor: Ci.AnimationMixer._Action,
  43646. play: function() {
  43647. return this._mixer._activateAction(this),
  43648. this
  43649. },
  43650. stop: function() {
  43651. return this._mixer._deactivateAction(this),
  43652. this.reset()
  43653. },
  43654. reset: function() {
  43655. return this.paused = !1,
  43656. this.enabled = !0,
  43657. this.time = 0,
  43658. this._loopCount = -1,
  43659. this._startTime = null,
  43660. this.stopFading().stopWarping()
  43661. },
  43662. isRunning: function() {
  43663. return this._startTime,
  43664. this.enabled && !this.paused && 0 !== this.timeScale && null === this._startTime && this._mixer._isActiveAction(this)
  43665. },
  43666. isScheduled: function() {
  43667. return this._mixer._isActiveAction(this)
  43668. },
  43669. startAt: function(e) {
  43670. return this._startTime = e,
  43671. this
  43672. },
  43673. setLoop: function(e, t) {
  43674. return this.loop = e,
  43675. this.repetitions = t,
  43676. this
  43677. },
  43678. setEffectiveWeight: function(e) {
  43679. return this.weight = e,
  43680. this._effectiveWeight = this.enabled ? e : 0,
  43681. this.stopFading()
  43682. },
  43683. getEffectiveWeight: function() {
  43684. return this._effectiveWeight
  43685. },
  43686. fadeIn: function(e) {
  43687. return this._scheduleFading(e, 0, 1)
  43688. },
  43689. fadeOut: function(e) {
  43690. return this._scheduleFading(e, 1, 0)
  43691. },
  43692. crossFadeFrom: function(e, t, i) {
  43693. if (this._mixer,
  43694. e.fadeOut(t),
  43695. this.fadeIn(t),
  43696. i) {
  43697. var n = this._clip.duration
  43698. , r = e._clip.duration
  43699. , o = r / n
  43700. , a = n / r;
  43701. e.warp(1, o, t),
  43702. this.warp(a, 1, t)
  43703. }
  43704. return this
  43705. },
  43706. crossFadeTo: function(e, t, i) {
  43707. return e.crossFadeFrom(this, t, i)
  43708. },
  43709. stopFading: function() {
  43710. var e = this._weightInterpolant;
  43711. return null !== e && (this._weightInterpolant = null,
  43712. this._mixer._takeBackControlInterpolant(e)),
  43713. this
  43714. },
  43715. setEffectiveTimeScale: function(e) {
  43716. return this.timeScale = e,
  43717. this._effectiveTimeScale = this.paused ? 0 : e,
  43718. this.stopWarping()
  43719. },
  43720. getEffectiveTimeScale: function() {
  43721. return this._effectiveTimeScale
  43722. },
  43723. setDuration: function(e) {
  43724. return this.timeScale = this._clip.duration / e,
  43725. this.stopWarping()
  43726. },
  43727. syncWith: function(e) {
  43728. return this.time = e.time,
  43729. this.timeScale = e.timeScale,
  43730. this.stopWarping()
  43731. },
  43732. halt: function(e) {
  43733. return this.warp(this._currentTimeScale, 0, e)
  43734. },
  43735. warp: function(e, t, i) {
  43736. var n = this._mixer
  43737. , r = n.time
  43738. , o = this._timeScaleInterpolant
  43739. , a = this.timeScale;
  43740. null === o && (o = n._lendControlInterpolant(),
  43741. this._timeScaleInterpolant = o);
  43742. var s = o.parameterPositions
  43743. , l = o.sampleValues;
  43744. return s[0] = r,
  43745. s[1] = r + i,
  43746. l[0] = e / a,
  43747. l[1] = t / a,
  43748. this
  43749. },
  43750. stopWarping: function() {
  43751. var e = this._timeScaleInterpolant;
  43752. return null !== e && (this._timeScaleInterpolant = null,
  43753. this._mixer._takeBackControlInterpolant(e)),
  43754. this
  43755. },
  43756. getMixer: function() {
  43757. return this._mixer
  43758. },
  43759. getClip: function() {
  43760. return this._clip
  43761. },
  43762. getRoot: function() {
  43763. return this._localRoot || this._mixer._root
  43764. },
  43765. _update: function(e, t, i, n) {
  43766. var r = this._startTime;
  43767. if (null !== r) {
  43768. var o = (e - r) * i;
  43769. if (o < 0 || 0 === i)
  43770. return;
  43771. this._startTime = null,
  43772. t = i * o
  43773. }
  43774. t *= this._updateTimeScale(e);
  43775. var a = this._updateTime(t)
  43776. , s = this._updateWeight(e);
  43777. if (0 < s)
  43778. for (var l = this._interpolants, c = this._propertyBindings, h = 0, u = l.length; h !== u; ++h)
  43779. l[h].evaluate(a),
  43780. c[h].accumulate(n, s)
  43781. },
  43782. _updateWeight: function(e) {
  43783. var t = 0;
  43784. if (this.enabled) {
  43785. t = this.weight;
  43786. var i = this._weightInterpolant;
  43787. if (null !== i) {
  43788. var n = i.evaluate(e)[0];
  43789. t *= n,
  43790. e > i.parameterPositions[1] && (this.stopFading(),
  43791. 0 === n && (this.enabled = !1))
  43792. }
  43793. }
  43794. return this._effectiveWeight = t
  43795. },
  43796. _updateTimeScale: function(e) {
  43797. var t = 0;
  43798. if (!this.paused) {
  43799. t = this.timeScale;
  43800. var i = this._timeScaleInterpolant;
  43801. if (null !== i)
  43802. t *= i.evaluate(e)[0],
  43803. e > i.parameterPositions[1] && (this.stopWarping(),
  43804. 0 === t ? this.pause = !0 : this.timeScale = t)
  43805. }
  43806. return this._effectiveTimeScale = t
  43807. },
  43808. _updateTime: function(e) {
  43809. var t = this.time + e;
  43810. if (0 === e)
  43811. return t;
  43812. var i = this._clip.duration
  43813. , n = this.loop
  43814. , r = this._loopCount
  43815. , o = !1;
  43816. switch (n) {
  43817. case Ci.LoopOnce:
  43818. if (-1 === r && (this.loopCount = 0,
  43819. this._setEndings(!0, !0, !1)),
  43820. i <= t)
  43821. t = i;
  43822. else {
  43823. if (!(t < 0))
  43824. break;
  43825. t = 0
  43826. }
  43827. this.clampWhenFinished ? this.pause = !0 : this.enabled = !1,
  43828. this._mixer.dispatchEvent({
  43829. type: "finished",
  43830. action: this,
  43831. direction: e < 0 ? -1 : 1
  43832. });
  43833. break;
  43834. case Ci.LoopPingPong:
  43835. o = !0;
  43836. case Ci.LoopRepeat:
  43837. if (-1 === r && (0 < e ? (r = 0,
  43838. this._setEndings(!0, 0 === this.repetitions, o)) : this._setEndings(0 === this.repetitions, !0, o)),
  43839. i <= t || t < 0) {
  43840. var a = Math.floor(t / i);
  43841. t -= i * a,
  43842. r += Math.abs(a);
  43843. var s = this.repetitions - r;
  43844. if (s < 0) {
  43845. this.clampWhenFinished ? this.paused = !0 : this.enabled = !1,
  43846. t = 0 < e ? i : 0,
  43847. this._mixer.dispatchEvent({
  43848. type: "finished",
  43849. action: this,
  43850. direction: 0 < e ? 1 : -1
  43851. });
  43852. break
  43853. }
  43854. if (0 == s) {
  43855. var l = e < 0;
  43856. this._setEndings(l, !l, o)
  43857. } else
  43858. this._setEndings(!1, !1, o);
  43859. this._loopCount = r,
  43860. this._mixer.dispatchEvent({
  43861. type: "loop",
  43862. action: this,
  43863. loopDelta: a
  43864. })
  43865. }
  43866. if (n === Ci.LoopPingPong && 1 == (1 & r))
  43867. return i - (this.time = t)
  43868. }
  43869. return this.time = t
  43870. },
  43871. _setEndings: function(e, t, i) {
  43872. var n = this._interpolantSettings;
  43873. i ? (n.endingStart = Ci.ZeroSlopeEnding,
  43874. n.endingEnd = Ci.ZeroSlopeEnding) : (n.endingStart = e ? this.zeroSlopeAtStart ? Ci.ZeroSlopeEnding : Ci.ZeroCurvatureEnding : Ci.WrapAroundEnding,
  43875. n.endingEnd = t ? this.zeroSlopeAtEnd ? Ci.ZeroSlopeEnding : Ci.ZeroCurvatureEnding : Ci.WrapAroundEnding)
  43876. },
  43877. _scheduleFading: function(e, t, i) {
  43878. var n = this._mixer
  43879. , r = n.time
  43880. , o = this._weightInterpolant;
  43881. null === o && (o = n._lendControlInterpolant(),
  43882. this._weightInterpolant = o);
  43883. var a = o.parameterPositions
  43884. , s = o.sampleValues;
  43885. return a[0] = r,
  43886. s[0] = t,
  43887. a[1] = r + e,
  43888. s[1] = i,
  43889. this
  43890. }
  43891. },
  43892. Object.assign(Ci.AnimationMixer.prototype, {
  43893. _bindAction: function(e, t) {
  43894. var i = e._localRoot || this._root
  43895. , n = e._clip.tracks
  43896. , r = n.length
  43897. , o = e._propertyBindings
  43898. , a = e._interpolants
  43899. , s = i.uuid
  43900. , l = this._bindingsByRootAndName
  43901. , c = l[s];
  43902. void 0 === c && (c = {},
  43903. l[s] = c);
  43904. for (var h = 0; h !== r; ++h) {
  43905. var u = n[h]
  43906. , d = u.name
  43907. , p = c[d];
  43908. if (void 0 !== p)
  43909. o[h] = p;
  43910. else {
  43911. if (void 0 !== (p = o[h])) {
  43912. null === p._cacheIndex && (++p.referenceCount,
  43913. this._addInactiveBinding(p, s, d));
  43914. continue
  43915. }
  43916. var f = t && t._propertyBindings[h].binding.parsedPath;
  43917. ++(p = new Ci.PropertyMixer(Ci.PropertyBinding.create(i, d, f),u.ValueTypeName,u.getValueSize())).referenceCount,
  43918. this._addInactiveBinding(p, s, d),
  43919. o[h] = p
  43920. }
  43921. a[h].resultBuffer = p.buffer
  43922. }
  43923. },
  43924. _activateAction: function(e) {
  43925. if (!this._isActiveAction(e)) {
  43926. if (null === e._cacheIndex) {
  43927. var t = (e._localRoot || this._root).uuid
  43928. , i = e._clip.name
  43929. , n = this._actionsByClip[i];
  43930. this._bindAction(e, n && n.knownActions[0]),
  43931. this._addInactiveAction(e, i, t)
  43932. }
  43933. for (var r = e._propertyBindings, o = 0, a = r.length; o !== a; ++o) {
  43934. var s = r[o];
  43935. 0 == s.useCount++ && (this._lendBinding(s),
  43936. s.saveOriginalState())
  43937. }
  43938. this._lendAction(e)
  43939. }
  43940. },
  43941. _deactivateAction: function(e) {
  43942. if (this._isActiveAction(e)) {
  43943. for (var t = e._propertyBindings, i = 0, n = t.length; i !== n; ++i) {
  43944. var r = t[i];
  43945. 0 == --r.useCount && (r.restoreOriginalState(),
  43946. this._takeBackBinding(r))
  43947. }
  43948. this._takeBackAction(e)
  43949. }
  43950. },
  43951. _initMemoryManager: function() {
  43952. this._actions = [],
  43953. this._nActiveActions = 0,
  43954. this._actionsByClip = {},
  43955. this._bindings = [],
  43956. this._nActiveBindings = 0,
  43957. this._bindingsByRootAndName = {},
  43958. this._controlInterpolants = [],
  43959. this._nActiveControlInterpolants = 0;
  43960. var e = this;
  43961. this.stats = {
  43962. actions: {
  43963. get total() {
  43964. return e._actions.length
  43965. },
  43966. get inUse() {
  43967. return e._nActiveActions
  43968. }
  43969. },
  43970. bindings: {
  43971. get total() {
  43972. return e._bindings.length
  43973. },
  43974. get inUse() {
  43975. return e._nActiveBindings
  43976. }
  43977. },
  43978. controlInterpolants: {
  43979. get total() {
  43980. return e._controlInterpolants.length
  43981. },
  43982. get inUse() {
  43983. return e._nActiveControlInterpolants
  43984. }
  43985. }
  43986. }
  43987. },
  43988. _isActiveAction: function(e) {
  43989. var t = e._cacheIndex;
  43990. return null !== t && t < this._nActiveActions
  43991. },
  43992. _addInactiveAction: function(e, t, i) {
  43993. var n = this._actions
  43994. , r = this._actionsByClip
  43995. , o = r[t];
  43996. if (void 0 === o)
  43997. o = {
  43998. knownActions: [e],
  43999. actionByRoot: {}
  44000. },
  44001. e._byClipCacheIndex = 0,
  44002. r[t] = o;
  44003. else {
  44004. var a = o.knownActions;
  44005. e._byClipCacheIndex = a.length,
  44006. a.push(e)
  44007. }
  44008. e._cacheIndex = n.length,
  44009. n.push(e),
  44010. o.actionByRoot[i] = e
  44011. },
  44012. _removeInactiveAction: function(e) {
  44013. var t = this._actions
  44014. , i = t[t.length - 1]
  44015. , n = e._cacheIndex;
  44016. t[i._cacheIndex = n] = i,
  44017. t.pop(),
  44018. e._cacheIndex = null;
  44019. var r = e._clip.name
  44020. , o = this._actionsByClip
  44021. , a = o[r]
  44022. , s = a.knownActions
  44023. , l = s[s.length - 1]
  44024. , c = e._byClipCacheIndex;
  44025. s[l._byClipCacheIndex = c] = l,
  44026. s.pop(),
  44027. e._byClipCacheIndex = null,
  44028. delete a.actionByRoot[(t._localRoot || this._root).uuid],
  44029. 0 === s.length && delete o[r],
  44030. this._removeInactiveBindingsForAction(e)
  44031. },
  44032. _removeInactiveBindingsForAction: function(e) {
  44033. for (var t = e._propertyBindings, i = 0, n = t.length; i !== n; ++i) {
  44034. var r = t[i];
  44035. 0 == --r.referenceCount && this._removeInactiveBinding(r)
  44036. }
  44037. },
  44038. _lendAction: function(e) {
  44039. var t = this._actions
  44040. , i = e._cacheIndex
  44041. , n = this._nActiveActions++
  44042. , r = t[n];
  44043. t[e._cacheIndex = n] = e,
  44044. t[r._cacheIndex = i] = r
  44045. },
  44046. _takeBackAction: function(e) {
  44047. var t = this._actions
  44048. , i = e._cacheIndex
  44049. , n = --this._nActiveActions
  44050. , r = t[n];
  44051. t[e._cacheIndex = n] = e,
  44052. t[r._cacheIndex = i] = r
  44053. },
  44054. _addInactiveBinding: function(e, t, i) {
  44055. var n = this._bindingsByRootAndName
  44056. , r = n[t]
  44057. , o = this._bindings;
  44058. void 0 === r && (r = {},
  44059. n[t] = r),
  44060. (r[i] = e)._cacheIndex = o.length,
  44061. o.push(e)
  44062. },
  44063. _removeInactiveBinding: function(e) {
  44064. var t = this._bindings
  44065. , i = e.binding
  44066. , n = i.rootNode.uuid
  44067. , r = i.path
  44068. , o = this._bindingsByRootAndName
  44069. , a = o[n]
  44070. , s = t[t.length - 1]
  44071. , l = e._cacheIndex;
  44072. t[s._cacheIndex = l] = s,
  44073. t.pop(),
  44074. delete a[r];
  44075. e: {
  44076. for (var c in a)
  44077. break e;
  44078. delete o[n]
  44079. }
  44080. },
  44081. _lendBinding: function(e) {
  44082. var t = this._bindings
  44083. , i = e._cacheIndex
  44084. , n = this._nActiveBindings++
  44085. , r = t[n];
  44086. t[e._cacheIndex = n] = e,
  44087. t[r._cacheIndex = i] = r
  44088. },
  44089. _takeBackBinding: function(e) {
  44090. var t = this._bindings
  44091. , i = e._cacheIndex
  44092. , n = --this._nActiveBindings
  44093. , r = t[n];
  44094. t[e._cacheIndex = n] = e,
  44095. t[r._cacheIndex = i] = r
  44096. },
  44097. _lendControlInterpolant: function() {
  44098. var e = this._controlInterpolants
  44099. , t = this._nActiveControlInterpolants++
  44100. , i = e[t];
  44101. return void 0 === i && (e[(i = new Ci.LinearInterpolant(new Float32Array(2),new Float32Array(2),1,this._controlInterpolantsResultBuffer)).__cacheIndex = t] = i),
  44102. i
  44103. },
  44104. _takeBackControlInterpolant: function(e) {
  44105. var t = this._controlInterpolants
  44106. , i = e.__cacheIndex
  44107. , n = --this._nActiveControlInterpolants
  44108. , r = t[n];
  44109. t[e.__cacheIndex = n] = e,
  44110. t[r.__cacheIndex = i] = r
  44111. },
  44112. _controlInterpolantsResultBuffer: new Float32Array(1)
  44113. }),
  44114. Ci.AnimationObjectGroup = function(e) {
  44115. this.uuid = Ci.Math.generateUUID(),
  44116. this._objects = Array.prototype.slice.call(arguments),
  44117. this.nCachedObjects_ = 0;
  44118. var t = {};
  44119. this._indicesByUUID = t;
  44120. for (var i = 0, n = arguments.length; i !== n; ++i)
  44121. t[arguments[i].uuid] = i;
  44122. this._paths = [],
  44123. this._parsedPaths = [],
  44124. this._bindings = [],
  44125. this._bindingsIndicesByPath = {};
  44126. var r = this;
  44127. this.stats = {
  44128. objects: {
  44129. get total() {
  44130. return r._objects.length
  44131. },
  44132. get inUse() {
  44133. return this.total - r.nCachedObjects_
  44134. }
  44135. },
  44136. get bindingsPerObject() {
  44137. return r._bindings.length
  44138. }
  44139. }
  44140. }
  44141. ,
  44142. Ci.AnimationObjectGroup.prototype = {
  44143. constructor: Ci.AnimationObjectGroup,
  44144. add: function(e) {
  44145. 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) {
  44146. var u = arguments[c]
  44147. , d = u.uuid
  44148. , p = r[d];
  44149. if (void 0 === p) {
  44150. p = i++,
  44151. r[d] = p,
  44152. t.push(u);
  44153. for (var f = 0, g = l; f !== g; ++f)
  44154. s[f].push(new Ci.PropertyBinding(u,o[f],a[f]))
  44155. } else if (p < n) {
  44156. var m = t[p]
  44157. , v = --n
  44158. , y = t[v];
  44159. t[r[y.uuid] = p] = y,
  44160. t[r[d] = v] = u;
  44161. for (f = 0,
  44162. g = l; f !== g; ++f) {
  44163. var A = s[f]
  44164. , C = A[v]
  44165. , I = A[p];
  44166. A[p] = C,
  44167. void 0 === I && (I = new Ci.PropertyBinding(u,o[f],a[f])),
  44168. A[v] = I
  44169. }
  44170. } else
  44171. t[p] !== m && console.error("Different objects with the same UUID detected. Clean the caches or recreate your infrastructure when reloading scenes...")
  44172. }
  44173. this.nCachedObjects_ = n
  44174. },
  44175. remove: function(e) {
  44176. for (var t = this._objects, i = (t.length,
  44177. this.nCachedObjects_), n = this._indicesByUUID, r = this._bindings, o = r.length, a = 0, s = arguments.length; a !== s; ++a) {
  44178. var l = arguments[a]
  44179. , c = l.uuid
  44180. , h = n[c];
  44181. if (void 0 !== h && i <= h) {
  44182. var u = i++
  44183. , d = t[u];
  44184. t[n[d.uuid] = h] = d,
  44185. t[n[c] = u] = l;
  44186. for (var p = 0, f = o; p !== f; ++p) {
  44187. var g = r[p]
  44188. , m = g[u]
  44189. , v = g[h];
  44190. g[h] = m,
  44191. g[u] = v
  44192. }
  44193. }
  44194. }
  44195. this.nCachedObjects_ = i
  44196. },
  44197. uncache: function(e) {
  44198. 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) {
  44199. var c = arguments[s].uuid
  44200. , h = r[c];
  44201. if (void 0 !== h)
  44202. if (delete r[c],
  44203. h < n) {
  44204. var u = --n
  44205. , d = t[u]
  44206. , p = t[y = --i];
  44207. t[r[d.uuid] = h] = d,
  44208. t[r[p.uuid] = u] = p,
  44209. t.pop();
  44210. for (var f = 0, g = a; f !== g; ++f) {
  44211. var m = (A = o[f])[u]
  44212. , v = A[y];
  44213. A[h] = m,
  44214. A[u] = v,
  44215. A.pop()
  44216. }
  44217. } else {
  44218. var y;
  44219. t[r[(p = t[y = --i]).uuid] = h] = p,
  44220. t.pop();
  44221. for (f = 0,
  44222. g = a; f !== g; ++f) {
  44223. var A;
  44224. (A = o[f])[h] = A[y],
  44225. A.pop()
  44226. }
  44227. }
  44228. }
  44229. this.nCachedObjects_ = n
  44230. },
  44231. subscribe_: function(e, t) {
  44232. var i = this._bindingsIndicesByPath
  44233. , n = i[e]
  44234. , r = this._bindings;
  44235. if (void 0 !== n)
  44236. return r[n];
  44237. var o = this._paths
  44238. , a = this._parsedPaths
  44239. , s = this._objects
  44240. , l = s.length
  44241. , c = this.nCachedObjects_
  44242. , h = new Array(l);
  44243. n = r.length,
  44244. i[e] = n,
  44245. o.push(e),
  44246. a.push(t),
  44247. r.push(h);
  44248. for (var u = c, d = s.length; u !== d; ++u) {
  44249. var p = s[u];
  44250. h[u] = new Ci.PropertyBinding(p,e,t)
  44251. }
  44252. return h
  44253. },
  44254. unsubscribe_: function(e) {
  44255. var t = this._bindingsIndicesByPath
  44256. , i = t[e];
  44257. if (void 0 !== i) {
  44258. var n = this._paths
  44259. , r = this._parsedPaths
  44260. , o = this._bindings
  44261. , a = o.length - 1
  44262. , s = o[a];
  44263. o[t[e[a]] = i] = s,
  44264. o.pop(),
  44265. r[i] = r[a],
  44266. r.pop(),
  44267. n[i] = n[a],
  44268. n.pop()
  44269. }
  44270. }
  44271. },
  44272. Ci.AnimationUtils = {
  44273. arraySlice: function(e, t, i) {
  44274. return Ci.AnimationUtils.isTypedArray(e) ? new e.constructor(e.subarray(t, i)) : e.slice(t, i)
  44275. },
  44276. convertArray: function(e, t, i) {
  44277. return !e || !i && e.constructor === t ? e : "number" == typeof t.BYTES_PER_ELEMENT ? new t(e) : Array.prototype.slice.call(e)
  44278. },
  44279. isTypedArray: function(e) {
  44280. return ArrayBuffer.isView(e) && !(e instanceof DataView)
  44281. },
  44282. getKeyframeOrder: function(i) {
  44283. for (var e = i.length, t = new Array(e), n = 0; n !== e; ++n)
  44284. t[n] = n;
  44285. return t.sort(function(e, t) {
  44286. return i[e] - i[t]
  44287. }),
  44288. t
  44289. },
  44290. sortedArray: function(e, t, i) {
  44291. for (var n = e.length, r = new e.constructor(n), o = 0, a = 0; a !== n; ++o)
  44292. for (var s = i[o] * t, l = 0; l !== t; ++l)
  44293. r[a++] = e[s + l];
  44294. return r
  44295. },
  44296. flattenJSON: function(e, t, i, n) {
  44297. for (var r = 1, o = e[0]; void 0 !== o && void 0 === o[n]; )
  44298. o = e[r++];
  44299. if (void 0 !== o) {
  44300. var a = o[n];
  44301. if (void 0 !== a)
  44302. if (Array.isArray(a))
  44303. for (; void 0 !== (a = o[n]) && (t.push(o.time),
  44304. i.push.apply(i, a)),
  44305. void 0 !== (o = e[r++]); )
  44306. ;
  44307. else if (void 0 !== a.toArray)
  44308. for (; void 0 !== (a = o[n]) && (t.push(o.time),
  44309. a.toArray(i, i.length)),
  44310. void 0 !== (o = e[r++]); )
  44311. ;
  44312. else
  44313. for (; void 0 !== (a = o[n]) && (t.push(o.time),
  44314. i.push(a)),
  44315. void 0 !== (o = e[r++]); )
  44316. ;
  44317. }
  44318. }
  44319. },
  44320. Ci.KeyframeTrack = function(e, t, i, n) {
  44321. if (void 0 === e)
  44322. throw new Error("track name is undefined");
  44323. if (void 0 === t || 0 === t.length)
  44324. throw new Error("no keyframes in track named " + e);
  44325. this.name = e,
  44326. this.times = Ci.AnimationUtils.convertArray(t, this.TimeBufferType),
  44327. this.values = Ci.AnimationUtils.convertArray(i, this.ValueBufferType),
  44328. this.setInterpolation(n || this.DefaultInterpolation),
  44329. this.validate(),
  44330. this.optimize()
  44331. }
  44332. ,
  44333. Ci.KeyframeTrack.prototype = {
  44334. constructor: Ci.KeyframeTrack,
  44335. TimeBufferType: Float32Array,
  44336. ValueBufferType: Float32Array,
  44337. DefaultInterpolation: Ci.InterpolateLinear,
  44338. InterpolantFactoryMethodDiscrete: function(e) {
  44339. return new Ci.DiscreteInterpolant(this.times,this.values,this.getValueSize(),e)
  44340. },
  44341. InterpolantFactoryMethodLinear: function(e) {
  44342. return new Ci.LinearInterpolant(this.times,this.values,this.getValueSize(),e)
  44343. },
  44344. InterpolantFactoryMethodSmooth: function(e) {
  44345. return new Ci.CubicInterpolant(this.times,this.values,this.getValueSize(),e)
  44346. },
  44347. setInterpolation: function(e) {
  44348. var t = void 0;
  44349. switch (e) {
  44350. case Ci.InterpolateDiscrete:
  44351. t = this.InterpolantFactoryMethodDiscrete;
  44352. break;
  44353. case Ci.InterpolateLinear:
  44354. t = this.InterpolantFactoryMethodLinear;
  44355. break;
  44356. case Ci.InterpolateSmooth:
  44357. t = this.InterpolantFactoryMethodSmooth
  44358. }
  44359. if (void 0 !== t)
  44360. this.createInterpolant = t;
  44361. else {
  44362. var i = "unsupported interpolation for " + this.ValueTypeName + " keyframe track named " + this.name;
  44363. if (void 0 === this.createInterpolant) {
  44364. if (e === this.DefaultInterpolation)
  44365. throw new Error(i);
  44366. this.setInterpolation(this.DefaultInterpolation)
  44367. }
  44368. console.warn(i)
  44369. }
  44370. },
  44371. getInterpolation: function() {
  44372. switch (this.createInterpolant) {
  44373. case this.InterpolantFactoryMethodDiscrete:
  44374. return Ci.InterpolateDiscrete;
  44375. case this.InterpolantFactoryMethodLinear:
  44376. return Ci.InterpolateLinear;
  44377. case this.InterpolantFactoryMethodSmooth:
  44378. return Ci.InterpolateSmooth
  44379. }
  44380. },
  44381. getValueSize: function() {
  44382. return this.values.length / this.times.length
  44383. },
  44384. shift: function(e) {
  44385. if (0 !== e)
  44386. for (var t = this.times, i = 0, n = t.length; i !== n; ++i)
  44387. t[i] += e;
  44388. return this
  44389. },
  44390. scale: function(e) {
  44391. if (1 !== e)
  44392. for (var t = this.times, i = 0, n = t.length; i !== n; ++i)
  44393. t[i] *= e;
  44394. return this
  44395. },
  44396. trim: function(e, t) {
  44397. for (var i = this.times, n = i.length, r = 0, o = n - 1; r !== n && i[r] < e; )
  44398. ++r;
  44399. for (; -1 !== o && i[o] > t; )
  44400. --o;
  44401. if (++o,
  44402. 0 !== r || o !== n) {
  44403. o <= r && (r = (o = Math.max(o, 1)) - 1);
  44404. var a = this.getValueSize();
  44405. this.times = Ci.AnimationUtils.arraySlice(i, r, o),
  44406. this.values = Ci.AnimationUtils.arraySlice(this.values, r * a, o * a)
  44407. }
  44408. return this
  44409. },
  44410. validate: function() {
  44411. var e = !0
  44412. , t = this.getValueSize();
  44413. t - Math.floor(t) != 0 && (console.error("invalid value size in track", this),
  44414. e = !1);
  44415. var i = this.times
  44416. , n = this.values
  44417. , r = i.length;
  44418. 0 === r && (console.error("track is empty", this),
  44419. e = !1);
  44420. for (var o = null, a = 0; a !== r; a++) {
  44421. var s = i[a];
  44422. if ("number" == typeof s && isNaN(s)) {
  44423. console.error("time is not a valid number", this, a, s),
  44424. e = !1;
  44425. break
  44426. }
  44427. if (null !== o && s < o) {
  44428. console.error("out of order keys", this, a, s, o),
  44429. e = !1;
  44430. break
  44431. }
  44432. o = s
  44433. }
  44434. if (void 0 !== n && Ci.AnimationUtils.isTypedArray(n)) {
  44435. a = 0;
  44436. for (var l = n.length; a !== l; ++a) {
  44437. var c = n[a];
  44438. if (isNaN(c)) {
  44439. console.error("value is not a valid number", this, a, c),
  44440. e = !1;
  44441. break
  44442. }
  44443. }
  44444. }
  44445. return e
  44446. },
  44447. optimize: function() {
  44448. for (var e = this.times, t = this.values, i = this.getValueSize(), n = 1, r = 1, o = e.length - 1; r <= o; ++r) {
  44449. var a = !1
  44450. , s = e[r];
  44451. if (s !== e[r + 1] && (1 !== r || s !== s[0]))
  44452. for (var l = r * i, c = l - i, h = l + i, u = 0; u !== i; ++u) {
  44453. var d = t[l + u];
  44454. if (d !== t[c + u] || d !== t[h + u]) {
  44455. a = !0;
  44456. break
  44457. }
  44458. }
  44459. if (a) {
  44460. if (r !== n) {
  44461. e[n] = e[r];
  44462. var p = r * i
  44463. , f = n * i;
  44464. for (u = 0; u !== i; ++u)
  44465. t[f + u] = t[p + u]
  44466. }
  44467. ++n
  44468. }
  44469. }
  44470. return n !== e.length && (this.times = Ci.AnimationUtils.arraySlice(e, 0, n),
  44471. this.values = Ci.AnimationUtils.arraySlice(t, 0, n * i)),
  44472. this
  44473. }
  44474. },
  44475. Object.assign(Ci.KeyframeTrack, {
  44476. parse: function(e) {
  44477. if (void 0 === e.type)
  44478. throw new Error("track type undefined, can not parse");
  44479. var t = Ci.KeyframeTrack._getTrackTypeForValueTypeName(e.type);
  44480. if (void 0 === e.times) {
  44481. console.warn("legacy JSON format detected, converting");
  44482. var i = []
  44483. , n = [];
  44484. Ci.AnimationUtils.flattenJSON(e.keys, i, n, "value"),
  44485. e.times = i,
  44486. e.values = n
  44487. }
  44488. return void 0 !== t.parse ? t.parse(e) : new t(e.name,e.times,e.values,e.interpolation)
  44489. },
  44490. toJSON: function(e) {
  44491. var t, i = e.constructor;
  44492. if (void 0 !== i.toJSON)
  44493. t = i.toJSON(e);
  44494. else {
  44495. t = {
  44496. name: e.name,
  44497. times: Ci.AnimationUtils.convertArray(e.times, Array),
  44498. values: Ci.AnimationUtils.convertArray(e.values, Array)
  44499. };
  44500. var n = e.getInterpolation();
  44501. n !== e.DefaultInterpolation && (t.interpolation = n)
  44502. }
  44503. return t.type = e.ValueTypeName,
  44504. t
  44505. },
  44506. _getTrackTypeForValueTypeName: function(e) {
  44507. switch (e.toLowerCase()) {
  44508. case "scalar":
  44509. case "double":
  44510. case "float":
  44511. case "number":
  44512. case "integer":
  44513. return Ci.NumberKeyframeTrack;
  44514. case "vector":
  44515. case "vector2":
  44516. case "vector3":
  44517. case "vector4":
  44518. return Ci.VectorKeyframeTrack;
  44519. case "color":
  44520. return Ci.ColorKeyframeTrack;
  44521. case "quaternion":
  44522. return Ci.QuaternionKeyframeTrack;
  44523. case "bool":
  44524. case "boolean":
  44525. return Ci.BooleanKeyframeTrack;
  44526. case "string":
  44527. return Ci.StringKeyframeTrack
  44528. }
  44529. throw new Error("Unsupported typeName: " + e)
  44530. }
  44531. }),
  44532. Ci.PropertyBinding = function(e, t, i) {
  44533. this.path = t,
  44534. this.parsedPath = i || Ci.PropertyBinding.parseTrackName(t),
  44535. this.node = Ci.PropertyBinding.findNode(e, this.parsedPath.nodeName) || e,
  44536. this.rootNode = e
  44537. }
  44538. ,
  44539. Ci.PropertyBinding.prototype = {
  44540. constructor: Ci.PropertyBinding,
  44541. getValue: function(e, t) {
  44542. this.bind(),
  44543. this.getValue(e, t)
  44544. },
  44545. setValue: function(e, t) {
  44546. this.bind(),
  44547. this.setValue(e, t)
  44548. },
  44549. bind: function() {
  44550. var e = this.node
  44551. , t = this.parsedPath
  44552. , i = t.objectName
  44553. , n = t.propertyName
  44554. , r = t.propertyIndex;
  44555. if (e || (e = Ci.PropertyBinding.findNode(this.rootNode, t.nodeName) || this.rootNode,
  44556. this.node = e),
  44557. this.getValue = this._getValue_unavailable,
  44558. this.setValue = this._setValue_unavailable,
  44559. e) {
  44560. if (i) {
  44561. var o = t.objectIndex;
  44562. switch (i) {
  44563. case "materials":
  44564. if (!e.material)
  44565. return void console.error(" can not bind to material as node does not have a material", this);
  44566. if (!e.material.materials)
  44567. return void console.error(" can not bind to material.materials as node.material does not have a materials array", this);
  44568. e = e.material.materials;
  44569. break;
  44570. case "bones":
  44571. if (!e.skeleton)
  44572. return void console.error(" can not bind to bones as node does not have a skeleton", this);
  44573. e = e.skeleton.bones;
  44574. for (var a = 0; a < e.length; a++)
  44575. if (e[a].name === o) {
  44576. o = a;
  44577. break
  44578. }
  44579. break;
  44580. default:
  44581. if (void 0 === e[i])
  44582. return void console.error(" can not bind to objectName of node, undefined", this);
  44583. e = e[i]
  44584. }
  44585. if (void 0 !== o) {
  44586. if (void 0 === e[o])
  44587. return void console.error(" trying to bind to objectIndex of objectName, but is undefined:", this, e);
  44588. e = e[o]
  44589. }
  44590. }
  44591. var s = e[n];
  44592. if (s) {
  44593. var l = this.Versioning.None;
  44594. void 0 !== e.needsUpdate ? (l = this.Versioning.NeedsUpdate,
  44595. this.targetObject = e) : void 0 !== e.matrixWorldNeedsUpdate && (l = this.Versioning.MatrixWorldNeedsUpdate,
  44596. this.targetObject = e);
  44597. var c = this.BindingType.Direct;
  44598. if (void 0 !== r) {
  44599. if ("morphTargetInfluences" === n) {
  44600. if (!e.geometry)
  44601. return void console.error(" can not bind to morphTargetInfluences becasuse node does not have a geometry", this);
  44602. if (!e.geometry.morphTargets)
  44603. return void console.error(" can not bind to morphTargetInfluences becasuse node does not have a geometry.morphTargets", this);
  44604. for (a = 0; a < this.node.geometry.morphTargets.length; a++)
  44605. if (e.geometry.morphTargets[a].name === r) {
  44606. r = a;
  44607. break
  44608. }
  44609. }
  44610. c = this.BindingType.ArrayElement,
  44611. this.resolvedProperty = s,
  44612. this.propertyIndex = r
  44613. } else
  44614. void 0 !== s.fromArray && void 0 !== s.toArray ? (c = this.BindingType.HasFromToArray,
  44615. this.resolvedProperty = s) : void 0 !== s.length ? (c = this.BindingType.EntireArray,
  44616. this.resolvedProperty = s) : this.propertyName = n;
  44617. this.getValue = this.GetterByBindingType[c],
  44618. this.setValue = this.SetterByBindingTypeAndVersioning[c][l]
  44619. } else {
  44620. var h = t.nodeName;
  44621. console.error(" trying to update property for track: " + h + "." + n + " but it wasn't found.", e)
  44622. }
  44623. } else
  44624. console.error(" trying to update node for track: " + this.path + " but it wasn't found.")
  44625. },
  44626. unbind: function() {
  44627. this.node = null,
  44628. this.getValue = this._getValue_unbound,
  44629. this.setValue = this._setValue_unbound
  44630. }
  44631. },
  44632. Object.assign(Ci.PropertyBinding.prototype, {
  44633. _getValue_unavailable: function() {},
  44634. _setValue_unavailable: function() {},
  44635. _getValue_unbound: Ci.PropertyBinding.prototype.getValue,
  44636. _setValue_unbound: Ci.PropertyBinding.prototype.setValue,
  44637. BindingType: {
  44638. Direct: 0,
  44639. EntireArray: 1,
  44640. ArrayElement: 2,
  44641. HasFromToArray: 3
  44642. },
  44643. Versioning: {
  44644. None: 0,
  44645. NeedsUpdate: 1,
  44646. MatrixWorldNeedsUpdate: 2
  44647. },
  44648. GetterByBindingType: [function(e, t) {
  44649. e[t] = this.node[this.propertyName]
  44650. }
  44651. , function(e, t) {
  44652. for (var i = this.resolvedProperty, n = 0, r = i.length; n !== r; ++n)
  44653. e[t++] = i[n]
  44654. }
  44655. , function(e, t) {
  44656. e[t] = this.resolvedProperty[this.propertyIndex]
  44657. }
  44658. , function(e, t) {
  44659. this.resolvedProperty.toArray(e, t)
  44660. }
  44661. ],
  44662. SetterByBindingTypeAndVersioning: [[function(e, t) {
  44663. this.node[this.propertyName] = e[t]
  44664. }
  44665. , function(e, t) {
  44666. this.node[this.propertyName] = e[t],
  44667. this.targetObject.needsUpdate = !0
  44668. }
  44669. , function(e, t) {
  44670. this.node[this.propertyName] = e[t],
  44671. this.targetObject.matrixWorldNeedsUpdate = !0
  44672. }
  44673. ], [function(e, t) {
  44674. for (var i = this.resolvedProperty, n = 0, r = i.length; n !== r; ++n)
  44675. i[n] = e[t++]
  44676. }
  44677. , function(e, t) {
  44678. for (var i = this.resolvedProperty, n = 0, r = i.length; n !== r; ++n)
  44679. i[n] = e[t++];
  44680. this.targetObject.needsUpdate = !0
  44681. }
  44682. , function(e, t) {
  44683. for (var i = this.resolvedProperty, n = 0, r = i.length; n !== r; ++n)
  44684. i[n] = e[t++];
  44685. this.targetObject.matrixWorldNeedsUpdate = !0
  44686. }
  44687. ], [function(e, t) {
  44688. this.resolvedProperty[this.propertyIndex] = e[t]
  44689. }
  44690. , function(e, t) {
  44691. this.resolvedProperty[this.propertyIndex] = e[t],
  44692. this.targetObject.needsUpdate = !0
  44693. }
  44694. , function(e, t) {
  44695. this.resolvedProperty[this.propertyIndex] = e[t],
  44696. this.targetObject.matrixWorldNeedsUpdate = !0
  44697. }
  44698. ], [function(e, t) {
  44699. this.resolvedProperty.fromArray(e, t)
  44700. }
  44701. , function(e, t) {
  44702. this.resolvedProperty.fromArray(e, t),
  44703. this.targetObject.needsUpdate = !0
  44704. }
  44705. , function(e, t) {
  44706. this.resolvedProperty.fromArray(e, t),
  44707. this.targetObject.matrixWorldNeedsUpdate = !0
  44708. }
  44709. ]]
  44710. }),
  44711. Ci.PropertyBinding.Composite = function(e, t, i) {
  44712. var n = i || Ci.PropertyBinding.parseTrackName(t);
  44713. this._targetGroup = e,
  44714. this._bindings = e.subscribe_(t, n)
  44715. }
  44716. ,
  44717. Ci.PropertyBinding.Composite.prototype = {
  44718. constructor: Ci.PropertyBinding.Composite,
  44719. getValue: function(e, t) {
  44720. this.bind();
  44721. var i = this._targetGroup.nCachedObjects_
  44722. , n = this._bindings[i];
  44723. void 0 !== n && n.getValue(e, t)
  44724. },
  44725. setValue: function(e, t) {
  44726. for (var i = this._bindings, n = this._targetGroup.nCachedObjects_, r = i.length; n !== r; ++n)
  44727. i[n].setValue(e, t)
  44728. },
  44729. bind: function() {
  44730. for (var e = this._bindings, t = this._targetGroup.nCachedObjects_, i = e.length; t !== i; ++t)
  44731. e[t].bind()
  44732. },
  44733. unbind: function() {
  44734. for (var e = this._bindings, t = this._targetGroup.nCachedObjects_, i = e.length; t !== i; ++t)
  44735. e[t].unbind()
  44736. }
  44737. },
  44738. Ci.PropertyBinding.create = function(e, t, i) {
  44739. return e instanceof Ci.AnimationObjectGroup ? new Ci.PropertyBinding.Composite(e,t,i) : new Ci.PropertyBinding(e,t,i)
  44740. }
  44741. ,
  44742. Ci.PropertyBinding.parseTrackName = function(e) {
  44743. var t = /^(([\w]+\/)*)([\w-\d]+)?(\.([\w]+)(\[([\w\d\[\]\_.:\- ]+)\])?)?(\.([\w.]+)(\[([\w\d\[\]\_. ]+)\])?)$/
  44744. , i = t.exec(e);
  44745. if (!i)
  44746. throw new Error("cannot parse trackName at all: " + e);
  44747. i.index === t.lastIndex && t.lastIndex++;
  44748. var n = {
  44749. nodeName: i[3],
  44750. objectName: i[5],
  44751. objectIndex: i[7],
  44752. propertyName: i[9],
  44753. propertyIndex: i[11]
  44754. };
  44755. if (null === n.propertyName || 0 === n.propertyName.length)
  44756. throw new Error("can not parse propertyName from trackName: " + e);
  44757. return n
  44758. }
  44759. ,
  44760. Ci.PropertyBinding.findNode = function(e, r) {
  44761. if (!r || "" === r || "root" === r || "." === r || -1 === r || r === e.name || r === e.uuid)
  44762. return e;
  44763. if (e.skeleton) {
  44764. var t = function(e) {
  44765. for (var t = 0; t < e.bones.length; t++) {
  44766. var i = e.bones[t];
  44767. if (i.name === r)
  44768. return i
  44769. }
  44770. return null
  44771. }(e.skeleton);
  44772. if (t)
  44773. return t
  44774. }
  44775. if (e.children) {
  44776. var o = function(e) {
  44777. for (var t = 0; t < e.length; t++) {
  44778. var i = e[t];
  44779. if (i.name === r || i.uuid === r)
  44780. return i;
  44781. var n = o(i.children);
  44782. if (n)
  44783. return n
  44784. }
  44785. return null
  44786. }
  44787. , i = o(e.children);
  44788. if (i)
  44789. return i
  44790. }
  44791. return null
  44792. }
  44793. ,
  44794. Ci.PropertyMixer = function(e, t, i) {
  44795. this.binding = e,
  44796. this.valueSize = i;
  44797. var n, r = Float64Array;
  44798. switch (t) {
  44799. case "quaternion":
  44800. n = this._slerp;
  44801. break;
  44802. case "string":
  44803. case "bool":
  44804. r = Array,
  44805. n = this._select;
  44806. break;
  44807. default:
  44808. n = this._lerp
  44809. }
  44810. this.buffer = new r(4 * i),
  44811. this._mixBufferRegion = n,
  44812. this.cumulativeWeight = 0,
  44813. this.useCount = 0,
  44814. this.referenceCount = 0
  44815. }
  44816. ,
  44817. Ci.PropertyMixer.prototype = {
  44818. constructor: Ci.PropertyMixer,
  44819. accumulate: function(e, t) {
  44820. var i = this.buffer
  44821. , n = this.valueSize
  44822. , r = e * n + n
  44823. , o = this.cumulativeWeight;
  44824. if (0 === o) {
  44825. for (var a = 0; a !== n; ++a)
  44826. i[r + a] = i[a];
  44827. o = t
  44828. } else {
  44829. var s = t / (o += t);
  44830. this._mixBufferRegion(i, r, 0, s, n)
  44831. }
  44832. this.cumulativeWeight = o
  44833. },
  44834. apply: function(e) {
  44835. var t = this.valueSize
  44836. , i = this.buffer
  44837. , n = e * t + t
  44838. , r = this.cumulativeWeight
  44839. , o = this.binding;
  44840. if (this.cumulativeWeight = 0,
  44841. r < 1) {
  44842. var a = 3 * t;
  44843. this._mixBufferRegion(i, n, a, 1 - r, t)
  44844. }
  44845. for (var s = t, l = t + t; s !== l; ++s)
  44846. if (i[s] !== i[s + t]) {
  44847. o.setValue(i, n);
  44848. break
  44849. }
  44850. },
  44851. saveOriginalState: function() {
  44852. var e = this.binding
  44853. , t = this.buffer
  44854. , i = this.valueSize
  44855. , n = 3 * i;
  44856. e.getValue(t, n);
  44857. for (var r = i, o = n; r !== o; ++r)
  44858. t[r] = t[n + r % i];
  44859. this.cumulativeWeight = 0
  44860. },
  44861. restoreOriginalState: function() {
  44862. var e = 3 * this.valueSize;
  44863. this.binding.setValue(this.buffer, e)
  44864. },
  44865. _select: function(e, t, i, n, r) {
  44866. if (.5 <= n)
  44867. for (var o = 0; o !== r; ++o)
  44868. e[t + o] = e[i + o]
  44869. },
  44870. _slerp: function(e, t, i, n, r) {
  44871. Ci.Quaternion.slerpFlat(e, t, e, t, e, i, n)
  44872. },
  44873. _lerp: function(e, t, i, n, r) {
  44874. for (var o = 1 - n, a = 0; a !== r; ++a) {
  44875. var s = t + a;
  44876. e[s] = e[s] * o + e[i + a] * n
  44877. }
  44878. }
  44879. },
  44880. Ci.BooleanKeyframeTrack = function(e, t, i) {
  44881. Ci.KeyframeTrack.call(this, e, t, i)
  44882. }
  44883. ,
  44884. Ci.BooleanKeyframeTrack.prototype = Object.assign(Object.create(Ci.KeyframeTrack.prototype), {
  44885. constructor: Ci.BooleanKeyframeTrack,
  44886. ValueTypeName: "bool",
  44887. ValueBufferType: Array,
  44888. DefaultInterpolation: Ci.IntepolateDiscrete,
  44889. InterpolantFactoryMethodLinear: void 0,
  44890. InterpolantFactoryMethodSmooth: void 0
  44891. }),
  44892. Ci.NumberKeyframeTrack = function(e, t, i, n) {
  44893. Ci.KeyframeTrack.call(this, e, t, i, n)
  44894. }
  44895. ,
  44896. Ci.NumberKeyframeTrack.prototype = Object.assign(Object.create(Ci.KeyframeTrack.prototype), {
  44897. constructor: Ci.NumberKeyframeTrack,
  44898. ValueTypeName: "number"
  44899. }),
  44900. Ci.QuaternionKeyframeTrack = function(e, t, i, n) {
  44901. Ci.KeyframeTrack.call(this, e, t, i, n)
  44902. }
  44903. ,
  44904. Ci.QuaternionKeyframeTrack.prototype = Object.assign(Object.create(Ci.KeyframeTrack.prototype), {
  44905. constructor: Ci.QuaternionKeyframeTrack,
  44906. ValueTypeName: "quaternion",
  44907. DefaultInterpolation: Ci.InterpolateLinear,
  44908. InterpolantFactoryMethodLinear: function(e) {
  44909. return new Ci.QuaternionLinearInterpolant(this.times,this.values,this.getValueSize(),e)
  44910. },
  44911. InterpolantFactoryMethodSmooth: void 0
  44912. }),
  44913. Ci.StringKeyframeTrack = function(e, t, i, n) {
  44914. Ci.KeyframeTrack.call(this, e, t, i, n)
  44915. }
  44916. ,
  44917. Ci.StringKeyframeTrack.prototype = Object.assign(Object.create(Ci.KeyframeTrack.prototype), {
  44918. constructor: Ci.StringKeyframeTrack,
  44919. ValueTypeName: "string",
  44920. ValueBufferType: Array,
  44921. DefaultInterpolation: Ci.IntepolateDiscrete,
  44922. InterpolantFactoryMethodLinear: void 0,
  44923. InterpolantFactoryMethodSmooth: void 0
  44924. }),
  44925. Ci.VectorKeyframeTrack = function(e, t, i, n) {
  44926. Ci.KeyframeTrack.call(this, e, t, i, n)
  44927. }
  44928. ,
  44929. Ci.VectorKeyframeTrack.prototype = Object.assign(Object.create(Ci.KeyframeTrack.prototype), {
  44930. constructor: Ci.VectorKeyframeTrack,
  44931. ValueTypeName: "vector"
  44932. }),
  44933. Ci.Audio = function(e) {
  44934. Ci.Object3D.call(this),
  44935. this.type = "Audio",
  44936. this.context = e.context,
  44937. this.source = this.context.createBufferSource(),
  44938. this.source.onended = this.onEnded.bind(this),
  44939. this.gain = this.context.createGain(),
  44940. this.gain.connect(e.getInput()),
  44941. this.autoplay = !1,
  44942. this.startTime = 0,
  44943. this.playbackRate = 1,
  44944. this.isPlaying = !1,
  44945. this.hasPlaybackControl = !0,
  44946. this.sourceType = "empty",
  44947. this.filter = null
  44948. }
  44949. ,
  44950. Ci.Audio.prototype = Object.create(Ci.Object3D.prototype),
  44951. Ci.Audio.prototype.constructor = Ci.Audio,
  44952. Ci.Audio.prototype.getOutput = function() {
  44953. return this.gain
  44954. }
  44955. ,
  44956. Ci.Audio.prototype.load = function(e) {
  44957. var t = new Ci.AudioBuffer(this.context);
  44958. return t.load(e),
  44959. this.setBuffer(t),
  44960. this
  44961. }
  44962. ,
  44963. Ci.Audio.prototype.setNodeSource = function(e) {
  44964. return this.hasPlaybackControl = !1,
  44965. this.sourceType = "audioNode",
  44966. this.source = e,
  44967. this.connect(),
  44968. this
  44969. }
  44970. ,
  44971. Ci.Audio.prototype.setBuffer = function(e) {
  44972. var t = this;
  44973. return e.onReady(function(e) {
  44974. t.source.buffer = e,
  44975. t.sourceType = "buffer",
  44976. t.autoplay && t.play()
  44977. }),
  44978. this
  44979. }
  44980. ,
  44981. Ci.Audio.prototype.play = function() {
  44982. if (!0 !== this.isPlaying)
  44983. if (!1 !== this.hasPlaybackControl) {
  44984. var e = this.context.createBufferSource();
  44985. e.buffer = this.source.buffer,
  44986. e.loop = this.source.loop,
  44987. e.onended = this.source.onended,
  44988. e.start(0, this.startTime),
  44989. e.playbackRate.value = this.playbackRate,
  44990. this.isPlaying = !0,
  44991. this.source = e,
  44992. this.connect()
  44993. } else
  44994. console.warn("THREE.Audio: this Audio has no playback control.");
  44995. else
  44996. console.warn("THREE.Audio: Audio is already playing.")
  44997. }
  44998. ,
  44999. Ci.Audio.prototype.pause = function() {
  45000. return !1 === this.hasPlaybackControl ? void console.warn("THREE.Audio: this Audio has no playback control.") : (this.source.stop(),
  45001. void (this.startTime = this.context.currentTime))
  45002. }
  45003. ,
  45004. Ci.Audio.prototype.stop = function() {
  45005. return !1 === this.hasPlaybackControl ? void console.warn("THREE.Audio: this Audio has no playback control.") : (this.source.stop(),
  45006. void (this.startTime = 0))
  45007. }
  45008. ,
  45009. Ci.Audio.prototype.connect = function() {
  45010. null !== this.filter ? (this.source.connect(this.filter),
  45011. this.filter.connect(this.getOutput())) : this.source.connect(this.getOutput())
  45012. }
  45013. ,
  45014. Ci.Audio.prototype.disconnect = function() {
  45015. null !== this.filter ? (this.source.disconnect(this.filter),
  45016. this.filter.disconnect(this.getOutput())) : this.source.disconnect(this.getOutput())
  45017. }
  45018. ,
  45019. Ci.Audio.prototype.getFilter = function() {
  45020. return this.filter
  45021. }
  45022. ,
  45023. Ci.Audio.prototype.setFilter = function(e) {
  45024. void 0 === e && (e = null),
  45025. !0 === this.isPlaying ? (this.disconnect(),
  45026. this.filter = e,
  45027. this.connect()) : this.filter = e
  45028. }
  45029. ,
  45030. Ci.Audio.prototype.setPlaybackRate = function(e) {
  45031. return !1 === this.hasPlaybackControl ? void console.warn("THREE.Audio: this Audio has no playback control.") : (this.playbackRate = e,
  45032. void (!0 === this.isPlaying && (this.source.playbackRate.value = this.playbackRate)))
  45033. }
  45034. ,
  45035. Ci.Audio.prototype.getPlaybackRate = function() {
  45036. return this.playbackRate
  45037. }
  45038. ,
  45039. Ci.Audio.prototype.onEnded = function() {
  45040. this.isPlaying = !1
  45041. }
  45042. ,
  45043. Ci.Audio.prototype.setLoop = function(e) {
  45044. return !1 === this.hasPlaybackControl ? void console.warn("THREE.Audio: this Audio has no playback control.") : void (this.source.loop = e)
  45045. }
  45046. ,
  45047. Ci.Audio.prototype.getLoop = function() {
  45048. return !1 === this.hasPlaybackControl ? (console.warn("THREE.Audio: this Audio has no playback control."),
  45049. !1) : this.source.loop
  45050. }
  45051. ,
  45052. Ci.Audio.prototype.setVolume = function(e) {
  45053. this.gain.gain.value = e
  45054. }
  45055. ,
  45056. Ci.Audio.prototype.getVolume = function() {
  45057. return this.gain.gain.value
  45058. }
  45059. ,
  45060. Ci.AudioAnalyser = function(e, t) {
  45061. this.analyser = e.context.createAnalyser(),
  45062. this.analyser.fftSize = void 0 !== t ? t : 2048,
  45063. this.data = new Uint8Array(this.analyser.frequencyBinCount),
  45064. e.getOutput().connect(this.analyser)
  45065. }
  45066. ,
  45067. Ci.AudioAnalyser.prototype = {
  45068. constructor: Ci.AudioAnalyser,
  45069. getData: function() {
  45070. return this.analyser.getByteFrequencyData(this.data),
  45071. this.data
  45072. }
  45073. },
  45074. Ci.AudioBuffer = function(e) {
  45075. this.context = e,
  45076. this.ready = !1,
  45077. this.readyCallbacks = []
  45078. }
  45079. ,
  45080. Ci.AudioBuffer.prototype.load = function(e) {
  45081. var i = this
  45082. , t = new XMLHttpRequest;
  45083. return t.open("GET", e, !0),
  45084. t.responseType = "arraybuffer",
  45085. t.onload = function(e) {
  45086. i.context.decodeAudioData(this.response, function(e) {
  45087. i.buffer = e,
  45088. i.ready = !0;
  45089. for (var t = 0; t < i.readyCallbacks.length; t++)
  45090. i.readyCallbacks[t](i.buffer);
  45091. i.readyCallbacks = []
  45092. })
  45093. }
  45094. ,
  45095. t.send(),
  45096. this
  45097. }
  45098. ,
  45099. Ci.AudioBuffer.prototype.onReady = function(e) {
  45100. this.ready ? e(this.buffer) : this.readyCallbacks.push(e)
  45101. }
  45102. ,
  45103. Ci.PositionalAudio = function(e) {
  45104. Ci.Audio.call(this, e),
  45105. this.panner = this.context.createPanner(),
  45106. this.panner.connect(this.gain)
  45107. }
  45108. ,
  45109. Ci.PositionalAudio.prototype = Object.create(Ci.Audio.prototype),
  45110. Ci.PositionalAudio.prototype.constructor = Ci.PositionalAudio,
  45111. Ci.PositionalAudio.prototype.getOutput = function() {
  45112. return this.panner
  45113. }
  45114. ,
  45115. Ci.PositionalAudio.prototype.setRefDistance = function(e) {
  45116. this.panner.refDistance = e
  45117. }
  45118. ,
  45119. Ci.PositionalAudio.prototype.getRefDistance = function() {
  45120. return this.panner.refDistance
  45121. }
  45122. ,
  45123. Ci.PositionalAudio.prototype.setRolloffFactor = function(e) {
  45124. this.panner.rolloffFactor = e
  45125. }
  45126. ,
  45127. Ci.PositionalAudio.prototype.getRolloffFactor = function() {
  45128. return this.panner.rolloffFactor
  45129. }
  45130. ,
  45131. Ci.PositionalAudio.prototype.setDistanceModel = function(e) {
  45132. this.panner.distanceModel = e
  45133. }
  45134. ,
  45135. Ci.PositionalAudio.prototype.getDistanceModel = function() {
  45136. return this.panner.distanceModel
  45137. }
  45138. ,
  45139. Ci.PositionalAudio.prototype.setMaxDistance = function(e) {
  45140. this.panner.maxDistance = e
  45141. }
  45142. ,
  45143. Ci.PositionalAudio.prototype.getMaxDistance = function() {
  45144. return this.panner.maxDistance
  45145. }
  45146. ,
  45147. Ci.PositionalAudio.prototype.updateMatrixWorld = (it = new Ci.Vector3,
  45148. function(e) {
  45149. Ci.Object3D.prototype.updateMatrixWorld.call(this, e),
  45150. it.setFromMatrixPosition(this.matrixWorld),
  45151. this.panner.setPosition(it.x, it.y, it.z)
  45152. }
  45153. ),
  45154. Ci.AudioListener = function() {
  45155. Ci.Object3D.call(this),
  45156. this.type = "AudioListener",
  45157. this.context = new (window.AudioContext || window.webkitAudioContext),
  45158. this.gain = this.context.createGain(),
  45159. this.gain.connect(this.context.destination),
  45160. this.filter = null
  45161. }
  45162. ,
  45163. Ci.AudioListener.prototype = Object.create(Ci.Object3D.prototype),
  45164. Ci.AudioListener.prototype.constructor = Ci.AudioListener,
  45165. Ci.AudioListener.prototype.getInput = function() {
  45166. return this.gain
  45167. }
  45168. ,
  45169. Ci.AudioListener.prototype.removeFilter = function() {
  45170. null !== this.filter && (this.gain.disconnect(this.filter),
  45171. this.filter.disconnect(this.context.destination),
  45172. this.gain.connect(this.context.destination),
  45173. this.filter = null)
  45174. }
  45175. ,
  45176. Ci.AudioListener.prototype.setFilter = function(e) {
  45177. null !== this.filter ? (this.gain.disconnect(this.filter),
  45178. this.filter.disconnect(this.context.destination)) : this.gain.disconnect(this.context.destination),
  45179. this.filter = e,
  45180. this.gain.connect(this.filter),
  45181. this.filter.connect(this.context.destination)
  45182. }
  45183. ,
  45184. Ci.AudioListener.prototype.getFilter = function() {
  45185. return this.filter
  45186. }
  45187. ,
  45188. Ci.AudioListener.prototype.setMasterVolume = function(e) {
  45189. this.gain.gain.value = e
  45190. }
  45191. ,
  45192. Ci.AudioListener.prototype.getMasterVolume = function() {
  45193. return this.gain.gain.value
  45194. }
  45195. ,
  45196. Ci.AudioListener.prototype.updateMatrixWorld = (Je = new Ci.Vector3,
  45197. $e = new Ci.Quaternion,
  45198. et = new Ci.Vector3,
  45199. tt = new Ci.Vector3,
  45200. function(e) {
  45201. Ci.Object3D.prototype.updateMatrixWorld.call(this, e);
  45202. var t = this.context.listener
  45203. , i = this.up;
  45204. this.matrixWorld.decompose(Je, $e, et),
  45205. tt.set(0, 0, -1).applyQuaternion($e),
  45206. t.setPosition(Je.x, Je.y, Je.z),
  45207. t.setOrientation(tt.x, tt.y, tt.z, i.x, i.y, i.z)
  45208. }
  45209. ),
  45210. Ci.Camera = function() {
  45211. Ci.Object3D.call(this),
  45212. this.type = "Camera",
  45213. this.matrixWorldInverse = new Ci.Matrix4,
  45214. this.projectionMatrix = new Ci.Matrix4
  45215. }
  45216. ,
  45217. Ci.Camera.prototype = Object.create(Ci.Object3D.prototype),
  45218. Ci.Camera.prototype.constructor = Ci.Camera,
  45219. Ci.Camera.prototype.getWorldDirection = (Qe = new Ci.Quaternion,
  45220. function(e) {
  45221. var t = e || new Ci.Vector3;
  45222. return this.getWorldQuaternion(Qe),
  45223. t.set(0, 0, -1).applyQuaternion(Qe)
  45224. }
  45225. ),
  45226. Ci.Camera.prototype.lookAt = (Ke = new Ci.Matrix4,
  45227. function(e) {
  45228. Ke.lookAt(this.position, e, this.up),
  45229. this.quaternion.setFromRotationMatrix(Ke)
  45230. }
  45231. ),
  45232. Ci.Camera.prototype.clone = function() {
  45233. return (new this.constructor).copy(this)
  45234. }
  45235. ,
  45236. Ci.Camera.prototype.copy = function(e) {
  45237. return Ci.Object3D.prototype.copy.call(this, e),
  45238. this.matrixWorldInverse.copy(e.matrixWorldInverse),
  45239. this.projectionMatrix.copy(e.projectionMatrix),
  45240. this
  45241. }
  45242. ,
  45243. Ci.CubeCamera = function(e, t, i) {
  45244. Ci.Object3D.call(this),
  45245. this.type = "CubeCamera";
  45246. var r = new Ci.PerspectiveCamera(90,1,e,t);
  45247. r.up.set(0, -1, 0),
  45248. r.lookAt(new Ci.Vector3(1,0,0)),
  45249. this.add(r);
  45250. var o = new Ci.PerspectiveCamera(90,1,e,t);
  45251. o.up.set(0, -1, 0),
  45252. o.lookAt(new Ci.Vector3(-1,0,0)),
  45253. this.add(o);
  45254. var a = new Ci.PerspectiveCamera(90,1,e,t);
  45255. a.up.set(0, 0, 1),
  45256. a.lookAt(new Ci.Vector3(0,1,0)),
  45257. this.add(a);
  45258. var s = new Ci.PerspectiveCamera(90,1,e,t);
  45259. s.up.set(0, 0, -1),
  45260. s.lookAt(new Ci.Vector3(0,-1,0)),
  45261. this.add(s);
  45262. var l = new Ci.PerspectiveCamera(90,1,e,t);
  45263. l.up.set(0, -1, 0),
  45264. l.lookAt(new Ci.Vector3(0,0,1)),
  45265. this.add(l);
  45266. var c = new Ci.PerspectiveCamera(90,1,e,t);
  45267. c.up.set(0, -1, 0),
  45268. c.lookAt(new Ci.Vector3(0,0,-1)),
  45269. this.add(c);
  45270. var n = {
  45271. format: Ci.RGBFormat,
  45272. magFilter: Ci.LinearFilter,
  45273. minFilter: Ci.LinearFilter
  45274. };
  45275. this.renderTarget = new Ci.WebGLRenderTargetCube(i,i,n),
  45276. this.updateCubeMap = function(e, t) {
  45277. null === this.parent && this.updateMatrixWorld();
  45278. var i = this.renderTarget
  45279. , n = i.texture.generateMipmaps;
  45280. i.texture.generateMipmaps = !1,
  45281. i.activeCubeFace = 0,
  45282. e.render(t, r, i),
  45283. i.activeCubeFace = 1,
  45284. e.render(t, o, i),
  45285. i.activeCubeFace = 2,
  45286. e.render(t, a, i),
  45287. i.activeCubeFace = 3,
  45288. e.render(t, s, i),
  45289. i.activeCubeFace = 4,
  45290. e.render(t, l, i),
  45291. i.texture.generateMipmaps = n,
  45292. i.activeCubeFace = 5,
  45293. e.render(t, c, i),
  45294. e.setRenderTarget(null)
  45295. }
  45296. }
  45297. ,
  45298. Ci.CubeCamera.prototype = Object.create(Ci.Object3D.prototype),
  45299. Ci.CubeCamera.prototype.constructor = Ci.CubeCamera,
  45300. Ci.OrthographicCamera = function(e, t, i, n, r, o) {
  45301. Ci.Camera.call(this),
  45302. this.type = "OrthographicCamera",
  45303. this.zoom = 1,
  45304. this.left = e,
  45305. this.right = t,
  45306. this.top = i,
  45307. this.bottom = n,
  45308. this.near = void 0 !== r ? r : .1,
  45309. this.far = void 0 !== o ? o : 2e3,
  45310. this.updateProjectionMatrix()
  45311. }
  45312. ,
  45313. Ci.OrthographicCamera.prototype = Object.create(Ci.Camera.prototype),
  45314. Ci.OrthographicCamera.prototype.constructor = Ci.OrthographicCamera,
  45315. Ci.OrthographicCamera.prototype.updateProjectionMatrix = function() {
  45316. var e = (this.right - this.left) / (2 * this.zoom)
  45317. , t = (this.top - this.bottom) / (2 * this.zoom)
  45318. , i = (this.right + this.left) / 2
  45319. , n = (this.top + this.bottom) / 2;
  45320. this.projectionMatrix.makeOrthographic(i - e, i + e, n + t, n - t, this.near, this.far)
  45321. }
  45322. ,
  45323. Ci.OrthographicCamera.prototype.copy = function(e) {
  45324. return Ci.Camera.prototype.copy.call(this, e),
  45325. this.left = e.left,
  45326. this.right = e.right,
  45327. this.top = e.top,
  45328. this.bottom = e.bottom,
  45329. this.near = e.near,
  45330. this.far = e.far,
  45331. this.zoom = e.zoom,
  45332. this
  45333. }
  45334. ,
  45335. Ci.OrthographicCamera.prototype.toJSON = function(e) {
  45336. var t = Ci.Object3D.prototype.toJSON.call(this, e);
  45337. return t.object.zoom = this.zoom,
  45338. t.object.left = this.left,
  45339. t.object.right = this.right,
  45340. t.object.top = this.top,
  45341. t.object.bottom = this.bottom,
  45342. t.object.near = this.near,
  45343. t.object.far = this.far,
  45344. t
  45345. }
  45346. ,
  45347. Ci.PerspectiveCamera = function(e, t, i, n) {
  45348. Ci.Camera.call(this),
  45349. this.type = "PerspectiveCamera",
  45350. this.focalLength = 10,
  45351. this.zoom = 1,
  45352. this.fov = void 0 !== e ? e : 50,
  45353. this.aspect = void 0 !== t ? t : 1,
  45354. this.near = void 0 !== i ? i : .1,
  45355. this.far = void 0 !== n ? n : 2e3,
  45356. this.updateProjectionMatrix()
  45357. }
  45358. ,
  45359. Ci.PerspectiveCamera.prototype = Object.create(Ci.Camera.prototype),
  45360. Ci.PerspectiveCamera.prototype.constructor = Ci.PerspectiveCamera,
  45361. Ci.PerspectiveCamera.prototype.setLens = function(e, t) {
  45362. void 0 === t && (t = 24),
  45363. this.fov = 2 * Ci.Math.radToDeg(Math.atan(t / (2 * e))),
  45364. this.updateProjectionMatrix()
  45365. }
  45366. ,
  45367. Ci.PerspectiveCamera.prototype.setViewOffset = function(e, t, i, n, r, o) {
  45368. this.fullWidth = e,
  45369. this.fullHeight = t,
  45370. this.x = i,
  45371. this.y = n,
  45372. this.width = r,
  45373. this.height = o,
  45374. this.updateProjectionMatrix()
  45375. }
  45376. ,
  45377. Ci.PerspectiveCamera.prototype.updateProjectionMatrix = function() {
  45378. var e = Ci.Math.radToDeg(2 * Math.atan(Math.tan(.5 * Ci.Math.degToRad(this.fov)) / this.zoom));
  45379. if (this.fullWidth) {
  45380. var t = this.fullWidth / this.fullHeight
  45381. , i = Math.tan(Ci.Math.degToRad(.5 * e)) * this.near
  45382. , n = -i
  45383. , r = t * n
  45384. , o = t * i
  45385. , a = Math.abs(o - r)
  45386. , s = Math.abs(i - n);
  45387. 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)
  45388. } else
  45389. this.projectionMatrix.makePerspective(e, this.aspect, this.near, this.far)
  45390. }
  45391. ,
  45392. Ci.PerspectiveCamera.prototype.copy = function(e) {
  45393. return Ci.Camera.prototype.copy.call(this, e),
  45394. this.focalLength = e.focalLength,
  45395. this.zoom = e.zoom,
  45396. this.fov = e.fov,
  45397. this.aspect = e.aspect,
  45398. this.near = e.near,
  45399. this.far = e.far,
  45400. this
  45401. }
  45402. ,
  45403. Ci.PerspectiveCamera.prototype.toJSON = function(e) {
  45404. var t = Ci.Object3D.prototype.toJSON.call(this, e);
  45405. return t.object.focalLength = this.focalLength,
  45406. t.object.zoom = this.zoom,
  45407. t.object.fov = this.fov,
  45408. t.object.aspect = this.aspect,
  45409. t.object.near = this.near,
  45410. t.object.far = this.far,
  45411. t
  45412. }
  45413. ,
  45414. Ci.StereoCamera = function() {
  45415. this.type = "StereoCamera",
  45416. this.aspect = 1,
  45417. this.cameraL = new Ci.PerspectiveCamera,
  45418. this.cameraL.layers.enable(1),
  45419. this.cameraL.matrixAutoUpdate = !1,
  45420. this.cameraR = new Ci.PerspectiveCamera,
  45421. this.cameraR.layers.enable(2),
  45422. this.cameraR.matrixAutoUpdate = !1
  45423. }
  45424. ,
  45425. Ci.StereoCamera.prototype = {
  45426. constructor: Ci.StereoCamera,
  45427. update: (Xe = new Ci.Matrix4,
  45428. Ze = new Ci.Matrix4,
  45429. function(e) {
  45430. if (Ge !== e.focalLength || We !== e.fov || je !== e.aspect * this.aspect || Ye !== e.near || qe !== e.far) {
  45431. Ge = e.focalLength,
  45432. We = e.fov,
  45433. je = e.aspect * this.aspect,
  45434. Ye = e.near,
  45435. qe = e.far;
  45436. var t, i, n = e.projectionMatrix.clone(), r = .032 * Ye / Ge, o = Ye * Math.tan(Ci.Math.degToRad(.5 * We));
  45437. Ze.elements[12] = -.032,
  45438. Xe.elements[12] = .032,
  45439. t = -o * je + r,
  45440. i = o * je + r,
  45441. n.elements[0] = 2 * Ye / (i - t),
  45442. n.elements[8] = (i + t) / (i - t),
  45443. this.cameraL.projectionMatrix.copy(n),
  45444. t = -o * je - r,
  45445. i = o * je - r,
  45446. n.elements[0] = 2 * Ye / (i - t),
  45447. n.elements[8] = (i + t) / (i - t),
  45448. this.cameraR.projectionMatrix.copy(n)
  45449. }
  45450. this.cameraL.matrixWorld.copy(e.matrixWorld).multiply(Ze),
  45451. this.cameraR.matrixWorld.copy(e.matrixWorld).multiply(Xe)
  45452. }
  45453. )
  45454. },
  45455. Ci.Light = function(e, t) {
  45456. Ci.Object3D.call(this),
  45457. this.type = "Light",
  45458. this.color = new Ci.Color(e),
  45459. this.intensity = void 0 !== t ? t : 1,
  45460. this.receiveShadow = void 0
  45461. }
  45462. ,
  45463. Ci.Light.prototype = Object.create(Ci.Object3D.prototype),
  45464. Ci.Light.prototype.constructor = Ci.Light,
  45465. Ci.Light.prototype.copy = function(e) {
  45466. return Ci.Object3D.prototype.copy.call(this, e),
  45467. this.color.copy(e.color),
  45468. this.intensity = e.intensity,
  45469. this
  45470. }
  45471. ,
  45472. Ci.Light.prototype.toJSON = function(e) {
  45473. var t = Ci.Object3D.prototype.toJSON.call(this, e);
  45474. return t.object.color = this.color.getHex(),
  45475. t.object.intensity = this.intensity,
  45476. void 0 !== this.groundColor && (t.object.groundColor = this.groundColor.getHex()),
  45477. void 0 !== this.distance && (t.object.distance = this.distance),
  45478. void 0 !== this.angle && (t.object.angle = this.angle),
  45479. void 0 !== this.decay && (t.object.decay = this.decay),
  45480. void 0 !== this.penumbra && (t.object.penumbra = this.penumbra),
  45481. t
  45482. }
  45483. ,
  45484. Ci.LightShadow = function(e) {
  45485. this.camera = e,
  45486. this.bias = 0,
  45487. this.radius = 1,
  45488. this.mapSize = new Ci.Vector2(512,512),
  45489. this.map = null,
  45490. this.matrix = new Ci.Matrix4
  45491. }
  45492. ,
  45493. Ci.LightShadow.prototype = {
  45494. constructor: Ci.LightShadow,
  45495. copy: function(e) {
  45496. return this.camera = e.camera.clone(),
  45497. this.bias = e.bias,
  45498. this.radius = e.radius,
  45499. this.mapSize.copy(e.mapSize),
  45500. this
  45501. },
  45502. clone: function() {
  45503. return (new this.constructor).copy(this)
  45504. }
  45505. },
  45506. Ci.AmbientLight = function(e, t) {
  45507. Ci.Light.call(this, e, t),
  45508. this.type = "AmbientLight",
  45509. this.castShadow = void 0
  45510. }
  45511. ,
  45512. Ci.AmbientLight.prototype = Object.create(Ci.Light.prototype),
  45513. Ci.AmbientLight.prototype.constructor = Ci.AmbientLight,
  45514. Ci.DirectionalLight = function(e, t) {
  45515. Ci.Light.call(this, e, t),
  45516. this.type = "DirectionalLight",
  45517. this.position.set(0, 1, 0),
  45518. this.updateMatrix(),
  45519. this.target = new Ci.Object3D,
  45520. this.shadow = new Ci.LightShadow(new Ci.OrthographicCamera(-5,5,5,-5,.5,500))
  45521. }
  45522. ,
  45523. Ci.DirectionalLight.prototype = Object.create(Ci.Light.prototype),
  45524. Ci.DirectionalLight.prototype.constructor = Ci.DirectionalLight,
  45525. Ci.DirectionalLight.prototype.copy = function(e) {
  45526. return Ci.Light.prototype.copy.call(this, e),
  45527. this.target = e.target.clone(),
  45528. this.shadow = e.shadow.clone(),
  45529. this
  45530. }
  45531. ,
  45532. Ci.HemisphereLight = function(e, t, i) {
  45533. Ci.Light.call(this, e, i),
  45534. this.type = "HemisphereLight",
  45535. this.castShadow = void 0,
  45536. this.position.set(0, 1, 0),
  45537. this.updateMatrix(),
  45538. this.groundColor = new Ci.Color(t)
  45539. }
  45540. ,
  45541. Ci.HemisphereLight.prototype = Object.create(Ci.Light.prototype),
  45542. Ci.HemisphereLight.prototype.constructor = Ci.HemisphereLight,
  45543. Ci.HemisphereLight.prototype.copy = function(e) {
  45544. return Ci.Light.prototype.copy.call(this, e),
  45545. this.groundColor.copy(e.groundColor),
  45546. this
  45547. }
  45548. ,
  45549. Ci.PointLight = function(e, t, i, n) {
  45550. Ci.Light.call(this, e, t),
  45551. this.type = "PointLight",
  45552. this.distance = void 0 !== i ? i : 0,
  45553. this.decay = void 0 !== n ? n : 1,
  45554. this.shadow = new Ci.LightShadow(new Ci.PerspectiveCamera(90,1,.5,500))
  45555. }
  45556. ,
  45557. Ci.PointLight.prototype = Object.create(Ci.Light.prototype),
  45558. Ci.PointLight.prototype.constructor = Ci.PointLight,
  45559. Object.defineProperty(Ci.PointLight.prototype, "power", {
  45560. get: function() {
  45561. return 4 * this.intensity * Math.PI
  45562. },
  45563. set: function(e) {
  45564. this.intensity = e / (4 * Math.PI)
  45565. }
  45566. }),
  45567. Ci.PointLight.prototype.copy = function(e) {
  45568. return Ci.Light.prototype.copy.call(this, e),
  45569. this.distance = e.distance,
  45570. this.decay = e.decay,
  45571. this.shadow = e.shadow.clone(),
  45572. this
  45573. }
  45574. ,
  45575. Ci.SpotLight = function(e, t, i, n, r, o) {
  45576. Ci.Light.call(this, e, t),
  45577. this.type = "SpotLight",
  45578. this.position.set(0, 1, 0),
  45579. this.updateMatrix(),
  45580. this.target = new Ci.Object3D,
  45581. this.distance = void 0 !== i ? i : 0,
  45582. this.angle = void 0 !== n ? n : Math.PI / 3,
  45583. this.penumbra = void 0 !== r ? r : 0,
  45584. this.decay = void 0 !== o ? o : 1,
  45585. this.shadow = new Ci.LightShadow(new Ci.PerspectiveCamera(50,1,.5,500))
  45586. }
  45587. ,
  45588. Ci.SpotLight.prototype = Object.create(Ci.Light.prototype),
  45589. Ci.SpotLight.prototype.constructor = Ci.SpotLight,
  45590. Object.defineProperty(Ci.SpotLight.prototype, "power", {
  45591. get: function() {
  45592. return this.intensity * Math.PI
  45593. },
  45594. set: function(e) {
  45595. this.intensity = e / Math.PI
  45596. }
  45597. }),
  45598. Ci.SpotLight.prototype.copy = function(e) {
  45599. return Ci.Light.prototype.copy.call(this, e),
  45600. this.distance = e.distance,
  45601. this.angle = e.angle,
  45602. this.penumbra = e.penumbra,
  45603. this.decay = e.decay,
  45604. this.target = e.target.clone(),
  45605. this.shadow = e.shadow.clone(),
  45606. this
  45607. }
  45608. ,
  45609. Ci.Cache = {
  45610. enabled: !1,
  45611. files: {},
  45612. add: function(e, t) {
  45613. !1 !== this.enabled && (this.files[e] = t)
  45614. },
  45615. get: function(e) {
  45616. if (!1 !== this.enabled)
  45617. return this.files[e]
  45618. },
  45619. remove: function(e) {
  45620. delete this.files[e]
  45621. },
  45622. clear: function() {
  45623. this.files = {}
  45624. }
  45625. },
  45626. Ci.Loader = function() {
  45627. this.onLoadStart = function() {}
  45628. ,
  45629. this.onLoadProgress = function() {}
  45630. ,
  45631. this.onLoadComplete = function() {}
  45632. }
  45633. ,
  45634. Ci.Loader.prototype = {
  45635. constructor: Ci.Loader,
  45636. crossOrigin: void 0,
  45637. extractUrlBase: function(e) {
  45638. var t = e.split("/");
  45639. return 1 === t.length ? "./" : (t.pop(),
  45640. t.join("/") + "/")
  45641. },
  45642. initMaterials: function(e, t, i) {
  45643. for (var n = [], r = 0; r < e.length; ++r)
  45644. n[r] = this.createMaterial(e[r], t, i);
  45645. return n
  45646. },
  45647. createMaterial: function(e, c, h) {
  45648. function t(e, t, i, n, r) {
  45649. var o, a = c + e, s = Ci.Loader.Handlers.get(a);
  45650. o = null !== s ? s.load(a) : (He.setCrossOrigin(h),
  45651. He.load(a)),
  45652. void 0 !== t && (o.repeat.fromArray(t),
  45653. 1 !== t[0] && (o.wrapS = Ci.RepeatWrapping),
  45654. 1 !== t[1] && (o.wrapT = Ci.RepeatWrapping)),
  45655. void 0 !== i && o.offset.fromArray(i),
  45656. void 0 !== n && ("repeat" === n[0] && (o.wrapS = Ci.RepeatWrapping),
  45657. "mirror" === n[0] && (o.wrapS = Ci.MirroredRepeatWrapping),
  45658. "repeat" === n[1] && (o.wrapT = Ci.RepeatWrapping),
  45659. "mirror" === n[1] && (o.wrapT = Ci.MirroredRepeatWrapping)),
  45660. void 0 !== r && (o.anisotropy = r);
  45661. var l = Ci.Math.generateUUID();
  45662. return u[l] = o,
  45663. l
  45664. }
  45665. void 0 === Ue && (Ue = new Ci.Color),
  45666. void 0 === He && (He = new Ci.TextureLoader),
  45667. void 0 === ze && (ze = new Ci.MaterialLoader);
  45668. var u = {}
  45669. , i = {
  45670. uuid: Ci.Math.generateUUID(),
  45671. type: "MeshLambertMaterial"
  45672. };
  45673. for (var n in e) {
  45674. var r = e[n];
  45675. switch (n) {
  45676. case "DbgColor":
  45677. case "DbgIndex":
  45678. case "opticalDensity":
  45679. case "illumination":
  45680. break;
  45681. case "DbgName":
  45682. i.name = r;
  45683. break;
  45684. case "blending":
  45685. i.blending = Ci[r];
  45686. break;
  45687. case "colorAmbient":
  45688. case "mapAmbient":
  45689. console.warn("THREE.Loader.createMaterial:", n, "is no longer supported.");
  45690. break;
  45691. case "colorDiffuse":
  45692. i.color = Ue.fromArray(r).getHex();
  45693. break;
  45694. case "colorSpecular":
  45695. i.specular = Ue.fromArray(r).getHex();
  45696. break;
  45697. case "colorEmissive":
  45698. i.emissive = Ue.fromArray(r).getHex();
  45699. break;
  45700. case "specularCoef":
  45701. i.shininess = r;
  45702. break;
  45703. case "shading":
  45704. "basic" === r.toLowerCase() && (i.type = "MeshBasicMaterial"),
  45705. "phong" === r.toLowerCase() && (i.type = "MeshPhongMaterial");
  45706. break;
  45707. case "mapDiffuse":
  45708. i.map = t(r, e.mapDiffuseRepeat, e.mapDiffuseOffset, e.mapDiffuseWrap, e.mapDiffuseAnisotropy);
  45709. break;
  45710. case "mapDiffuseRepeat":
  45711. case "mapDiffuseOffset":
  45712. case "mapDiffuseWrap":
  45713. case "mapDiffuseAnisotropy":
  45714. break;
  45715. case "mapLight":
  45716. i.lightMap = t(r, e.mapLightRepeat, e.mapLightOffset, e.mapLightWrap, e.mapLightAnisotropy);
  45717. break;
  45718. case "mapLightRepeat":
  45719. case "mapLightOffset":
  45720. case "mapLightWrap":
  45721. case "mapLightAnisotropy":
  45722. break;
  45723. case "mapAO":
  45724. i.aoMap = t(r, e.mapAORepeat, e.mapAOOffset, e.mapAOWrap, e.mapAOAnisotropy);
  45725. break;
  45726. case "mapAORepeat":
  45727. case "mapAOOffset":
  45728. case "mapAOWrap":
  45729. case "mapAOAnisotropy":
  45730. break;
  45731. case "mapBump":
  45732. i.bumpMap = t(r, e.mapBumpRepeat, e.mapBumpOffset, e.mapBumpWrap, e.mapBumpAnisotropy);
  45733. break;
  45734. case "mapBumpScale":
  45735. i.bumpScale = r;
  45736. break;
  45737. case "mapBumpRepeat":
  45738. case "mapBumpOffset":
  45739. case "mapBumpWrap":
  45740. case "mapBumpAnisotropy":
  45741. break;
  45742. case "mapNormal":
  45743. i.normalMap = t(r, e.mapNormalRepeat, e.mapNormalOffset, e.mapNormalWrap, e.mapNormalAnisotropy);
  45744. break;
  45745. case "mapNormalFactor":
  45746. i.normalScale = [r, r];
  45747. break;
  45748. case "mapNormalRepeat":
  45749. case "mapNormalOffset":
  45750. case "mapNormalWrap":
  45751. case "mapNormalAnisotropy":
  45752. break;
  45753. case "mapSpecular":
  45754. i.specularMap = t(r, e.mapSpecularRepeat, e.mapSpecularOffset, e.mapSpecularWrap, e.mapSpecularAnisotropy);
  45755. break;
  45756. case "mapSpecularRepeat":
  45757. case "mapSpecularOffset":
  45758. case "mapSpecularWrap":
  45759. case "mapSpecularAnisotropy":
  45760. break;
  45761. case "mapAlpha":
  45762. i.alphaMap = t(r, e.mapAlphaRepeat, e.mapAlphaOffset, e.mapAlphaWrap, e.mapAlphaAnisotropy);
  45763. break;
  45764. case "mapAlphaRepeat":
  45765. case "mapAlphaOffset":
  45766. case "mapAlphaWrap":
  45767. case "mapAlphaAnisotropy":
  45768. break;
  45769. case "flipSided":
  45770. i.side = Ci.BackSide;
  45771. break;
  45772. case "doubleSided":
  45773. i.side = Ci.DoubleSide;
  45774. break;
  45775. case "transparency":
  45776. console.warn("THREE.Loader.createMaterial: transparency has been renamed to opacity"),
  45777. i.opacity = r;
  45778. break;
  45779. case "depthTest":
  45780. case "depthWrite":
  45781. case "colorWrite":
  45782. case "opacity":
  45783. case "reflectivity":
  45784. case "transparent":
  45785. case "visible":
  45786. case "wireframe":
  45787. i[n] = r;
  45788. break;
  45789. case "vertexColors":
  45790. !0 === r && (i.vertexColors = Ci.VertexColors),
  45791. "face" === r && (i.vertexColors = Ci.FaceColors);
  45792. break;
  45793. default:
  45794. console.error("THREE.Loader.createMaterial: Unsupported", n, r)
  45795. }
  45796. }
  45797. return "MeshBasicMaterial" === i.type && delete i.emissive,
  45798. "MeshPhongMaterial" !== i.type && delete i.specular,
  45799. i.opacity < 1 && (i.transparent = !0),
  45800. ze.setTextures(u),
  45801. ze.parse(i)
  45802. }
  45803. },
  45804. Ci.Loader.Handlers = {
  45805. handlers: [],
  45806. add: function(e, t) {
  45807. this.handlers.push(e, t)
  45808. },
  45809. get: function(e) {
  45810. for (var t = this.handlers, i = 0, n = t.length; i < n; i += 2) {
  45811. var r = t[i]
  45812. , o = t[i + 1];
  45813. if (r.test(e))
  45814. return o
  45815. }
  45816. return null
  45817. }
  45818. },
  45819. Ci.XHRLoader = function(e) {
  45820. this.manager = void 0 !== e ? e : Ci.DefaultLoadingManager
  45821. }
  45822. ,
  45823. Ci.XHRLoader.prototype = {
  45824. constructor: Ci.XHRLoader,
  45825. load: function(i, n, t, r) {
  45826. void 0 !== this.path && (i = this.path + i);
  45827. var o = this
  45828. , e = Ci.Cache.get(i);
  45829. if (void 0 !== e)
  45830. return n && setTimeout(function() {
  45831. n(e)
  45832. }, 0),
  45833. e;
  45834. var a = new XMLHttpRequest;
  45835. return a.overrideMimeType("text/plain"),
  45836. a.open("GET", i, !0),
  45837. a.addEventListener("load", function(e) {
  45838. var t = e.target.response;
  45839. Ci.Cache.add(i, t),
  45840. 200 === this.status ? (n && n(t),
  45841. o.manager.itemEnd(i)) : 0 === this.status ? (console.warn("THREE.XHRLoader: HTTP Status 0 received."),
  45842. n && n(t),
  45843. o.manager.itemEnd(i)) : (r && r(e),
  45844. o.manager.itemError(i))
  45845. }, !1),
  45846. void 0 !== t && a.addEventListener("progress", function(e) {
  45847. t(e)
  45848. }, !1),
  45849. a.addEventListener("error", function(e) {
  45850. r && r(e),
  45851. o.manager.itemError(i)
  45852. }, !1),
  45853. void 0 !== this.responseType && (a.responseType = this.responseType),
  45854. void 0 !== this.withCredentials && (a.withCredentials = this.withCredentials),
  45855. a.send(null),
  45856. o.manager.itemStart(i),
  45857. a
  45858. },
  45859. setPath: function(e) {
  45860. this.path = e
  45861. },
  45862. setResponseType: function(e) {
  45863. this.responseType = e
  45864. },
  45865. setWithCredentials: function(e) {
  45866. this.withCredentials = e
  45867. }
  45868. },
  45869. Ci.FontLoader = function(e) {
  45870. this.manager = void 0 !== e ? e : Ci.DefaultLoadingManager
  45871. }
  45872. ,
  45873. Ci.FontLoader.prototype = {
  45874. constructor: Ci.FontLoader,
  45875. load: function(e, t, i, n) {
  45876. new Ci.XHRLoader(this.manager).load(e, function(e) {
  45877. t(new Ci.Font(JSON.parse(e.substring(65, e.length - 2))))
  45878. }, i, n)
  45879. }
  45880. },
  45881. Ci.ImageLoader = function(e) {
  45882. this.manager = void 0 !== e ? e : Ci.DefaultLoadingManager
  45883. }
  45884. ,
  45885. Ci.ImageLoader.prototype = {
  45886. constructor: Ci.ImageLoader,
  45887. load: function(t, i, n, r) {
  45888. void 0 !== this.path && (t = this.path + t);
  45889. var o = this
  45890. , e = Ci.Cache.get(t);
  45891. if (void 0 !== e)
  45892. return o.manager.itemStart(t),
  45893. i ? setTimeout(function() {
  45894. i(e),
  45895. o.manager.itemEnd(t)
  45896. }, 0) : o.manager.itemEnd(t),
  45897. e;
  45898. var a = document.createElement("img");
  45899. return a.addEventListener("load", function(e) {
  45900. Ci.Cache.add(t, this),
  45901. i && i(this),
  45902. o.manager.itemEnd(t)
  45903. }, !1),
  45904. void 0 !== n && a.addEventListener("progress", function(e) {
  45905. n(e)
  45906. }, !1),
  45907. a.addEventListener("error", function(e) {
  45908. r && r(e),
  45909. o.manager.itemError(t)
  45910. }, !1),
  45911. void 0 !== this.crossOrigin && (a.crossOrigin = this.crossOrigin),
  45912. o.manager.itemStart(t),
  45913. a.src = t,
  45914. a
  45915. },
  45916. setCrossOrigin: function(e) {
  45917. this.crossOrigin = e
  45918. },
  45919. setPath: function(e) {
  45920. this.path = e
  45921. }
  45922. },
  45923. Ci.JSONLoader = function(e) {
  45924. "boolean" == typeof e && (console.warn("THREE.JSONLoader: showStatus parameter has been removed from constructor."),
  45925. e = void 0),
  45926. this.manager = void 0 !== e ? e : Ci.DefaultLoadingManager,
  45927. this.withCredentials = !1
  45928. }
  45929. ,
  45930. Ci.JSONLoader.prototype = {
  45931. constructor: Ci.JSONLoader,
  45932. get statusDomElement() {
  45933. return void 0 === this._statusDomElement && (this._statusDomElement = document.createElement("div")),
  45934. console.warn("THREE.JSONLoader: .statusDomElement has been removed."),
  45935. this._statusDomElement
  45936. },
  45937. load: function(o, a, e, t) {
  45938. var s = this
  45939. , l = this.texturePath && "string" == typeof this.texturePath ? this.texturePath : Ci.Loader.prototype.extractUrlBase(o)
  45940. , i = new Ci.XHRLoader(this.manager);
  45941. i.setWithCredentials(this.withCredentials),
  45942. i.load(o, function(e) {
  45943. var t = JSON.parse(e)
  45944. , i = t.metadata;
  45945. if (void 0 !== i) {
  45946. var n = i.type;
  45947. if (void 0 !== n) {
  45948. if ("object" === n.toLowerCase())
  45949. return void console.error("THREE.JSONLoader: " + o + " should be loaded with THREE.ObjectLoader instead.");
  45950. if ("scene" === n.toLowerCase())
  45951. return void console.error("THREE.JSONLoader: " + o + " should be loaded with THREE.SceneLoader instead.")
  45952. }
  45953. }
  45954. var r = s.parse(t, l);
  45955. a(r.geometry, r.materials)
  45956. }, e, t)
  45957. },
  45958. setTexturePath: function(e) {
  45959. this.texturePath = e
  45960. },
  45961. parse: function(D, e) {
  45962. var N = new Ci.Geometry
  45963. , t = void 0 !== D.scale ? 1 / D.scale : 1;
  45964. if (function(e) {
  45965. function t(e, t) {
  45966. return e & 1 << t
  45967. }
  45968. 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;
  45969. if (void 0 !== D.uvs) {
  45970. for (i = 0; i < D.uvs.length; i++)
  45971. D.uvs[i].length && L++;
  45972. for (i = 0; i < L; i++)
  45973. N.faceVertexUvs[i] = []
  45974. }
  45975. for (o = 0,
  45976. a = R.length; o < a; )
  45977. (A = new Ci.Vector3).x = R[o++] * e,
  45978. A.y = R[o++] * e,
  45979. A.z = R[o++] * e,
  45980. N.vertices.push(A);
  45981. for (o = 0,
  45982. a = M.length; o < a; )
  45983. if (d = t(u = M[o++], 0),
  45984. p = t(u, 1),
  45985. f = t(u, 3),
  45986. g = t(u, 4),
  45987. m = t(u, 5),
  45988. v = t(u, 6),
  45989. y = t(u, 7),
  45990. d) {
  45991. if ((I = new Ci.Face3).a = M[o],
  45992. I.b = M[o + 1],
  45993. I.c = M[o + 3],
  45994. (E = new Ci.Face3).a = M[o + 1],
  45995. E.b = M[o + 2],
  45996. E.c = M[o + 3],
  45997. o += 4,
  45998. p && (h = M[o++],
  45999. I.materialIndex = h,
  46000. E.materialIndex = h),
  46001. r = N.faces.length,
  46002. f)
  46003. for (i = 0; i < L; i++)
  46004. for (w = D.uvs[i],
  46005. N.faceVertexUvs[i][r] = [],
  46006. N.faceVertexUvs[i][r + 1] = [],
  46007. n = 0; n < 4; n++)
  46008. x = w[2 * (c = M[o++])],
  46009. S = w[2 * c + 1],
  46010. T = new Ci.Vector2(x,S),
  46011. 2 !== n && N.faceVertexUvs[i][r].push(T),
  46012. 0 !== n && N.faceVertexUvs[i][r + 1].push(T);
  46013. if (g && (l = 3 * M[o++],
  46014. I.normal.set(P[l++], P[l++], P[l]),
  46015. E.normal.copy(I.normal)),
  46016. m)
  46017. for (i = 0; i < 4; i++)
  46018. l = 3 * M[o++],
  46019. b = new Ci.Vector3(P[l++],P[l++],P[l]),
  46020. 2 !== i && I.vertexNormals.push(b),
  46021. 0 !== i && E.vertexNormals.push(b);
  46022. if (v && (_ = O[s = M[o++]],
  46023. I.color.setHex(_),
  46024. E.color.setHex(_)),
  46025. y)
  46026. for (i = 0; i < 4; i++)
  46027. _ = O[s = M[o++]],
  46028. 2 !== i && I.vertexColors.push(new Ci.Color(_)),
  46029. 0 !== i && E.vertexColors.push(new Ci.Color(_));
  46030. N.faces.push(I),
  46031. N.faces.push(E)
  46032. } else {
  46033. if ((C = new Ci.Face3).a = M[o++],
  46034. C.b = M[o++],
  46035. C.c = M[o++],
  46036. p && (h = M[o++],
  46037. C.materialIndex = h),
  46038. r = N.faces.length,
  46039. f)
  46040. for (i = 0; i < L; i++)
  46041. for (w = D.uvs[i],
  46042. N.faceVertexUvs[i][r] = [],
  46043. n = 0; n < 3; n++)
  46044. x = w[2 * (c = M[o++])],
  46045. S = w[2 * c + 1],
  46046. T = new Ci.Vector2(x,S),
  46047. N.faceVertexUvs[i][r].push(T);
  46048. if (g && (l = 3 * M[o++],
  46049. C.normal.set(P[l++], P[l++], P[l])),
  46050. m)
  46051. for (i = 0; i < 3; i++)
  46052. l = 3 * M[o++],
  46053. b = new Ci.Vector3(P[l++],P[l++],P[l]),
  46054. C.vertexNormals.push(b);
  46055. if (v && (s = M[o++],
  46056. C.color.setHex(O[s])),
  46057. y)
  46058. for (i = 0; i < 3; i++)
  46059. s = M[o++],
  46060. C.vertexColors.push(new Ci.Color(O[s]));
  46061. N.faces.push(C)
  46062. }
  46063. }(t),
  46064. function() {
  46065. var e = void 0 !== D.influencesPerVertex ? D.influencesPerVertex : 2;
  46066. if (D.skinWeights)
  46067. for (var t = 0, i = D.skinWeights.length; t < i; t += e) {
  46068. var n = D.skinWeights[t]
  46069. , r = 1 < e ? D.skinWeights[t + 1] : 0
  46070. , o = 2 < e ? D.skinWeights[t + 2] : 0
  46071. , a = 3 < e ? D.skinWeights[t + 3] : 0;
  46072. N.skinWeights.push(new Ci.Vector4(n,r,o,a))
  46073. }
  46074. if (D.skinIndices)
  46075. for (t = 0,
  46076. i = D.skinIndices.length; t < i; t += e) {
  46077. var s = D.skinIndices[t]
  46078. , l = 1 < e ? D.skinIndices[t + 1] : 0
  46079. , c = 2 < e ? D.skinIndices[t + 2] : 0
  46080. , h = 3 < e ? D.skinIndices[t + 3] : 0;
  46081. N.skinIndices.push(new Ci.Vector4(s,l,c,h))
  46082. }
  46083. N.bones = D.bones,
  46084. 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.")
  46085. }(),
  46086. function(e) {
  46087. if (void 0 !== D.morphTargets)
  46088. for (var t = 0, i = D.morphTargets.length; t < i; t++) {
  46089. N.morphTargets[t] = {},
  46090. N.morphTargets[t].name = D.morphTargets[t].name,
  46091. N.morphTargets[t].vertices = [];
  46092. for (var n = N.morphTargets[t].vertices, r = D.morphTargets[t].vertices, o = 0, a = r.length; o < a; o += 3) {
  46093. var s = new Ci.Vector3;
  46094. s.x = r[o] * e,
  46095. s.y = r[o + 1] * e,
  46096. s.z = r[o + 2] * e,
  46097. n.push(s)
  46098. }
  46099. }
  46100. if (void 0 !== D.morphColors && 0 < D.morphColors.length) {
  46101. console.warn('THREE.JSONLoader: "morphColors" no longer supported. Using them as face colors.');
  46102. var l = N.faces
  46103. , c = D.morphColors[0].colors;
  46104. for (t = 0,
  46105. i = l.length; t < i; t++)
  46106. l[t].color.fromArray(c, 3 * t)
  46107. }
  46108. }(t),
  46109. function() {
  46110. var e = []
  46111. , t = [];
  46112. void 0 !== D.animation && t.push(D.animation),
  46113. void 0 !== D.animations && (D.animations.length ? t = t.concat(D.animations) : t.push(D.animations));
  46114. for (var i = 0; i < t.length; i++) {
  46115. var n = Ci.AnimationClip.parseAnimation(t[i], N.bones);
  46116. n && e.push(n)
  46117. }
  46118. if (N.morphTargets) {
  46119. var r = Ci.AnimationClip.CreateClipsFromMorphTargetSequences(N.morphTargets, 10);
  46120. e = e.concat(r)
  46121. }
  46122. 0 < e.length && (N.animations = e)
  46123. }(),
  46124. N.computeFaceNormals(),
  46125. N.computeBoundingSphere(),
  46126. void 0 === D.materials || 0 === D.materials.length)
  46127. return {
  46128. geometry: N
  46129. };
  46130. var i = Ci.Loader.prototype.initMaterials(D.materials, e, this.crossOrigin);
  46131. return {
  46132. geometry: N,
  46133. materials: i
  46134. }
  46135. }
  46136. },
  46137. Ci.LoadingManager = function(e, t, i) {
  46138. var n = this
  46139. , r = !1
  46140. , o = 0
  46141. , a = 0;
  46142. this.onStart = void 0,
  46143. this.onLoad = e,
  46144. this.onProgress = t,
  46145. this.onError = i,
  46146. this.itemStart = function(e) {
  46147. a++,
  46148. !1 === r && void 0 !== n.onStart && n.onStart(e, o, a),
  46149. r = !0
  46150. }
  46151. ,
  46152. this.itemEnd = function(e) {
  46153. o++,
  46154. void 0 !== n.onProgress && n.onProgress(e, o, a),
  46155. o === a && (r = !1,
  46156. void 0 !== n.onLoad && n.onLoad())
  46157. }
  46158. ,
  46159. this.itemError = function(e) {
  46160. void 0 !== n.onError && n.onError(e)
  46161. }
  46162. }
  46163. ,
  46164. Ci.DefaultLoadingManager = new Ci.LoadingManager,
  46165. Ci.BufferGeometryLoader = function(e) {
  46166. this.manager = void 0 !== e ? e : Ci.DefaultLoadingManager
  46167. }
  46168. ,
  46169. Ci.BufferGeometryLoader.prototype = {
  46170. constructor: Ci.BufferGeometryLoader,
  46171. load: function(e, t, i, n) {
  46172. var r = this;
  46173. new Ci.XHRLoader(r.manager).load(e, function(e) {
  46174. t(r.parse(JSON.parse(e)))
  46175. }, i, n)
  46176. },
  46177. parse: function(e) {
  46178. var t = new Ci.BufferGeometry
  46179. , i = e.data.index
  46180. , n = {
  46181. Int8Array: Int8Array,
  46182. Uint8Array: Uint8Array,
  46183. Uint8ClampedArray: Uint8ClampedArray,
  46184. Int16Array: Int16Array,
  46185. Uint16Array: Uint16Array,
  46186. Int32Array: Int32Array,
  46187. Uint32Array: Uint32Array,
  46188. Float32Array: Float32Array,
  46189. Float64Array: Float64Array
  46190. };
  46191. if (void 0 !== i) {
  46192. var r = new n[i.type](i.array);
  46193. t.setIndex(new Ci.BufferAttribute(r,1))
  46194. }
  46195. var o = e.data.attributes;
  46196. for (var a in o) {
  46197. var s = o[a];
  46198. r = new n[s.type](s.array);
  46199. t.addAttribute(a, new Ci.BufferAttribute(r,s.itemSize))
  46200. }
  46201. var l = e.data.groups || e.data.drawcalls || e.data.offsets;
  46202. if (void 0 !== l)
  46203. for (var c = 0, h = l.length; c !== h; ++c) {
  46204. var u = l[c];
  46205. t.addGroup(u.start, u.count, u.materialIndex)
  46206. }
  46207. var d = e.data.boundingSphere;
  46208. if (void 0 !== d) {
  46209. var p = new Ci.Vector3;
  46210. void 0 !== d.center && p.fromArray(d.center),
  46211. t.boundingSphere = new Ci.Sphere(p,d.radius)
  46212. }
  46213. return t
  46214. }
  46215. },
  46216. Ci.MaterialLoader = function(e) {
  46217. this.manager = void 0 !== e ? e : Ci.DefaultLoadingManager,
  46218. this.textures = {}
  46219. }
  46220. ,
  46221. Ci.MaterialLoader.prototype = {
  46222. constructor: Ci.MaterialLoader,
  46223. load: function(e, t, i, n) {
  46224. var r = this;
  46225. new Ci.XHRLoader(r.manager).load(e, function(e) {
  46226. t(r.parse(JSON.parse(e)))
  46227. }, i, n)
  46228. },
  46229. setTextures: function(e) {
  46230. this.textures = e
  46231. },
  46232. getTexture: function(e) {
  46233. var t = this.textures;
  46234. return void 0 === t[e] && console.warn("THREE.MaterialLoader: Undefined texture", e),
  46235. t[e]
  46236. },
  46237. parse: function(e) {
  46238. var t = new Ci[e.type];
  46239. if (void 0 !== e.uuid && (t.uuid = e.uuid),
  46240. void 0 !== e.name && (t.name = e.name),
  46241. void 0 !== e.color && t.color.setHex(e.color),
  46242. void 0 !== e.roughness && (t.roughness = e.roughness),
  46243. void 0 !== e.metalness && (t.metalness = e.metalness),
  46244. void 0 !== e.emissive && t.emissive.setHex(e.emissive),
  46245. void 0 !== e.specular && t.specular.setHex(e.specular),
  46246. void 0 !== e.shininess && (t.shininess = e.shininess),
  46247. void 0 !== e.uniforms && (t.uniforms = e.uniforms),
  46248. void 0 !== e.vertexShader && (t.vertexShader = e.vertexShader),
  46249. void 0 !== e.fragmentShader && (t.fragmentShader = e.fragmentShader),
  46250. void 0 !== e.vertexColors && (t.vertexColors = e.vertexColors),
  46251. void 0 !== e.shading && (t.shading = e.shading),
  46252. void 0 !== e.blending && (t.blending = e.blending),
  46253. void 0 !== e.side && (t.side = e.side),
  46254. void 0 !== e.opacity && (t.opacity = e.opacity),
  46255. void 0 !== e.transparent && (t.transparent = e.transparent),
  46256. void 0 !== e.alphaTest && (t.alphaTest = e.alphaTest),
  46257. void 0 !== e.depthTest && (t.depthTest = e.depthTest),
  46258. void 0 !== e.depthWrite && (t.depthWrite = e.depthWrite),
  46259. void 0 !== e.colorWrite && (t.colorWrite = e.colorWrite),
  46260. void 0 !== e.wireframe && (t.wireframe = e.wireframe),
  46261. void 0 !== e.wireframeLinewidth && (t.wireframeLinewidth = e.wireframeLinewidth),
  46262. void 0 !== e.size && (t.size = e.size),
  46263. void 0 !== e.sizeAttenuation && (t.sizeAttenuation = e.sizeAttenuation),
  46264. void 0 !== e.map && (t.map = this.getTexture(e.map)),
  46265. void 0 !== e.alphaMap && (t.alphaMap = this.getTexture(e.alphaMap),
  46266. t.transparent = !0),
  46267. void 0 !== e.bumpMap && (t.bumpMap = this.getTexture(e.bumpMap)),
  46268. void 0 !== e.bumpScale && (t.bumpScale = e.bumpScale),
  46269. void 0 !== e.normalMap && (t.normalMap = this.getTexture(e.normalMap)),
  46270. void 0 !== e.normalScale) {
  46271. var i = e.normalScale;
  46272. !1 === Array.isArray(i) && (i = [i, i]),
  46273. t.normalScale = (new Ci.Vector2).fromArray(i)
  46274. }
  46275. if (void 0 !== e.displacementMap && (t.displacementMap = this.getTexture(e.displacementMap)),
  46276. void 0 !== e.displacementScale && (t.displacementScale = e.displacementScale),
  46277. void 0 !== e.displacementBias && (t.displacementBias = e.displacementBias),
  46278. void 0 !== e.roughnessMap && (t.roughnessMap = this.getTexture(e.roughnessMap)),
  46279. void 0 !== e.metalnessMap && (t.metalnessMap = this.getTexture(e.metalnessMap)),
  46280. void 0 !== e.emissiveMap && (t.emissiveMap = this.getTexture(e.emissiveMap)),
  46281. void 0 !== e.emissiveIntensity && (t.emissiveIntensity = e.emissiveIntensity),
  46282. void 0 !== e.specularMap && (t.specularMap = this.getTexture(e.specularMap)),
  46283. void 0 !== e.envMap && (t.envMap = this.getTexture(e.envMap),
  46284. t.combine = Ci.MultiplyOperation),
  46285. e.reflectivity && (t.reflectivity = e.reflectivity),
  46286. void 0 !== e.lightMap && (t.lightMap = this.getTexture(e.lightMap)),
  46287. void 0 !== e.lightMapIntensity && (t.lightMapIntensity = e.lightMapIntensity),
  46288. void 0 !== e.aoMap && (t.aoMap = this.getTexture(e.aoMap)),
  46289. void 0 !== e.aoMapIntensity && (t.aoMapIntensity = e.aoMapIntensity),
  46290. void 0 !== e.materials)
  46291. for (var n = 0, r = e.materials.length; n < r; n++)
  46292. t.materials.push(this.parse(e.materials[n]));
  46293. return t
  46294. }
  46295. },
  46296. Ci.ObjectLoader = function(e) {
  46297. this.manager = void 0 !== e ? e : Ci.DefaultLoadingManager,
  46298. this.texturePath = ""
  46299. }
  46300. ,
  46301. Ci.ObjectLoader.prototype = {
  46302. constructor: Ci.ObjectLoader,
  46303. load: function(e, t, i, n) {
  46304. "" === this.texturePath && (this.texturePath = e.substring(0, e.lastIndexOf("/") + 1));
  46305. var r = this;
  46306. new Ci.XHRLoader(r.manager).load(e, function(e) {
  46307. r.parse(JSON.parse(e), t)
  46308. }, i, n)
  46309. },
  46310. setTexturePath: function(e) {
  46311. this.texturePath = e
  46312. },
  46313. setCrossOrigin: function(e) {
  46314. this.crossOrigin = e
  46315. },
  46316. parse: function(e, t) {
  46317. var i = this.parseGeometries(e.geometries)
  46318. , n = this.parseImages(e.images, function() {
  46319. void 0 !== t && t(a)
  46320. })
  46321. , r = this.parseTextures(e.textures, n)
  46322. , o = this.parseMaterials(e.materials, r)
  46323. , a = this.parseObject(e.object, i, o);
  46324. return e.animations && (a.animations = this.parseAnimations(e.animations)),
  46325. void 0 !== e.images && 0 !== e.images.length || void 0 !== t && t(a),
  46326. a
  46327. },
  46328. parseGeometries: function(e) {
  46329. var t = {};
  46330. if (void 0 !== e)
  46331. for (var i = new Ci.JSONLoader, n = new Ci.BufferGeometryLoader, r = 0, o = e.length; r < o; r++) {
  46332. var a, s = e[r];
  46333. switch (s.type) {
  46334. case "PlaneGeometry":
  46335. case "PlaneBufferGeometry":
  46336. a = new Ci[s.type](s.width,s.height,s.widthSegments,s.heightSegments);
  46337. break;
  46338. case "BoxGeometry":
  46339. case "BoxBufferGeometry":
  46340. case "CubeGeometry":
  46341. a = new Ci[s.type](s.width,s.height,s.depth,s.widthSegments,s.heightSegments,s.depthSegments);
  46342. break;
  46343. case "CircleGeometry":
  46344. case "CircleBufferGeometry":
  46345. a = new Ci[s.type](s.radius,s.segments,s.thetaStart,s.thetaLength);
  46346. break;
  46347. case "CylinderGeometry":
  46348. case "CylinderBufferGeometry":
  46349. a = new Ci[s.type](s.radiusTop,s.radiusBottom,s.height,s.radialSegments,s.heightSegments,s.openEnded,s.thetaStart,s.thetaLength);
  46350. break;
  46351. case "SphereGeometry":
  46352. case "SphereBufferGeometry":
  46353. a = new Ci[s.type](s.radius,s.widthSegments,s.heightSegments,s.phiStart,s.phiLength,s.thetaStart,s.thetaLength);
  46354. break;
  46355. case "DodecahedronGeometry":
  46356. a = new Ci.DodecahedronGeometry(s.radius,s.detail);
  46357. break;
  46358. case "IcosahedronGeometry":
  46359. a = new Ci.IcosahedronGeometry(s.radius,s.detail);
  46360. break;
  46361. case "OctahedronGeometry":
  46362. a = new Ci.OctahedronGeometry(s.radius,s.detail);
  46363. break;
  46364. case "TetrahedronGeometry":
  46365. a = new Ci.TetrahedronGeometry(s.radius,s.detail);
  46366. break;
  46367. case "RingGeometry":
  46368. case "RingBufferGeometry":
  46369. a = new Ci[s.type](s.innerRadius,s.outerRadius,s.thetaSegments,s.phiSegments,s.thetaStart,s.thetaLength);
  46370. break;
  46371. case "TorusGeometry":
  46372. case "TorusBufferGeometry":
  46373. a = new Ci[s.type](s.radius,s.tube,s.radialSegments,s.tubularSegments,s.arc);
  46374. break;
  46375. case "TorusKnotGeometry":
  46376. case "TorusKnotBufferGeometry":
  46377. a = new Ci[s.type](s.radius,s.tube,s.tubularSegments,s.radialSegments,s.p,s.q);
  46378. break;
  46379. case "LatheGeometry":
  46380. a = new Ci.LatheGeometry(s.points,s.segments,s.phiStart,s.phiLength);
  46381. break;
  46382. case "BufferGeometry":
  46383. a = n.parse(s);
  46384. break;
  46385. case "Geometry":
  46386. a = i.parse(s.data, this.texturePath).geometry;
  46387. break;
  46388. default:
  46389. console.warn('THREE.ObjectLoader: Unsupported geometry type "' + s.type + '"');
  46390. continue
  46391. }
  46392. a.uuid = s.uuid,
  46393. void 0 !== s.name && (a.name = s.name),
  46394. t[s.uuid] = a
  46395. }
  46396. return t
  46397. },
  46398. parseMaterials: function(e, t) {
  46399. var i = {};
  46400. if (void 0 !== e) {
  46401. var n = new Ci.MaterialLoader;
  46402. n.setTextures(t);
  46403. for (var r = 0, o = e.length; r < o; r++) {
  46404. var a = n.parse(e[r]);
  46405. i[a.uuid] = a
  46406. }
  46407. }
  46408. return i
  46409. },
  46410. parseAnimations: function(e) {
  46411. for (var t = [], i = 0; i < e.length; i++) {
  46412. var n = Ci.AnimationClip.parse(e[i]);
  46413. t.push(n)
  46414. }
  46415. return t
  46416. },
  46417. parseImages: function(e, t) {
  46418. function i(e) {
  46419. return n.manager.itemStart(e),
  46420. a.load(e, function() {
  46421. n.manager.itemEnd(e)
  46422. })
  46423. }
  46424. var n = this
  46425. , r = {};
  46426. if (void 0 !== e && 0 < e.length) {
  46427. var o = new Ci.LoadingManager(t)
  46428. , a = new Ci.ImageLoader(o);
  46429. a.setCrossOrigin(this.crossOrigin);
  46430. for (var s = 0, l = e.length; s < l; s++) {
  46431. var c = e[s]
  46432. , h = /^(\/\/)|([a-z]+:(\/\/)?)/i.test(c.url) ? c.url : n.texturePath + c.url;
  46433. r[c.uuid] = i(h)
  46434. }
  46435. }
  46436. return r
  46437. },
  46438. parseTextures: function(e, t) {
  46439. function i(e) {
  46440. return "number" == typeof e ? e : (console.warn("THREE.ObjectLoader.parseTexture: Constant should be in numeric form.", e),
  46441. Ci[e])
  46442. }
  46443. var n = {};
  46444. if (void 0 !== e)
  46445. for (var r = 0, o = e.length; r < o; r++) {
  46446. var a = e[r];
  46447. void 0 === a.image && console.warn('THREE.ObjectLoader: No "image" specified for', a.uuid),
  46448. void 0 === t[a.image] && console.warn("THREE.ObjectLoader: Undefined image", a.image);
  46449. var s = new Ci.Texture(t[a.image]);
  46450. s.needsUpdate = !0,
  46451. s.uuid = a.uuid,
  46452. void 0 !== a.name && (s.name = a.name),
  46453. void 0 !== a.mapping && (s.mapping = i(a.mapping)),
  46454. void 0 !== a.offset && (s.offset = new Ci.Vector2(a.offset[0],a.offset[1])),
  46455. void 0 !== a.repeat && (s.repeat = new Ci.Vector2(a.repeat[0],a.repeat[1])),
  46456. void 0 !== a.minFilter && (s.minFilter = i(a.minFilter)),
  46457. void 0 !== a.magFilter && (s.magFilter = i(a.magFilter)),
  46458. void 0 !== a.anisotropy && (s.anisotropy = a.anisotropy),
  46459. Array.isArray(a.wrap) && (s.wrapS = i(a.wrap[0]),
  46460. s.wrapT = i(a.wrap[1])),
  46461. n[a.uuid] = s
  46462. }
  46463. return n
  46464. },
  46465. parseObject: (ke = new Ci.Matrix4,
  46466. function(e, t, i) {
  46467. function n(e) {
  46468. return void 0 === t[e] && console.warn("THREE.ObjectLoader: Undefined geometry", e),
  46469. t[e]
  46470. }
  46471. function r(e) {
  46472. if (void 0 !== e)
  46473. return void 0 === i[e] && console.warn("THREE.ObjectLoader: Undefined material", e),
  46474. i[e]
  46475. }
  46476. var o;
  46477. switch (e.type) {
  46478. case "Scene":
  46479. o = new Ci.Scene;
  46480. break;
  46481. case "PerspectiveCamera":
  46482. o = new Ci.PerspectiveCamera(e.fov,e.aspect,e.near,e.far);
  46483. break;
  46484. case "OrthographicCamera":
  46485. o = new Ci.OrthographicCamera(e.left,e.right,e.top,e.bottom,e.near,e.far);
  46486. break;
  46487. case "AmbientLight":
  46488. o = new Ci.AmbientLight(e.color,e.intensity);
  46489. break;
  46490. case "DirectionalLight":
  46491. o = new Ci.DirectionalLight(e.color,e.intensity);
  46492. break;
  46493. case "PointLight":
  46494. o = new Ci.PointLight(e.color,e.intensity,e.distance,e.decay);
  46495. break;
  46496. case "SpotLight":
  46497. o = new Ci.SpotLight(e.color,e.intensity,e.distance,e.angle,e.penumbra,e.decay);
  46498. break;
  46499. case "HemisphereLight":
  46500. o = new Ci.HemisphereLight(e.color,e.groundColor,e.intensity);
  46501. break;
  46502. case "Mesh":
  46503. var a = n(e.geometry)
  46504. , s = r(e.material);
  46505. o = a.bones && 0 < a.bones.length ? new Ci.SkinnedMesh(a,s) : new Ci.Mesh(a,s);
  46506. break;
  46507. case "LOD":
  46508. o = new Ci.LOD;
  46509. break;
  46510. case "Line":
  46511. o = new Ci.Line(n(e.geometry),r(e.material),e.mode);
  46512. break;
  46513. case "PointCloud":
  46514. case "Points":
  46515. o = new Ci.Points(n(e.geometry),r(e.material));
  46516. break;
  46517. case "Sprite":
  46518. o = new Ci.Sprite(r(e.material));
  46519. break;
  46520. case "Group":
  46521. o = new Ci.Group;
  46522. break;
  46523. default:
  46524. o = new Ci.Object3D
  46525. }
  46526. if (o.uuid = e.uuid,
  46527. void 0 !== e.name && (o.name = e.name),
  46528. void 0 !== e.matrix ? (ke.fromArray(e.matrix),
  46529. ke.decompose(o.position, o.quaternion, o.scale)) : (void 0 !== e.position && o.position.fromArray(e.position),
  46530. void 0 !== e.rotation && o.rotation.fromArray(e.rotation),
  46531. void 0 !== e.scale && o.scale.fromArray(e.scale)),
  46532. void 0 !== e.castShadow && (o.castShadow = e.castShadow),
  46533. void 0 !== e.receiveShadow && (o.receiveShadow = e.receiveShadow),
  46534. void 0 !== e.visible && (o.visible = e.visible),
  46535. void 0 !== e.userData && (o.userData = e.userData),
  46536. void 0 !== e.children)
  46537. for (var l in e.children)
  46538. o.add(this.parseObject(e.children[l], t, i));
  46539. if ("LOD" === e.type)
  46540. for (var c = e.levels, h = 0; h < c.length; h++) {
  46541. var u = c[h];
  46542. void 0 !== (l = o.getObjectByProperty("uuid", u.object)) && o.addLevel(l, u.distance)
  46543. }
  46544. return o
  46545. }
  46546. )
  46547. },
  46548. Ci.TextureLoader = function(e) {
  46549. this.manager = void 0 !== e ? e : Ci.DefaultLoadingManager
  46550. }
  46551. ,
  46552. Ci.TextureLoader.prototype = {
  46553. constructor: Ci.TextureLoader,
  46554. load: function(e, t, i, n) {
  46555. var r = new Ci.Texture
  46556. , o = new Ci.ImageLoader(this.manager);
  46557. return o.setCrossOrigin(this.crossOrigin),
  46558. o.setPath(this.path),
  46559. o.load(e, function(e) {
  46560. r.image = e,
  46561. r.needsUpdate = !0,
  46562. void 0 !== t && t(r)
  46563. }, i, n),
  46564. r
  46565. },
  46566. setCrossOrigin: function(e) {
  46567. this.crossOrigin = e
  46568. },
  46569. setPath: function(e) {
  46570. this.path = e
  46571. }
  46572. },
  46573. Ci.CubeTextureLoader = function(e) {
  46574. this.manager = void 0 !== e ? e : Ci.DefaultLoadingManager
  46575. }
  46576. ,
  46577. Ci.CubeTextureLoader.prototype = {
  46578. constructor: Ci.CubeTextureLoader,
  46579. load: function(e, i, t, n) {
  46580. function r(t) {
  46581. a.load(e[t], function(e) {
  46582. o.images[t] = e,
  46583. 6 === ++s && (o.needsUpdate = !0,
  46584. i && i(o))
  46585. }, void 0, n)
  46586. }
  46587. var o = new Ci.CubeTexture
  46588. , a = new Ci.ImageLoader(this.manager);
  46589. a.setCrossOrigin(this.crossOrigin),
  46590. a.setPath(this.path);
  46591. for (var s = 0, l = 0; l < e.length; ++l)
  46592. r(l);
  46593. return o
  46594. },
  46595. setCrossOrigin: function(e) {
  46596. this.crossOrigin = e
  46597. },
  46598. setPath: function(e) {
  46599. this.path = e
  46600. }
  46601. },
  46602. Ci.DataTextureLoader = Ci.BinaryTextureLoader = function(e) {
  46603. this.manager = void 0 !== e ? e : Ci.DefaultLoadingManager,
  46604. this._parser = null
  46605. }
  46606. ,
  46607. Ci.BinaryTextureLoader.prototype = {
  46608. constructor: Ci.BinaryTextureLoader,
  46609. load: function(e, i, t, n) {
  46610. var r = this
  46611. , o = new Ci.DataTexture
  46612. , a = new Ci.XHRLoader(this.manager);
  46613. return a.setResponseType("arraybuffer"),
  46614. a.load(e, function(e) {
  46615. var t = r._parser(e);
  46616. t && (void 0 !== t.image ? o.image = t.image : void 0 !== t.data && (o.image.width = t.width,
  46617. o.image.height = t.height,
  46618. o.image.data = t.data),
  46619. o.wrapS = void 0 !== t.wrapS ? t.wrapS : Ci.ClampToEdgeWrapping,
  46620. o.wrapT = void 0 !== t.wrapT ? t.wrapT : Ci.ClampToEdgeWrapping,
  46621. o.magFilter = void 0 !== t.magFilter ? t.magFilter : Ci.LinearFilter,
  46622. o.minFilter = void 0 !== t.minFilter ? t.minFilter : Ci.LinearMipMapLinearFilter,
  46623. o.anisotropy = void 0 !== t.anisotropy ? t.anisotropy : 1,
  46624. void 0 !== t.format && (o.format = t.format),
  46625. void 0 !== t.type && (o.type = t.type),
  46626. void 0 !== t.mipmaps && (o.mipmaps = t.mipmaps),
  46627. 1 === t.mipmapCount && (o.minFilter = Ci.LinearFilter),
  46628. o.needsUpdate = !0,
  46629. i && i(o, t))
  46630. }, t, n),
  46631. o
  46632. }
  46633. },
  46634. Ci.CompressedTextureLoader = function(e) {
  46635. this.manager = void 0 !== e ? e : Ci.DefaultLoadingManager,
  46636. this._parser = null
  46637. }
  46638. ,
  46639. Ci.CompressedTextureLoader.prototype = {
  46640. constructor: Ci.CompressedTextureLoader,
  46641. load: function(e, o, t, n) {
  46642. function i(i) {
  46643. r.load(e[i], function(e) {
  46644. var t = a._parser(e, !0);
  46645. s[i] = {
  46646. width: t.width,
  46647. height: t.height,
  46648. format: t.format,
  46649. mipmaps: t.mipmaps
  46650. },
  46651. 6 === (c += 1) && (1 === t.mipmapCount && (l.minFilter = Ci.LinearFilter),
  46652. l.format = t.format,
  46653. l.needsUpdate = !0,
  46654. o && o(l))
  46655. }, t, n)
  46656. }
  46657. var a = this
  46658. , s = []
  46659. , l = new Ci.CompressedTexture;
  46660. l.image = s;
  46661. var r = new Ci.XHRLoader(this.manager);
  46662. if (r.setPath(this.path),
  46663. r.setResponseType("arraybuffer"),
  46664. Array.isArray(e))
  46665. for (var c = 0, h = 0, u = e.length; h < u; ++h)
  46666. i(h);
  46667. else
  46668. r.load(e, function(e) {
  46669. var t = a._parser(e, !0);
  46670. if (t.isCubemap)
  46671. for (var i = t.mipmaps.length / t.mipmapCount, n = 0; n < i; n++) {
  46672. s[n] = {
  46673. mipmaps: []
  46674. };
  46675. for (var r = 0; r < t.mipmapCount; r++)
  46676. s[n].mipmaps.push(t.mipmaps[n * t.mipmapCount + r]),
  46677. s[n].format = t.format,
  46678. s[n].width = t.width,
  46679. s[n].height = t.height
  46680. }
  46681. else
  46682. l.image.width = t.width,
  46683. l.image.height = t.height,
  46684. l.mipmaps = t.mipmaps;
  46685. 1 === t.mipmapCount && (l.minFilter = Ci.LinearFilter),
  46686. l.format = t.format,
  46687. l.needsUpdate = !0,
  46688. o && o(l)
  46689. }, t, n);
  46690. return l
  46691. },
  46692. setPath: function(e) {
  46693. this.path = e
  46694. }
  46695. },
  46696. Ci.Material = function() {
  46697. Object.defineProperty(this, "id", {
  46698. value: Ci.MaterialIdCount++
  46699. }),
  46700. this.uuid = Ci.Math.generateUUID(),
  46701. this.name = "",
  46702. this.type = "Material",
  46703. this.side = Ci.FrontSide,
  46704. this.opacity = 1,
  46705. this.transparent = !1,
  46706. this.blending = Ci.NormalBlending,
  46707. this.blendSrc = Ci.SrcAlphaFactor,
  46708. this.blendDst = Ci.OneMinusSrcAlphaFactor,
  46709. this.blendEquation = Ci.AddEquation,
  46710. this.blendSrcAlpha = null,
  46711. this.blendDstAlpha = null,
  46712. this.blendEquationAlpha = null,
  46713. this.depthFunc = Ci.LessEqualDepth,
  46714. this.depthTest = !0,
  46715. this.depthWrite = !0,
  46716. this.colorWrite = !0,
  46717. this.precision = null,
  46718. this.polygonOffset = !1,
  46719. this.polygonOffsetFactor = 0,
  46720. this.polygonOffsetUnits = 0,
  46721. this.alphaTest = 0,
  46722. this.premultipliedAlpha = !1,
  46723. this.overdraw = 0,
  46724. this.visible = !0,
  46725. this._needsUpdate = !0
  46726. }
  46727. ,
  46728. Ci.Material.prototype = {
  46729. constructor: Ci.Material,
  46730. get needsUpdate() {
  46731. return this._needsUpdate
  46732. },
  46733. set needsUpdate(e) {
  46734. !0 === e && this.update(),
  46735. this._needsUpdate = e
  46736. },
  46737. setValues: function(e) {
  46738. if (void 0 !== e)
  46739. for (var t in e) {
  46740. var i = e[t];
  46741. if (void 0 !== i) {
  46742. var n = this[t];
  46743. 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.")
  46744. } else
  46745. console.warn("THREE.Material: '" + t + "' parameter is undefined.")
  46746. }
  46747. },
  46748. toJSON: function(e) {
  46749. function t(e) {
  46750. var t = [];
  46751. for (var i in e) {
  46752. var n = e[i];
  46753. delete n.metadata,
  46754. t.push(n)
  46755. }
  46756. return t
  46757. }
  46758. var i = void 0 === e;
  46759. i && (e = {
  46760. textures: {},
  46761. images: {}
  46762. });
  46763. var n = {
  46764. metadata: {
  46765. version: 4.4,
  46766. type: "Material",
  46767. generator: "Material.toJSON"
  46768. }
  46769. };
  46770. if (n.uuid = this.uuid,
  46771. n.type = this.type,
  46772. "" !== this.name && (n.name = this.name),
  46773. this.color instanceof Ci.Color && (n.color = this.color.getHex()),
  46774. .5 !== this.roughness && (n.roughness = this.roughness),
  46775. .5 !== this.metalness && (n.metalness = this.metalness),
  46776. this.emissive instanceof Ci.Color && (n.emissive = this.emissive.getHex()),
  46777. this.specular instanceof Ci.Color && (n.specular = this.specular.getHex()),
  46778. void 0 !== this.shininess && (n.shininess = this.shininess),
  46779. this.map instanceof Ci.Texture && (n.map = this.map.toJSON(e).uuid),
  46780. this.alphaMap instanceof Ci.Texture && (n.alphaMap = this.alphaMap.toJSON(e).uuid),
  46781. this.lightMap instanceof Ci.Texture && (n.lightMap = this.lightMap.toJSON(e).uuid),
  46782. this.bumpMap instanceof Ci.Texture && (n.bumpMap = this.bumpMap.toJSON(e).uuid,
  46783. n.bumpScale = this.bumpScale),
  46784. this.normalMap instanceof Ci.Texture && (n.normalMap = this.normalMap.toJSON(e).uuid,
  46785. n.normalScale = this.normalScale.toArray()),
  46786. this.displacementMap instanceof Ci.Texture && (n.displacementMap = this.displacementMap.toJSON(e).uuid,
  46787. n.displacementScale = this.displacementScale,
  46788. n.displacementBias = this.displacementBias),
  46789. this.roughnessMap instanceof Ci.Texture && (n.roughnessMap = this.roughnessMap.toJSON(e).uuid),
  46790. this.metalnessMap instanceof Ci.Texture && (n.metalnessMap = this.metalnessMap.toJSON(e).uuid),
  46791. this.emissiveMap instanceof Ci.Texture && (n.emissiveMap = this.emissiveMap.toJSON(e).uuid),
  46792. this.specularMap instanceof Ci.Texture && (n.specularMap = this.specularMap.toJSON(e).uuid),
  46793. this.envMap instanceof Ci.Texture && (n.envMap = this.envMap.toJSON(e).uuid,
  46794. n.reflectivity = this.reflectivity),
  46795. void 0 !== this.size && (n.size = this.size),
  46796. void 0 !== this.sizeAttenuation && (n.sizeAttenuation = this.sizeAttenuation),
  46797. void 0 !== this.vertexColors && this.vertexColors !== Ci.NoColors && (n.vertexColors = this.vertexColors),
  46798. void 0 !== this.shading && this.shading !== Ci.SmoothShading && (n.shading = this.shading),
  46799. void 0 !== this.blending && this.blending !== Ci.NormalBlending && (n.blending = this.blending),
  46800. void 0 !== this.side && this.side !== Ci.FrontSide && (n.side = this.side),
  46801. this.opacity < 1 && (n.opacity = this.opacity),
  46802. !0 === this.transparent && (n.transparent = this.transparent),
  46803. 0 < this.alphaTest && (n.alphaTest = this.alphaTest),
  46804. !0 === this.premultipliedAlpha && (n.premultipliedAlpha = this.premultipliedAlpha),
  46805. !0 === this.wireframe && (n.wireframe = this.wireframe),
  46806. 1 < this.wireframeLinewidth && (n.wireframeLinewidth = this.wireframeLinewidth),
  46807. i) {
  46808. var r = t(e.textures)
  46809. , o = t(e.images);
  46810. 0 < r.length && (n.textures = r),
  46811. 0 < o.length && (n.images = o)
  46812. }
  46813. return n
  46814. },
  46815. clone: function() {
  46816. return (new this.constructor).copy(this)
  46817. },
  46818. copy: function(e) {
  46819. return this.name = e.name,
  46820. this.side = e.side,
  46821. this.opacity = e.opacity,
  46822. this.transparent = e.transparent,
  46823. this.blending = e.blending,
  46824. this.blendSrc = e.blendSrc,
  46825. this.blendDst = e.blendDst,
  46826. this.blendEquation = e.blendEquation,
  46827. this.blendSrcAlpha = e.blendSrcAlpha,
  46828. this.blendDstAlpha = e.blendDstAlpha,
  46829. this.blendEquationAlpha = e.blendEquationAlpha,
  46830. this.depthFunc = e.depthFunc,
  46831. this.depthTest = e.depthTest,
  46832. this.depthWrite = e.depthWrite,
  46833. this.colorWrite = e.colorWrite,
  46834. this.precision = e.precision,
  46835. this.polygonOffset = e.polygonOffset,
  46836. this.polygonOffsetFactor = e.polygonOffsetFactor,
  46837. this.polygonOffsetUnits = e.polygonOffsetUnits,
  46838. this.alphaTest = e.alphaTest,
  46839. this.premultipliedAlpha = e.premultipliedAlpha,
  46840. this.overdraw = e.overdraw,
  46841. this.visible = e.visible,
  46842. this
  46843. },
  46844. update: function() {
  46845. this.dispatchEvent({
  46846. type: "update"
  46847. })
  46848. },
  46849. dispose: function() {
  46850. this.dispatchEvent({
  46851. type: "dispose"
  46852. })
  46853. }
  46854. },
  46855. Ci.EventDispatcher.prototype.apply(Ci.Material.prototype),
  46856. Ci.MaterialIdCount = 0,
  46857. Ci.LineBasicMaterial = function(e) {
  46858. Ci.Material.call(this),
  46859. this.type = "LineBasicMaterial",
  46860. this.color = new Ci.Color(16777215),
  46861. this.linewidth = 1,
  46862. this.linecap = "round",
  46863. this.linejoin = "round",
  46864. this.blending = Ci.NormalBlending,
  46865. this.vertexColors = Ci.NoColors,
  46866. this.fog = !0,
  46867. this.setValues(e)
  46868. }
  46869. ,
  46870. Ci.LineBasicMaterial.prototype = Object.create(Ci.Material.prototype),
  46871. Ci.LineBasicMaterial.prototype.constructor = Ci.LineBasicMaterial,
  46872. Ci.LineBasicMaterial.prototype.copy = function(e) {
  46873. return Ci.Material.prototype.copy.call(this, e),
  46874. this.color.copy(e.color),
  46875. this.linewidth = e.linewidth,
  46876. this.linecap = e.linecap,
  46877. this.linejoin = e.linejoin,
  46878. this.vertexColors = e.vertexColors,
  46879. this.fog = e.fog,
  46880. this
  46881. }
  46882. ,
  46883. Ci.LineDashedMaterial = function(e) {
  46884. Ci.Material.call(this),
  46885. this.type = "LineDashedMaterial",
  46886. this.color = new Ci.Color(16777215),
  46887. this.linewidth = 1,
  46888. this.scale = 1,
  46889. this.dashSize = 3,
  46890. this.gapSize = 1,
  46891. this.blending = Ci.NormalBlending,
  46892. this.vertexColors = Ci.NoColors,
  46893. this.fog = !0,
  46894. this.setValues(e)
  46895. }
  46896. ,
  46897. Ci.LineDashedMaterial.prototype = Object.create(Ci.Material.prototype),
  46898. Ci.LineDashedMaterial.prototype.constructor = Ci.LineDashedMaterial,
  46899. Ci.LineDashedMaterial.prototype.copy = function(e) {
  46900. return Ci.Material.prototype.copy.call(this, e),
  46901. this.color.copy(e.color),
  46902. this.linewidth = e.linewidth,
  46903. this.scale = e.scale,
  46904. this.dashSize = e.dashSize,
  46905. this.gapSize = e.gapSize,
  46906. this.vertexColors = e.vertexColors,
  46907. this.fog = e.fog,
  46908. this
  46909. }
  46910. ,
  46911. Ci.MeshBasicMaterial = function(e) {
  46912. Ci.Material.call(this),
  46913. this.type = "MeshBasicMaterial",
  46914. this.color = new Ci.Color(16777215),
  46915. this.map = null,
  46916. this.aoMap = null,
  46917. this.aoMapIntensity = 1,
  46918. this.specularMap = null,
  46919. this.alphaMap = null,
  46920. this.envMap = null,
  46921. this.combine = Ci.MultiplyOperation,
  46922. this.reflectivity = 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.setValues(e)
  46935. }
  46936. ,
  46937. Ci.MeshBasicMaterial.prototype = Object.create(Ci.Material.prototype),
  46938. Ci.MeshBasicMaterial.prototype.constructor = Ci.MeshBasicMaterial,
  46939. Ci.MeshBasicMaterial.prototype.copy = function(e) {
  46940. return Ci.Material.prototype.copy.call(this, e),
  46941. this.color.copy(e.color),
  46942. this.map = e.map,
  46943. this.aoMap = e.aoMap,
  46944. this.aoMapIntensity = e.aoMapIntensity,
  46945. this.specularMap = e.specularMap,
  46946. this.alphaMap = e.alphaMap,
  46947. this.envMap = e.envMap,
  46948. this.combine = e.combine,
  46949. this.reflectivity = e.reflectivity,
  46950. this.refractionRatio = e.refractionRatio,
  46951. this.fog = e.fog,
  46952. this.shading = e.shading,
  46953. this.wireframe = e.wireframe,
  46954. this.wireframeLinewidth = e.wireframeLinewidth,
  46955. this.wireframeLinecap = e.wireframeLinecap,
  46956. this.wireframeLinejoin = e.wireframeLinejoin,
  46957. this.vertexColors = e.vertexColors,
  46958. this.skinning = e.skinning,
  46959. this.morphTargets = e.morphTargets,
  46960. this
  46961. }
  46962. ,
  46963. Ci.MeshLambertMaterial = function(e) {
  46964. Ci.Material.call(this),
  46965. this.type = "MeshLambertMaterial",
  46966. this.color = new Ci.Color(16777215),
  46967. this.map = null,
  46968. this.lightMap = null,
  46969. this.lightMapIntensity = 1,
  46970. this.aoMap = null,
  46971. this.aoMapIntensity = 1,
  46972. this.emissive = new Ci.Color(0),
  46973. this.emissiveIntensity = 1,
  46974. this.emissiveMap = null,
  46975. this.specularMap = null,
  46976. this.alphaMap = null,
  46977. this.envMap = null,
  46978. this.combine = Ci.MultiplyOperation,
  46979. this.reflectivity = 1,
  46980. this.refractionRatio = .98,
  46981. this.fog = !0,
  46982. this.blending = Ci.NormalBlending,
  46983. this.wireframe = !1,
  46984. this.wireframeLinewidth = 1,
  46985. this.wireframeLinecap = "round",
  46986. this.wireframeLinejoin = "round",
  46987. this.vertexColors = Ci.NoColors,
  46988. this.skinning = !1,
  46989. this.morphTargets = !1,
  46990. this.morphNormals = !1,
  46991. this.setValues(e)
  46992. }
  46993. ,
  46994. Ci.MeshLambertMaterial.prototype = Object.create(Ci.Material.prototype),
  46995. Ci.MeshLambertMaterial.prototype.constructor = Ci.MeshLambertMaterial,
  46996. Ci.MeshLambertMaterial.prototype.copy = function(e) {
  46997. return Ci.Material.prototype.copy.call(this, e),
  46998. this.color.copy(e.color),
  46999. this.map = e.map,
  47000. this.lightMap = e.lightMap,
  47001. this.lightMapIntensity = e.lightMapIntensity,
  47002. this.aoMap = e.aoMap,
  47003. this.aoMapIntensity = e.aoMapIntensity,
  47004. this.emissive.copy(e.emissive),
  47005. this.emissiveMap = e.emissiveMap,
  47006. this.emissiveIntensity = e.emissiveIntensity,
  47007. this.specularMap = e.specularMap,
  47008. this.alphaMap = e.alphaMap,
  47009. this.envMap = e.envMap,
  47010. this.combine = e.combine,
  47011. this.reflectivity = e.reflectivity,
  47012. this.refractionRatio = e.refractionRatio,
  47013. this.fog = e.fog,
  47014. this.wireframe = e.wireframe,
  47015. this.wireframeLinewidth = e.wireframeLinewidth,
  47016. this.wireframeLinecap = e.wireframeLinecap,
  47017. this.wireframeLinejoin = e.wireframeLinejoin,
  47018. this.vertexColors = e.vertexColors,
  47019. this.skinning = e.skinning,
  47020. this.morphTargets = e.morphTargets,
  47021. this.morphNormals = e.morphNormals,
  47022. this
  47023. }
  47024. ,
  47025. Ci.MeshPhongMaterial = function(e) {
  47026. Ci.Material.call(this),
  47027. this.type = "MeshPhongMaterial",
  47028. this.color = new Ci.Color(16777215),
  47029. this.specular = new Ci.Color(1118481),
  47030. this.shininess = 30,
  47031. this.map = null,
  47032. this.lightMap = null,
  47033. this.lightMapIntensity = 1,
  47034. this.aoMap = null,
  47035. this.aoMapIntensity = 1,
  47036. this.emissive = new Ci.Color(0),
  47037. this.emissiveIntensity = 1,
  47038. this.emissiveMap = null,
  47039. this.bumpMap = null,
  47040. this.bumpScale = 1,
  47041. this.normalMap = null,
  47042. this.normalScale = new Ci.Vector2(1,1),
  47043. this.displacementMap = null,
  47044. this.displacementScale = 1,
  47045. this.displacementBias = 0,
  47046. this.specularMap = null,
  47047. this.alphaMap = null,
  47048. this.envMap = null,
  47049. this.combine = Ci.MultiplyOperation,
  47050. this.reflectivity = 1,
  47051. this.refractionRatio = .98,
  47052. this.fog = !0,
  47053. this.shading = Ci.SmoothShading,
  47054. this.blending = Ci.NormalBlending,
  47055. this.wireframe = !1,
  47056. this.wireframeLinewidth = 1,
  47057. this.wireframeLinecap = "round",
  47058. this.wireframeLinejoin = "round",
  47059. this.vertexColors = Ci.NoColors,
  47060. this.skinning = !1,
  47061. this.morphTargets = !1,
  47062. this.morphNormals = !1,
  47063. this.setValues(e)
  47064. }
  47065. ,
  47066. Ci.MeshPhongMaterial.prototype = Object.create(Ci.Material.prototype),
  47067. Ci.MeshPhongMaterial.prototype.constructor = Ci.MeshPhongMaterial,
  47068. Ci.MeshPhongMaterial.prototype.copy = function(e) {
  47069. return Ci.Material.prototype.copy.call(this, e),
  47070. this.color.copy(e.color),
  47071. this.specular.copy(e.specular),
  47072. this.shininess = e.shininess,
  47073. this.map = e.map,
  47074. this.lightMap = e.lightMap,
  47075. this.lightMapIntensity = e.lightMapIntensity,
  47076. this.aoMap = e.aoMap,
  47077. this.aoMapIntensity = e.aoMapIntensity,
  47078. this.emissive.copy(e.emissive),
  47079. this.emissiveMap = e.emissiveMap,
  47080. this.emissiveIntensity = e.emissiveIntensity,
  47081. this.bumpMap = e.bumpMap,
  47082. this.bumpScale = e.bumpScale,
  47083. this.normalMap = e.normalMap,
  47084. this.normalScale.copy(e.normalScale),
  47085. this.displacementMap = e.displacementMap,
  47086. this.displacementScale = e.displacementScale,
  47087. this.displacementBias = e.displacementBias,
  47088. this.specularMap = e.specularMap,
  47089. this.alphaMap = e.alphaMap,
  47090. this.envMap = e.envMap,
  47091. this.combine = e.combine,
  47092. this.reflectivity = e.reflectivity,
  47093. this.refractionRatio = e.refractionRatio,
  47094. this.fog = e.fog,
  47095. this.shading = e.shading,
  47096. this.wireframe = e.wireframe,
  47097. this.wireframeLinewidth = e.wireframeLinewidth,
  47098. this.wireframeLinecap = e.wireframeLinecap,
  47099. this.wireframeLinejoin = e.wireframeLinejoin,
  47100. this.vertexColors = e.vertexColors,
  47101. this.skinning = e.skinning,
  47102. this.morphTargets = e.morphTargets,
  47103. this.morphNormals = e.morphNormals,
  47104. this
  47105. }
  47106. ,
  47107. Ci.MeshStandardMaterial = function(e) {
  47108. Ci.Material.call(this),
  47109. this.type = "MeshStandardMaterial",
  47110. this.color = new Ci.Color(16777215),
  47111. this.roughness = .5,
  47112. this.metalness = .5,
  47113. this.map = null,
  47114. this.lightMap = null,
  47115. this.lightMapIntensity = 1,
  47116. this.aoMap = null,
  47117. this.aoMapIntensity = 1,
  47118. this.emissive = new Ci.Color(0),
  47119. this.emissiveIntensity = 1,
  47120. this.emissiveMap = null,
  47121. this.bumpMap = null,
  47122. this.bumpScale = 1,
  47123. this.normalMap = null,
  47124. this.normalScale = new Ci.Vector2(1,1),
  47125. this.displacementMap = null,
  47126. this.displacementScale = 1,
  47127. this.displacementBias = 0,
  47128. this.roughnessMap = null,
  47129. this.metalnessMap = null,
  47130. this.alphaMap = null,
  47131. this.envMap = null,
  47132. this.envMapIntensity = 1,
  47133. this.refractionRatio = .98,
  47134. this.fog = !0,
  47135. this.shading = Ci.SmoothShading,
  47136. this.blending = Ci.NormalBlending,
  47137. this.wireframe = !1,
  47138. this.wireframeLinewidth = 1,
  47139. this.wireframeLinecap = "round",
  47140. this.wireframeLinejoin = "round",
  47141. this.vertexColors = Ci.NoColors,
  47142. this.skinning = !1,
  47143. this.morphTargets = !1,
  47144. this.morphNormals = !1,
  47145. this.setValues(e)
  47146. }
  47147. ,
  47148. Ci.MeshStandardMaterial.prototype = Object.create(Ci.Material.prototype),
  47149. Ci.MeshStandardMaterial.prototype.constructor = Ci.MeshStandardMaterial,
  47150. Ci.MeshStandardMaterial.prototype.copy = function(e) {
  47151. return Ci.Material.prototype.copy.call(this, e),
  47152. this.color.copy(e.color),
  47153. this.roughness = e.roughness,
  47154. this.metalness = e.metalness,
  47155. this.map = e.map,
  47156. this.lightMap = e.lightMap,
  47157. this.lightMapIntensity = e.lightMapIntensity,
  47158. this.aoMap = e.aoMap,
  47159. this.aoMapIntensity = e.aoMapIntensity,
  47160. this.emissive.copy(e.emissive),
  47161. this.emissiveMap = e.emissiveMap,
  47162. this.emissiveIntensity = e.emissiveIntensity,
  47163. this.bumpMap = e.bumpMap,
  47164. this.bumpScale = e.bumpScale,
  47165. this.normalMap = e.normalMap,
  47166. this.normalScale.copy(e.normalScale),
  47167. this.displacementMap = e.displacementMap,
  47168. this.displacementScale = e.displacementScale,
  47169. this.displacementBias = e.displacementBias,
  47170. this.roughnessMap = e.roughnessMap,
  47171. this.metalnessMap = e.metalnessMap,
  47172. this.alphaMap = e.alphaMap,
  47173. this.envMap = e.envMap,
  47174. this.envMapIntensity = e.envMapIntensity,
  47175. this.refractionRatio = e.refractionRatio,
  47176. this.fog = e.fog,
  47177. this.shading = e.shading,
  47178. this.wireframe = e.wireframe,
  47179. this.wireframeLinewidth = e.wireframeLinewidth,
  47180. this.wireframeLinecap = e.wireframeLinecap,
  47181. this.wireframeLinejoin = e.wireframeLinejoin,
  47182. this.vertexColors = e.vertexColors,
  47183. this.skinning = e.skinning,
  47184. this.morphTargets = e.morphTargets,
  47185. this.morphNormals = e.morphNormals,
  47186. this
  47187. }
  47188. ,
  47189. Ci.MeshDepthMaterial = function(e) {
  47190. Ci.Material.call(this),
  47191. this.type = "MeshDepthMaterial",
  47192. this.morphTargets = !1,
  47193. this.wireframe = !1,
  47194. this.wireframeLinewidth = 1,
  47195. this.setValues(e)
  47196. }
  47197. ,
  47198. Ci.MeshDepthMaterial.prototype = Object.create(Ci.Material.prototype),
  47199. Ci.MeshDepthMaterial.prototype.constructor = Ci.MeshDepthMaterial,
  47200. Ci.MeshDepthMaterial.prototype.copy = function(e) {
  47201. return Ci.Material.prototype.copy.call(this, e),
  47202. this.wireframe = e.wireframe,
  47203. this.wireframeLinewidth = e.wireframeLinewidth,
  47204. this
  47205. }
  47206. ,
  47207. Ci.MeshNormalMaterial = function(e) {
  47208. Ci.Material.call(this, e),
  47209. this.type = "MeshNormalMaterial",
  47210. this.wireframe = !1,
  47211. this.wireframeLinewidth = 1,
  47212. this.morphTargets = !1,
  47213. this.setValues(e)
  47214. }
  47215. ,
  47216. Ci.MeshNormalMaterial.prototype = Object.create(Ci.Material.prototype),
  47217. Ci.MeshNormalMaterial.prototype.constructor = Ci.MeshNormalMaterial,
  47218. Ci.MeshNormalMaterial.prototype.copy = function(e) {
  47219. return Ci.Material.prototype.copy.call(this, e),
  47220. this.wireframe = e.wireframe,
  47221. this.wireframeLinewidth = e.wireframeLinewidth,
  47222. this
  47223. }
  47224. ,
  47225. Ci.MultiMaterial = function(e) {
  47226. this.uuid = Ci.Math.generateUUID(),
  47227. this.type = "MultiMaterial",
  47228. this.materials = e instanceof Array ? e : [],
  47229. this.visible = !0
  47230. }
  47231. ,
  47232. Ci.MultiMaterial.prototype = {
  47233. constructor: Ci.MultiMaterial,
  47234. toJSON: function(e) {
  47235. for (var t = {
  47236. metadata: {
  47237. version: 4.2,
  47238. type: "material",
  47239. generator: "MaterialExporter"
  47240. },
  47241. uuid: this.uuid,
  47242. type: this.type,
  47243. materials: []
  47244. }, i = this.materials, n = 0, r = i.length; n < r; n++) {
  47245. var o = i[n].toJSON(e);
  47246. delete o.metadata,
  47247. t.materials.push(o)
  47248. }
  47249. return t.visible = this.visible,
  47250. t
  47251. },
  47252. clone: function() {
  47253. for (var e = new this.constructor, t = 0; t < this.materials.length; t++)
  47254. e.materials.push(this.materials[t].clone());
  47255. return e.visible = this.visible,
  47256. e
  47257. }
  47258. },
  47259. Ci.PointsMaterial = function(e) {
  47260. Ci.Material.call(this),
  47261. this.type = "PointsMaterial",
  47262. this.color = new Ci.Color(16777215),
  47263. this.map = null,
  47264. this.size = 1,
  47265. this.sizeAttenuation = !0,
  47266. this.blending = Ci.NormalBlending,
  47267. this.vertexColors = Ci.NoColors,
  47268. this.fog = !0,
  47269. this.setValues(e)
  47270. }
  47271. ,
  47272. Ci.PointsMaterial.prototype = Object.create(Ci.Material.prototype),
  47273. Ci.PointsMaterial.prototype.constructor = Ci.PointsMaterial,
  47274. Ci.PointsMaterial.prototype.copy = function(e) {
  47275. return Ci.Material.prototype.copy.call(this, e),
  47276. this.color.copy(e.color),
  47277. this.map = e.map,
  47278. this.size = e.size,
  47279. this.sizeAttenuation = e.sizeAttenuation,
  47280. this.vertexColors = e.vertexColors,
  47281. this.fog = e.fog,
  47282. this
  47283. }
  47284. ,
  47285. Ci.ShaderMaterial = function(e) {
  47286. Ci.Material.call(this),
  47287. this.type = "ShaderMaterial",
  47288. this.defines = {},
  47289. this.uniforms = {},
  47290. this.vertexShader = "void main() {\n\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}",
  47291. this.fragmentShader = "void main() {\n\tgl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );\n}",
  47292. this.shading = Ci.SmoothShading,
  47293. this.linewidth = 1,
  47294. this.wireframe = !1,
  47295. this.wireframeLinewidth = 1,
  47296. this.fog = !1,
  47297. this.lights = !1,
  47298. this.vertexColors = Ci.NoColors,
  47299. this.skinning = !1,
  47300. this.morphTargets = !1,
  47301. this.morphNormals = !1,
  47302. this.extensions = {
  47303. derivatives: !1,
  47304. fragDepth: !1,
  47305. drawBuffers: !1,
  47306. shaderTextureLOD: !1
  47307. },
  47308. this.defaultAttributeValues = {
  47309. color: [1, 1, 1],
  47310. uv: [0, 0],
  47311. uv2: [0, 0]
  47312. },
  47313. (this.index0AttributeName = void 0) !== e && (void 0 !== e.attributes && console.error("THREE.ShaderMaterial: attributes should now be defined in THREE.BufferGeometry instead."),
  47314. this.setValues(e))
  47315. }
  47316. ,
  47317. Ci.ShaderMaterial.prototype = Object.create(Ci.Material.prototype),
  47318. Ci.ShaderMaterial.prototype.constructor = Ci.ShaderMaterial,
  47319. Ci.ShaderMaterial.prototype.copy = function(e) {
  47320. return Ci.Material.prototype.copy.call(this, e),
  47321. this.fragmentShader = e.fragmentShader,
  47322. this.vertexShader = e.vertexShader,
  47323. this.uniforms = Ci.UniformsUtils.clone(e.uniforms),
  47324. this.defines = e.defines,
  47325. this.shading = e.shading,
  47326. this.wireframe = e.wireframe,
  47327. this.wireframeLinewidth = e.wireframeLinewidth,
  47328. this.fog = e.fog,
  47329. this.lights = e.lights,
  47330. this.vertexColors = e.vertexColors,
  47331. this.skinning = e.skinning,
  47332. this.morphTargets = e.morphTargets,
  47333. this.morphNormals = e.morphNormals,
  47334. this.extensions = e.extensions,
  47335. this
  47336. }
  47337. ,
  47338. Ci.ShaderMaterial.prototype.toJSON = function(e) {
  47339. var t = Ci.Material.prototype.toJSON.call(this, e);
  47340. return t.uniforms = this.uniforms,
  47341. t.vertexShader = this.vertexShader,
  47342. t.fragmentShader = this.fragmentShader,
  47343. t
  47344. }
  47345. ,
  47346. Ci.RawShaderMaterial = function(e) {
  47347. Ci.ShaderMaterial.call(this, e),
  47348. this.type = "RawShaderMaterial"
  47349. }
  47350. ,
  47351. Ci.RawShaderMaterial.prototype = Object.create(Ci.ShaderMaterial.prototype),
  47352. Ci.RawShaderMaterial.prototype.constructor = Ci.RawShaderMaterial,
  47353. Ci.SpriteMaterial = function(e) {
  47354. Ci.Material.call(this),
  47355. this.type = "SpriteMaterial",
  47356. this.color = new Ci.Color(16777215),
  47357. this.map = null,
  47358. this.rotation = 0,
  47359. this.fog = !1,
  47360. this.setValues(e)
  47361. }
  47362. ,
  47363. Ci.SpriteMaterial.prototype = Object.create(Ci.Material.prototype),
  47364. Ci.SpriteMaterial.prototype.constructor = Ci.SpriteMaterial,
  47365. Ci.SpriteMaterial.prototype.copy = function(e) {
  47366. return Ci.Material.prototype.copy.call(this, e),
  47367. this.color.copy(e.color),
  47368. this.map = e.map,
  47369. this.rotation = e.rotation,
  47370. this.fog = e.fog,
  47371. this
  47372. }
  47373. ,
  47374. Ci.Texture = function(e, t, i, n, r, o, a, s, l) {
  47375. Object.defineProperty(this, "id", {
  47376. value: Ci.TextureIdCount++
  47377. }),
  47378. this.uuid = Ci.Math.generateUUID(),
  47379. this.name = "",
  47380. this.sourceFile = "",
  47381. this.image = void 0 !== e ? e : Ci.Texture.DEFAULT_IMAGE,
  47382. this.mipmaps = [],
  47383. this.mapping = void 0 !== t ? t : Ci.Texture.DEFAULT_MAPPING,
  47384. this.wrapS = void 0 !== i ? i : Ci.ClampToEdgeWrapping,
  47385. this.wrapT = void 0 !== n ? n : Ci.ClampToEdgeWrapping,
  47386. this.magFilter = void 0 !== r ? r : Ci.LinearFilter,
  47387. this.minFilter = void 0 !== o ? o : Ci.LinearMipMapLinearFilter,
  47388. this.anisotropy = void 0 !== l ? l : 1,
  47389. this.format = void 0 !== a ? a : Ci.RGBAFormat,
  47390. this.type = void 0 !== s ? s : Ci.UnsignedByteType,
  47391. this.offset = new Ci.Vector2(0,0),
  47392. this.repeat = new Ci.Vector2(1,1),
  47393. this.generateMipmaps = !0,
  47394. this.premultiplyAlpha = !1,
  47395. this.flipY = !0,
  47396. this.unpackAlignment = 4,
  47397. this.encoding = Ci.LinearEncoding,
  47398. this.version = 0,
  47399. this.onUpdate = null
  47400. }
  47401. ,
  47402. Ci.Texture.DEFAULT_IMAGE = void 0,
  47403. Ci.Texture.DEFAULT_MAPPING = Ci.UVMapping,
  47404. Ci.Texture.prototype = {
  47405. constructor: Ci.Texture,
  47406. set needsUpdate(e) {
  47407. !0 === e && this.version++
  47408. },
  47409. clone: function() {
  47410. return (new this.constructor).copy(this)
  47411. },
  47412. copy: function(e) {
  47413. return this.image = e.image,
  47414. this.mipmaps = e.mipmaps.slice(0),
  47415. this.mapping = e.mapping,
  47416. this.wrapS = e.wrapS,
  47417. this.wrapT = e.wrapT,
  47418. this.magFilter = e.magFilter,
  47419. this.minFilter = e.minFilter,
  47420. this.anisotropy = e.anisotropy,
  47421. this.format = e.format,
  47422. this.type = e.type,
  47423. this.offset.copy(e.offset),
  47424. this.repeat.copy(e.repeat),
  47425. this.generateMipmaps = e.generateMipmaps,
  47426. this.premultiplyAlpha = e.premultiplyAlpha,
  47427. this.flipY = e.flipY,
  47428. this.unpackAlignment = e.unpackAlignment,
  47429. this.encoding = e.encoding,
  47430. this
  47431. },
  47432. toJSON: function(e) {
  47433. if (void 0 !== e.textures[this.uuid])
  47434. return e.textures[this.uuid];
  47435. var t, i, n = {
  47436. metadata: {
  47437. version: 4.4,
  47438. type: "Texture",
  47439. generator: "Texture.toJSON"
  47440. },
  47441. uuid: this.uuid,
  47442. name: this.name,
  47443. mapping: this.mapping,
  47444. repeat: [this.repeat.x, this.repeat.y],
  47445. offset: [this.offset.x, this.offset.y],
  47446. wrap: [this.wrapS, this.wrapT],
  47447. minFilter: this.minFilter,
  47448. magFilter: this.magFilter,
  47449. anisotropy: this.anisotropy
  47450. };
  47451. if (void 0 !== this.image) {
  47452. var r = this.image;
  47453. void 0 === r.uuid && (r.uuid = Ci.Math.generateUUID()),
  47454. void 0 === e.images[r.uuid] && (e.images[r.uuid] = {
  47455. uuid: r.uuid,
  47456. url: (t = r,
  47457. void 0 !== t.toDataURL ? i = t : ((i = document.createElement("canvas")).width = t.width,
  47458. i.height = t.height,
  47459. i.getContext("2d").drawImage(t, 0, 0, t.width, t.height)),
  47460. 2048 < i.width || 2048 < i.height ? i.toDataURL("image/jpeg", .6) : i.toDataURL("image/png"))
  47461. }),
  47462. n.image = r.uuid
  47463. }
  47464. return e.textures[this.uuid] = n
  47465. },
  47466. dispose: function() {
  47467. this.dispatchEvent({
  47468. type: "dispose"
  47469. })
  47470. },
  47471. transformUv: function(e) {
  47472. if (this.mapping === Ci.UVMapping) {
  47473. if (e.multiply(this.repeat),
  47474. e.add(this.offset),
  47475. e.x < 0 || 1 < e.x)
  47476. switch (this.wrapS) {
  47477. case Ci.RepeatWrapping:
  47478. e.x = e.x - Math.floor(e.x);
  47479. break;
  47480. case Ci.ClampToEdgeWrapping:
  47481. e.x = e.x < 0 ? 0 : 1;
  47482. break;
  47483. case Ci.MirroredRepeatWrapping:
  47484. 1 === Math.abs(Math.floor(e.x) % 2) ? e.x = Math.ceil(e.x) - e.x : e.x = e.x - Math.floor(e.x)
  47485. }
  47486. if (e.y < 0 || 1 < e.y)
  47487. switch (this.wrapT) {
  47488. case Ci.RepeatWrapping:
  47489. e.y = e.y - Math.floor(e.y);
  47490. break;
  47491. case Ci.ClampToEdgeWrapping:
  47492. e.y = e.y < 0 ? 0 : 1;
  47493. break;
  47494. case Ci.MirroredRepeatWrapping:
  47495. 1 === Math.abs(Math.floor(e.y) % 2) ? e.y = Math.ceil(e.y) - e.y : e.y = e.y - Math.floor(e.y)
  47496. }
  47497. this.flipY && (e.y = 1 - e.y)
  47498. }
  47499. }
  47500. },
  47501. Ci.EventDispatcher.prototype.apply(Ci.Texture.prototype),
  47502. Ci.TextureIdCount = 0,
  47503. Ci.CanvasTexture = function(e, t, i, n, r, o, a, s, l) {
  47504. Ci.Texture.call(this, e, t, i, n, r, o, a, s, l),
  47505. this.needsUpdate = !0
  47506. }
  47507. ,
  47508. Ci.CanvasTexture.prototype = Object.create(Ci.Texture.prototype),
  47509. Ci.CanvasTexture.prototype.constructor = Ci.CanvasTexture,
  47510. Ci.CubeTexture = function(e, t, i, n, r, o, a, s, l) {
  47511. e = void 0 !== e ? e : [],
  47512. t = void 0 !== t ? t : Ci.CubeReflectionMapping,
  47513. Ci.Texture.call(this, e, t, i, n, r, o, a, s, l),
  47514. this.flipY = !1
  47515. }
  47516. ,
  47517. Ci.CubeTexture.prototype = Object.create(Ci.Texture.prototype),
  47518. Ci.CubeTexture.prototype.constructor = Ci.CubeTexture,
  47519. Object.defineProperty(Ci.CubeTexture.prototype, "images", {
  47520. get: function() {
  47521. return this.image
  47522. },
  47523. set: function(e) {
  47524. this.image = e
  47525. }
  47526. }),
  47527. Ci.CompressedTexture = function(e, t, i, n, r, o, a, s, l, c, h) {
  47528. Ci.Texture.call(this, null, o, a, s, l, c, n, r, h),
  47529. this.image = {
  47530. width: t,
  47531. height: i
  47532. },
  47533. this.mipmaps = e,
  47534. this.flipY = !1,
  47535. this.generateMipmaps = !1
  47536. }
  47537. ,
  47538. Ci.CompressedTexture.prototype = Object.create(Ci.Texture.prototype),
  47539. Ci.CompressedTexture.prototype.constructor = Ci.CompressedTexture,
  47540. Ci.DataTexture = function(e, t, i, n, r, o, a, s, l, c, h) {
  47541. Ci.Texture.call(this, null, o, a, s, l, c, n, r, h),
  47542. this.image = {
  47543. data: e,
  47544. width: t,
  47545. height: i
  47546. },
  47547. this.magFilter = void 0 !== l ? l : Ci.NearestFilter,
  47548. this.minFilter = void 0 !== c ? c : Ci.NearestFilter,
  47549. this.flipY = !1,
  47550. this.generateMipmaps = !1
  47551. }
  47552. ,
  47553. Ci.DataTexture.prototype = Object.create(Ci.Texture.prototype),
  47554. Ci.DataTexture.prototype.constructor = Ci.DataTexture,
  47555. Ci.VideoTexture = function(t, e, i, n, r, o, a, s, l) {
  47556. Ci.Texture.call(this, t, e, i, n, r, o, a, s, l),
  47557. this.generateMipmaps = !1;
  47558. var c = this;
  47559. !function e() {
  47560. requestAnimationFrame(e),
  47561. !t.paused && t.readyState === t.HAVE_ENOUGH_DATA && (c.needsUpdate = !0)
  47562. }()
  47563. }
  47564. ,
  47565. Ci.VideoTexture.prototype = Object.create(Ci.Texture.prototype),
  47566. Ci.VideoTexture.prototype.constructor = Ci.VideoTexture,
  47567. Ci.Group = function() {
  47568. Ci.Object3D.call(this),
  47569. this.type = "Group"
  47570. }
  47571. ,
  47572. Ci.Group.prototype = Object.create(Ci.Object3D.prototype),
  47573. Ci.Group.prototype.constructor = Ci.Group,
  47574. Ci.Points = function(e, t) {
  47575. Ci.Object3D.call(this),
  47576. this.type = "Points",
  47577. this.geometry = void 0 !== e ? e : new Ci.Geometry,
  47578. this.material = void 0 !== t ? t : new Ci.PointsMaterial({
  47579. color: 16777215 * Math.random()
  47580. })
  47581. }
  47582. ,
  47583. Ci.Points.prototype = Object.create(Ci.Object3D.prototype),
  47584. Ci.Points.prototype.constructor = Ci.Points,
  47585. Ci.Points.prototype.raycast = (Wt = new Ci.Matrix4,
  47586. jt = new Ci.Ray,
  47587. Yt = new Ci.Sphere,
  47588. function(o, a) {
  47589. function e(e, t) {
  47590. var i = jt.distanceSqToPoint(e);
  47591. if (i < c) {
  47592. var n = jt.closestPointToPoint(e);
  47593. n.applyMatrix4(l);
  47594. var r = o.ray.origin.distanceTo(n);
  47595. if (r < o.near || r > o.far)
  47596. return;
  47597. a.push({
  47598. distance: r,
  47599. distanceToRay: Math.sqrt(i),
  47600. point: n.clone(),
  47601. index: t,
  47602. face: null,
  47603. object: s
  47604. })
  47605. }
  47606. }
  47607. var s = this
  47608. , t = this.geometry
  47609. , l = this.matrixWorld
  47610. , i = o.params.Points.threshold;
  47611. if (null === t.boundingSphere && t.computeBoundingSphere(),
  47612. Yt.copy(t.boundingSphere),
  47613. Yt.applyMatrix4(l),
  47614. !1 !== o.ray.intersectsSphere(Yt)) {
  47615. Wt.getInverse(l),
  47616. jt.copy(o.ray).applyMatrix4(Wt);
  47617. var n = i / ((this.scale.x + this.scale.y + this.scale.z) / 3)
  47618. , c = n * n
  47619. , r = new Ci.Vector3;
  47620. if (t instanceof Ci.BufferGeometry) {
  47621. var h = t.index
  47622. , u = t.attributes.position.array;
  47623. if (null !== h)
  47624. for (var d = h.array, p = 0, f = d.length; p < f; p++) {
  47625. var g = d[p];
  47626. r.fromArray(u, 3 * g),
  47627. e(r, g)
  47628. }
  47629. else {
  47630. p = 0;
  47631. for (var m = u.length / 3; p < m; p++)
  47632. r.fromArray(u, 3 * p),
  47633. e(r, p)
  47634. }
  47635. } else {
  47636. var v = t.vertices;
  47637. for (p = 0,
  47638. m = v.length; p < m; p++)
  47639. e(v[p], p)
  47640. }
  47641. }
  47642. }
  47643. ),
  47644. Ci.Points.prototype.clone = function() {
  47645. return new this.constructor(this.geometry,this.material).copy(this)
  47646. }
  47647. ,
  47648. Ci.Line = function(e, t, i) {
  47649. return 1 === i ? (console.warn("THREE.Line: parameter THREE.LinePieces no longer supported. Created THREE.LineSegments instead."),
  47650. new Ci.LineSegments(e,t)) : (Ci.Object3D.call(this),
  47651. this.type = "Line",
  47652. this.geometry = void 0 !== e ? e : new Ci.Geometry,
  47653. void (this.material = void 0 !== t ? t : new Ci.LineBasicMaterial({
  47654. color: 16777215 * Math.random()
  47655. })))
  47656. }
  47657. ,
  47658. Ci.Line.prototype = Object.create(Ci.Object3D.prototype),
  47659. Ci.Line.prototype.constructor = Ci.Line,
  47660. Ci.Line.prototype.raycast = (Ht = new Ci.Matrix4,
  47661. zt = new Ci.Ray,
  47662. Gt = new Ci.Sphere,
  47663. function(e, t) {
  47664. var i = e.linePrecision
  47665. , n = i * i
  47666. , r = this.geometry
  47667. , o = this.matrixWorld;
  47668. if (null === r.boundingSphere && r.computeBoundingSphere(),
  47669. Gt.copy(r.boundingSphere),
  47670. Gt.applyMatrix4(o),
  47671. !1 !== e.ray.intersectsSphere(Gt)) {
  47672. Ht.getInverse(o),
  47673. zt.copy(e.ray).applyMatrix4(Ht);
  47674. var a = new Ci.Vector3
  47675. , s = new Ci.Vector3
  47676. , l = new Ci.Vector3
  47677. , c = new Ci.Vector3
  47678. , h = this instanceof Ci.LineSegments ? 2 : 1;
  47679. if (r instanceof Ci.BufferGeometry) {
  47680. var u = r.index
  47681. , d = r.attributes.position.array;
  47682. if (null !== u)
  47683. for (var p = u.array, f = 0, g = p.length - 1; f < g; f += h) {
  47684. var m = p[f]
  47685. , v = p[f + 1];
  47686. a.fromArray(d, 3 * m),
  47687. s.fromArray(d, 3 * v),
  47688. n < zt.distanceSqToSegment(a, s, c, l) || (c.applyMatrix4(this.matrixWorld),
  47689. (C = e.ray.origin.distanceTo(c)) < e.near || C > e.far || t.push({
  47690. distance: C,
  47691. point: l.clone().applyMatrix4(this.matrixWorld),
  47692. index: f,
  47693. face: null,
  47694. faceIndex: null,
  47695. object: this
  47696. }))
  47697. }
  47698. else
  47699. for (f = 0,
  47700. g = d.length / 3 - 1; f < g; f += h)
  47701. a.fromArray(d, 3 * f),
  47702. s.fromArray(d, 3 * f + 3),
  47703. n < zt.distanceSqToSegment(a, s, c, l) || (c.applyMatrix4(this.matrixWorld),
  47704. (C = e.ray.origin.distanceTo(c)) < e.near || C > e.far || t.push({
  47705. distance: C,
  47706. point: l.clone().applyMatrix4(this.matrixWorld),
  47707. index: f,
  47708. face: null,
  47709. faceIndex: null,
  47710. object: this
  47711. }))
  47712. } else if (r instanceof Ci.Geometry) {
  47713. var y = r.vertices
  47714. , A = y.length;
  47715. for (f = 0; f < A - 1; f += h) {
  47716. var C;
  47717. n < zt.distanceSqToSegment(y[f], y[f + 1], c, l) || (c.applyMatrix4(this.matrixWorld),
  47718. (C = e.ray.origin.distanceTo(c)) < e.near || C > e.far || t.push({
  47719. distance: C,
  47720. point: l.clone().applyMatrix4(this.matrixWorld),
  47721. index: f,
  47722. face: null,
  47723. faceIndex: null,
  47724. object: this
  47725. }))
  47726. }
  47727. }
  47728. }
  47729. }
  47730. ),
  47731. Ci.Line.prototype.clone = function() {
  47732. return new this.constructor(this.geometry,this.material).copy(this)
  47733. }
  47734. ,
  47735. Ci.LineStrip = 0,
  47736. Ci.LinePieces = 1,
  47737. Ci.LineSegments = function(e, t) {
  47738. Ci.Line.call(this, e, t),
  47739. this.type = "LineSegments"
  47740. }
  47741. ,
  47742. Ci.LineSegments.prototype = Object.create(Ci.Line.prototype),
  47743. Ci.LineSegments.prototype.constructor = Ci.LineSegments,
  47744. Ci.Mesh = function(e, t) {
  47745. Ci.Object3D.call(this),
  47746. this.type = "Mesh",
  47747. this.geometry = void 0 !== e ? e : new Ci.Geometry,
  47748. this.material = void 0 !== t ? t : new Ci.MeshBasicMaterial({
  47749. color: 16777215 * Math.random()
  47750. }),
  47751. this.drawMode = Ci.TrianglesDrawMode,
  47752. this.updateMorphTargets()
  47753. }
  47754. ,
  47755. Ci.Mesh.prototype = Object.create(Ci.Object3D.prototype),
  47756. Ci.Mesh.prototype.constructor = Ci.Mesh,
  47757. Ci.Mesh.prototype.setDrawMode = function(e) {
  47758. this.drawMode = e
  47759. }
  47760. ,
  47761. Ci.Mesh.prototype.updateMorphTargets = function() {
  47762. if (void 0 !== this.geometry.morphTargets && 0 < this.geometry.morphTargets.length) {
  47763. this.morphTargetBase = -1,
  47764. this.morphTargetInfluences = [],
  47765. this.morphTargetDictionary = {};
  47766. for (var e = 0, t = this.geometry.morphTargets.length; e < t; e++)
  47767. this.morphTargetInfluences.push(0),
  47768. this.morphTargetDictionary[this.geometry.morphTargets[e].name] = e
  47769. }
  47770. }
  47771. ,
  47772. Ci.Mesh.prototype.getMorphTargetIndexByName = function(e) {
  47773. return void 0 !== this.morphTargetDictionary[e] ? this.morphTargetDictionary[e] : (console.warn("THREE.Mesh.getMorphTargetIndexByName: morph target " + e + " does not exist. Returning 0."),
  47774. 0)
  47775. }
  47776. ,
  47777. Ci.Mesh.prototype.raycast = (Tt = new Ci.Matrix4,
  47778. xt = new Ci.Ray,
  47779. St = new Ci.Sphere,
  47780. Mt = new Ci.Vector3,
  47781. Rt = new Ci.Vector3,
  47782. Pt = new Ci.Vector3,
  47783. Ot = new Ci.Vector3,
  47784. Lt = new Ci.Vector3,
  47785. Dt = new Ci.Vector3,
  47786. Nt = new Ci.Vector2,
  47787. Ft = new Ci.Vector2,
  47788. Bt = new Ci.Vector2,
  47789. Vt = new Ci.Vector3,
  47790. kt = new Ci.Vector3,
  47791. Ut = new Ci.Vector3,
  47792. function(e, t) {
  47793. var i, n, r = this.geometry, o = this.material, a = this.matrixWorld;
  47794. if (void 0 !== o && (null === r.boundingSphere && r.computeBoundingSphere(),
  47795. St.copy(r.boundingSphere),
  47796. St.applyMatrix4(a),
  47797. !1 !== e.ray.intersectsSphere(St) && (Tt.getInverse(a),
  47798. xt.copy(e.ray).applyMatrix4(Tt),
  47799. null === r.boundingBox || !1 !== xt.intersectsBox(r.boundingBox))))
  47800. if (r instanceof Ci.BufferGeometry) {
  47801. var s, l, c, h = r.index, u = r.attributes, d = u.position.array;
  47802. if (void 0 !== u.uv && (i = u.uv.array),
  47803. null !== h)
  47804. for (var p = h.array, f = 0, g = p.length; f < g; f += 3)
  47805. s = p[f],
  47806. l = p[f + 1],
  47807. c = p[f + 2],
  47808. (n = Ti(this, e, xt, d, i, s, l, c)) && (n.faceIndex = Math.floor(f / 3),
  47809. t.push(n));
  47810. else
  47811. for (f = 0,
  47812. g = d.length; f < g; f += 9)
  47813. (n = Ti(this, e, xt, d, i, s = f / 3, l = s + 1, c = s + 2)) && (n.index = s,
  47814. t.push(n))
  47815. } else if (r instanceof Ci.Geometry) {
  47816. var m, v, y, A = o instanceof Ci.MultiMaterial, C = 1 == A ? o.materials : null, I = r.vertices, E = r.faces, _ = r.faceVertexUvs[0];
  47817. 0 < _.length && (i = _);
  47818. for (var b = 0, w = E.length; b < w; b++) {
  47819. var T = E[b]
  47820. , x = 1 == A ? C[T.materialIndex] : o;
  47821. if (void 0 !== x) {
  47822. if (m = I[T.a],
  47823. v = I[T.b],
  47824. y = I[T.c],
  47825. !0 === x.morphTargets) {
  47826. var S = r.morphTargets
  47827. , M = this.morphTargetInfluences;
  47828. Mt.set(0, 0, 0),
  47829. Rt.set(0, 0, 0),
  47830. Pt.set(0, 0, 0);
  47831. for (var R = 0, P = S.length; R < P; R++) {
  47832. var O = M[R];
  47833. if (0 !== O) {
  47834. var L = S[R].vertices;
  47835. Mt.addScaledVector(Ot.subVectors(L[T.a], m), O),
  47836. Rt.addScaledVector(Lt.subVectors(L[T.b], v), O),
  47837. Pt.addScaledVector(Dt.subVectors(L[T.c], y), O)
  47838. }
  47839. }
  47840. Mt.add(m),
  47841. Rt.add(v),
  47842. Pt.add(y),
  47843. m = Mt,
  47844. v = Rt,
  47845. y = Pt
  47846. }
  47847. if (n = wi(this, e, xt, m, v, y, kt)) {
  47848. if (i) {
  47849. var D = i[b];
  47850. Nt.copy(D[0]),
  47851. Ft.copy(D[1]),
  47852. Bt.copy(D[2]),
  47853. n.uv = bi(kt, m, v, y, Nt, Ft, Bt)
  47854. }
  47855. n.face = T,
  47856. n.faceIndex = b,
  47857. t.push(n)
  47858. }
  47859. }
  47860. }
  47861. }
  47862. }
  47863. ),
  47864. Ci.Mesh.prototype.clone = function() {
  47865. return new this.constructor(this.geometry,this.material).copy(this)
  47866. }
  47867. ,
  47868. Ci.Bone = function(e) {
  47869. Ci.Object3D.call(this),
  47870. this.type = "Bone",
  47871. this.skin = e
  47872. }
  47873. ,
  47874. Ci.Bone.prototype = Object.create(Ci.Object3D.prototype),
  47875. Ci.Bone.prototype.constructor = Ci.Bone,
  47876. Ci.Bone.prototype.copy = function(e) {
  47877. return Ci.Object3D.prototype.copy.call(this, e),
  47878. this.skin = e.skin,
  47879. this
  47880. }
  47881. ,
  47882. Ci.Skeleton = function(e, t, i) {
  47883. if (this.useVertexTexture = void 0 === i || i,
  47884. this.identityMatrix = new Ci.Matrix4,
  47885. e = e || [],
  47886. this.bones = e.slice(0),
  47887. this.useVertexTexture) {
  47888. var n = Math.sqrt(4 * this.bones.length);
  47889. n = Ci.Math.nextPowerOfTwo(Math.ceil(n)),
  47890. n = Math.max(n, 4),
  47891. this.boneTextureWidth = n,
  47892. this.boneTextureHeight = n,
  47893. this.boneMatrices = new Float32Array(this.boneTextureWidth * this.boneTextureHeight * 4),
  47894. this.boneTexture = new Ci.DataTexture(this.boneMatrices,this.boneTextureWidth,this.boneTextureHeight,Ci.RGBAFormat,Ci.FloatType)
  47895. } else
  47896. this.boneMatrices = new Float32Array(16 * this.bones.length);
  47897. if (void 0 === t)
  47898. this.calculateInverses();
  47899. else if (this.bones.length === t.length)
  47900. this.boneInverses = t.slice(0);
  47901. else {
  47902. console.warn("THREE.Skeleton bonInverses is the wrong length."),
  47903. this.boneInverses = [];
  47904. for (var r = 0, o = this.bones.length; r < o; r++)
  47905. this.boneInverses.push(new Ci.Matrix4)
  47906. }
  47907. }
  47908. ,
  47909. Ci.Skeleton.prototype.calculateInverses = function() {
  47910. this.boneInverses = [];
  47911. for (var e = 0, t = this.bones.length; e < t; e++) {
  47912. var i = new Ci.Matrix4;
  47913. this.bones[e] && i.getInverse(this.bones[e].matrixWorld),
  47914. this.boneInverses.push(i)
  47915. }
  47916. }
  47917. ,
  47918. Ci.Skeleton.prototype.pose = function() {
  47919. for (var e, t = 0, i = this.bones.length; t < i; t++)
  47920. (e = this.bones[t]) && e.matrixWorld.getInverse(this.boneInverses[t]);
  47921. for (t = 0,
  47922. i = this.bones.length; t < i; t++)
  47923. (e = this.bones[t]) && (e.parent ? (e.matrix.getInverse(e.parent.matrixWorld),
  47924. e.matrix.multiply(e.matrixWorld)) : e.matrix.copy(e.matrixWorld),
  47925. e.matrix.decompose(e.position, e.quaternion, e.scale))
  47926. }
  47927. ,
  47928. Ci.Skeleton.prototype.update = (wt = new Ci.Matrix4,
  47929. function() {
  47930. for (var e = 0, t = this.bones.length; e < t; e++) {
  47931. var i = this.bones[e] ? this.bones[e].matrixWorld : this.identityMatrix;
  47932. wt.multiplyMatrices(i, this.boneInverses[e]),
  47933. wt.flattenToArrayOffset(this.boneMatrices, 16 * e)
  47934. }
  47935. this.useVertexTexture && (this.boneTexture.needsUpdate = !0)
  47936. }
  47937. ),
  47938. Ci.Skeleton.prototype.clone = function() {
  47939. return new Ci.Skeleton(this.bones,this.boneInverses,this.useVertexTexture)
  47940. }
  47941. ,
  47942. Ci.SkinnedMesh = function(e, t, i) {
  47943. Ci.Mesh.call(this, e, t),
  47944. this.type = "SkinnedMesh",
  47945. this.bindMode = "attached",
  47946. this.bindMatrix = new Ci.Matrix4,
  47947. this.bindMatrixInverse = new Ci.Matrix4;
  47948. var n = [];
  47949. if (this.geometry && void 0 !== this.geometry.bones) {
  47950. for (var r, o, a = 0, s = this.geometry.bones.length; a < s; ++a)
  47951. o = this.geometry.bones[a],
  47952. r = new Ci.Bone(this),
  47953. n.push(r),
  47954. r.name = o.name,
  47955. r.position.fromArray(o.pos),
  47956. r.quaternion.fromArray(o.rotq),
  47957. void 0 !== o.scl && r.scale.fromArray(o.scl);
  47958. for (a = 0,
  47959. s = this.geometry.bones.length; a < s; ++a)
  47960. -1 !== (o = this.geometry.bones[a]).parent && null !== o.parent ? n[o.parent].add(n[a]) : this.add(n[a])
  47961. }
  47962. this.normalizeSkinWeights(),
  47963. this.updateMatrixWorld(!0),
  47964. this.bind(new Ci.Skeleton(n,void 0,i), this.matrixWorld)
  47965. }
  47966. ,
  47967. Ci.SkinnedMesh.prototype = Object.create(Ci.Mesh.prototype),
  47968. Ci.SkinnedMesh.prototype.constructor = Ci.SkinnedMesh,
  47969. Ci.SkinnedMesh.prototype.bind = function(e, t) {
  47970. this.skeleton = e,
  47971. void 0 === t && (this.updateMatrixWorld(!0),
  47972. this.skeleton.calculateInverses(),
  47973. t = this.matrixWorld),
  47974. this.bindMatrix.copy(t),
  47975. this.bindMatrixInverse.getInverse(t)
  47976. }
  47977. ,
  47978. Ci.SkinnedMesh.prototype.pose = function() {
  47979. this.skeleton.pose()
  47980. }
  47981. ,
  47982. Ci.SkinnedMesh.prototype.normalizeSkinWeights = function() {
  47983. if (this.geometry instanceof Ci.Geometry)
  47984. for (var e = 0; e < this.geometry.skinWeights.length; e++) {
  47985. var t = this.geometry.skinWeights[e];
  47986. (r = 1 / t.lengthManhattan()) !== 1 / 0 ? t.multiplyScalar(r) : t.set(1, 0, 0, 0)
  47987. }
  47988. else if (this.geometry instanceof Ci.BufferGeometry) {
  47989. var i = new Ci.Vector4
  47990. , n = this.geometry.attributes.skinWeight;
  47991. for (e = 0; e < n.count; e++) {
  47992. var r;
  47993. i.x = n.getX(e),
  47994. i.y = n.getY(e),
  47995. i.z = n.getZ(e),
  47996. i.w = n.getW(e),
  47997. (r = 1 / i.lengthManhattan()) !== 1 / 0 ? i.multiplyScalar(r) : i.set(1, 0, 0, 0),
  47998. n.setXYZW(e, i.x, i.y, i.z, i.w)
  47999. }
  48000. }
  48001. }
  48002. ,
  48003. Ci.SkinnedMesh.prototype.updateMatrixWorld = function(e) {
  48004. Ci.Mesh.prototype.updateMatrixWorld.call(this, !0),
  48005. "attached" === this.bindMode ? this.bindMatrixInverse.getInverse(this.matrixWorld) : "detached" === this.bindMode ? this.bindMatrixInverse.getInverse(this.bindMatrix) : console.warn("THREE.SkinnedMesh unrecognized bindMode: " + this.bindMode)
  48006. }
  48007. ,
  48008. Ci.SkinnedMesh.prototype.clone = function() {
  48009. return new this.constructor(this.geometry,this.material,this.useVertexTexture).copy(this)
  48010. }
  48011. ,
  48012. Ci.LOD = function() {
  48013. Ci.Object3D.call(this),
  48014. this.type = "LOD",
  48015. Object.defineProperties(this, {
  48016. levels: {
  48017. enumerable: !0,
  48018. value: []
  48019. },
  48020. objects: {
  48021. get: function() {
  48022. return console.warn("THREE.LOD: .objects has been renamed to .levels."),
  48023. this.levels
  48024. }
  48025. }
  48026. })
  48027. }
  48028. ,
  48029. Ci.LOD.prototype = Object.create(Ci.Object3D.prototype),
  48030. Ci.LOD.prototype.constructor = Ci.LOD,
  48031. Ci.LOD.prototype.addLevel = function(e, t) {
  48032. void 0 === t && (t = 0),
  48033. t = Math.abs(t);
  48034. for (var i = this.levels, n = 0; n < i.length && !(t < i[n].distance); n++)
  48035. ;
  48036. i.splice(n, 0, {
  48037. distance: t,
  48038. object: e
  48039. }),
  48040. this.add(e)
  48041. }
  48042. ,
  48043. Ci.LOD.prototype.getObjectForDistance = function(e) {
  48044. for (var t = this.levels, i = 1, n = t.length; i < n && !(e < t[i].distance); i++)
  48045. ;
  48046. return t[i - 1].object
  48047. }
  48048. ,
  48049. Ci.LOD.prototype.raycast = (bt = new Ci.Vector3,
  48050. function(e, t) {
  48051. bt.setFromMatrixPosition(this.matrixWorld);
  48052. var i = e.ray.origin.distanceTo(bt);
  48053. this.getObjectForDistance(i).raycast(e, t)
  48054. }
  48055. ),
  48056. Ci.LOD.prototype.update = (Et = new Ci.Vector3,
  48057. _t = new Ci.Vector3,
  48058. function(e) {
  48059. var t = this.levels;
  48060. if (1 < t.length) {
  48061. Et.setFromMatrixPosition(e.matrixWorld),
  48062. _t.setFromMatrixPosition(this.matrixWorld);
  48063. var i = Et.distanceTo(_t);
  48064. t[0].object.visible = !0;
  48065. for (var n = 1, r = t.length; n < r && i >= t[n].distance; n++)
  48066. t[n - 1].object.visible = !1,
  48067. t[n].object.visible = !0;
  48068. for (; n < r; n++)
  48069. t[n].object.visible = !1
  48070. }
  48071. }
  48072. ),
  48073. Ci.LOD.prototype.copy = function(e) {
  48074. Ci.Object3D.prototype.copy.call(this, e, !1);
  48075. for (var t = e.levels, i = 0, n = t.length; i < n; i++) {
  48076. var r = t[i];
  48077. this.addLevel(r.object.clone(), r.distance)
  48078. }
  48079. return this
  48080. }
  48081. ,
  48082. Ci.LOD.prototype.toJSON = function(e) {
  48083. var t = Ci.Object3D.prototype.toJSON.call(this, e);
  48084. t.object.levels = [];
  48085. for (var i = this.levels, n = 0, r = i.length; n < r; n++) {
  48086. var o = i[n];
  48087. t.object.levels.push({
  48088. object: o.object.uuid,
  48089. distance: o.distance
  48090. })
  48091. }
  48092. return t
  48093. }
  48094. ,
  48095. Ci.Sprite = (yt = new Uint16Array([0, 1, 2, 0, 2, 3]),
  48096. At = new Float32Array([-.5, -.5, 0, .5, -.5, 0, .5, .5, 0, -.5, .5, 0]),
  48097. Ct = new Float32Array([0, 0, 1, 0, 1, 1, 0, 1]),
  48098. (It = new Ci.BufferGeometry).setIndex(new Ci.BufferAttribute(yt,1)),
  48099. It.addAttribute("position", new Ci.BufferAttribute(At,3)),
  48100. It.addAttribute("uv", new Ci.BufferAttribute(Ct,2)),
  48101. function(e) {
  48102. Ci.Object3D.call(this),
  48103. this.type = "Sprite",
  48104. this.geometry = It,
  48105. this.material = void 0 !== e ? e : new Ci.SpriteMaterial
  48106. }
  48107. ),
  48108. Ci.Sprite.prototype = Object.create(Ci.Object3D.prototype),
  48109. Ci.Sprite.prototype.constructor = Ci.Sprite,
  48110. Ci.Sprite.prototype.raycast = (vt = new Ci.Vector3,
  48111. function(e, t) {
  48112. vt.setFromMatrixPosition(this.matrixWorld);
  48113. var i = e.ray.distanceSqToPoint(vt);
  48114. this.scale.x * this.scale.y < i || t.push({
  48115. distance: Math.sqrt(i),
  48116. point: this.position,
  48117. face: null,
  48118. object: this
  48119. })
  48120. }
  48121. ),
  48122. Ci.Sprite.prototype.clone = function() {
  48123. return new this.constructor(this.material).copy(this)
  48124. }
  48125. ,
  48126. Ci.Particle = Ci.Sprite,
  48127. Ci.LensFlare = function(e, t, i, n, r) {
  48128. Ci.Object3D.call(this),
  48129. this.lensFlares = [],
  48130. this.positionScreen = new Ci.Vector3,
  48131. (this.customUpdateCallback = void 0) !== e && this.add(e, t, i, n, r)
  48132. }
  48133. ,
  48134. Ci.LensFlare.prototype = Object.create(Ci.Object3D.prototype),
  48135. Ci.LensFlare.prototype.constructor = Ci.LensFlare,
  48136. Ci.LensFlare.prototype.add = function(e, t, i, n, r, o) {
  48137. void 0 === t && (t = -1),
  48138. void 0 === i && (i = 0),
  48139. void 0 === o && (o = 1),
  48140. void 0 === r && (r = new Ci.Color(16777215)),
  48141. void 0 === n && (n = Ci.NormalBlending),
  48142. i = Math.min(i, Math.max(0, i)),
  48143. this.lensFlares.push({
  48144. texture: e,
  48145. size: t,
  48146. distance: i,
  48147. x: 0,
  48148. y: 0,
  48149. z: 0,
  48150. scale: 1,
  48151. rotation: 0,
  48152. opacity: o,
  48153. color: r,
  48154. blending: n
  48155. })
  48156. }
  48157. ,
  48158. Ci.LensFlare.prototype.updateLensFlares = function() {
  48159. var e, t, i = this.lensFlares.length, n = 2 * -this.positionScreen.x, r = 2 * -this.positionScreen.y;
  48160. for (e = 0; e < i; e++)
  48161. (t = this.lensFlares[e]).x = this.positionScreen.x + n * t.distance,
  48162. t.y = this.positionScreen.y + r * t.distance,
  48163. t.wantedRotation = t.x * Math.PI * .25,
  48164. t.rotation += .25 * (t.wantedRotation - t.rotation)
  48165. }
  48166. ,
  48167. Ci.LensFlare.prototype.copy = function(e) {
  48168. Ci.Object3D.prototype.copy.call(this, e),
  48169. this.positionScreen.copy(e.positionScreen),
  48170. this.customUpdateCallback = e.customUpdateCallback;
  48171. for (var t = 0, i = e.lensFlares.length; t < i; t++)
  48172. this.lensFlares.push(e.lensFlares[t]);
  48173. return this
  48174. }
  48175. ,
  48176. Ci.Scene = function() {
  48177. Ci.Object3D.call(this),
  48178. this.type = "Scene",
  48179. this.fog = null,
  48180. this.overrideMaterial = null,
  48181. this.autoUpdate = !0
  48182. }
  48183. ,
  48184. Ci.Scene.prototype = Object.create(Ci.Object3D.prototype),
  48185. Ci.Scene.prototype.constructor = Ci.Scene,
  48186. Ci.Scene.prototype.copy = function(e, t) {
  48187. return Ci.Object3D.prototype.copy.call(this, e, t),
  48188. null !== e.fog && (this.fog = e.fog.clone()),
  48189. null !== e.overrideMaterial && (this.overrideMaterial = e.overrideMaterial.clone()),
  48190. this.autoUpdate = e.autoUpdate,
  48191. this.matrixAutoUpdate = e.matrixAutoUpdate,
  48192. this
  48193. }
  48194. ,
  48195. Ci.Fog = function(e, t, i) {
  48196. this.name = "",
  48197. this.color = new Ci.Color(e),
  48198. this.near = void 0 !== t ? t : 1,
  48199. this.far = void 0 !== i ? i : 1e3
  48200. }
  48201. ,
  48202. Ci.Fog.prototype.clone = function() {
  48203. return new Ci.Fog(this.color.getHex(),this.near,this.far)
  48204. }
  48205. ,
  48206. Ci.FogExp2 = function(e, t) {
  48207. this.name = "",
  48208. this.color = new Ci.Color(e),
  48209. this.density = void 0 !== t ? t : 25e-5
  48210. }
  48211. ,
  48212. Ci.FogExp2.prototype.clone = function() {
  48213. return new Ci.FogExp2(this.color.getHex(),this.density)
  48214. }
  48215. ,
  48216. Ci.ShaderChunk = {},
  48217. Ci.ShaderChunk.alphamap_fragment = "#ifdef USE_ALPHAMAP\n\tdiffuseColor.a *= texture2D( alphaMap, vUv ).g;\n#endif\n",
  48218. Ci.ShaderChunk.alphamap_pars_fragment = "#ifdef USE_ALPHAMAP\n\tuniform sampler2D alphaMap;\n#endif\n",
  48219. Ci.ShaderChunk.alphatest_fragment = "#ifdef ALPHATEST\n\tif ( diffuseColor.a < ALPHATEST ) discard;\n#endif\n",
  48220. 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",
  48221. Ci.ShaderChunk.aomap_pars_fragment = "#ifdef USE_AOMAP\n\tuniform sampler2D aoMap;\n\tuniform float aoMapIntensity;\n#endif",
  48222. Ci.ShaderChunk.begin_vertex = "\nvec3 transformed = vec3( position );\n",
  48223. Ci.ShaderChunk.beginnormal_vertex = "\nvec3 objectNormal = vec3( normal );\n",
  48224. 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",
  48225. 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",
  48226. Ci.ShaderChunk.color_fragment = "#ifdef USE_COLOR\n\tdiffuseColor.rgb *= vColor;\n#endif",
  48227. Ci.ShaderChunk.color_pars_fragment = "#ifdef USE_COLOR\n\tvarying vec3 vColor;\n#endif\n",
  48228. Ci.ShaderChunk.color_pars_vertex = "#ifdef USE_COLOR\n\tvarying vec3 vColor;\n#endif",
  48229. Ci.ShaderChunk.color_vertex = "#ifdef USE_COLOR\n\tvColor.xyz = color.xyz;\n#endif",
  48230. 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",
  48231. 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",
  48232. Ci.ShaderChunk.defaultnormal_vertex = "#ifdef FLIP_SIDED\n\tobjectNormal = -objectNormal;\n#endif\nvec3 transformedNormal = normalMatrix * objectNormal;\n",
  48233. Ci.ShaderChunk.displacementmap_vertex = "#ifdef USE_DISPLACEMENTMAP\n\ttransformed += normal * ( texture2D( displacementMap, uv ).x * displacementScale + displacementBias );\n#endif\n",
  48234. Ci.ShaderChunk.displacementmap_pars_vertex = "#ifdef USE_DISPLACEMENTMAP\n\tuniform sampler2D displacementMap;\n\tuniform float displacementScale;\n\tuniform float displacementBias;\n#endif\n",
  48235. 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",
  48236. Ci.ShaderChunk.emissivemap_pars_fragment = "#ifdef USE_EMISSIVEMAP\n\tuniform sampler2D emissiveMap;\n#endif\n",
  48237. 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",
  48238. Ci.ShaderChunk.encodings_fragment = " gl_FragColor = linearToOutputTexel( gl_FragColor );\n",
  48239. 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",
  48240. 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",
  48241. 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",
  48242. 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",
  48243. 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",
  48244. 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",
  48245. Ci.ShaderChunk.lightmap_fragment = "#ifdef USE_LIGHTMAP\n\treflectedLight.indirectDiffuse += PI * texture2D( lightMap, vUv2 ).xyz * lightMapIntensity;\n#endif\n",
  48246. Ci.ShaderChunk.lightmap_pars_fragment = "#ifdef USE_LIGHTMAP\n\tuniform sampler2D lightMap;\n\tuniform float lightMapIntensity;\n#endif",
  48247. 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",
  48248. 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",
  48249. Ci.ShaderChunk.lights_phong_fragment = "BlinnPhongMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularColor = specular;\nmaterial.specularShininess = shininess;\nmaterial.specularStrength = specularStrength;\n",
  48250. 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",
  48251. Ci.ShaderChunk.lights_phong_pars_vertex = "#ifdef USE_ENVMAP\n\tvarying vec3 vWorldPosition;\n#endif\n",
  48252. Ci.ShaderChunk.lights_phong_vertex = "#ifdef USE_ENVMAP\n\tvWorldPosition = worldPosition.xyz;\n#endif\n",
  48253. 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",
  48254. 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",
  48255. 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",
  48256. Ci.ShaderChunk.logdepthbuf_fragment = "#if defined(USE_LOGDEPTHBUF) && defined(USE_LOGDEPTHBUF_EXT)\n\tgl_FragDepthEXT = log2(vFragDepth) * logDepthBufFC * 0.5;\n#endif",
  48257. 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",
  48258. 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",
  48259. 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",
  48260. Ci.ShaderChunk.map_fragment = "#ifdef USE_MAP\n\tvec4 texelColor = texture2D( map, vUv );\n\ttexelColor = mapTexelToLinear( texelColor );\n\tdiffuseColor *= texelColor;\n#endif\n",
  48261. Ci.ShaderChunk.map_pars_fragment = "#ifdef USE_MAP\n\tuniform sampler2D map;\n#endif\n",
  48262. 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",
  48263. Ci.ShaderChunk.map_particle_pars_fragment = "#ifdef USE_MAP\n\tuniform vec4 offsetRepeat;\n\tuniform sampler2D map;\n#endif\n",
  48264. Ci.ShaderChunk.metalnessmap_fragment = "float metalnessFactor = metalness;\n#ifdef USE_METALNESSMAP\n\tvec4 texelMetalness = texture2D( metalnessMap, vUv );\n\tmetalnessFactor *= texelMetalness.r;\n#endif\n",
  48265. Ci.ShaderChunk.metalnessmap_pars_fragment = "#ifdef USE_METALNESSMAP\n\tuniform sampler2D metalnessMap;\n#endif",
  48266. 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",
  48267. 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",
  48268. 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",
  48269. 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",
  48270. 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",
  48271. Ci.ShaderChunk.premultiplied_alpha_fragment = "#ifdef PREMULTIPLIED_ALPHA\n\tgl_FragColor.rgb *= gl_FragColor.a;\n#endif\n",
  48272. 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",
  48273. Ci.ShaderChunk.roughnessmap_fragment = "float roughnessFactor = roughness;\n#ifdef USE_ROUGHNESSMAP\n\tvec4 texelRoughness = texture2D( roughnessMap, vUv );\n\troughnessFactor *= texelRoughness.r;\n#endif\n",
  48274. Ci.ShaderChunk.roughnessmap_pars_fragment = "#ifdef USE_ROUGHNESSMAP\n\tuniform sampler2D roughnessMap;\n#endif",
  48275. 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",
  48276. 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",
  48277. 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",
  48278. 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",
  48279. 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",
  48280. 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",
  48281. 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",
  48282. 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",
  48283. 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",
  48284. Ci.ShaderChunk.specularmap_pars_fragment = "#ifdef USE_SPECULARMAP\n\tuniform sampler2D specularMap;\n#endif",
  48285. Ci.ShaderChunk.tonemapping_fragment = "#if defined( TONE_MAPPING )\n gl_FragColor.rgb = toneMapping( gl_FragColor.rgb );\n#endif\n",
  48286. 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",
  48287. Ci.ShaderChunk.uv2_pars_fragment = "#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tvarying vec2 vUv2;\n#endif",
  48288. Ci.ShaderChunk.uv2_pars_vertex = "#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tattribute vec2 uv2;\n\tvarying vec2 vUv2;\n#endif",
  48289. Ci.ShaderChunk.uv2_vertex = "#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tvUv2 = uv2;\n#endif",
  48290. 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",
  48291. 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",
  48292. 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",
  48293. 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",
  48294. Ci.UniformsUtils = {
  48295. merge: function(e) {
  48296. for (var t = {}, i = 0; i < e.length; i++) {
  48297. var n = this.clone(e[i]);
  48298. for (var r in n)
  48299. t[r] = n[r]
  48300. }
  48301. return t
  48302. },
  48303. clone: function(e) {
  48304. var t = {};
  48305. for (var i in e)
  48306. for (var n in t[i] = {},
  48307. e[i]) {
  48308. var r = e[i][n];
  48309. 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
  48310. }
  48311. return t
  48312. }
  48313. },
  48314. Ci.UniformsLib = {
  48315. common: {
  48316. diffuse: {
  48317. type: "c",
  48318. value: new Ci.Color(15658734)
  48319. },
  48320. opacity: {
  48321. type: "f",
  48322. value: 1
  48323. },
  48324. map: {
  48325. type: "t",
  48326. value: null
  48327. },
  48328. offsetRepeat: {
  48329. type: "v4",
  48330. value: new Ci.Vector4(0,0,1,1)
  48331. },
  48332. specularMap: {
  48333. type: "t",
  48334. value: null
  48335. },
  48336. alphaMap: {
  48337. type: "t",
  48338. value: null
  48339. },
  48340. envMap: {
  48341. type: "t",
  48342. value: null
  48343. },
  48344. flipEnvMap: {
  48345. type: "f",
  48346. value: -1
  48347. },
  48348. reflectivity: {
  48349. type: "f",
  48350. value: 1
  48351. },
  48352. refractionRatio: {
  48353. type: "f",
  48354. value: .98
  48355. }
  48356. },
  48357. aomap: {
  48358. aoMap: {
  48359. type: "t",
  48360. value: null
  48361. },
  48362. aoMapIntensity: {
  48363. type: "f",
  48364. value: 1
  48365. }
  48366. },
  48367. lightmap: {
  48368. lightMap: {
  48369. type: "t",
  48370. value: null
  48371. },
  48372. lightMapIntensity: {
  48373. type: "f",
  48374. value: 1
  48375. }
  48376. },
  48377. emissivemap: {
  48378. emissiveMap: {
  48379. type: "t",
  48380. value: null
  48381. }
  48382. },
  48383. bumpmap: {
  48384. bumpMap: {
  48385. type: "t",
  48386. value: null
  48387. },
  48388. bumpScale: {
  48389. type: "f",
  48390. value: 1
  48391. }
  48392. },
  48393. normalmap: {
  48394. normalMap: {
  48395. type: "t",
  48396. value: null
  48397. },
  48398. normalScale: {
  48399. type: "v2",
  48400. value: new Ci.Vector2(1,1)
  48401. }
  48402. },
  48403. displacementmap: {
  48404. displacementMap: {
  48405. type: "t",
  48406. value: null
  48407. },
  48408. displacementScale: {
  48409. type: "f",
  48410. value: 1
  48411. },
  48412. displacementBias: {
  48413. type: "f",
  48414. value: 0
  48415. }
  48416. },
  48417. roughnessmap: {
  48418. roughnessMap: {
  48419. type: "t",
  48420. value: null
  48421. }
  48422. },
  48423. metalnessmap: {
  48424. metalnessMap: {
  48425. type: "t",
  48426. value: null
  48427. }
  48428. },
  48429. fog: {
  48430. fogDensity: {
  48431. type: "f",
  48432. value: 25e-5
  48433. },
  48434. fogNear: {
  48435. type: "f",
  48436. value: 1
  48437. },
  48438. fogFar: {
  48439. type: "f",
  48440. value: 2e3
  48441. },
  48442. fogColor: {
  48443. type: "c",
  48444. value: new Ci.Color(16777215)
  48445. }
  48446. },
  48447. lights: {
  48448. ambientLightColor: {
  48449. type: "fv",
  48450. value: []
  48451. },
  48452. directionalLights: {
  48453. type: "sa",
  48454. value: [],
  48455. properties: {
  48456. direction: {
  48457. type: "v3"
  48458. },
  48459. color: {
  48460. type: "c"
  48461. },
  48462. shadow: {
  48463. type: "i"
  48464. },
  48465. shadowBias: {
  48466. type: "f"
  48467. },
  48468. shadowRadius: {
  48469. type: "f"
  48470. },
  48471. shadowMapSize: {
  48472. type: "v2"
  48473. }
  48474. }
  48475. },
  48476. directionalShadowMap: {
  48477. type: "tv",
  48478. value: []
  48479. },
  48480. directionalShadowMatrix: {
  48481. type: "m4v",
  48482. value: []
  48483. },
  48484. spotLights: {
  48485. type: "sa",
  48486. value: [],
  48487. properties: {
  48488. color: {
  48489. type: "c"
  48490. },
  48491. position: {
  48492. type: "v3"
  48493. },
  48494. direction: {
  48495. type: "v3"
  48496. },
  48497. distance: {
  48498. type: "f"
  48499. },
  48500. coneCos: {
  48501. type: "f"
  48502. },
  48503. penumbraCos: {
  48504. type: "f"
  48505. },
  48506. decay: {
  48507. type: "f"
  48508. },
  48509. shadow: {
  48510. type: "i"
  48511. },
  48512. shadowBias: {
  48513. type: "f"
  48514. },
  48515. shadowRadius: {
  48516. type: "f"
  48517. },
  48518. shadowMapSize: {
  48519. type: "v2"
  48520. }
  48521. }
  48522. },
  48523. spotShadowMap: {
  48524. type: "tv",
  48525. value: []
  48526. },
  48527. spotShadowMatrix: {
  48528. type: "m4v",
  48529. value: []
  48530. },
  48531. pointLights: {
  48532. type: "sa",
  48533. value: [],
  48534. properties: {
  48535. color: {
  48536. type: "c"
  48537. },
  48538. position: {
  48539. type: "v3"
  48540. },
  48541. decay: {
  48542. type: "f"
  48543. },
  48544. distance: {
  48545. type: "f"
  48546. },
  48547. shadow: {
  48548. type: "i"
  48549. },
  48550. shadowBias: {
  48551. type: "f"
  48552. },
  48553. shadowRadius: {
  48554. type: "f"
  48555. },
  48556. shadowMapSize: {
  48557. type: "v2"
  48558. }
  48559. }
  48560. },
  48561. pointShadowMap: {
  48562. type: "tv",
  48563. value: []
  48564. },
  48565. pointShadowMatrix: {
  48566. type: "m4v",
  48567. value: []
  48568. },
  48569. hemisphereLights: {
  48570. type: "sa",
  48571. value: [],
  48572. properties: {
  48573. direction: {
  48574. type: "v3"
  48575. },
  48576. skyColor: {
  48577. type: "c"
  48578. },
  48579. groundColor: {
  48580. type: "c"
  48581. }
  48582. }
  48583. }
  48584. },
  48585. points: {
  48586. diffuse: {
  48587. type: "c",
  48588. value: new Ci.Color(15658734)
  48589. },
  48590. opacity: {
  48591. type: "f",
  48592. value: 1
  48593. },
  48594. size: {
  48595. type: "f",
  48596. value: 1
  48597. },
  48598. scale: {
  48599. type: "f",
  48600. value: 1
  48601. },
  48602. map: {
  48603. type: "t",
  48604. value: null
  48605. },
  48606. offsetRepeat: {
  48607. type: "v4",
  48608. value: new Ci.Vector4(0,0,1,1)
  48609. }
  48610. }
  48611. },
  48612. 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",
  48613. 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",
  48614. 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",
  48615. 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",
  48616. 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",
  48617. 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",
  48618. 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",
  48619. 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",
  48620. 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",
  48621. 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",
  48622. 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",
  48623. 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",
  48624. 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",
  48625. 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",
  48626. 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",
  48627. 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",
  48628. 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",
  48629. 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",
  48630. 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",
  48631. 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",
  48632. 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",
  48633. 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",
  48634. 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",
  48635. 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",
  48636. Ci.ShaderLib = {
  48637. basic: {
  48638. uniforms: Ci.UniformsUtils.merge([Ci.UniformsLib.common, Ci.UniformsLib.aomap, Ci.UniformsLib.fog]),
  48639. vertexShader: Ci.ShaderChunk.meshbasic_vert,
  48640. fragmentShader: Ci.ShaderChunk.meshbasic_frag
  48641. },
  48642. lambert: {
  48643. uniforms: Ci.UniformsUtils.merge([Ci.UniformsLib.common, Ci.UniformsLib.aomap, Ci.UniformsLib.lightmap, Ci.UniformsLib.emissivemap, Ci.UniformsLib.fog, Ci.UniformsLib.lights, {
  48644. emissive: {
  48645. type: "c",
  48646. value: new Ci.Color(0)
  48647. }
  48648. }]),
  48649. vertexShader: Ci.ShaderChunk.meshlambert_vert,
  48650. fragmentShader: Ci.ShaderChunk.meshlambert_frag
  48651. },
  48652. phong: {
  48653. 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, {
  48654. emissive: {
  48655. type: "c",
  48656. value: new Ci.Color(0)
  48657. },
  48658. specular: {
  48659. type: "c",
  48660. value: new Ci.Color(1118481)
  48661. },
  48662. shininess: {
  48663. type: "f",
  48664. value: 30
  48665. }
  48666. }]),
  48667. vertexShader: Ci.ShaderChunk.meshphong_vert,
  48668. fragmentShader: Ci.ShaderChunk.meshphong_frag
  48669. },
  48670. standard: {
  48671. 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, {
  48672. emissive: {
  48673. type: "c",
  48674. value: new Ci.Color(0)
  48675. },
  48676. roughness: {
  48677. type: "f",
  48678. value: .5
  48679. },
  48680. metalness: {
  48681. type: "f",
  48682. value: 0
  48683. },
  48684. envMapIntensity: {
  48685. type: "f",
  48686. value: 1
  48687. }
  48688. }]),
  48689. vertexShader: Ci.ShaderChunk.meshstandard_vert,
  48690. fragmentShader: Ci.ShaderChunk.meshstandard_frag
  48691. },
  48692. points: {
  48693. uniforms: Ci.UniformsUtils.merge([Ci.UniformsLib.points, Ci.UniformsLib.fog]),
  48694. vertexShader: Ci.ShaderChunk.points_vert,
  48695. fragmentShader: Ci.ShaderChunk.points_frag
  48696. },
  48697. dashed: {
  48698. uniforms: Ci.UniformsUtils.merge([Ci.UniformsLib.common, Ci.UniformsLib.fog, {
  48699. scale: {
  48700. type: "f",
  48701. value: 1
  48702. },
  48703. dashSize: {
  48704. type: "f",
  48705. value: 1
  48706. },
  48707. totalSize: {
  48708. type: "f",
  48709. value: 2
  48710. }
  48711. }]),
  48712. vertexShader: Ci.ShaderChunk.linedashed_vert,
  48713. fragmentShader: Ci.ShaderChunk.linedashed_frag
  48714. },
  48715. depth: {
  48716. uniforms: {
  48717. mNear: {
  48718. type: "f",
  48719. value: 1
  48720. },
  48721. mFar: {
  48722. type: "f",
  48723. value: 2e3
  48724. },
  48725. opacity: {
  48726. type: "f",
  48727. value: 1
  48728. }
  48729. },
  48730. vertexShader: Ci.ShaderChunk.depth_vert,
  48731. fragmentShader: Ci.ShaderChunk.depth_frag
  48732. },
  48733. normal: {
  48734. uniforms: {
  48735. opacity: {
  48736. type: "f",
  48737. value: 1
  48738. }
  48739. },
  48740. vertexShader: Ci.ShaderChunk.normal_vert,
  48741. fragmentShader: Ci.ShaderChunk.normal_frag
  48742. },
  48743. cube: {
  48744. uniforms: {
  48745. tCube: {
  48746. type: "t",
  48747. value: null
  48748. },
  48749. tFlip: {
  48750. type: "f",
  48751. value: -1
  48752. }
  48753. },
  48754. vertexShader: Ci.ShaderChunk.cube_vert,
  48755. fragmentShader: Ci.ShaderChunk.cube_frag
  48756. },
  48757. equirect: {
  48758. uniforms: {
  48759. tEquirect: {
  48760. type: "t",
  48761. value: null
  48762. },
  48763. tFlip: {
  48764. type: "f",
  48765. value: -1
  48766. }
  48767. },
  48768. vertexShader: Ci.ShaderChunk.equirect_vert,
  48769. fragmentShader: Ci.ShaderChunk.equirect_frag
  48770. },
  48771. depthRGBA: {
  48772. uniforms: {},
  48773. vertexShader: Ci.ShaderChunk.depthRGBA_vert,
  48774. fragmentShader: Ci.ShaderChunk.depthRGBA_frag
  48775. },
  48776. distanceRGBA: {
  48777. uniforms: {
  48778. lightPos: {
  48779. type: "v3",
  48780. value: new Ci.Vector3(0,0,0)
  48781. }
  48782. },
  48783. vertexShader: Ci.ShaderChunk.distanceRGBA_vert,
  48784. fragmentShader: Ci.ShaderChunk.distanceRGBA_frag
  48785. }
  48786. },
  48787. Ci.WebGLRenderer = function(e) {
  48788. function S() {
  48789. return null === Q ? he : 1
  48790. }
  48791. function i(e, t, i, n) {
  48792. !0 === V && (e *= n,
  48793. t *= n,
  48794. i *= n),
  48795. _e.clearColor(e, t, i, n)
  48796. }
  48797. function t() {
  48798. _e.init(),
  48799. _e.scissor(ie.copy(ue).multiplyScalar(he)),
  48800. _e.viewport(re.copy(pe).multiplyScalar(he)),
  48801. i(ae.r, ae.g, ae.b, se)
  48802. }
  48803. function n() {
  48804. te = K = null,
  48805. ee = "",
  48806. $ = -1,
  48807. _e.reset()
  48808. }
  48809. function r(e) {
  48810. e.preventDefault(),
  48811. n(),
  48812. t(),
  48813. be.clear()
  48814. }
  48815. function f(e) {
  48816. var t = e.target;
  48817. t.removeEventListener("dispose", f),
  48818. function(e) {
  48819. var t = be.get(e);
  48820. if (e.image && t.__image__webglTextureCube)
  48821. X.deleteTexture(t.__image__webglTextureCube);
  48822. else {
  48823. if (void 0 === t.__webglInit)
  48824. return;
  48825. X.deleteTexture(t.__webglTexture)
  48826. }
  48827. be.delete(e)
  48828. }(t),
  48829. ye.textures--
  48830. }
  48831. function a(e) {
  48832. var t = e.target;
  48833. t.removeEventListener("dispose", a),
  48834. function(e) {
  48835. var t = be.get(e)
  48836. , i = be.get(e.texture);
  48837. if (e && void 0 !== i.__webglTexture) {
  48838. if (X.deleteTexture(i.__webglTexture),
  48839. e instanceof Ci.WebGLRenderTargetCube)
  48840. for (var n = 0; n < 6; n++)
  48841. X.deleteFramebuffer(t.__webglFramebuffer[n]),
  48842. X.deleteRenderbuffer(t.__webglDepthbuffer[n]);
  48843. else
  48844. X.deleteFramebuffer(t.__webglFramebuffer),
  48845. X.deleteRenderbuffer(t.__webglDepthbuffer);
  48846. be.delete(e.texture),
  48847. be.delete(e)
  48848. }
  48849. }(t),
  48850. ye.textures--
  48851. }
  48852. function v(e) {
  48853. var t = e.target;
  48854. t.removeEventListener("dispose", v),
  48855. function(e) {
  48856. y(e),
  48857. be.delete(e)
  48858. }(t)
  48859. }
  48860. function y(e) {
  48861. var t = be.get(e).program;
  48862. (e.program = void 0) !== t && Te.releaseProgram(t)
  48863. }
  48864. function M(e, t) {
  48865. return Math.abs(t[0]) - Math.abs(e[0])
  48866. }
  48867. function s(e, t) {
  48868. 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
  48869. }
  48870. function l(e, t) {
  48871. 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
  48872. }
  48873. function d(e, t, i, n, r) {
  48874. var o, a;
  48875. a = i.transparent ? (o = G,
  48876. ++W) : (o = H,
  48877. ++z);
  48878. var s = o[a];
  48879. void 0 !== s ? (s.id = e.id,
  48880. s.object = e,
  48881. s.geometry = t,
  48882. s.material = i,
  48883. s.z = me.z,
  48884. s.group = r) : (s = {
  48885. id: e.id,
  48886. object: e,
  48887. geometry: t,
  48888. material: i,
  48889. z: me.z,
  48890. group: r
  48891. },
  48892. o.push(s))
  48893. }
  48894. function c(e, t, i, n) {
  48895. for (var r = 0, o = e.length; r < o; r++) {
  48896. var a = e[r]
  48897. , s = a.object
  48898. , l = a.geometry
  48899. , c = void 0 === n ? a.material : n
  48900. , h = a.group;
  48901. if (s.modelViewMatrix.multiplyMatrices(t.matrixWorldInverse, s.matrixWorld),
  48902. s.normalMatrix.getNormalMatrix(s.modelViewMatrix),
  48903. s instanceof Ci.ImmediateRenderObject) {
  48904. R(c);
  48905. var u = P(t, i, c, s);
  48906. ee = "",
  48907. s.render(function(e) {
  48908. Z.renderBufferImmediate(e, u, c)
  48909. })
  48910. } else
  48911. Z.renderBufferDirect(t, i, l, c, s, h)
  48912. }
  48913. }
  48914. function R(e) {
  48915. (function(e) {
  48916. e.side !== Ci.DoubleSide ? _e.enable(X.CULL_FACE) : _e.disable(X.CULL_FACE),
  48917. _e.setFlipSided(e.side === Ci.BackSide)
  48918. }
  48919. )(e),
  48920. !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),
  48921. _e.setDepthFunc(e.depthFunc),
  48922. _e.setDepthTest(e.depthTest),
  48923. _e.setDepthWrite(e.depthWrite),
  48924. _e.setColorWrite(e.colorWrite),
  48925. _e.setPolygonOffset(e.polygonOffset, e.polygonOffsetFactor, e.polygonOffsetUnits)
  48926. }
  48927. function P(e, t, i, n) {
  48928. oe = 0;
  48929. var r = be.get(i);
  48930. void 0 === r.program && (i.needsUpdate = !0),
  48931. void 0 !== r.lightsHash && r.lightsHash !== ve.hash && (i.needsUpdate = !0),
  48932. i.needsUpdate && (function(e, t, i) {
  48933. var n = be.get(e)
  48934. , r = Te.getParameters(e, ve, t, i)
  48935. , o = Te.getProgramCode(e, r)
  48936. , a = n.program
  48937. , s = !0;
  48938. if (void 0 === a)
  48939. e.addEventListener("dispose", v);
  48940. else if (a.code !== o)
  48941. y(e);
  48942. else {
  48943. if (void 0 !== r.shaderID)
  48944. return;
  48945. s = !1
  48946. }
  48947. if (s) {
  48948. if (r.shaderID) {
  48949. var l = Ci.ShaderLib[r.shaderID];
  48950. n.__webglShader = {
  48951. name: e.type,
  48952. uniforms: Ci.UniformsUtils.clone(l.uniforms),
  48953. vertexShader: l.vertexShader,
  48954. fragmentShader: l.fragmentShader
  48955. }
  48956. } else
  48957. n.__webglShader = {
  48958. name: e.type,
  48959. uniforms: e.uniforms,
  48960. vertexShader: e.vertexShader,
  48961. fragmentShader: e.fragmentShader
  48962. };
  48963. e.__webglShader = n.__webglShader,
  48964. a = Te.acquireProgram(e, r, o),
  48965. n.program = a,
  48966. e.program = a
  48967. }
  48968. var c = a.getAttributes();
  48969. if (e.morphTargets)
  48970. for (var h = e.numSupportedMorphTargets = 0; h < Z.maxMorphTargets; h++)
  48971. 0 <= c["morphTarget" + h] && e.numSupportedMorphTargets++;
  48972. if (e.morphNormals)
  48973. for (h = e.numSupportedMorphNormals = 0; h < Z.maxMorphNormals; h++)
  48974. 0 <= c["morphNormal" + h] && e.numSupportedMorphNormals++;
  48975. n.uniformsList = [];
  48976. var u = n.__webglShader.uniforms
  48977. , d = n.program.getUniforms();
  48978. for (var p in u) {
  48979. var f = d[p];
  48980. f && n.uniformsList.push([n.__webglShader.uniforms[p], f])
  48981. }
  48982. (e instanceof Ci.MeshPhongMaterial || e instanceof Ci.MeshLambertMaterial || e instanceof Ci.MeshStandardMaterial || e.lights) && (n.lightsHash = ve.hash,
  48983. u.ambientLightColor.value = ve.ambient,
  48984. u.directionalLights.value = ve.directional,
  48985. u.spotLights.value = ve.spot,
  48986. u.pointLights.value = ve.point,
  48987. u.hemisphereLights.value = ve.hemi,
  48988. u.directionalShadowMap.value = ve.directionalShadowMap,
  48989. u.directionalShadowMatrix.value = ve.directionalShadowMatrix,
  48990. u.spotShadowMap.value = ve.spotShadowMap,
  48991. u.spotShadowMatrix.value = ve.spotShadowMatrix,
  48992. u.pointShadowMap.value = ve.pointShadowMap,
  48993. u.pointShadowMatrix.value = ve.pointShadowMatrix),
  48994. n.hasDynamicUniforms = !1;
  48995. for (var g = 0, m = n.uniformsList.length; g < m; g++) {
  48996. if (!0 === n.uniformsList[g][0].dynamic) {
  48997. n.hasDynamicUniforms = !0;
  48998. break
  48999. }
  49000. }
  49001. }(i, t, n),
  49002. i.needsUpdate = !1);
  49003. var o = !1
  49004. , a = !1
  49005. , s = !1
  49006. , l = r.program
  49007. , c = l.getUniforms()
  49008. , h = r.__webglShader.uniforms;
  49009. if (l.id !== K && (X.useProgram(l.program),
  49010. K = l.id,
  49011. s = a = o = !0),
  49012. i.id !== $ && ($ = i.id,
  49013. a = !0),
  49014. !o && e === te || (X.uniformMatrix4fv(c.projectionMatrix, !1, e.projectionMatrix.elements),
  49015. Ee.logarithmicDepthBuffer && X.uniform1f(c.logDepthBufFC, 2 / (Math.log(e.far + 1) / Math.LN2)),
  49016. e !== te && (te = e,
  49017. s = a = !0),
  49018. (i instanceof Ci.ShaderMaterial || i instanceof Ci.MeshPhongMaterial || i instanceof Ci.MeshStandardMaterial || i.envMap) && void 0 !== c.cameraPosition && (me.setFromMatrixPosition(e.matrixWorld),
  49019. X.uniform3f(c.cameraPosition, me.x, me.y, me.z)),
  49020. (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),
  49021. void 0 !== c.toneMappingExposure && X.uniform1f(c.toneMappingExposure, Z.toneMappingExposure),
  49022. void 0 !== c.toneMappingWhitePoint && X.uniform1f(c.toneMappingWhitePoint, Z.toneMappingWhitePoint)),
  49023. i.skinning)
  49024. if (n.bindMatrix && void 0 !== c.bindMatrix && X.uniformMatrix4fv(c.bindMatrix, !1, n.bindMatrix.elements),
  49025. n.bindMatrixInverse && void 0 !== c.bindMatrixInverse && X.uniformMatrix4fv(c.bindMatrixInverse, !1, n.bindMatrixInverse.elements),
  49026. Ee.floatVertexTextures && n.skeleton && n.skeleton.useVertexTexture) {
  49027. if (void 0 !== c.boneTexture) {
  49028. var u = A();
  49029. X.uniform1i(c.boneTexture, u),
  49030. Z.setTexture(n.skeleton.boneTexture, u)
  49031. }
  49032. void 0 !== c.boneTextureWidth && X.uniform1i(c.boneTextureWidth, n.skeleton.boneTextureWidth),
  49033. void 0 !== c.boneTextureHeight && X.uniform1i(c.boneTextureHeight, n.skeleton.boneTextureHeight)
  49034. } else
  49035. n.skeleton && n.skeleton.boneMatrices && void 0 !== c.boneGlobalMatrices && X.uniformMatrix4fv(c.boneGlobalMatrices, !1, n.skeleton.boneMatrices);
  49036. return a && ((i instanceof Ci.MeshPhongMaterial || i instanceof Ci.MeshLambertMaterial || i instanceof Ci.MeshStandardMaterial || i.lights) && function(e, t) {
  49037. e.ambientLightColor.needsUpdate = t,
  49038. e.directionalLights.needsUpdate = t,
  49039. e.pointLights.needsUpdate = t,
  49040. e.spotLights.needsUpdate = t,
  49041. e.hemisphereLights.needsUpdate = t
  49042. }(h, s),
  49043. t && i.fog && function(e, t) {
  49044. e.fogColor.value = t.color,
  49045. t instanceof Ci.Fog ? (e.fogNear.value = t.near,
  49046. e.fogFar.value = t.far) : t instanceof Ci.FogExp2 && (e.fogDensity.value = t.density)
  49047. }(h, t),
  49048. (i instanceof Ci.MeshBasicMaterial || i instanceof Ci.MeshLambertMaterial || i instanceof Ci.MeshPhongMaterial || i instanceof Ci.MeshStandardMaterial) && function(e, t) {
  49049. var i;
  49050. if (e.opacity.value = t.opacity,
  49051. e.diffuse.value = t.color,
  49052. t.emissive && e.emissive.value.copy(t.emissive).multiplyScalar(t.emissiveIntensity),
  49053. e.map.value = t.map,
  49054. e.specularMap.value = t.specularMap,
  49055. e.alphaMap.value = t.alphaMap,
  49056. t.aoMap && (e.aoMap.value = t.aoMap,
  49057. e.aoMapIntensity.value = t.aoMapIntensity),
  49058. 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),
  49059. void 0 !== i) {
  49060. i instanceof Ci.WebGLRenderTarget && (i = i.texture);
  49061. var n = i.offset
  49062. , r = i.repeat;
  49063. e.offsetRepeat.value.set(n.x, n.y, r.x, r.y)
  49064. }
  49065. e.envMap.value = t.envMap,
  49066. e.flipEnvMap.value = t.envMap instanceof Ci.WebGLRenderTargetCube ? 1 : -1,
  49067. e.reflectivity.value = t.reflectivity,
  49068. e.refractionRatio.value = t.refractionRatio
  49069. }(h, i),
  49070. i instanceof Ci.LineBasicMaterial ? p(h, i) : i instanceof Ci.LineDashedMaterial ? (p(h, i),
  49071. function(e, t) {
  49072. e.dashSize.value = t.dashSize,
  49073. e.totalSize.value = t.dashSize + t.gapSize,
  49074. e.scale.value = t.scale
  49075. }(h, i)) : i instanceof Ci.PointsMaterial ? function(e, t) {
  49076. if (e.diffuse.value = t.color,
  49077. e.opacity.value = t.opacity,
  49078. e.size.value = t.size * he,
  49079. e.scale.value = O.clientHeight / 2,
  49080. e.map.value = t.map,
  49081. null !== t.map) {
  49082. var i = t.map.offset
  49083. , n = t.map.repeat;
  49084. e.offsetRepeat.value.set(i.x, i.y, n.x, n.y)
  49085. }
  49086. }(h, i) : i instanceof Ci.MeshLambertMaterial ? function(e, t) {
  49087. t.lightMap && (e.lightMap.value = t.lightMap,
  49088. e.lightMapIntensity.value = t.lightMapIntensity),
  49089. t.emissiveMap && (e.emissiveMap.value = t.emissiveMap)
  49090. }(h, i) : i instanceof Ci.MeshPhongMaterial ? function(e, t) {
  49091. e.specular.value = t.specular,
  49092. e.shininess.value = Math.max(t.shininess, 1e-4),
  49093. t.lightMap && (e.lightMap.value = t.lightMap,
  49094. e.lightMapIntensity.value = t.lightMapIntensity),
  49095. t.emissiveMap && (e.emissiveMap.value = t.emissiveMap),
  49096. t.bumpMap && (e.bumpMap.value = t.bumpMap,
  49097. e.bumpScale.value = t.bumpScale),
  49098. t.normalMap && (e.normalMap.value = t.normalMap,
  49099. e.normalScale.value.copy(t.normalScale)),
  49100. t.displacementMap && (e.displacementMap.value = t.displacementMap,
  49101. e.displacementScale.value = t.displacementScale,
  49102. e.displacementBias.value = t.displacementBias)
  49103. }(h, i) : i instanceof Ci.MeshStandardMaterial ? function(e, t) {
  49104. e.roughness.value = t.roughness,
  49105. e.metalness.value = t.metalness,
  49106. t.roughnessMap && (e.roughnessMap.value = t.roughnessMap),
  49107. t.metalnessMap && (e.metalnessMap.value = t.metalnessMap),
  49108. t.lightMap && (e.lightMap.value = t.lightMap,
  49109. e.lightMapIntensity.value = t.lightMapIntensity),
  49110. t.emissiveMap && (e.emissiveMap.value = t.emissiveMap),
  49111. t.bumpMap && (e.bumpMap.value = t.bumpMap,
  49112. e.bumpScale.value = t.bumpScale),
  49113. t.normalMap && (e.normalMap.value = t.normalMap,
  49114. e.normalScale.value.copy(t.normalScale)),
  49115. t.displacementMap && (e.displacementMap.value = t.displacementMap,
  49116. e.displacementScale.value = t.displacementScale,
  49117. e.displacementBias.value = t.displacementBias),
  49118. t.envMap && (e.envMapIntensity.value = t.envMapIntensity)
  49119. }(h, i) : i instanceof Ci.MeshDepthMaterial ? (h.mNear.value = e.near,
  49120. h.mFar.value = e.far,
  49121. h.opacity.value = i.opacity) : i instanceof Ci.MeshNormalMaterial && (h.opacity.value = i.opacity),
  49122. g(r.uniformsList)),
  49123. function(e, t) {
  49124. X.uniformMatrix4fv(e.modelViewMatrix, !1, t.modelViewMatrix.elements),
  49125. e.normalMatrix && X.uniformMatrix3fv(e.normalMatrix, !1, t.normalMatrix.elements)
  49126. }(c, n),
  49127. void 0 !== c.modelMatrix && X.uniformMatrix4fv(c.modelMatrix, !1, n.matrixWorld.elements),
  49128. !0 === r.hasDynamicUniforms && function(e, t, i) {
  49129. for (var n = [], r = 0, o = e.length; r < o; r++) {
  49130. var a = e[r][0]
  49131. , s = a.onUpdateCallback;
  49132. void 0 !== s && (s.bind(a)(t, i),
  49133. n.push(e[r]))
  49134. }
  49135. g(n)
  49136. }(r.uniformsList, n, e),
  49137. l
  49138. }
  49139. function p(e, t) {
  49140. e.diffuse.value = t.color,
  49141. e.opacity.value = t.opacity
  49142. }
  49143. function A() {
  49144. var e = oe;
  49145. return e >= Ee.maxTextures && console.warn("WebGLRenderer: trying to use " + e + " texture units while this GPU supports only " + Ee.maxTextures),
  49146. oe += 1,
  49147. e
  49148. }
  49149. function C(e, t, i, n) {
  49150. var r, o;
  49151. if ("1i" === t)
  49152. X.uniform1i(i, n);
  49153. else if ("1f" === t)
  49154. X.uniform1f(i, n);
  49155. else if ("2f" === t)
  49156. X.uniform2f(i, n[0], n[1]);
  49157. else if ("3f" === t)
  49158. X.uniform3f(i, n[0], n[1], n[2]);
  49159. else if ("4f" === t)
  49160. X.uniform4f(i, n[0], n[1], n[2], n[3]);
  49161. else if ("1iv" === t)
  49162. X.uniform1iv(i, n);
  49163. else if ("3iv" === t)
  49164. X.uniform3iv(i, n);
  49165. else if ("1fv" === t)
  49166. X.uniform1fv(i, n);
  49167. else if ("2fv" === t)
  49168. X.uniform2fv(i, n);
  49169. else if ("3fv" === t)
  49170. X.uniform3fv(i, n);
  49171. else if ("4fv" === t)
  49172. X.uniform4fv(i, n);
  49173. else if ("Matrix2fv" === t)
  49174. X.uniformMatrix2fv(i, !1, n);
  49175. else if ("Matrix3fv" === t)
  49176. X.uniformMatrix3fv(i, !1, n);
  49177. else if ("Matrix4fv" === t)
  49178. X.uniformMatrix4fv(i, !1, n);
  49179. else if ("i" === t)
  49180. X.uniform1i(i, n);
  49181. else if ("f" === t)
  49182. X.uniform1f(i, n);
  49183. else if ("v2" === t)
  49184. X.uniform2f(i, n.x, n.y);
  49185. else if ("v3" === t)
  49186. X.uniform3f(i, n.x, n.y, n.z);
  49187. else if ("v4" === t)
  49188. X.uniform4f(i, n.x, n.y, n.z, n.w);
  49189. else if ("c" === t)
  49190. X.uniform3f(i, n.r, n.g, n.b);
  49191. else if ("s" === t) {
  49192. var a = e.properties;
  49193. for (var s in a) {
  49194. var l = a[s]
  49195. , c = i[s]
  49196. , h = n[s];
  49197. C(l, l.type, c, h)
  49198. }
  49199. } else if ("sa" === t) {
  49200. a = e.properties;
  49201. for (var u = 0, d = n.length; u < d; u++)
  49202. for (var s in a) {
  49203. l = a[s],
  49204. c = i[u][s],
  49205. h = n[u][s];
  49206. C(l, l.type, c, h)
  49207. }
  49208. } else if ("iv1" === t)
  49209. X.uniform1iv(i, n);
  49210. else if ("iv" === t)
  49211. X.uniform3iv(i, n);
  49212. else if ("fv1" === t)
  49213. X.uniform1fv(i, n);
  49214. else if ("fv" === t)
  49215. X.uniform3fv(i, n);
  49216. else if ("v2v" === t) {
  49217. void 0 === e._array && (e._array = new Float32Array(2 * n.length));
  49218. u = 0;
  49219. for (var p = 0, f = n.length; u < f; u++,
  49220. p += 2)
  49221. e._array[p + 0] = n[u].x,
  49222. e._array[p + 1] = n[u].y;
  49223. X.uniform2fv(i, e._array)
  49224. } else if ("v3v" === t) {
  49225. void 0 === e._array && (e._array = new Float32Array(3 * n.length));
  49226. u = 0;
  49227. var g = 0;
  49228. for (f = n.length; u < f; u++,
  49229. g += 3)
  49230. e._array[g + 0] = n[u].x,
  49231. e._array[g + 1] = n[u].y,
  49232. e._array[g + 2] = n[u].z;
  49233. X.uniform3fv(i, e._array)
  49234. } else if ("v4v" === t) {
  49235. void 0 === e._array && (e._array = new Float32Array(4 * n.length));
  49236. u = 0;
  49237. var m = 0;
  49238. for (f = n.length; u < f; u++,
  49239. m += 4)
  49240. e._array[m + 0] = n[u].x,
  49241. e._array[m + 1] = n[u].y,
  49242. e._array[m + 2] = n[u].z,
  49243. e._array[m + 3] = n[u].w;
  49244. X.uniform4fv(i, e._array)
  49245. } else if ("m2" === t)
  49246. X.uniformMatrix2fv(i, !1, n.elements);
  49247. else if ("m3" === t)
  49248. X.uniformMatrix3fv(i, !1, n.elements);
  49249. else if ("m3v" === t) {
  49250. void 0 === e._array && (e._array = new Float32Array(9 * n.length));
  49251. for (u = 0,
  49252. f = n.length; u < f; u++)
  49253. n[u].flattenToArrayOffset(e._array, 9 * u);
  49254. X.uniformMatrix3fv(i, !1, e._array)
  49255. } else if ("m4" === t)
  49256. X.uniformMatrix4fv(i, !1, n.elements);
  49257. else if ("m4v" === t) {
  49258. void 0 === e._array && (e._array = new Float32Array(16 * n.length));
  49259. for (u = 0,
  49260. f = n.length; u < f; u++)
  49261. n[u].flattenToArrayOffset(e._array, 16 * u);
  49262. X.uniformMatrix4fv(i, !1, e._array)
  49263. } else if ("t" === t) {
  49264. if (r = n,
  49265. o = A(),
  49266. X.uniform1i(i, o),
  49267. !r)
  49268. return;
  49269. 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)
  49270. } else if ("tv" === t) {
  49271. void 0 === e._array && (e._array = []);
  49272. for (u = 0,
  49273. f = e.value.length; u < f; u++)
  49274. e._array[u] = A();
  49275. X.uniform1iv(i, e._array);
  49276. for (u = 0,
  49277. f = e.value.length; u < f; u++)
  49278. r = e.value[u],
  49279. o = e._array[u],
  49280. 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))
  49281. } else
  49282. console.warn("THREE.WebGLRenderer: Unknown uniform type: " + t)
  49283. }
  49284. function g(e) {
  49285. for (var t = 0, i = e.length; t < i; t++) {
  49286. var n = e[t][0];
  49287. if (!1 !== n.needsUpdate)
  49288. C(n, n.type, e[t][1], n.value)
  49289. }
  49290. }
  49291. function m(e, t, i) {
  49292. var n;
  49293. if (i ? (X.texParameteri(e, X.TEXTURE_WRAP_S, x(t.wrapS)),
  49294. X.texParameteri(e, X.TEXTURE_WRAP_T, x(t.wrapT)),
  49295. X.texParameteri(e, X.TEXTURE_MAG_FILTER, x(t.magFilter)),
  49296. X.texParameteri(e, X.TEXTURE_MIN_FILTER, x(t.minFilter))) : (X.texParameteri(e, X.TEXTURE_WRAP_S, X.CLAMP_TO_EDGE),
  49297. X.texParameteri(e, X.TEXTURE_WRAP_T, X.CLAMP_TO_EDGE),
  49298. 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),
  49299. X.texParameteri(e, X.TEXTURE_MAG_FILTER, T(t.magFilter)),
  49300. X.texParameteri(e, X.TEXTURE_MIN_FILTER, T(t.minFilter)),
  49301. 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)),
  49302. n = Ie.get("EXT_texture_filter_anisotropic")) {
  49303. if (t.type === Ci.FloatType && null === Ie.get("OES_texture_float_linear"))
  49304. return;
  49305. if (t.type === Ci.HalfFloatType && null === Ie.get("OES_texture_half_float_linear"))
  49306. return;
  49307. (1 < t.anisotropy || be.get(t).__currentAnisotropy) && (X.texParameterf(e, n.TEXTURE_MAX_ANISOTROPY_EXT, Math.min(t.anisotropy, Z.getMaxAnisotropy())),
  49308. be.get(t).__currentAnisotropy = t.anisotropy)
  49309. }
  49310. }
  49311. function o(e, t, i) {
  49312. void 0 === e.__webglInit && (e.__webglInit = !0,
  49313. t.addEventListener("dispose", f),
  49314. e.__webglTexture = X.createTexture(),
  49315. ye.textures++),
  49316. _e.activeTexture(X.TEXTURE0 + i),
  49317. _e.bindTexture(X.TEXTURE_2D, e.__webglTexture),
  49318. X.pixelStorei(X.UNPACK_FLIP_Y_WEBGL, t.flipY),
  49319. X.pixelStorei(X.UNPACK_PREMULTIPLY_ALPHA_WEBGL, t.premultiplyAlpha),
  49320. X.pixelStorei(X.UNPACK_ALIGNMENT, t.unpackAlignment);
  49321. var n = I(t.image, Ee.maxTextureSize);
  49322. !function(e) {
  49323. return e.wrapS !== Ci.ClampToEdgeWrapping || e.wrapT !== Ci.ClampToEdgeWrapping || e.minFilter !== Ci.NearestFilter && e.minFilter !== Ci.LinearFilter
  49324. }(t) || !1 !== E(n) || (n = function(e) {
  49325. if (e instanceof HTMLImageElement || e instanceof HTMLCanvasElement) {
  49326. var t = document.createElement("canvas");
  49327. return t.width = Ci.Math.nearestPowerOfTwo(e.width),
  49328. t.height = Ci.Math.nearestPowerOfTwo(e.height),
  49329. t.getContext("2d").drawImage(e, 0, 0, t.width, t.height),
  49330. console.warn("THREE.WebGLRenderer: image is not power of two (" + e.width + "x" + e.height + "). Resized to " + t.width + "x" + t.height, e),
  49331. t
  49332. }
  49333. return e
  49334. }(n));
  49335. var r = E(n)
  49336. , o = x(t.format)
  49337. , a = x(t.type);
  49338. m(X.TEXTURE_2D, t, r);
  49339. var s, l = t.mipmaps;
  49340. if (t instanceof Ci.DataTexture)
  49341. if (0 < l.length && r) {
  49342. for (var c = 0, h = l.length; c < h; c++)
  49343. s = l[c],
  49344. _e.texImage2D(X.TEXTURE_2D, c, o, s.width, s.height, 0, o, a, s.data);
  49345. t.generateMipmaps = !1
  49346. } else
  49347. _e.texImage2D(X.TEXTURE_2D, 0, o, n.width, n.height, 0, o, a, n.data);
  49348. else if (t instanceof Ci.CompressedTexture)
  49349. for (c = 0,
  49350. h = l.length; c < h; c++)
  49351. s = l[c],
  49352. 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);
  49353. else if (0 < l.length && r) {
  49354. for (c = 0,
  49355. h = l.length; c < h; c++)
  49356. s = l[c],
  49357. _e.texImage2D(X.TEXTURE_2D, c, o, o, a, s);
  49358. t.generateMipmaps = !1
  49359. } else
  49360. _e.texImage2D(X.TEXTURE_2D, 0, o, o, a, n);
  49361. t.generateMipmaps && r && X.generateMipmap(X.TEXTURE_2D),
  49362. e.__version = t.version,
  49363. t.onUpdate && t.onUpdate(t)
  49364. }
  49365. function I(e, t) {
  49366. if (e.width > t || e.height > t) {
  49367. var i = t / Math.max(e.width, e.height)
  49368. , n = document.createElement("canvas");
  49369. return n.width = Math.floor(e.width * i),
  49370. n.height = Math.floor(e.height * i),
  49371. n.getContext("2d").drawImage(e, 0, 0, e.width, e.height, 0, 0, n.width, n.height),
  49372. console.warn("THREE.WebGLRenderer: image is too big (" + e.width + "x" + e.height + "). Resized to " + n.width + "x" + n.height, e),
  49373. n
  49374. }
  49375. return e
  49376. }
  49377. function E(e) {
  49378. return Ci.Math.isPowerOfTwo(e.width) && Ci.Math.isPowerOfTwo(e.height)
  49379. }
  49380. function _(e, t) {
  49381. var i = be.get(e);
  49382. if (6 === e.image.length)
  49383. if (0 < e.version && i.__version !== e.version) {
  49384. i.__image__webglTextureCube || (e.addEventListener("dispose", f),
  49385. i.__image__webglTextureCube = X.createTexture(),
  49386. ye.textures++),
  49387. _e.activeTexture(X.TEXTURE0 + t),
  49388. _e.bindTexture(X.TEXTURE_CUBE_MAP, i.__image__webglTextureCube),
  49389. X.pixelStorei(X.UNPACK_FLIP_Y_WEBGL, e.flipY);
  49390. for (var n = e instanceof Ci.CompressedTexture, r = e.image[0]instanceof Ci.DataTexture, o = [], a = 0; a < 6; a++)
  49391. !Z.autoScaleCubemaps || n || r ? o[a] = r ? e.image[a].image : e.image[a] : o[a] = I(e.image[a], Ee.maxCubemapSize);
  49392. var s = E(o[0])
  49393. , l = x(e.format)
  49394. , c = x(e.type);
  49395. m(X.TEXTURE_CUBE_MAP, e, s);
  49396. for (a = 0; a < 6; a++)
  49397. if (n)
  49398. for (var h, u = o[a].mipmaps, d = 0, p = u.length; d < p; d++)
  49399. h = u[d],
  49400. 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);
  49401. else
  49402. 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]);
  49403. e.generateMipmaps && s && X.generateMipmap(X.TEXTURE_CUBE_MAP),
  49404. i.__version = e.version,
  49405. e.onUpdate && e.onUpdate(e)
  49406. } else
  49407. _e.activeTexture(X.TEXTURE0 + t),
  49408. _e.bindTexture(X.TEXTURE_CUBE_MAP, i.__image__webglTextureCube)
  49409. }
  49410. function b(e, t) {
  49411. _e.activeTexture(X.TEXTURE0 + t),
  49412. _e.bindTexture(X.TEXTURE_CUBE_MAP, be.get(e).__webglTexture)
  49413. }
  49414. function h(e, t, i, n) {
  49415. var r = x(t.texture.format)
  49416. , o = x(t.texture.type);
  49417. _e.texImage2D(n, 0, r, t.width, t.height, 0, r, o, null),
  49418. X.bindFramebuffer(X.FRAMEBUFFER, e),
  49419. X.framebufferTexture2D(X.FRAMEBUFFER, i, n, be.get(t.texture).__webglTexture, 0),
  49420. X.bindFramebuffer(X.FRAMEBUFFER, null)
  49421. }
  49422. function u(e, t) {
  49423. X.bindRenderbuffer(X.RENDERBUFFER, e),
  49424. t.depthBuffer && !t.stencilBuffer ? (X.renderbufferStorage(X.RENDERBUFFER, X.DEPTH_COMPONENT16, t.width, t.height),
  49425. 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),
  49426. X.framebufferRenderbuffer(X.FRAMEBUFFER, X.DEPTH_STENCIL_ATTACHMENT, X.RENDERBUFFER, e)) : X.renderbufferStorage(X.RENDERBUFFER, X.RGBA4, t.width, t.height),
  49427. X.bindRenderbuffer(X.RENDERBUFFER, null)
  49428. }
  49429. function w(e) {
  49430. var t = be.get(e)
  49431. , i = be.get(e.texture);
  49432. e.addEventListener("dispose", a),
  49433. i.__webglTexture = X.createTexture(),
  49434. ye.textures++;
  49435. var n = e instanceof Ci.WebGLRenderTargetCube
  49436. , r = Ci.Math.isPowerOfTwo(e.width) && Ci.Math.isPowerOfTwo(e.height);
  49437. if (n) {
  49438. t.__webglFramebuffer = [];
  49439. for (var o = 0; o < 6; o++)
  49440. t.__webglFramebuffer[o] = X.createFramebuffer()
  49441. } else
  49442. t.__webglFramebuffer = X.createFramebuffer();
  49443. if (n) {
  49444. _e.bindTexture(X.TEXTURE_CUBE_MAP, i.__webglTexture),
  49445. m(X.TEXTURE_CUBE_MAP, e.texture, r);
  49446. for (o = 0; o < 6; o++)
  49447. h(t.__webglFramebuffer[o], e, X.COLOR_ATTACHMENT0, X.TEXTURE_CUBE_MAP_POSITIVE_X + o);
  49448. e.texture.generateMipmaps && r && X.generateMipmap(X.TEXTURE_CUBE_MAP),
  49449. _e.bindTexture(X.TEXTURE_CUBE_MAP, null)
  49450. } else
  49451. _e.bindTexture(X.TEXTURE_2D, i.__webglTexture),
  49452. m(X.TEXTURE_2D, e.texture, r),
  49453. h(t.__webglFramebuffer, e, X.COLOR_ATTACHMENT0, X.TEXTURE_2D),
  49454. e.texture.generateMipmaps && r && X.generateMipmap(X.TEXTURE_2D),
  49455. _e.bindTexture(X.TEXTURE_2D, null);
  49456. e.depthBuffer && function(e) {
  49457. var t = be.get(e);
  49458. if (e instanceof Ci.WebGLRenderTargetCube) {
  49459. t.__webglDepthbuffer = [];
  49460. for (var i = 0; i < 6; i++)
  49461. X.bindFramebuffer(X.FRAMEBUFFER, t.__webglFramebuffer[i]),
  49462. t.__webglDepthbuffer[i] = X.createRenderbuffer(),
  49463. u(t.__webglDepthbuffer[i], e)
  49464. } else
  49465. X.bindFramebuffer(X.FRAMEBUFFER, t.__webglFramebuffer),
  49466. t.__webglDepthbuffer = X.createRenderbuffer(),
  49467. u(t.__webglDepthbuffer, e);
  49468. X.bindFramebuffer(X.FRAMEBUFFER, null)
  49469. }(e)
  49470. }
  49471. function T(e) {
  49472. return e === Ci.NearestFilter || e === Ci.NearestMipMapNearestFilter || e === Ci.NearestMipMapLinearFilter ? X.NEAREST : X.LINEAR
  49473. }
  49474. function x(e) {
  49475. var t;
  49476. if (e === Ci.RepeatWrapping)
  49477. return X.REPEAT;
  49478. if (e === Ci.ClampToEdgeWrapping)
  49479. return X.CLAMP_TO_EDGE;
  49480. if (e === Ci.MirroredRepeatWrapping)
  49481. return X.MIRRORED_REPEAT;
  49482. if (e === Ci.NearestFilter)
  49483. return X.NEAREST;
  49484. if (e === Ci.NearestMipMapNearestFilter)
  49485. return X.NEAREST_MIPMAP_NEAREST;
  49486. if (e === Ci.NearestMipMapLinearFilter)
  49487. return X.NEAREST_MIPMAP_LINEAR;
  49488. if (e === Ci.LinearFilter)
  49489. return X.LINEAR;
  49490. if (e === Ci.LinearMipMapNearestFilter)
  49491. return X.LINEAR_MIPMAP_NEAREST;
  49492. if (e === Ci.LinearMipMapLinearFilter)
  49493. return X.LINEAR_MIPMAP_LINEAR;
  49494. if (e === Ci.UnsignedByteType)
  49495. return X.UNSIGNED_BYTE;
  49496. if (e === Ci.UnsignedShort4444Type)
  49497. return X.UNSIGNED_SHORT_4_4_4_4;
  49498. if (e === Ci.UnsignedShort5551Type)
  49499. return X.UNSIGNED_SHORT_5_5_5_1;
  49500. if (e === Ci.UnsignedShort565Type)
  49501. return X.UNSIGNED_SHORT_5_6_5;
  49502. if (e === Ci.ByteType)
  49503. return X.BYTE;
  49504. if (e === Ci.ShortType)
  49505. return X.SHORT;
  49506. if (e === Ci.UnsignedShortType)
  49507. return X.UNSIGNED_SHORT;
  49508. if (e === Ci.IntType)
  49509. return X.INT;
  49510. if (e === Ci.UnsignedIntType)
  49511. return X.UNSIGNED_INT;
  49512. if (e === Ci.FloatType)
  49513. return X.FLOAT;
  49514. if (null !== (t = Ie.get("OES_texture_half_float")) && e === Ci.HalfFloatType)
  49515. return t.HALF_FLOAT_OES;
  49516. if (e === Ci.AlphaFormat)
  49517. return X.ALPHA;
  49518. if (e === Ci.RGBFormat)
  49519. return X.RGB;
  49520. if (e === Ci.RGBAFormat)
  49521. return X.RGBA;
  49522. if (e === Ci.LuminanceFormat)
  49523. return X.LUMINANCE;
  49524. if (e === Ci.LuminanceAlphaFormat)
  49525. return X.LUMINANCE_ALPHA;
  49526. if (e === Ci.AddEquation)
  49527. return X.FUNC_ADD;
  49528. if (e === Ci.SubtractEquation)
  49529. return X.FUNC_SUBTRACT;
  49530. if (e === Ci.ReverseSubtractEquation)
  49531. return X.FUNC_REVERSE_SUBTRACT;
  49532. if (e === Ci.ZeroFactor)
  49533. return X.ZERO;
  49534. if (e === Ci.OneFactor)
  49535. return X.ONE;
  49536. if (e === Ci.SrcColorFactor)
  49537. return X.SRC_COLOR;
  49538. if (e === Ci.OneMinusSrcColorFactor)
  49539. return X.ONE_MINUS_SRC_COLOR;
  49540. if (e === Ci.SrcAlphaFactor)
  49541. return X.SRC_ALPHA;
  49542. if (e === Ci.OneMinusSrcAlphaFactor)
  49543. return X.ONE_MINUS_SRC_ALPHA;
  49544. if (e === Ci.DstAlphaFactor)
  49545. return X.DST_ALPHA;
  49546. if (e === Ci.OneMinusDstAlphaFactor)
  49547. return X.ONE_MINUS_DST_ALPHA;
  49548. if (e === Ci.DstColorFactor)
  49549. return X.DST_COLOR;
  49550. if (e === Ci.OneMinusDstColorFactor)
  49551. return X.ONE_MINUS_DST_COLOR;
  49552. if (e === Ci.SrcAlphaSaturateFactor)
  49553. return X.SRC_ALPHA_SATURATE;
  49554. if (null !== (t = Ie.get("WEBGL_compressed_texture_s3tc"))) {
  49555. if (e === Ci.RGB_S3TC_DXT1_Format)
  49556. return t.COMPRESSED_RGB_S3TC_DXT1_EXT;
  49557. if (e === Ci.RGBA_S3TC_DXT1_Format)
  49558. return t.COMPRESSED_RGBA_S3TC_DXT1_EXT;
  49559. if (e === Ci.RGBA_S3TC_DXT3_Format)
  49560. return t.COMPRESSED_RGBA_S3TC_DXT3_EXT;
  49561. if (e === Ci.RGBA_S3TC_DXT5_Format)
  49562. return t.COMPRESSED_RGBA_S3TC_DXT5_EXT
  49563. }
  49564. if (null !== (t = Ie.get("WEBGL_compressed_texture_pvrtc"))) {
  49565. if (e === Ci.RGB_PVRTC_4BPPV1_Format)
  49566. return t.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;
  49567. if (e === Ci.RGB_PVRTC_2BPPV1_Format)
  49568. return t.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;
  49569. if (e === Ci.RGBA_PVRTC_4BPPV1_Format)
  49570. return t.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;
  49571. if (e === Ci.RGBA_PVRTC_2BPPV1_Format)
  49572. return t.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG
  49573. }
  49574. if (null !== (t = Ie.get("WEBGL_compressed_texture_etc1")) && e === Ci.RGB_ETC1_Format)
  49575. return t.COMPRESSED_RGB_ETC1_WEBGL;
  49576. if (null !== (t = Ie.get("EXT_blend_minmax"))) {
  49577. if (e === Ci.MinEquation)
  49578. return t.MIN_EXT;
  49579. if (e === Ci.MaxEquation)
  49580. return t.MAX_EXT
  49581. }
  49582. return 0
  49583. }
  49584. console.log("THREE.WebGLRenderer", Ci.REVISION);
  49585. var O = void 0 !== (e = e || {}).canvas ? e.canvas : document.createElement("canvas")
  49586. , L = void 0 !== e.context ? e.context : null
  49587. , D = void 0 !== e.alpha && e.alpha
  49588. , N = void 0 === e.depth || e.depth
  49589. , F = void 0 === e.stencil || e.stencil
  49590. , B = void 0 !== e.antialias && e.antialias
  49591. , V = void 0 === e.premultipliedAlpha || e.premultipliedAlpha
  49592. , k = void 0 !== e.preserveDrawingBuffer && e.preserveDrawingBuffer
  49593. , U = []
  49594. , H = []
  49595. , z = -1
  49596. , G = []
  49597. , W = -1
  49598. , j = new Float32Array(8)
  49599. , Y = []
  49600. , q = [];
  49601. this.domElement = O,
  49602. this.context = null,
  49603. this.autoClear = !0,
  49604. this.autoClearColor = !0,
  49605. this.autoClearDepth = !0,
  49606. this.autoClearStencil = !0,
  49607. this.sortObjects = !0,
  49608. this.gammaFactor = 2,
  49609. this.gammaInput = !1,
  49610. this.gammaOutput = !1,
  49611. this.physicallyCorrectLights = !1,
  49612. this.toneMapping = Ci.LinearToneMapping,
  49613. this.toneMappingExposure = 1,
  49614. this.toneMappingWhitePoint = 1,
  49615. this.maxMorphTargets = 8,
  49616. this.maxMorphNormals = 4,
  49617. this.autoScaleCubemaps = !0;
  49618. 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 = {
  49619. hash: "",
  49620. ambient: [0, 0, 0],
  49621. directional: [],
  49622. directionalShadowMap: [],
  49623. directionalShadowMatrix: [],
  49624. spot: [],
  49625. spotShadowMap: [],
  49626. spotShadowMatrix: [],
  49627. point: [],
  49628. pointShadowMap: [],
  49629. pointShadowMatrix: [],
  49630. hemi: [],
  49631. shadows: [],
  49632. shadowsPointLight: 0
  49633. }, ye = {
  49634. geometries: 0,
  49635. textures: 0
  49636. }, Ae = {
  49637. calls: 0,
  49638. vertices: 0,
  49639. faces: 0,
  49640. points: 0
  49641. };
  49642. this.info = {
  49643. render: Ae,
  49644. memory: ye,
  49645. programs: null
  49646. };
  49647. try {
  49648. var Ce = {
  49649. alpha: D,
  49650. depth: N,
  49651. stencil: F,
  49652. antialias: B,
  49653. premultipliedAlpha: V,
  49654. preserveDrawingBuffer: k
  49655. };
  49656. if (null === (X = L || O.getContext("webgl", Ce) || O.getContext("experimental-webgl", Ce)))
  49657. throw null !== O.getContext("webgl") ? "Error creating WebGL context with your selected attributes." : "Error creating WebGL context.";
  49658. void 0 === X.getShaderPrecisionFormat && (X.getShaderPrecisionFormat = function() {
  49659. return {
  49660. rangeMin: 1,
  49661. rangeMax: 1,
  49662. precision: 1
  49663. }
  49664. }
  49665. ),
  49666. O.addEventListener("webglcontextlost", r, !1)
  49667. } catch (e) {
  49668. console.error("THREE.WebGLRenderer: " + e)
  49669. }
  49670. var Ie = new Ci.WebGLExtensions(X);
  49671. Ie.get("OES_texture_float"),
  49672. Ie.get("OES_texture_float_linear"),
  49673. Ie.get("OES_texture_half_float"),
  49674. Ie.get("OES_texture_half_float_linear"),
  49675. Ie.get("OES_standard_derivatives"),
  49676. Ie.get("ANGLE_instanced_arrays"),
  49677. Ie.get("OES_element_index_uint") && (Ci.BufferGeometry.MaxIndex = 4294967296);
  49678. var Ee = new Ci.WebGLCapabilities(X,Ie,e)
  49679. , _e = new Ci.WebGLState(X,Ie,x)
  49680. , be = new Ci.WebGLProperties
  49681. , we = new Ci.WebGLObjects(X,be,this.info)
  49682. , Te = new Ci.WebGLPrograms(this,Ee)
  49683. , xe = new Ci.WebGLLights;
  49684. this.info.programs = Te.programs;
  49685. var Se = new Ci.WebGLBufferRenderer(X,Ie,Ae)
  49686. , Me = new Ci.WebGLIndexedBufferRenderer(X,Ie,Ae);
  49687. t(),
  49688. this.context = X,
  49689. this.capabilities = Ee,
  49690. this.extensions = Ie,
  49691. this.properties = be,
  49692. this.state = _e;
  49693. var Re = new Ci.WebGLShadowMap(this,ve,we);
  49694. this.shadowMap = Re;
  49695. var Pe, Oe = new Ci.SpritePlugin(this,Y), Le = new Ci.LensFlarePlugin(this,q);
  49696. this.getContext = function() {
  49697. return X
  49698. }
  49699. ,
  49700. this.getContextAttributes = function() {
  49701. return X.getContextAttributes()
  49702. }
  49703. ,
  49704. this.forceContextLoss = function() {
  49705. Ie.get("WEBGL_lose_context").loseContext()
  49706. }
  49707. ,
  49708. this.getMaxAnisotropy = function() {
  49709. if (void 0 !== Pe)
  49710. return Pe;
  49711. var e = Ie.get("EXT_texture_filter_anisotropic");
  49712. return Pe = null !== e ? X.getParameter(e.MAX_TEXTURE_MAX_ANISOTROPY_EXT) : 0
  49713. }
  49714. ,
  49715. this.getPrecision = function() {
  49716. return Ee.precision
  49717. }
  49718. ,
  49719. this.getPixelRatio = function() {
  49720. return he
  49721. }
  49722. ,
  49723. this.setPixelRatio = function(e) {
  49724. void 0 !== e && (he = e,
  49725. this.setSize(pe.z, pe.w, !1))
  49726. }
  49727. ,
  49728. this.getSize = function() {
  49729. return {
  49730. width: le,
  49731. height: ce
  49732. }
  49733. }
  49734. ,
  49735. this.setSize = function(e, t, i, n) {
  49736. null != n && (he = n),
  49737. le = e,
  49738. ce = t,
  49739. O.width = e * he,
  49740. O.height = t * he,
  49741. !1 !== i && (O.style.width = e + "px",
  49742. O.style.height = t + "px"),
  49743. this.setViewport(0, 0, e, t)
  49744. }
  49745. ,
  49746. this.setViewport = function(e, t, i, n) {
  49747. _e.viewport(pe.set(e, t, i, n))
  49748. }
  49749. ,
  49750. this.setScissor = function(e, t, i, n) {
  49751. _e.scissor(ue.set(e, t, i, n))
  49752. }
  49753. ,
  49754. this.setScissorTest = function(e) {
  49755. _e.setScissorTest(de = e)
  49756. }
  49757. ,
  49758. this.getClearColor = function() {
  49759. return ae
  49760. }
  49761. ,
  49762. this.setClearColor = function(e, t) {
  49763. ae.set(e),
  49764. se = void 0 !== t ? t : 1,
  49765. i(ae.r, ae.g, ae.b, se)
  49766. }
  49767. ,
  49768. this.getClearAlpha = function() {
  49769. return se
  49770. }
  49771. ,
  49772. this.setClearAlpha = function(e) {
  49773. se = e,
  49774. i(ae.r, ae.g, ae.b, se)
  49775. }
  49776. ,
  49777. this.clear = function(e, t, i) {
  49778. var n = 0;
  49779. void 0 !== e && !e || (n |= X.COLOR_BUFFER_BIT),
  49780. void 0 !== t && !t || (n |= X.DEPTH_BUFFER_BIT),
  49781. void 0 !== i && !i || (n |= X.STENCIL_BUFFER_BIT),
  49782. X.clear(n)
  49783. }
  49784. ,
  49785. this.clearColor = function() {
  49786. this.clear(!0, !1, !1)
  49787. }
  49788. ,
  49789. this.clearDepth = function() {
  49790. this.clear(!1, !0, !1)
  49791. }
  49792. ,
  49793. this.clearStencil = function() {
  49794. this.clear(!1, !1, !0)
  49795. }
  49796. ,
  49797. this.clearTarget = function(e, t, i, n) {
  49798. this.setRenderTarget(e),
  49799. this.clear(t, i, n)
  49800. }
  49801. ,
  49802. this.resetGLState = n,
  49803. this.dispose = function() {
  49804. O.removeEventListener("webglcontextlost", r, !1)
  49805. }
  49806. ,
  49807. this.renderBufferImmediate = function(e, t, i) {
  49808. _e.initAttributes();
  49809. var n = be.get(e);
  49810. e.hasPositions && !n.position && (n.position = X.createBuffer()),
  49811. e.hasNormals && !n.normal && (n.normal = X.createBuffer()),
  49812. e.hasUvs && !n.uv && (n.uv = X.createBuffer()),
  49813. e.hasColors && !n.color && (n.color = X.createBuffer());
  49814. var r = t.getAttributes();
  49815. if (e.hasPositions && (X.bindBuffer(X.ARRAY_BUFFER, n.position),
  49816. X.bufferData(X.ARRAY_BUFFER, e.positionArray, X.DYNAMIC_DRAW),
  49817. _e.enableAttribute(r.position),
  49818. X.vertexAttribPointer(r.position, 3, X.FLOAT, !1, 0, 0)),
  49819. e.hasNormals) {
  49820. if (X.bindBuffer(X.ARRAY_BUFFER, n.normal),
  49821. "MeshPhongMaterial" !== i.type && "MeshStandardMaterial" !== i.type && i.shading === Ci.FlatShading)
  49822. for (var o = 0, a = 3 * e.count; o < a; o += 9) {
  49823. var s = e.normalArray
  49824. , l = (s[o + 0] + s[o + 3] + s[o + 6]) / 3
  49825. , c = (s[o + 1] + s[o + 4] + s[o + 7]) / 3
  49826. , h = (s[o + 2] + s[o + 5] + s[o + 8]) / 3;
  49827. s[o + 0] = l,
  49828. s[o + 1] = c,
  49829. s[o + 2] = h,
  49830. s[o + 3] = l,
  49831. s[o + 4] = c,
  49832. s[o + 5] = h,
  49833. s[o + 6] = l,
  49834. s[o + 7] = c,
  49835. s[o + 8] = h
  49836. }
  49837. X.bufferData(X.ARRAY_BUFFER, e.normalArray, X.DYNAMIC_DRAW),
  49838. _e.enableAttribute(r.normal),
  49839. X.vertexAttribPointer(r.normal, 3, X.FLOAT, !1, 0, 0)
  49840. }
  49841. e.hasUvs && i.map && (X.bindBuffer(X.ARRAY_BUFFER, n.uv),
  49842. X.bufferData(X.ARRAY_BUFFER, e.uvArray, X.DYNAMIC_DRAW),
  49843. _e.enableAttribute(r.uv),
  49844. X.vertexAttribPointer(r.uv, 2, X.FLOAT, !1, 0, 0)),
  49845. e.hasColors && i.vertexColors !== Ci.NoColors && (X.bindBuffer(X.ARRAY_BUFFER, n.color),
  49846. X.bufferData(X.ARRAY_BUFFER, e.colorArray, X.DYNAMIC_DRAW),
  49847. _e.enableAttribute(r.color),
  49848. X.vertexAttribPointer(r.color, 3, X.FLOAT, !1, 0, 0)),
  49849. _e.disableUnusedAttributes(),
  49850. X.drawArrays(X.TRIANGLES, 0, e.count),
  49851. e.count = 0
  49852. }
  49853. ,
  49854. this.renderBufferDirect = function(e, t, i, n, r, o) {
  49855. R(n);
  49856. var a = P(e, t, n, r)
  49857. , s = !1
  49858. , l = i.id + "_" + a.id + "_" + n.wireframe;
  49859. l !== ee && (ee = l,
  49860. s = !0);
  49861. var c = r.morphTargetInfluences;
  49862. if (void 0 !== c) {
  49863. for (var h = [], u = 0, d = c.length; u < d; u++) {
  49864. var p = c[u];
  49865. h.push([p, u])
  49866. }
  49867. h.sort(M),
  49868. 8 < h.length && (h.length = 8);
  49869. var f = i.morphAttributes;
  49870. for (u = 0,
  49871. d = h.length; u < d; u++) {
  49872. p = h[u];
  49873. if (j[u] = p[0],
  49874. 0 !== p[0]) {
  49875. var g = p[1];
  49876. !0 === n.morphTargets && f.position && i.addAttribute("morphTarget" + u, f.position[g]),
  49877. !0 === n.morphNormals && f.normal && i.addAttribute("morphNormal" + u, f.normal[g])
  49878. } else
  49879. !0 === n.morphTargets && i.removeAttribute("morphTarget" + u),
  49880. !0 === n.morphNormals && i.removeAttribute("morphNormal" + u)
  49881. }
  49882. var m = a.getUniforms();
  49883. null !== m.morphTargetInfluences && X.uniform1fv(m.morphTargetInfluences, j),
  49884. s = !0
  49885. }
  49886. g = i.index;
  49887. var v, y = i.attributes.position;
  49888. !0 === n.wireframe && (g = we.getWireframeAttribute(i)),
  49889. null !== g ? (v = Me).setIndex(g) : v = Se,
  49890. s && (function(e, t, i, n) {
  49891. var r;
  49892. if (i instanceof Ci.InstancedBufferGeometry && null === (r = Ie.get("ANGLE_instanced_arrays")))
  49893. console.error("THREE.WebGLRenderer.setupVertexAttributes: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");
  49894. else {
  49895. void 0 === n && (n = 0),
  49896. _e.initAttributes();
  49897. var o = i.attributes
  49898. , a = t.getAttributes()
  49899. , s = e.defaultAttributeValues;
  49900. for (var l in a) {
  49901. var c = a[l];
  49902. if (0 <= c) {
  49903. var h = o[l];
  49904. if (void 0 !== h) {
  49905. var u = h.itemSize
  49906. , d = we.getAttributeBuffer(h);
  49907. if (h instanceof Ci.InterleavedBufferAttribute) {
  49908. var p = h.data
  49909. , f = p.stride
  49910. , g = h.offset;
  49911. p instanceof Ci.InstancedInterleavedBuffer ? (_e.enableAttributeAndDivisor(c, p.meshPerAttribute, r),
  49912. void 0 === i.maxInstancedCount && (i.maxInstancedCount = p.meshPerAttribute * p.count)) : _e.enableAttribute(c),
  49913. X.bindBuffer(X.ARRAY_BUFFER, d),
  49914. X.vertexAttribPointer(c, u, X.FLOAT, !1, f * p.array.BYTES_PER_ELEMENT, (n * f + g) * p.array.BYTES_PER_ELEMENT)
  49915. } else
  49916. h instanceof Ci.InstancedBufferAttribute ? (_e.enableAttributeAndDivisor(c, h.meshPerAttribute, r),
  49917. void 0 === i.maxInstancedCount && (i.maxInstancedCount = h.meshPerAttribute * h.count)) : _e.enableAttribute(c),
  49918. X.bindBuffer(X.ARRAY_BUFFER, d),
  49919. X.vertexAttribPointer(c, u, X.FLOAT, !1, 0, n * u * 4)
  49920. } else if (void 0 !== s) {
  49921. var m = s[l];
  49922. if (void 0 !== m)
  49923. switch (m.length) {
  49924. case 2:
  49925. X.vertexAttrib2fv(c, m);
  49926. break;
  49927. case 3:
  49928. X.vertexAttrib3fv(c, m);
  49929. break;
  49930. case 4:
  49931. X.vertexAttrib4fv(c, m);
  49932. break;
  49933. default:
  49934. X.vertexAttrib1fv(c, m)
  49935. }
  49936. }
  49937. }
  49938. }
  49939. _e.disableUnusedAttributes()
  49940. }
  49941. }(n, a, i),
  49942. null !== g && X.bindBuffer(X.ELEMENT_ARRAY_BUFFER, we.getAttributeBuffer(g)));
  49943. var A = 1 / 0;
  49944. null !== g ? A = g.count : void 0 !== y && (A = y.count);
  49945. var C = i.drawRange.start
  49946. , I = i.drawRange.count
  49947. , E = null !== o ? o.start : 0
  49948. , _ = null !== o ? o.count : 1 / 0
  49949. , b = Math.max(0, C, E)
  49950. , w = Math.min(0 + A, C + I, E + _) - 1
  49951. , T = Math.max(0, w - b + 1);
  49952. if (r instanceof Ci.Mesh)
  49953. if (!0 === n.wireframe)
  49954. _e.setLineWidth(n.wireframeLinewidth * S()),
  49955. v.setMode(X.LINES);
  49956. else
  49957. switch (r.drawMode) {
  49958. case Ci.TrianglesDrawMode:
  49959. v.setMode(X.TRIANGLES);
  49960. break;
  49961. case Ci.TriangleStripDrawMode:
  49962. v.setMode(X.TRIANGLE_STRIP);
  49963. break;
  49964. case Ci.TriangleFanDrawMode:
  49965. v.setMode(X.TRIANGLE_FAN)
  49966. }
  49967. else if (r instanceof Ci.Line) {
  49968. var x = n.linewidth;
  49969. void 0 === x && (x = 1),
  49970. _e.setLineWidth(x * S()),
  49971. r instanceof Ci.LineSegments ? v.setMode(X.LINES) : v.setMode(X.LINE_STRIP)
  49972. } else
  49973. r instanceof Ci.Points && v.setMode(X.POINTS);
  49974. i instanceof Ci.InstancedBufferGeometry ? 0 < i.maxInstancedCount && v.renderInstances(i, b, T) : v.render(b, T)
  49975. }
  49976. ,
  49977. this.render = function(e, t, i, n) {
  49978. if (t instanceof Ci.Camera != 0) {
  49979. var r = e.fog;
  49980. if (ee = "",
  49981. $ = -1,
  49982. !(te = null) === e.autoUpdate && e.updateMatrixWorld(),
  49983. null === t.parent && t.updateMatrixWorld(),
  49984. t.matrixWorldInverse.getInverse(t.matrixWorld),
  49985. ge.multiplyMatrices(t.projectionMatrix, t.matrixWorldInverse),
  49986. fe.setFromMatrix(ge),
  49987. U.length = 0,
  49988. W = z = -1,
  49989. Y.length = 0,
  49990. q.length = 0,
  49991. function e(t, i) {
  49992. if (!1 !== t.visible) {
  49993. if (t.layers.test(i.layers))
  49994. if (t instanceof Ci.Light)
  49995. U.push(t);
  49996. else if (t instanceof Ci.Sprite)
  49997. !1 !== t.frustumCulled && !0 !== fe.intersectsObject(t) || Y.push(t);
  49998. else if (t instanceof Ci.LensFlare)
  49999. q.push(t);
  50000. else if (t instanceof Ci.ImmediateRenderObject)
  50001. !0 === Z.sortObjects && (me.setFromMatrixPosition(t.matrixWorld),
  50002. me.applyProjection(ge)),
  50003. d(t, null, t.material, me.z, null);
  50004. else if ((t instanceof Ci.Mesh || t instanceof Ci.Line || t instanceof Ci.Points) && (t instanceof Ci.SkinnedMesh && t.skeleton.update(),
  50005. !1 === t.frustumCulled || !0 === fe.intersectsObject(t))) {
  50006. var n = t.material;
  50007. if (!0 === n.visible) {
  50008. !0 === Z.sortObjects && (me.setFromMatrixPosition(t.matrixWorld),
  50009. me.applyProjection(ge));
  50010. var r = we.update(t);
  50011. if (n instanceof Ci.MultiMaterial)
  50012. for (var o = r.groups, a = n.materials, s = 0, l = o.length; s < l; s++) {
  50013. var c = o[s]
  50014. , h = a[c.materialIndex];
  50015. !0 === h.visible && d(t, r, h, me.z, c)
  50016. }
  50017. else
  50018. d(t, r, n, me.z, null)
  50019. }
  50020. }
  50021. var u = t.children;
  50022. for (s = 0,
  50023. l = u.length; s < l; s++)
  50024. e(u[s], i)
  50025. }
  50026. }(e, t),
  50027. H.length = z + 1,
  50028. G.length = W + 1,
  50029. !0 === Z.sortObjects && (H.sort(s),
  50030. G.sort(l)),
  50031. function(e, t) {
  50032. 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;
  50033. for (i = ve.shadowsPointLight = 0,
  50034. n = e.length; i < n; i++)
  50035. if (o = (r = e[i]).color,
  50036. a = r.intensity,
  50037. s = r.distance,
  50038. r instanceof Ci.AmbientLight)
  50039. l += o.r * a,
  50040. c += o.g * a,
  50041. h += o.b * a;
  50042. else if (r instanceof Ci.DirectionalLight) {
  50043. (v = xe.get(r)).color.copy(r.color).multiplyScalar(r.intensity),
  50044. v.direction.setFromMatrixPosition(r.matrixWorld),
  50045. me.setFromMatrixPosition(r.target.matrixWorld),
  50046. v.direction.sub(me),
  50047. v.direction.transformDirection(u),
  50048. v.shadow = r.castShadow,
  50049. r.castShadow && (v.shadowBias = r.shadow.bias,
  50050. v.shadowRadius = r.shadow.radius,
  50051. v.shadowMapSize = r.shadow.mapSize,
  50052. ve.shadows[m++] = r),
  50053. ve.directionalShadowMap[d] = r.shadow.map,
  50054. ve.directionalShadowMatrix[d] = r.shadow.matrix,
  50055. ve.directional[d++] = v
  50056. } else if (r instanceof Ci.SpotLight) {
  50057. (v = xe.get(r)).position.setFromMatrixPosition(r.matrixWorld),
  50058. v.position.applyMatrix4(u),
  50059. v.color.copy(o).multiplyScalar(a),
  50060. v.distance = s,
  50061. v.direction.setFromMatrixPosition(r.matrixWorld),
  50062. me.setFromMatrixPosition(r.target.matrixWorld),
  50063. v.direction.sub(me),
  50064. v.direction.transformDirection(u),
  50065. v.coneCos = Math.cos(r.angle),
  50066. v.penumbraCos = Math.cos(r.angle * (1 - r.penumbra)),
  50067. v.decay = 0 === r.distance ? 0 : r.decay,
  50068. v.shadow = r.castShadow,
  50069. r.castShadow && (v.shadowBias = r.shadow.bias,
  50070. v.shadowRadius = r.shadow.radius,
  50071. v.shadowMapSize = r.shadow.mapSize,
  50072. ve.shadows[m++] = r),
  50073. ve.spotShadowMap[f] = r.shadow.map,
  50074. ve.spotShadowMatrix[f] = r.shadow.matrix,
  50075. ve.spot[f++] = v
  50076. } else if (r instanceof Ci.PointLight) {
  50077. (v = xe.get(r)).position.setFromMatrixPosition(r.matrixWorld),
  50078. v.position.applyMatrix4(u),
  50079. v.color.copy(r.color).multiplyScalar(r.intensity),
  50080. v.distance = r.distance,
  50081. v.decay = 0 === r.distance ? 0 : r.decay,
  50082. v.shadow = r.castShadow,
  50083. r.castShadow && (v.shadowBias = r.shadow.bias,
  50084. v.shadowRadius = r.shadow.radius,
  50085. v.shadowMapSize = r.shadow.mapSize,
  50086. ve.shadows[m++] = r),
  50087. ve.pointShadowMap[p] = r.shadow.map,
  50088. void 0 === ve.pointShadowMatrix[p] && (ve.pointShadowMatrix[p] = new Ci.Matrix4),
  50089. me.setFromMatrixPosition(r.matrixWorld).negate(),
  50090. ve.pointShadowMatrix[p].identity().setPosition(me),
  50091. ve.point[p++] = v
  50092. } else if (r instanceof Ci.HemisphereLight) {
  50093. var v;
  50094. (v = xe.get(r)).direction.setFromMatrixPosition(r.matrixWorld),
  50095. v.direction.transformDirection(u),
  50096. v.direction.normalize(),
  50097. v.skyColor.copy(r.color).multiplyScalar(a),
  50098. v.groundColor.copy(r.groundColor).multiplyScalar(a),
  50099. ve.hemi[g++] = v
  50100. }
  50101. ve.ambient[0] = l,
  50102. ve.ambient[1] = c,
  50103. ve.ambient[2] = h,
  50104. ve.directional.length = d,
  50105. ve.spot.length = f,
  50106. ve.point.length = p,
  50107. ve.hemi.length = g,
  50108. ve.shadows.length = m,
  50109. ve.hash = d + "," + p + "," + f + "," + g + "," + m
  50110. }(U, t),
  50111. Re.render(e, t),
  50112. Ae.calls = 0,
  50113. Ae.vertices = 0,
  50114. Ae.faces = 0,
  50115. void (Ae.points = 0) === i && (i = null),
  50116. this.setRenderTarget(i),
  50117. (this.autoClear || n) && this.clear(this.autoClearColor, this.autoClearDepth, this.autoClearStencil),
  50118. e.overrideMaterial) {
  50119. var o = e.overrideMaterial;
  50120. c(H, t, r, o),
  50121. c(G, t, r, o)
  50122. } else
  50123. _e.setBlending(Ci.NoBlending),
  50124. c(H, t, r),
  50125. c(G, t, r);
  50126. if (Oe.render(e, t),
  50127. Le.render(e, t, re),
  50128. i) {
  50129. var a = i.texture;
  50130. a.generateMipmaps && E(i) && a.minFilter !== Ci.NearestFilter && a.minFilter !== Ci.LinearFilter && function(e) {
  50131. var t = e instanceof Ci.WebGLRenderTargetCube ? X.TEXTURE_CUBE_MAP : X.TEXTURE_2D
  50132. , i = be.get(e.texture).__webglTexture;
  50133. _e.bindTexture(t, i),
  50134. X.generateMipmap(t),
  50135. _e.bindTexture(t, null)
  50136. }(i)
  50137. }
  50138. _e.setDepthTest(!0),
  50139. _e.setDepthWrite(!0),
  50140. _e.setColorWrite(!0)
  50141. } else
  50142. console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.")
  50143. }
  50144. ,
  50145. this.setFaceCulling = function(e, t) {
  50146. e === Ci.CullFaceNone ? _e.disable(X.CULL_FACE) : (t === Ci.FrontFaceDirectionCW ? X.frontFace(X.CW) : X.frontFace(X.CCW),
  50147. e === Ci.CullFaceBack ? X.cullFace(X.BACK) : e === Ci.CullFaceFront ? X.cullFace(X.FRONT) : X.cullFace(X.FRONT_AND_BACK),
  50148. _e.enable(X.CULL_FACE))
  50149. }
  50150. ,
  50151. this.setTexture = function(e, t) {
  50152. var i = be.get(e);
  50153. if (0 < e.version && i.__version !== e.version) {
  50154. var n = e.image;
  50155. 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)
  50156. }
  50157. _e.activeTexture(X.TEXTURE0 + t),
  50158. _e.bindTexture(X.TEXTURE_2D, i.__webglTexture)
  50159. }
  50160. ,
  50161. this.getCurrentRenderTarget = function() {
  50162. return Q
  50163. }
  50164. ,
  50165. this.setRenderTarget = function(e) {
  50166. (Q = e) && void 0 === be.get(e).__webglFramebuffer && w(e);
  50167. var t, i = e instanceof Ci.WebGLRenderTargetCube;
  50168. if (e) {
  50169. var n = be.get(e);
  50170. t = i ? n.__webglFramebuffer[e.activeCubeFace] : n.__webglFramebuffer,
  50171. ie.copy(e.scissor),
  50172. ne = e.scissorTest,
  50173. re.copy(e.viewport)
  50174. } else
  50175. t = null,
  50176. ie.copy(ue).multiplyScalar(he),
  50177. ne = de,
  50178. re.copy(pe).multiplyScalar(he);
  50179. if (J !== t && (X.bindFramebuffer(X.FRAMEBUFFER, t),
  50180. J = t),
  50181. _e.scissor(ie),
  50182. _e.setScissorTest(ne),
  50183. _e.viewport(re),
  50184. i) {
  50185. var r = be.get(e.texture);
  50186. X.framebufferTexture2D(X.FRAMEBUFFER, X.COLOR_ATTACHMENT0, X.TEXTURE_CUBE_MAP_POSITIVE_X + e.activeCubeFace, r.__webglTexture, e.activeMipMapLevel)
  50187. }
  50188. }
  50189. ,
  50190. this.readRenderTargetPixels = function(e, t, i, n, r, o) {
  50191. if (e instanceof Ci.WebGLRenderTarget != 0) {
  50192. var a = be.get(e).__webglFramebuffer;
  50193. if (a) {
  50194. var s = !1;
  50195. a !== J && (X.bindFramebuffer(X.FRAMEBUFFER, a),
  50196. s = !0);
  50197. try {
  50198. var l = e.texture;
  50199. if (l.format !== Ci.RGBAFormat && x(l.format) !== X.getParameter(X.IMPLEMENTATION_COLOR_READ_FORMAT))
  50200. return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");
  50201. 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")))
  50202. return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");
  50203. 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.")
  50204. } finally {
  50205. s && X.bindFramebuffer(X.FRAMEBUFFER, J)
  50206. }
  50207. }
  50208. } else
  50209. console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.")
  50210. }
  50211. }
  50212. ,
  50213. Ci.WebGLRenderTarget = function(e, t, i) {
  50214. this.uuid = Ci.Math.generateUUID(),
  50215. this.width = e,
  50216. this.height = t,
  50217. this.scissor = new Ci.Vector4(0,0,e,t),
  50218. this.scissorTest = !1,
  50219. this.viewport = new Ci.Vector4(0,0,e,t),
  50220. void 0 === (i = i || {}).minFilter && (i.minFilter = Ci.LinearFilter),
  50221. this.texture = new Ci.Texture(void 0,void 0,i.wrapS,i.wrapT,i.magFilter,i.minFilter,i.format,i.type,i.anisotropy),
  50222. this.depthBuffer = void 0 === i.depthBuffer || i.depthBuffer,
  50223. this.stencilBuffer = void 0 === i.stencilBuffer || i.stencilBuffer
  50224. }
  50225. ,
  50226. Ci.WebGLRenderTarget.prototype = {
  50227. constructor: Ci.WebGLRenderTarget,
  50228. setSize: function(e, t) {
  50229. this.width === e && this.height === t || (this.width = e,
  50230. this.height = t,
  50231. this.dispose()),
  50232. this.viewport.set(0, 0, e, t),
  50233. this.scissor.set(0, 0, e, t)
  50234. },
  50235. clone: function() {
  50236. return (new this.constructor).copy(this)
  50237. },
  50238. copy: function(e) {
  50239. return this.width = e.width,
  50240. this.height = e.height,
  50241. this.viewport.copy(e.viewport),
  50242. this.texture = e.texture.clone(),
  50243. this.depthBuffer = e.depthBuffer,
  50244. this.stencilBuffer = e.stencilBuffer,
  50245. this
  50246. },
  50247. dispose: function() {
  50248. this.dispatchEvent({
  50249. type: "dispose"
  50250. })
  50251. }
  50252. },
  50253. Ci.EventDispatcher.prototype.apply(Ci.WebGLRenderTarget.prototype),
  50254. Ci.WebGLRenderTargetCube = function(e, t, i) {
  50255. Ci.WebGLRenderTarget.call(this, e, t, i),
  50256. this.activeCubeFace = 0,
  50257. this.activeMipMapLevel = 0
  50258. }
  50259. ,
  50260. Ci.WebGLRenderTargetCube.prototype = Object.create(Ci.WebGLRenderTarget.prototype),
  50261. Ci.WebGLRenderTargetCube.prototype.constructor = Ci.WebGLRenderTargetCube,
  50262. Ci.WebGLBufferRenderer = function(r, o, a) {
  50263. var s;
  50264. this.setMode = function(e) {
  50265. s = e
  50266. }
  50267. ,
  50268. this.render = function(e, t) {
  50269. r.drawArrays(s, e, t),
  50270. a.calls++,
  50271. a.vertices += t,
  50272. s === r.TRIANGLES && (a.faces += t / 3)
  50273. }
  50274. ,
  50275. this.renderInstances = function(e) {
  50276. var t = o.get("ANGLE_instanced_arrays");
  50277. if (null !== t) {
  50278. var i = e.attributes.position
  50279. , n = 0;
  50280. n = i instanceof Ci.InterleavedBufferAttribute ? i.data.count : i.count,
  50281. t.drawArraysInstancedANGLE(s, 0, n, e.maxInstancedCount),
  50282. a.calls++,
  50283. a.vertices += n * e.maxInstancedCount,
  50284. s === r.TRIANGLES && (a.faces += e.maxInstancedCount * n / 3)
  50285. } else
  50286. console.error("THREE.WebGLBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.")
  50287. }
  50288. }
  50289. ,
  50290. Ci.WebGLIndexedBufferRenderer = function(r, o, a) {
  50291. var s, l, c;
  50292. this.setMode = function(e) {
  50293. s = e
  50294. }
  50295. ,
  50296. this.setIndex = function(e) {
  50297. c = e.array instanceof Uint32Array && o.get("OES_element_index_uint") ? (l = r.UNSIGNED_INT,
  50298. 4) : (l = r.UNSIGNED_SHORT,
  50299. 2)
  50300. }
  50301. ,
  50302. this.render = function(e, t) {
  50303. r.drawElements(s, t, l, e * c),
  50304. a.calls++,
  50305. a.vertices += t,
  50306. s === r.TRIANGLES && (a.faces += t / 3)
  50307. }
  50308. ,
  50309. this.renderInstances = function(e, t, i) {
  50310. var n = o.get("ANGLE_instanced_arrays");
  50311. 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),
  50312. a.calls++,
  50313. a.vertices += i * e.maxInstancedCount,
  50314. void (s === r.TRIANGLES && (a.faces += e.maxInstancedCount * i / 3)))
  50315. }
  50316. }
  50317. ,
  50318. Ci.WebGLExtensions = function(i) {
  50319. var n = {};
  50320. this.get = function(e) {
  50321. if (void 0 !== n[e])
  50322. return n[e];
  50323. var t;
  50324. switch (e) {
  50325. case "EXT_texture_filter_anisotropic":
  50326. t = i.getExtension("EXT_texture_filter_anisotropic") || i.getExtension("MOZ_EXT_texture_filter_anisotropic") || i.getExtension("WEBKIT_EXT_texture_filter_anisotropic");
  50327. break;
  50328. case "WEBGL_compressed_texture_s3tc":
  50329. t = i.getExtension("WEBGL_compressed_texture_s3tc") || i.getExtension("MOZ_WEBGL_compressed_texture_s3tc") || i.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc");
  50330. break;
  50331. case "WEBGL_compressed_texture_pvrtc":
  50332. t = i.getExtension("WEBGL_compressed_texture_pvrtc") || i.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc");
  50333. break;
  50334. case "WEBGL_compressed_texture_etc1":
  50335. t = i.getExtension("WEBGL_compressed_texture_etc1");
  50336. break;
  50337. default:
  50338. t = i.getExtension(e)
  50339. }
  50340. return null === t && console.warn("THREE.WebGLRenderer: " + e + " extension not supported."),
  50341. n[e] = t
  50342. }
  50343. }
  50344. ,
  50345. Ci.WebGLCapabilities = function(t, e, i) {
  50346. function n(e) {
  50347. if ("highp" === e) {
  50348. if (0 < t.getShaderPrecisionFormat(t.VERTEX_SHADER, t.HIGH_FLOAT).precision && 0 < t.getShaderPrecisionFormat(t.FRAGMENT_SHADER, t.HIGH_FLOAT).precision)
  50349. return "highp";
  50350. e = "mediump"
  50351. }
  50352. 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"
  50353. }
  50354. this.getMaxPrecision = n,
  50355. this.precision = void 0 !== i.precision ? i.precision : "highp",
  50356. this.logarithmicDepthBuffer = void 0 !== i.logarithmicDepthBuffer && i.logarithmicDepthBuffer,
  50357. this.maxTextures = t.getParameter(t.MAX_TEXTURE_IMAGE_UNITS),
  50358. this.maxVertexTextures = t.getParameter(t.MAX_VERTEX_TEXTURE_IMAGE_UNITS),
  50359. this.maxTextureSize = t.getParameter(t.MAX_TEXTURE_SIZE),
  50360. this.maxCubemapSize = t.getParameter(t.MAX_CUBE_MAP_TEXTURE_SIZE),
  50361. this.maxAttributes = t.getParameter(t.MAX_VERTEX_ATTRIBS),
  50362. this.maxVertexUniforms = t.getParameter(t.MAX_VERTEX_UNIFORM_VECTORS),
  50363. this.maxVaryings = t.getParameter(t.MAX_VARYING_VECTORS),
  50364. this.maxFragmentUniforms = t.getParameter(t.MAX_FRAGMENT_UNIFORM_VECTORS),
  50365. this.vertexTextures = 0 < this.maxVertexTextures,
  50366. this.floatFragmentTextures = !!e.get("OES_texture_float"),
  50367. this.floatVertexTextures = this.vertexTextures && this.floatFragmentTextures;
  50368. var r = n(this.precision);
  50369. r !== this.precision && (console.warn("THREE.WebGLRenderer:", this.precision, "not supported, using", r, "instead."),
  50370. this.precision = r),
  50371. this.logarithmicDepthBuffer && (this.logarithmicDepthBuffer = !!e.get("EXT_frag_depth"))
  50372. }
  50373. ,
  50374. Ci.WebGLGeometries = function(i, o, a) {
  50375. function s(e) {
  50376. var t = e.target
  50377. , i = c[t.id];
  50378. null !== i.index && l(i.index),
  50379. function(e) {
  50380. for (var t in e)
  50381. l(e[t])
  50382. }(i.attributes),
  50383. t.removeEventListener("dispose", s),
  50384. delete c[t.id];
  50385. var n = o.get(t);
  50386. n.wireframe && l(n.wireframe),
  50387. o.delete(t);
  50388. var r = o.get(i);
  50389. r.wireframe && l(r.wireframe),
  50390. o.delete(i),
  50391. a.memory.geometries--
  50392. }
  50393. function l(e) {
  50394. var t = function(e) {
  50395. return e instanceof Ci.InterleavedBufferAttribute ? o.get(e.data).__webglBuffer : o.get(e).__webglBuffer
  50396. }(e);
  50397. void 0 !== t && (i.deleteBuffer(t),
  50398. function(e) {
  50399. e instanceof Ci.InterleavedBufferAttribute ? o.delete(e.data) : o.delete(e)
  50400. }(e))
  50401. }
  50402. var c = {};
  50403. this.get = function(e) {
  50404. var t, i = e.geometry;
  50405. return void 0 !== c[i.id] ? c[i.id] : (i.addEventListener("dispose", s),
  50406. i instanceof Ci.BufferGeometry ? t = i : i instanceof Ci.Geometry && (void 0 === i._bufferGeometry && (i._bufferGeometry = (new Ci.BufferGeometry).setFromObject(e)),
  50407. t = i._bufferGeometry),
  50408. c[i.id] = t,
  50409. a.memory.geometries++,
  50410. t)
  50411. }
  50412. }
  50413. ,
  50414. Ci.WebGLLights = function() {
  50415. var i = {};
  50416. this.get = function(e) {
  50417. if (void 0 !== i[e.id])
  50418. return i[e.id];
  50419. var t;
  50420. switch (e.type) {
  50421. case "DirectionalLight":
  50422. t = {
  50423. direction: new Ci.Vector3,
  50424. color: new Ci.Color,
  50425. shadow: !1,
  50426. shadowBias: 0,
  50427. shadowRadius: 1,
  50428. shadowMapSize: new Ci.Vector2
  50429. };
  50430. break;
  50431. case "SpotLight":
  50432. t = {
  50433. position: new Ci.Vector3,
  50434. direction: new Ci.Vector3,
  50435. color: new Ci.Color,
  50436. distance: 0,
  50437. coneCos: 0,
  50438. penumbraCos: 0,
  50439. decay: 0,
  50440. shadow: !1,
  50441. shadowBias: 0,
  50442. shadowRadius: 1,
  50443. shadowMapSize: new Ci.Vector2
  50444. };
  50445. break;
  50446. case "PointLight":
  50447. t = {
  50448. position: new Ci.Vector3,
  50449. color: new Ci.Color,
  50450. distance: 0,
  50451. decay: 0,
  50452. shadow: !1,
  50453. shadowBias: 0,
  50454. shadowRadius: 1,
  50455. shadowMapSize: new Ci.Vector2
  50456. };
  50457. break;
  50458. case "HemisphereLight":
  50459. t = {
  50460. direction: new Ci.Vector3,
  50461. skyColor: new Ci.Color,
  50462. groundColor: new Ci.Color
  50463. }
  50464. }
  50465. return i[e.id] = t
  50466. }
  50467. }
  50468. ,
  50469. Ci.WebGLObjects = function(g, m, e) {
  50470. function v(e, t) {
  50471. var i = e instanceof Ci.InterleavedBufferAttribute ? e.data : e
  50472. , n = m.get(i);
  50473. void 0 === n.__webglBuffer ? function(e, t, i) {
  50474. e.__webglBuffer = g.createBuffer(),
  50475. g.bindBuffer(i, e.__webglBuffer);
  50476. var n = t.dynamic ? g.DYNAMIC_DRAW : g.STATIC_DRAW;
  50477. g.bufferData(i, t.array, n),
  50478. e.version = t.version
  50479. }(n, i, t) : n.version !== i.version && function(e, t, i) {
  50480. g.bindBuffer(i, e.__webglBuffer),
  50481. !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)),
  50482. t.updateRange.count = 0),
  50483. e.version = t.version
  50484. }(n, i, t)
  50485. }
  50486. function y(e, t, i) {
  50487. if (i < t) {
  50488. var n = t;
  50489. t = i,
  50490. i = n
  50491. }
  50492. var r = e[t];
  50493. return void 0 === r ? (e[t] = [i],
  50494. !0) : -1 === r.indexOf(i) && (r.push(i),
  50495. !0)
  50496. }
  50497. var c = new Ci.WebGLGeometries(g,m,e);
  50498. this.getAttributeBuffer = function(e) {
  50499. return e instanceof Ci.InterleavedBufferAttribute ? m.get(e.data).__webglBuffer : m.get(e).__webglBuffer
  50500. }
  50501. ,
  50502. this.getWireframeAttribute = function(e) {
  50503. var t = m.get(e);
  50504. if (void 0 !== t.wireframe)
  50505. return t.wireframe;
  50506. var i, n = [], r = e.index, o = e.attributes, a = o.position;
  50507. if (null !== r)
  50508. for (var s = {}, l = 0, c = (i = r.array).length; l < c; l += 3) {
  50509. var h = i[l + 0]
  50510. , u = i[l + 1]
  50511. , d = i[l + 2];
  50512. y(s, h, u) && n.push(h, u),
  50513. y(s, u, d) && n.push(u, d),
  50514. y(s, d, h) && n.push(d, h)
  50515. }
  50516. else
  50517. for (l = 0,
  50518. c = (i = o.position.array).length / 3 - 1; l < c; l += 3) {
  50519. h = l + 0,
  50520. u = l + 1,
  50521. d = l + 2;
  50522. n.push(h, u, u, d, d, h)
  50523. }
  50524. var p = 65535 < a.count ? Uint32Array : Uint16Array
  50525. , f = new Ci.BufferAttribute(new p(n),1);
  50526. return v(f, g.ELEMENT_ARRAY_BUFFER),
  50527. t.wireframe = f
  50528. }
  50529. ,
  50530. this.update = function(e) {
  50531. var t = c.get(e);
  50532. e.geometry instanceof Ci.Geometry && t.updateFromObject(e);
  50533. var i = t.index
  50534. , n = t.attributes;
  50535. for (var r in null !== i && v(i, g.ELEMENT_ARRAY_BUFFER),
  50536. n)
  50537. v(n[r], g.ARRAY_BUFFER);
  50538. var o = t.morphAttributes;
  50539. for (var r in o)
  50540. for (var a = o[r], s = 0, l = a.length; s < l; s++)
  50541. v(a[s], g.ARRAY_BUFFER);
  50542. return t
  50543. }
  50544. }
  50545. ,
  50546. Ci.WebGLProgram = (Qt = 0,
  50547. Jt = /^([\w\d_]+)\.([\w\d_]+)$/,
  50548. $t = /^([\w\d_]+)\[(\d+)\]\.([\w\d_]+)$/,
  50549. ei = /^([\w\d_]+)\[0\]$/,
  50550. function(e, t, i, n) {
  50551. var r = e.context
  50552. , o = i.extensions
  50553. , a = i.defines
  50554. , s = i.__webglShader.vertexShader
  50555. , l = i.__webglShader.fragmentShader
  50556. , c = "SHADOWMAP_TYPE_BASIC";
  50557. n.shadowMapType === Ci.PCFShadowMap ? c = "SHADOWMAP_TYPE_PCF" : n.shadowMapType === Ci.PCFSoftShadowMap && (c = "SHADOWMAP_TYPE_PCF_SOFT");
  50558. var h = "ENVMAP_TYPE_CUBE"
  50559. , u = "ENVMAP_MODE_REFLECTION"
  50560. , d = "ENVMAP_BLENDING_MULTIPLY";
  50561. if (n.envMap) {
  50562. switch (i.envMap.mapping) {
  50563. case Ci.CubeReflectionMapping:
  50564. case Ci.CubeRefractionMapping:
  50565. h = "ENVMAP_TYPE_CUBE";
  50566. break;
  50567. case Ci.CubeUVReflectionMapping:
  50568. case Ci.CubeUVRefractionMapping:
  50569. h = "ENVMAP_TYPE_CUBE_UV";
  50570. break;
  50571. case Ci.EquirectangularReflectionMapping:
  50572. case Ci.EquirectangularRefractionMapping:
  50573. h = "ENVMAP_TYPE_EQUIREC";
  50574. break;
  50575. case Ci.SphericalReflectionMapping:
  50576. h = "ENVMAP_TYPE_SPHERE"
  50577. }
  50578. switch (i.envMap.mapping) {
  50579. case Ci.CubeRefractionMapping:
  50580. case Ci.EquirectangularRefractionMapping:
  50581. u = "ENVMAP_MODE_REFRACTION"
  50582. }
  50583. switch (i.combine) {
  50584. case Ci.MultiplyOperation:
  50585. d = "ENVMAP_BLENDING_MULTIPLY";
  50586. break;
  50587. case Ci.MixOperation:
  50588. d = "ENVMAP_BLENDING_MIX";
  50589. break;
  50590. case Ci.AddOperation:
  50591. d = "ENVMAP_BLENDING_ADD"
  50592. }
  50593. }
  50594. var p, f, g = 0 < e.gammaFactor ? e.gammaFactor : 1, m = function(e, t, i) {
  50595. 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")
  50596. }(o, n, e.extensions), v = function(e) {
  50597. var t = [];
  50598. for (var i in e) {
  50599. var n = e[i];
  50600. !1 !== n && t.push("#define " + i + " " + n)
  50601. }
  50602. return t.join("\n")
  50603. }(a), y = r.createProgram();
  50604. 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"),
  50605. [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) {
  50606. var i;
  50607. switch (t) {
  50608. case Ci.LinearToneMapping:
  50609. i = "Linear";
  50610. break;
  50611. case Ci.ReinhardToneMapping:
  50612. i = "Reinhard";
  50613. break;
  50614. case Ci.Uncharted2ToneMapping:
  50615. i = "Uncharted2";
  50616. break;
  50617. case Ci.CineonToneMapping:
  50618. i = "OptimizedCineon";
  50619. break;
  50620. default:
  50621. throw new Error("unsupported toneMapping: " + t)
  50622. }
  50623. return "vec3 " + e + "( vec3 color ) { return " + i + "ToneMapping( color ); }"
  50624. }("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) {
  50625. var i = Mi(t);
  50626. return "vec4 " + e + "( vec4 value ) { return LinearTo" + i[0] + i[1] + "; }"
  50627. }("linearToOutputTexel", n.outputEncoding) : "", "\n"].filter(Pi).join("\n")),
  50628. s = Oi(s = Li(s), n),
  50629. l = Oi(l = Li(l), n),
  50630. i instanceof Ci.ShaderMaterial == 0 && (s = Di(s),
  50631. l = Di(l));
  50632. var A = p + s
  50633. , C = f + l
  50634. , I = Ci.WebGLShader(r, r.VERTEX_SHADER, A)
  50635. , E = Ci.WebGLShader(r, r.FRAGMENT_SHADER, C);
  50636. r.attachShader(y, I),
  50637. r.attachShader(y, E),
  50638. void 0 !== i.index0AttributeName ? r.bindAttribLocation(y, 0, i.index0AttributeName) : !0 === n.morphTargets && r.bindAttribLocation(y, 0, "position"),
  50639. r.linkProgram(y);
  50640. var _, b, w = r.getProgramInfoLog(y), T = r.getShaderInfoLog(I), x = r.getShaderInfoLog(E), S = !0, M = !0;
  50641. return !1 === r.getProgramParameter(y, r.LINK_STATUS) ? (S = !1,
  50642. 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),
  50643. M && (this.diagnostics = {
  50644. runnable: S,
  50645. material: i,
  50646. programLog: w,
  50647. vertexShader: {
  50648. log: T,
  50649. prefix: p
  50650. },
  50651. fragmentShader: {
  50652. log: x,
  50653. prefix: f
  50654. }
  50655. }),
  50656. r.deleteShader(I),
  50657. r.deleteShader(E),
  50658. this.getUniforms = function() {
  50659. return void 0 === _ && (_ = function(e, t) {
  50660. for (var i = {}, n = e.getProgramParameter(t, e.ACTIVE_UNIFORMS), r = 0; r < n; r++) {
  50661. var o = e.getActiveUniform(t, r).name
  50662. , a = e.getUniformLocation(t, o)
  50663. , s = Jt.exec(o);
  50664. if (s) {
  50665. var l = s[1]
  50666. , c = s[2]
  50667. , h = i[l];
  50668. (h = h || (i[l] = {}))[c] = a
  50669. } else if (s = $t.exec(o)) {
  50670. var u = s[1]
  50671. , d = s[2]
  50672. , p = s[3]
  50673. , f = i[u]
  50674. , g = (f = f || (i[u] = []))[d];
  50675. (g = g || (f[d] = {}))[p] = a
  50676. } else
  50677. (s = ei.exec(o)) ? i[u = s[1]] = a : i[o] = a
  50678. }
  50679. return i
  50680. }(r, y)),
  50681. _
  50682. }
  50683. ,
  50684. this.getAttributes = function() {
  50685. return void 0 === b && (b = function(e, t) {
  50686. for (var i = {}, n = e.getProgramParameter(t, e.ACTIVE_ATTRIBUTES), r = 0; r < n; r++) {
  50687. var o = e.getActiveAttrib(t, r).name;
  50688. i[o] = e.getAttribLocation(t, o)
  50689. }
  50690. return i
  50691. }(r, y)),
  50692. b
  50693. }
  50694. ,
  50695. this.destroy = function() {
  50696. r.deleteProgram(y),
  50697. this.program = void 0
  50698. }
  50699. ,
  50700. Object.defineProperties(this, {
  50701. uniforms: {
  50702. get: function() {
  50703. return console.warn("THREE.WebGLProgram: .uniforms is now .getUniforms()."),
  50704. this.getUniforms()
  50705. }
  50706. },
  50707. attributes: {
  50708. get: function() {
  50709. return console.warn("THREE.WebGLProgram: .attributes is now .getAttributes()."),
  50710. this.getAttributes()
  50711. }
  50712. }
  50713. }),
  50714. this.id = Qt++,
  50715. this.code = t,
  50716. this.usedTimes = 1,
  50717. this.program = y,
  50718. this.vertexShader = I,
  50719. this.fragmentShader = E,
  50720. this
  50721. }
  50722. ),
  50723. Ci.WebGLPrograms = function(s, l) {
  50724. function c(e, t) {
  50725. var i;
  50726. return e ? e instanceof Ci.Texture ? i = e.encoding : e instanceof Ci.WebGLRenderTarget && (i = e.texture.encoding) : i = Ci.LinearEncoding,
  50727. i === Ci.LinearEncoding && t && (i = Ci.GammaEncoding),
  50728. i
  50729. }
  50730. var h = []
  50731. , u = {
  50732. MeshDepthMaterial: "depth",
  50733. MeshNormalMaterial: "normal",
  50734. MeshBasicMaterial: "basic",
  50735. MeshLambertMaterial: "lambert",
  50736. MeshPhongMaterial: "phong",
  50737. MeshStandardMaterial: "standard",
  50738. LineBasicMaterial: "basic",
  50739. LineDashedMaterial: "dashed",
  50740. PointsMaterial: "points"
  50741. }
  50742. , 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"];
  50743. this.getParameters = function(e, t, i, n) {
  50744. var r = u[e.type]
  50745. , o = function(e) {
  50746. if (l.floatVertexTextures && e && e.skeleton && e.skeleton.useVertexTexture)
  50747. return 1024;
  50748. var t = l.maxVertexUniforms
  50749. , i = Math.floor((t - 20) / 4);
  50750. 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)")),
  50751. i
  50752. }(n)
  50753. , a = s.getPrecision();
  50754. return null === e.precision || (a = l.getMaxPrecision(e.precision)) !== e.precision && console.warn("THREE.WebGLProgram.getParameters:", e.precision, "not supported, using", a, "instead."),
  50755. {
  50756. shaderID: r,
  50757. precision: a,
  50758. supportsVertexTextures: l.vertexTextures,
  50759. outputEncoding: c(s.getCurrentRenderTarget(), s.gammaOutput),
  50760. map: !!e.map,
  50761. mapEncoding: c(e.map, s.gammaInput),
  50762. envMap: !!e.envMap,
  50763. envMapMode: e.envMap && e.envMap.mapping,
  50764. envMapEncoding: c(e.envMap, s.gammaInput),
  50765. envMapCubeUV: !!e.envMap && (e.envMap.mapping === Ci.CubeUVReflectionMapping || e.envMap.mapping === Ci.CubeUVRefractionMapping),
  50766. lightMap: !!e.lightMap,
  50767. aoMap: !!e.aoMap,
  50768. emissiveMap: !!e.emissiveMap,
  50769. emissiveMapEncoding: c(e.emissiveMap, s.gammaInput),
  50770. bumpMap: !!e.bumpMap,
  50771. normalMap: !!e.normalMap,
  50772. displacementMap: !!e.displacementMap,
  50773. roughnessMap: !!e.roughnessMap,
  50774. metalnessMap: !!e.metalnessMap,
  50775. specularMap: !!e.specularMap,
  50776. alphaMap: !!e.alphaMap,
  50777. combine: e.combine,
  50778. vertexColors: e.vertexColors,
  50779. fog: i,
  50780. useFog: e.fog,
  50781. fogExp: i instanceof Ci.FogExp2,
  50782. flatShading: e.shading === Ci.FlatShading,
  50783. sizeAttenuation: e.sizeAttenuation,
  50784. logarithmicDepthBuffer: l.logarithmicDepthBuffer,
  50785. skinning: e.skinning,
  50786. maxBones: o,
  50787. useVertexTexture: l.floatVertexTextures && n && n.skeleton && n.skeleton.useVertexTexture,
  50788. morphTargets: e.morphTargets,
  50789. morphNormals: e.morphNormals,
  50790. maxMorphTargets: s.maxMorphTargets,
  50791. maxMorphNormals: s.maxMorphNormals,
  50792. numDirLights: t.directional.length,
  50793. numPointLights: t.point.length,
  50794. numSpotLights: t.spot.length,
  50795. numHemiLights: t.hemi.length,
  50796. pointLightShadows: t.shadowsPointLight,
  50797. shadowMapEnabled: s.shadowMap.enabled && n.receiveShadow && 0 < t.shadows.length,
  50798. shadowMapType: s.shadowMap.type,
  50799. toneMapping: s.toneMapping,
  50800. physicallyCorrectLights: s.physicallyCorrectLights,
  50801. premultipliedAlpha: e.premultipliedAlpha,
  50802. alphaTest: e.alphaTest,
  50803. doubleSided: e.side === Ci.DoubleSide,
  50804. flipSided: e.side === Ci.BackSide
  50805. }
  50806. }
  50807. ,
  50808. this.getProgramCode = function(e, t) {
  50809. var i = [];
  50810. if (t.shaderID ? i.push(t.shaderID) : (i.push(e.fragmentShader),
  50811. i.push(e.vertexShader)),
  50812. void 0 !== e.defines)
  50813. for (var n in e.defines)
  50814. i.push(n),
  50815. i.push(e.defines[n]);
  50816. for (var r = 0; r < a.length; r++) {
  50817. var o = a[r];
  50818. i.push(o),
  50819. i.push(t[o])
  50820. }
  50821. return i.join()
  50822. }
  50823. ,
  50824. this.acquireProgram = function(e, t, i) {
  50825. for (var n, r = 0, o = h.length; r < o; r++) {
  50826. var a = h[r];
  50827. if (a.code === i) {
  50828. ++(n = a).usedTimes;
  50829. break
  50830. }
  50831. }
  50832. return void 0 === n && (n = new Ci.WebGLProgram(s,i,e,t),
  50833. h.push(n)),
  50834. n
  50835. }
  50836. ,
  50837. this.releaseProgram = function(e) {
  50838. if (0 == --e.usedTimes) {
  50839. var t = h.indexOf(e);
  50840. h[t] = h[h.length - 1],
  50841. h.pop(),
  50842. e.destroy()
  50843. }
  50844. }
  50845. ,
  50846. this.programs = h
  50847. }
  50848. ,
  50849. Ci.WebGLProperties = function() {
  50850. var n = {};
  50851. this.get = function(e) {
  50852. var t = e.uuid
  50853. , i = n[t];
  50854. return void 0 === i && (i = {},
  50855. n[t] = i),
  50856. i
  50857. }
  50858. ,
  50859. this.delete = function(e) {
  50860. delete n[e.uuid]
  50861. }
  50862. ,
  50863. this.clear = function() {
  50864. n = {}
  50865. }
  50866. }
  50867. ,
  50868. Ci.WebGLShader = function(e, t, i) {
  50869. var n = e.createShader(t);
  50870. return e.shaderSource(n, i),
  50871. e.compileShader(n),
  50872. !1 === e.getShaderParameter(n, e.COMPILE_STATUS) && console.error("THREE.WebGLShader: Shader couldn't compile."),
  50873. "" !== e.getShaderInfoLog(n) && console.warn("THREE.WebGLShader: gl.getShaderInfoLog()", t === e.VERTEX_SHADER ? "vertex" : "fragment", e.getShaderInfoLog(n), function(e) {
  50874. for (var t = e.split("\n"), i = 0; i < t.length; i++)
  50875. t[i] = i + 1 + ": " + t[i];
  50876. return t.join("\n")
  50877. }(i)),
  50878. n
  50879. }
  50880. ,
  50881. Ci.WebGLShadowMap = function(P, O, L) {
  50882. function D(e, t, i, n) {
  50883. var r = e.geometry
  50884. , o = null
  50885. , a = p
  50886. , s = e.customDepthMaterial;
  50887. if (i && (a = f,
  50888. s = e.customDistanceMaterial),
  50889. s)
  50890. o = s;
  50891. else {
  50892. var l = void 0 !== r.morphTargets && 0 < r.morphTargets.length && t.morphTargets
  50893. , c = e instanceof Ci.SkinnedMesh && t.skinning
  50894. , h = 0;
  50895. l && (h |= u),
  50896. c && (h |= d),
  50897. o = a[h]
  50898. }
  50899. return o.visible = t.visible,
  50900. o.wireframe = t.wireframe,
  50901. o.wireframeLinewidth = t.wireframeLinewidth,
  50902. i && void 0 !== o.uniforms.lightPos && o.uniforms.lightPos.value.copy(n),
  50903. o
  50904. }
  50905. function N(e, t, i) {
  50906. if (!1 !== e.visible) {
  50907. 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)))
  50908. !0 === e.material.visible && (e.modelViewMatrix.multiplyMatrices(i.matrixWorldInverse, e.matrixWorld),
  50909. G.push(e));
  50910. for (var n = e.children, r = 0, o = n.length; r < o; r++)
  50911. N(n[r], t, i)
  50912. }
  50913. }
  50914. 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) {
  50915. var a = 0 != (o & u)
  50916. , s = 0 != (o & d)
  50917. , l = new Ci.ShaderMaterial({
  50918. uniforms: i,
  50919. vertexShader: t.vertexShader,
  50920. fragmentShader: t.fragmentShader,
  50921. morphTargets: a,
  50922. skinning: s
  50923. });
  50924. p[o] = l;
  50925. var c = new Ci.ShaderMaterial({
  50926. defines: {
  50927. USE_SHADOWMAP: ""
  50928. },
  50929. uniforms: r,
  50930. vertexShader: n.vertexShader,
  50931. fragmentShader: n.fragmentShader,
  50932. morphTargets: a,
  50933. skinning: s
  50934. });
  50935. f[o] = c
  50936. }
  50937. var q = this;
  50938. this.enabled = !1,
  50939. this.autoUpdate = !0,
  50940. this.needsUpdate = !1,
  50941. this.type = Ci.PCFShadowMap,
  50942. this.cullFace = Ci.CullFaceFront,
  50943. this.render = function(e, t) {
  50944. var i, n, r = O.shadows;
  50945. if (0 !== r.length && !1 !== q.enabled && (!1 !== q.autoUpdate || !1 !== q.needsUpdate)) {
  50946. B.clearColor(1, 1, 1, 1),
  50947. B.disable(F.BLEND),
  50948. B.enable(F.CULL_FACE),
  50949. F.frontFace(F.CCW),
  50950. F.cullFace(q.cullFace === Ci.CullFaceFront ? F.FRONT : F.BACK),
  50951. B.setDepthTest(!0),
  50952. B.setScissorTest(!1);
  50953. for (var o = 0, a = r.length; o < a; o++) {
  50954. var s = r[o]
  50955. , l = s.shadow
  50956. , c = l.camera;
  50957. if (U.copy(l.mapSize),
  50958. s instanceof Ci.PointLight) {
  50959. i = 6,
  50960. n = !0;
  50961. var h = U.x
  50962. , u = U.y;
  50963. Y[0].set(2 * h, u, h, u),
  50964. Y[1].set(0, u, h, u),
  50965. Y[2].set(3 * h, u, h, u),
  50966. Y[3].set(h, u, h, u),
  50967. Y[4].set(3 * h, 0, h, u),
  50968. Y[5].set(h, 0, h, u),
  50969. U.x *= 4,
  50970. U.y *= 2
  50971. } else
  50972. n = !(i = 1);
  50973. if (null === l.map) {
  50974. var d = {
  50975. minFilter: Ci.NearestFilter,
  50976. magFilter: Ci.NearestFilter,
  50977. format: Ci.RGBAFormat
  50978. };
  50979. l.map = new Ci.WebGLRenderTarget(U.x,U.y,d),
  50980. s instanceof Ci.SpotLight && (c.aspect = U.x / U.y),
  50981. c.updateProjectionMatrix()
  50982. }
  50983. var p = l.map
  50984. , f = l.matrix;
  50985. z.setFromMatrixPosition(s.matrixWorld),
  50986. c.position.copy(z),
  50987. P.setRenderTarget(p),
  50988. P.clear();
  50989. for (var g = 0; g < i; g++) {
  50990. if (n) {
  50991. H.copy(c.position),
  50992. H.add(W[g]),
  50993. c.up.copy(j[g]),
  50994. c.lookAt(H);
  50995. var m = Y[g];
  50996. B.viewport(m)
  50997. } else
  50998. H.setFromMatrixPosition(s.target.matrixWorld),
  50999. c.lookAt(H);
  51000. c.updateMatrixWorld(),
  51001. c.matrixWorldInverse.getInverse(c.matrixWorld),
  51002. f.set(.5, 0, 0, .5, 0, .5, 0, .5, 0, 0, .5, .5, 0, 0, 0, 1),
  51003. f.multiply(c.projectionMatrix),
  51004. f.multiply(c.matrixWorldInverse),
  51005. k.multiplyMatrices(c.projectionMatrix, c.matrixWorldInverse),
  51006. V.setFromMatrix(k),
  51007. G.length = 0,
  51008. N(e, t, c);
  51009. for (var v = 0, y = G.length; v < y; v++) {
  51010. var A = G[v]
  51011. , C = L.update(A)
  51012. , I = A.material;
  51013. if (I instanceof Ci.MultiMaterial)
  51014. for (var E = C.groups, _ = I.materials, b = 0, w = E.length; b < w; b++) {
  51015. var T = E[b]
  51016. , x = _[T.materialIndex];
  51017. if (!0 === x.visible) {
  51018. var S = D(A, x, n, z);
  51019. P.renderBufferDirect(c, null, C, S, A, T)
  51020. }
  51021. }
  51022. else {
  51023. S = D(A, I, n, z);
  51024. P.renderBufferDirect(c, null, C, S, A, null)
  51025. }
  51026. }
  51027. }
  51028. }
  51029. var M = P.getClearColor()
  51030. , R = P.getClearAlpha();
  51031. P.setClearColor(M, R),
  51032. B.enable(F.BLEND),
  51033. q.cullFace === Ci.CullFaceFront && F.cullFace(F.BACK),
  51034. q.needsUpdate = !1
  51035. }
  51036. }
  51037. }
  51038. ,
  51039. Ci.WebGLState = function(l, i, c) {
  51040. var n = this
  51041. , r = new Ci.Vector4
  51042. , o = new Uint8Array(16)
  51043. , a = new Uint8Array(16)
  51044. , s = new Uint8Array(16)
  51045. , t = {}
  51046. , h = null
  51047. , u = null
  51048. , d = null
  51049. , p = null
  51050. , f = null
  51051. , g = null
  51052. , m = null
  51053. , v = null
  51054. , y = !1
  51055. , A = null
  51056. , C = null
  51057. , I = null
  51058. , E = null
  51059. , _ = null
  51060. , b = null
  51061. , w = null
  51062. , T = null
  51063. , x = null
  51064. , S = null
  51065. , M = null
  51066. , R = null
  51067. , P = null
  51068. , O = null
  51069. , L = null
  51070. , D = l.getParameter(l.MAX_TEXTURE_IMAGE_UNITS)
  51071. , N = void 0
  51072. , F = {}
  51073. , B = new Ci.Vector4
  51074. , V = null
  51075. , k = null
  51076. , U = new Ci.Vector4
  51077. , H = new Ci.Vector4
  51078. , z = l.createTexture();
  51079. l.bindTexture(l.TEXTURE_2D, z),
  51080. l.texParameteri(l.TEXTURE_2D, l.TEXTURE_MIN_FILTER, l.LINEAR),
  51081. l.texImage2D(l.TEXTURE_2D, 0, l.RGB, 1, 1, 0, l.RGB, l.UNSIGNED_BYTE, new Uint8Array(3)),
  51082. this.init = function() {
  51083. this.clearColor(0, 0, 0, 1),
  51084. this.clearDepth(1),
  51085. this.clearStencil(0),
  51086. this.enable(l.DEPTH_TEST),
  51087. l.depthFunc(l.LEQUAL),
  51088. l.frontFace(l.CCW),
  51089. l.cullFace(l.BACK),
  51090. this.enable(l.CULL_FACE),
  51091. this.enable(l.BLEND),
  51092. l.blendEquation(l.FUNC_ADD),
  51093. l.blendFunc(l.SRC_ALPHA, l.ONE_MINUS_SRC_ALPHA)
  51094. }
  51095. ,
  51096. this.initAttributes = function() {
  51097. for (var e = 0, t = o.length; e < t; e++)
  51098. o[e] = 0
  51099. }
  51100. ,
  51101. this.enableAttribute = function(e) {
  51102. o[e] = 1,
  51103. 0 === a[e] && (l.enableVertexAttribArray(e),
  51104. a[e] = 1),
  51105. 0 !== s[e] && (i.get("ANGLE_instanced_arrays").vertexAttribDivisorANGLE(e, 0),
  51106. s[e] = 0)
  51107. }
  51108. ,
  51109. this.enableAttributeAndDivisor = function(e, t, i) {
  51110. o[e] = 1,
  51111. 0 === a[e] && (l.enableVertexAttribArray(e),
  51112. a[e] = 1),
  51113. s[e] !== t && (i.vertexAttribDivisorANGLE(e, t),
  51114. s[e] = t)
  51115. }
  51116. ,
  51117. this.disableUnusedAttributes = function() {
  51118. for (var e = 0, t = a.length; e < t; e++)
  51119. a[e] !== o[e] && (l.disableVertexAttribArray(e),
  51120. a[e] = 0)
  51121. }
  51122. ,
  51123. this.enable = function(e) {
  51124. !0 !== t[e] && (l.enable(e),
  51125. t[e] = !0)
  51126. }
  51127. ,
  51128. this.disable = function(e) {
  51129. !1 !== t[e] && (l.disable(e),
  51130. t[e] = !1)
  51131. }
  51132. ,
  51133. this.getCompressedTextureFormats = function() {
  51134. if (null === h && (h = [],
  51135. i.get("WEBGL_compressed_texture_pvrtc") || i.get("WEBGL_compressed_texture_s3tc") || i.get("WEBGL_compressed_texture_etc1")))
  51136. for (var e = l.getParameter(l.COMPRESSED_TEXTURE_FORMATS), t = 0; t < e.length; t++)
  51137. h.push(e[t]);
  51138. return h
  51139. }
  51140. ,
  51141. this.setBlending = function(e, t, i, n, r, o, a, s) {
  51142. e === Ci.NoBlending ? this.disable(l.BLEND) : this.enable(l.BLEND),
  51143. e === u && s === y || (e === Ci.AdditiveBlending ? s ? (l.blendEquationSeparate(l.FUNC_ADD, l.FUNC_ADD),
  51144. l.blendFuncSeparate(l.ONE, l.ONE, l.ONE, l.ONE)) : (l.blendEquation(l.FUNC_ADD),
  51145. l.blendFunc(l.SRC_ALPHA, l.ONE)) : e === Ci.SubtractiveBlending ? s ? (l.blendEquationSeparate(l.FUNC_ADD, l.FUNC_ADD),
  51146. l.blendFuncSeparate(l.ZERO, l.ZERO, l.ONE_MINUS_SRC_COLOR, l.ONE_MINUS_SRC_ALPHA)) : (l.blendEquation(l.FUNC_ADD),
  51147. l.blendFunc(l.ZERO, l.ONE_MINUS_SRC_COLOR)) : e === Ci.MultiplyBlending ? s ? (l.blendEquationSeparate(l.FUNC_ADD, l.FUNC_ADD),
  51148. l.blendFuncSeparate(l.ZERO, l.ZERO, l.SRC_COLOR, l.SRC_ALPHA)) : (l.blendEquation(l.FUNC_ADD),
  51149. l.blendFunc(l.ZERO, l.SRC_COLOR)) : s ? (l.blendEquationSeparate(l.FUNC_ADD, l.FUNC_ADD),
  51150. l.blendFuncSeparate(l.ONE, l.ONE_MINUS_SRC_ALPHA, l.ONE, l.ONE_MINUS_SRC_ALPHA)) : (l.blendEquationSeparate(l.FUNC_ADD, l.FUNC_ADD),
  51151. l.blendFuncSeparate(l.SRC_ALPHA, l.ONE_MINUS_SRC_ALPHA, l.ONE, l.ONE_MINUS_SRC_ALPHA)),
  51152. u = e,
  51153. y = s),
  51154. e === Ci.CustomBlending ? (r = r || t,
  51155. o = o || i,
  51156. a = a || n,
  51157. t === d && r === g || (l.blendEquationSeparate(c(t), c(r)),
  51158. d = t,
  51159. g = r),
  51160. i === p && n === f && o === m && a === v || (l.blendFuncSeparate(c(i), c(n), c(o), c(a)),
  51161. p = i,
  51162. f = n,
  51163. m = o,
  51164. v = a)) : v = m = g = f = p = d = null
  51165. }
  51166. ,
  51167. this.setDepthFunc = function(e) {
  51168. if (A !== e) {
  51169. if (e)
  51170. switch (e) {
  51171. case Ci.NeverDepth:
  51172. l.depthFunc(l.NEVER);
  51173. break;
  51174. case Ci.AlwaysDepth:
  51175. l.depthFunc(l.ALWAYS);
  51176. break;
  51177. case Ci.LessDepth:
  51178. l.depthFunc(l.LESS);
  51179. break;
  51180. case Ci.LessEqualDepth:
  51181. l.depthFunc(l.LEQUAL);
  51182. break;
  51183. case Ci.EqualDepth:
  51184. l.depthFunc(l.EQUAL);
  51185. break;
  51186. case Ci.GreaterEqualDepth:
  51187. l.depthFunc(l.GEQUAL);
  51188. break;
  51189. case Ci.GreaterDepth:
  51190. l.depthFunc(l.GREATER);
  51191. break;
  51192. case Ci.NotEqualDepth:
  51193. l.depthFunc(l.NOTEQUAL);
  51194. break;
  51195. default:
  51196. l.depthFunc(l.LEQUAL)
  51197. }
  51198. else
  51199. l.depthFunc(l.LEQUAL);
  51200. A = e
  51201. }
  51202. }
  51203. ,
  51204. this.setDepthTest = function(e) {
  51205. e ? this.enable(l.DEPTH_TEST) : this.disable(l.DEPTH_TEST)
  51206. }
  51207. ,
  51208. this.setDepthWrite = function(e) {
  51209. C !== e && (l.depthMask(e),
  51210. C = e)
  51211. }
  51212. ,
  51213. this.setColorWrite = function(e) {
  51214. I !== e && (l.colorMask(e, e, e, e),
  51215. I = e)
  51216. }
  51217. ,
  51218. this.setStencilFunc = function(e, t, i) {
  51219. _ === e && b === t && w === i || (l.stencilFunc(e, t, i),
  51220. _ = e,
  51221. b = t,
  51222. w = i)
  51223. }
  51224. ,
  51225. this.setStencilOp = function(e, t, i) {
  51226. T === e && x === t && S === i || (l.stencilOp(e, t, i),
  51227. T = e,
  51228. x = t,
  51229. S = i)
  51230. }
  51231. ,
  51232. this.setStencilTest = function(e) {
  51233. e ? this.enable(l.STENCIL_TEST) : this.disable(l.STENCIL_TEST)
  51234. }
  51235. ,
  51236. this.setStencilWrite = function(e) {
  51237. E !== e && (l.stencilMask(e),
  51238. E = e)
  51239. }
  51240. ,
  51241. this.setFlipSided = function(e) {
  51242. M !== e && (e ? l.frontFace(l.CW) : l.frontFace(l.CCW),
  51243. M = e)
  51244. }
  51245. ,
  51246. this.setLineWidth = function(e) {
  51247. e !== R && (l.lineWidth(e),
  51248. R = e)
  51249. }
  51250. ,
  51251. this.setPolygonOffset = function(e, t, i) {
  51252. e ? this.enable(l.POLYGON_OFFSET_FILL) : this.disable(l.POLYGON_OFFSET_FILL),
  51253. !e || P === t && O === i || (l.polygonOffset(t, i),
  51254. P = t,
  51255. O = i)
  51256. }
  51257. ,
  51258. this.getScissorTest = function() {
  51259. return L
  51260. }
  51261. ,
  51262. this.setScissorTest = function(e) {
  51263. (L = e) ? this.enable(l.SCISSOR_TEST) : this.disable(l.SCISSOR_TEST)
  51264. }
  51265. ,
  51266. this.activeTexture = function(e) {
  51267. void 0 === e && (e = l.TEXTURE0 + D - 1),
  51268. N !== e && (l.activeTexture(e),
  51269. N = e)
  51270. }
  51271. ,
  51272. this.bindTexture = function(e, t) {
  51273. void 0 === N && n.activeTexture();
  51274. var i = F[N];
  51275. void 0 === i && (i = {
  51276. type: void 0,
  51277. texture: void 0
  51278. },
  51279. F[N] = i),
  51280. i.type === e && i.texture === t || (l.bindTexture(e, t || z),
  51281. i.type = e,
  51282. i.texture = t)
  51283. }
  51284. ,
  51285. this.compressedTexImage2D = function() {
  51286. try {
  51287. l.compressedTexImage2D.apply(l, arguments)
  51288. } catch (e) {
  51289. console.error(e)
  51290. }
  51291. }
  51292. ,
  51293. this.texImage2D = function() {
  51294. try {
  51295. l.texImage2D.apply(l, arguments)
  51296. } catch (e) {
  51297. console.error(e)
  51298. }
  51299. }
  51300. ,
  51301. this.clearColor = function(e, t, i, n) {
  51302. r.set(e, t, i, n),
  51303. !1 === B.equals(r) && (l.clearColor(e, t, i, n),
  51304. B.copy(r))
  51305. }
  51306. ,
  51307. this.clearDepth = function(e) {
  51308. V !== e && (l.clearDepth(e),
  51309. V = e)
  51310. }
  51311. ,
  51312. this.clearStencil = function(e) {
  51313. k !== e && (l.clearStencil(e),
  51314. k = e)
  51315. }
  51316. ,
  51317. this.scissor = function(e) {
  51318. !1 === U.equals(e) && (l.scissor(e.x, e.y, e.z, e.w),
  51319. U.copy(e))
  51320. }
  51321. ,
  51322. this.viewport = function(e) {
  51323. !1 === H.equals(e) && (l.viewport(e.x, e.y, e.z, e.w),
  51324. H.copy(e))
  51325. }
  51326. ,
  51327. this.reset = function() {
  51328. for (var e = 0; e < a.length; e++)
  51329. 1 === a[e] && (l.disableVertexAttribArray(e),
  51330. a[e] = 0);
  51331. t = {},
  51332. N = void 0,
  51333. F = {},
  51334. M = E = C = I = u = h = null
  51335. }
  51336. }
  51337. ,
  51338. Ci.LensFlarePlugin = function(v, y) {
  51339. function A() {
  51340. 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]);
  51341. C = S.createBuffer(),
  51342. I = S.createBuffer(),
  51343. S.bindBuffer(S.ARRAY_BUFFER, C),
  51344. S.bufferData(S.ARRAY_BUFFER, t, S.STATIC_DRAW),
  51345. S.bindBuffer(S.ELEMENT_ARRAY_BUFFER, I),
  51346. S.bufferData(S.ELEMENT_ARRAY_BUFFER, i, S.STATIC_DRAW),
  51347. T = S.createTexture(),
  51348. x = S.createTexture(),
  51349. M.bindTexture(S.TEXTURE_2D, T),
  51350. S.texImage2D(S.TEXTURE_2D, 0, S.RGB, 16, 16, 0, S.RGB, S.UNSIGNED_BYTE, null),
  51351. S.texParameteri(S.TEXTURE_2D, S.TEXTURE_WRAP_S, S.CLAMP_TO_EDGE),
  51352. S.texParameteri(S.TEXTURE_2D, S.TEXTURE_WRAP_T, S.CLAMP_TO_EDGE),
  51353. S.texParameteri(S.TEXTURE_2D, S.TEXTURE_MAG_FILTER, S.NEAREST),
  51354. S.texParameteri(S.TEXTURE_2D, S.TEXTURE_MIN_FILTER, S.NEAREST),
  51355. M.bindTexture(S.TEXTURE_2D, x),
  51356. S.texImage2D(S.TEXTURE_2D, 0, S.RGBA, 16, 16, 0, S.RGBA, S.UNSIGNED_BYTE, null),
  51357. S.texParameteri(S.TEXTURE_2D, S.TEXTURE_WRAP_S, S.CLAMP_TO_EDGE),
  51358. S.texParameteri(S.TEXTURE_2D, S.TEXTURE_WRAP_T, S.CLAMP_TO_EDGE),
  51359. S.texParameteri(S.TEXTURE_2D, S.TEXTURE_MAG_FILTER, S.NEAREST),
  51360. S.texParameteri(S.TEXTURE_2D, S.TEXTURE_MIN_FILTER, S.NEAREST),
  51361. e = (w = 0 < S.getParameter(S.MAX_VERTEX_TEXTURE_IMAGE_UNITS)) ? {
  51362. 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"),
  51363. 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")
  51364. } : {
  51365. 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"),
  51366. 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")
  51367. },
  51368. E = function(e) {
  51369. var t = S.createProgram()
  51370. , i = S.createShader(S.FRAGMENT_SHADER)
  51371. , n = S.createShader(S.VERTEX_SHADER)
  51372. , r = "precision " + v.getPrecision() + " float;\n";
  51373. return S.shaderSource(i, r + e.fragmentShader),
  51374. S.shaderSource(n, r + e.vertexShader),
  51375. S.compileShader(i),
  51376. S.compileShader(n),
  51377. S.attachShader(t, i),
  51378. S.attachShader(t, n),
  51379. S.linkProgram(t),
  51380. t
  51381. }(e),
  51382. _ = {
  51383. vertex: S.getAttribLocation(E, "position"),
  51384. uv: S.getAttribLocation(E, "uv")
  51385. },
  51386. b = {
  51387. renderType: S.getUniformLocation(E, "renderType"),
  51388. map: S.getUniformLocation(E, "map"),
  51389. occlusionMap: S.getUniformLocation(E, "occlusionMap"),
  51390. opacity: S.getUniformLocation(E, "opacity"),
  51391. color: S.getUniformLocation(E, "color"),
  51392. scale: S.getUniformLocation(E, "scale"),
  51393. rotation: S.getUniformLocation(E, "rotation"),
  51394. screenPosition: S.getUniformLocation(E, "screenPosition")
  51395. }
  51396. }
  51397. var C, I, E, _, b, w, T, x, S = v.context, M = v.state;
  51398. this.render = function(e, t, i) {
  51399. if (0 !== y.length) {
  51400. var n = new Ci.Vector3
  51401. , r = i.w / i.z
  51402. , o = .5 * i.z
  51403. , a = .5 * i.w
  51404. , s = 16 / i.w
  51405. , l = new Ci.Vector2(s * r,s)
  51406. , c = new Ci.Vector3(1,1,0)
  51407. , h = new Ci.Vector2(1,1);
  51408. void 0 === E && A(),
  51409. S.useProgram(E),
  51410. M.initAttributes(),
  51411. M.enableAttribute(_.vertex),
  51412. M.enableAttribute(_.uv),
  51413. M.disableUnusedAttributes(),
  51414. S.uniform1i(b.occlusionMap, 0),
  51415. S.uniform1i(b.map, 1),
  51416. S.bindBuffer(S.ARRAY_BUFFER, C),
  51417. S.vertexAttribPointer(_.vertex, 2, S.FLOAT, !1, 16, 0),
  51418. S.vertexAttribPointer(_.uv, 2, S.FLOAT, !1, 16, 8),
  51419. S.bindBuffer(S.ELEMENT_ARRAY_BUFFER, I),
  51420. M.disable(S.CULL_FACE),
  51421. M.setDepthWrite(!1);
  51422. for (var u = 0, d = y.length; u < d; u++) {
  51423. s = 16 / i.w,
  51424. l.set(s * r, s);
  51425. var p = y[u];
  51426. if (n.set(p.matrixWorld.elements[12], p.matrixWorld.elements[13], p.matrixWorld.elements[14]),
  51427. n.applyMatrix4(t.matrixWorldInverse),
  51428. n.applyProjection(t.projectionMatrix),
  51429. c.copy(n),
  51430. h.x = c.x * o + o,
  51431. h.y = c.y * a + a,
  51432. w || 0 < h.x && h.x < i.z && 0 < h.y && h.y < i.w) {
  51433. M.activeTexture(S.TEXTURE0),
  51434. M.bindTexture(S.TEXTURE_2D, null),
  51435. M.activeTexture(S.TEXTURE1),
  51436. M.bindTexture(S.TEXTURE_2D, T),
  51437. S.copyTexImage2D(S.TEXTURE_2D, 0, S.RGB, i.x + h.x - 8, i.y + h.y - 8, 16, 16, 0),
  51438. S.uniform1i(b.renderType, 0),
  51439. S.uniform2f(b.scale, l.x, l.y),
  51440. S.uniform3f(b.screenPosition, c.x, c.y, c.z),
  51441. M.disable(S.BLEND),
  51442. M.enable(S.DEPTH_TEST),
  51443. S.drawElements(S.TRIANGLES, 6, S.UNSIGNED_SHORT, 0),
  51444. M.activeTexture(S.TEXTURE0),
  51445. M.bindTexture(S.TEXTURE_2D, x),
  51446. S.copyTexImage2D(S.TEXTURE_2D, 0, S.RGBA, i.x + h.x - 8, i.y + h.y - 8, 16, 16, 0),
  51447. S.uniform1i(b.renderType, 1),
  51448. M.disable(S.DEPTH_TEST),
  51449. M.activeTexture(S.TEXTURE1),
  51450. M.bindTexture(S.TEXTURE_2D, T),
  51451. S.drawElements(S.TRIANGLES, 6, S.UNSIGNED_SHORT, 0),
  51452. p.positionScreen.copy(c),
  51453. p.customUpdateCallback ? p.customUpdateCallback(p) : p.updateLensFlares(),
  51454. S.uniform1i(b.renderType, 2),
  51455. M.enable(S.BLEND);
  51456. for (var f = 0, g = p.lensFlares.length; f < g; f++) {
  51457. var m = p.lensFlares[f];
  51458. .001 < m.opacity && .001 < m.scale && (c.x = m.x,
  51459. c.y = m.y,
  51460. c.z = m.z,
  51461. s = m.size * m.scale / i.w,
  51462. l.x = s * r,
  51463. l.y = s,
  51464. S.uniform3f(b.screenPosition, c.x, c.y, c.z),
  51465. S.uniform2f(b.scale, l.x, l.y),
  51466. S.uniform1f(b.rotation, m.rotation),
  51467. S.uniform1f(b.opacity, m.opacity),
  51468. S.uniform3f(b.color, m.color.r, m.color.g, m.color.b),
  51469. M.setBlending(m.blending, m.blendEquation, m.blendSrc, m.blendDst),
  51470. v.setTexture(m.texture, 1),
  51471. S.drawElements(S.TRIANGLES, 6, S.UNSIGNED_SHORT, 0))
  51472. }
  51473. }
  51474. }
  51475. M.enable(S.CULL_FACE),
  51476. M.enable(S.DEPTH_TEST),
  51477. M.setDepthWrite(!0),
  51478. v.resetGLState()
  51479. }
  51480. }
  51481. }
  51482. ,
  51483. Ci.SpritePlugin = function(u, d) {
  51484. function p() {
  51485. var e = new Float32Array([-.5, -.5, 0, 0, .5, -.5, 1, 0, .5, .5, 1, 1, -.5, .5, 0, 1])
  51486. , t = new Uint16Array([0, 1, 2, 0, 2, 3]);
  51487. g = I.createBuffer(),
  51488. m = I.createBuffer(),
  51489. I.bindBuffer(I.ARRAY_BUFFER, g),
  51490. I.bufferData(I.ARRAY_BUFFER, e, I.STATIC_DRAW),
  51491. I.bindBuffer(I.ELEMENT_ARRAY_BUFFER, m),
  51492. I.bufferData(I.ELEMENT_ARRAY_BUFFER, t, I.STATIC_DRAW),
  51493. v = function() {
  51494. var e = I.createProgram()
  51495. , t = I.createShader(I.VERTEX_SHADER)
  51496. , i = I.createShader(I.FRAGMENT_SHADER);
  51497. 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")),
  51498. 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")),
  51499. I.compileShader(t),
  51500. I.compileShader(i),
  51501. I.attachShader(e, t),
  51502. I.attachShader(e, i),
  51503. I.linkProgram(e),
  51504. e
  51505. }(),
  51506. y = {
  51507. position: I.getAttribLocation(v, "position"),
  51508. uv: I.getAttribLocation(v, "uv")
  51509. },
  51510. A = {
  51511. uvOffset: I.getUniformLocation(v, "uvOffset"),
  51512. uvScale: I.getUniformLocation(v, "uvScale"),
  51513. rotation: I.getUniformLocation(v, "rotation"),
  51514. scale: I.getUniformLocation(v, "scale"),
  51515. color: I.getUniformLocation(v, "color"),
  51516. map: I.getUniformLocation(v, "map"),
  51517. opacity: I.getUniformLocation(v, "opacity"),
  51518. modelViewMatrix: I.getUniformLocation(v, "modelViewMatrix"),
  51519. projectionMatrix: I.getUniformLocation(v, "projectionMatrix"),
  51520. fogType: I.getUniformLocation(v, "fogType"),
  51521. fogDensity: I.getUniformLocation(v, "fogDensity"),
  51522. fogNear: I.getUniformLocation(v, "fogNear"),
  51523. fogFar: I.getUniformLocation(v, "fogFar"),
  51524. fogColor: I.getUniformLocation(v, "fogColor"),
  51525. alphaTest: I.getUniformLocation(v, "alphaTest")
  51526. };
  51527. var i = document.createElement("canvas");
  51528. i.width = 8,
  51529. i.height = 8;
  51530. var n = i.getContext("2d");
  51531. n.fillStyle = "white",
  51532. n.fillRect(0, 0, 8, 8),
  51533. (C = new Ci.Texture(i)).needsUpdate = !0
  51534. }
  51535. function f(e, t) {
  51536. return e.renderOrder !== t.renderOrder ? e.renderOrder - t.renderOrder : e.z !== t.z ? t.z - e.z : t.id - e.id
  51537. }
  51538. var g, m, v, y, A, C, I = u.context, E = u.state, _ = new Ci.Vector3, b = new Ci.Quaternion, w = new Ci.Vector3;
  51539. this.render = function(e, t) {
  51540. if (0 !== d.length) {
  51541. void 0 === v && p(),
  51542. I.useProgram(v),
  51543. E.initAttributes(),
  51544. E.enableAttribute(y.position),
  51545. E.enableAttribute(y.uv),
  51546. E.disableUnusedAttributes(),
  51547. E.disable(I.CULL_FACE),
  51548. E.enable(I.BLEND),
  51549. I.bindBuffer(I.ARRAY_BUFFER, g),
  51550. I.vertexAttribPointer(y.position, 2, I.FLOAT, !1, 16, 0),
  51551. I.vertexAttribPointer(y.uv, 2, I.FLOAT, !1, 16, 8),
  51552. I.bindBuffer(I.ELEMENT_ARRAY_BUFFER, m),
  51553. I.uniformMatrix4fv(A.projectionMatrix, !1, t.projectionMatrix.elements),
  51554. E.activeTexture(I.TEXTURE0),
  51555. I.uniform1i(A.map, 0);
  51556. var i = 0
  51557. , n = 0
  51558. , r = e.fog;
  51559. r ? (I.uniform3f(A.fogColor, r.color.r, r.color.g, r.color.b),
  51560. r instanceof Ci.Fog ? (I.uniform1f(A.fogNear, r.near),
  51561. I.uniform1f(A.fogFar, r.far),
  51562. I.uniform1i(A.fogType, 1),
  51563. n = i = 1) : r instanceof Ci.FogExp2 && (I.uniform1f(A.fogDensity, r.density),
  51564. I.uniform1i(A.fogType, 2),
  51565. n = i = 2)) : (I.uniform1i(A.fogType, 0),
  51566. n = i = 0);
  51567. for (var o = 0, a = d.length; o < a; o++) {
  51568. (l = d[o]).modelViewMatrix.multiplyMatrices(t.matrixWorldInverse, l.matrixWorld),
  51569. l.z = -l.modelViewMatrix.elements[14]
  51570. }
  51571. d.sort(f);
  51572. var s = [];
  51573. for (o = 0,
  51574. a = d.length; o < a; o++) {
  51575. var l, c = (l = d[o]).material;
  51576. I.uniform1f(A.alphaTest, c.alphaTest),
  51577. I.uniformMatrix4fv(A.modelViewMatrix, !1, l.modelViewMatrix.elements),
  51578. l.matrixWorld.decompose(_, b, w),
  51579. s[0] = w.x,
  51580. s[1] = w.y;
  51581. var h = 0;
  51582. e.fog && c.fog && (h = n),
  51583. i !== h && (I.uniform1i(A.fogType, h),
  51584. i = h),
  51585. null !== c.map ? (I.uniform2f(A.uvOffset, c.map.offset.x, c.map.offset.y),
  51586. I.uniform2f(A.uvScale, c.map.repeat.x, c.map.repeat.y)) : (I.uniform2f(A.uvOffset, 0, 0),
  51587. I.uniform2f(A.uvScale, 1, 1)),
  51588. I.uniform1f(A.opacity, c.opacity),
  51589. I.uniform3f(A.color, c.color.r, c.color.g, c.color.b),
  51590. I.uniform1f(A.rotation, c.rotation),
  51591. I.uniform2fv(A.scale, s),
  51592. E.setBlending(c.blending, c.blendEquation, c.blendSrc, c.blendDst),
  51593. E.setDepthTest(c.depthTest),
  51594. E.setDepthWrite(c.depthWrite),
  51595. c.map && c.map.image && c.map.image.width ? u.setTexture(c.map, 0) : u.setTexture(C, 0),
  51596. I.drawElements(I.TRIANGLES, 6, I.UNSIGNED_SHORT, 0)
  51597. }
  51598. E.enable(I.CULL_FACE),
  51599. u.resetGLState()
  51600. }
  51601. }
  51602. }
  51603. ,
  51604. Object.defineProperties(Ci.Box2.prototype, {
  51605. empty: {
  51606. value: function() {
  51607. return console.warn("THREE.Box2: .empty() has been renamed to .isEmpty()."),
  51608. this.isEmpty()
  51609. }
  51610. },
  51611. isIntersectionBox: {
  51612. value: function(e) {
  51613. return console.warn("THREE.Box2: .isIntersectionBox() has been renamed to .intersectsBox()."),
  51614. this.intersectsBox(e)
  51615. }
  51616. }
  51617. }),
  51618. Object.defineProperties(Ci.Box3.prototype, {
  51619. empty: {
  51620. value: function() {
  51621. return console.warn("THREE.Box3: .empty() has been renamed to .isEmpty()."),
  51622. this.isEmpty()
  51623. }
  51624. },
  51625. isIntersectionBox: {
  51626. value: function(e) {
  51627. return console.warn("THREE.Box3: .isIntersectionBox() has been renamed to .intersectsBox()."),
  51628. this.intersectsBox(e)
  51629. }
  51630. },
  51631. isIntersectionSphere: {
  51632. value: function(e) {
  51633. return console.warn("THREE.Box3: .isIntersectionSphere() has been renamed to .intersectsSphere()."),
  51634. this.intersectsSphere(e)
  51635. }
  51636. }
  51637. }),
  51638. Object.defineProperties(Ci.Matrix3.prototype, {
  51639. multiplyVector3: {
  51640. value: function(e) {
  51641. return console.warn("THREE.Matrix3: .multiplyVector3() has been removed. Use vector.applyMatrix3( matrix ) instead."),
  51642. e.applyMatrix3(this)
  51643. }
  51644. },
  51645. multiplyVector3Array: {
  51646. value: function(e) {
  51647. return console.warn("THREE.Matrix3: .multiplyVector3Array() has been renamed. Use matrix.applyToVector3Array( array ) instead."),
  51648. this.applyToVector3Array(e)
  51649. }
  51650. }
  51651. }),
  51652. Object.defineProperties(Ci.Matrix4.prototype, {
  51653. extractPosition: {
  51654. value: function(e) {
  51655. return console.warn("THREE.Matrix4: .extractPosition() has been renamed to .copyPosition()."),
  51656. this.copyPosition(e)
  51657. }
  51658. },
  51659. setRotationFromQuaternion: {
  51660. value: function(e) {
  51661. return console.warn("THREE.Matrix4: .setRotationFromQuaternion() has been renamed to .makeRotationFromQuaternion()."),
  51662. this.makeRotationFromQuaternion(e)
  51663. }
  51664. },
  51665. multiplyVector3: {
  51666. value: function(e) {
  51667. return console.warn("THREE.Matrix4: .multiplyVector3() has been removed. Use vector.applyMatrix4( matrix ) or vector.applyProjection( matrix ) instead."),
  51668. e.applyProjection(this)
  51669. }
  51670. },
  51671. multiplyVector4: {
  51672. value: function(e) {
  51673. return console.warn("THREE.Matrix4: .multiplyVector4() has been removed. Use vector.applyMatrix4( matrix ) instead."),
  51674. e.applyMatrix4(this)
  51675. }
  51676. },
  51677. multiplyVector3Array: {
  51678. value: function(e) {
  51679. return console.warn("THREE.Matrix4: .multiplyVector3Array() has been renamed. Use matrix.applyToVector3Array( array ) instead."),
  51680. this.applyToVector3Array(e)
  51681. }
  51682. },
  51683. rotateAxis: {
  51684. value: function(e) {
  51685. console.warn("THREE.Matrix4: .rotateAxis() has been removed. Use Vector3.transformDirection( matrix ) instead."),
  51686. e.transformDirection(this)
  51687. }
  51688. },
  51689. crossVector: {
  51690. value: function(e) {
  51691. return console.warn("THREE.Matrix4: .crossVector() has been removed. Use vector.applyMatrix4( matrix ) instead."),
  51692. e.applyMatrix4(this)
  51693. }
  51694. },
  51695. translate: {
  51696. value: function(e) {
  51697. console.error("THREE.Matrix4: .translate() has been removed.")
  51698. }
  51699. },
  51700. rotateX: {
  51701. value: function(e) {
  51702. console.error("THREE.Matrix4: .rotateX() has been removed.")
  51703. }
  51704. },
  51705. rotateY: {
  51706. value: function(e) {
  51707. console.error("THREE.Matrix4: .rotateY() has been removed.")
  51708. }
  51709. },
  51710. rotateZ: {
  51711. value: function(e) {
  51712. console.error("THREE.Matrix4: .rotateZ() has been removed.")
  51713. }
  51714. },
  51715. rotateByAxis: {
  51716. value: function(e, t) {
  51717. console.error("THREE.Matrix4: .rotateByAxis() has been removed.")
  51718. }
  51719. }
  51720. }),
  51721. Object.defineProperties(Ci.Plane.prototype, {
  51722. isIntersectionLine: {
  51723. value: function(e) {
  51724. return console.warn("THREE.Plane: .isIntersectionLine() has been renamed to .intersectsLine()."),
  51725. this.intersectsLine(e)
  51726. }
  51727. }
  51728. }),
  51729. Object.defineProperties(Ci.Quaternion.prototype, {
  51730. multiplyVector3: {
  51731. value: function(e) {
  51732. return console.warn("THREE.Quaternion: .multiplyVector3() has been removed. Use is now vector.applyQuaternion( quaternion ) instead."),
  51733. e.applyQuaternion(this)
  51734. }
  51735. }
  51736. }),
  51737. Object.defineProperties(Ci.Ray.prototype, {
  51738. isIntersectionBox: {
  51739. value: function(e) {
  51740. return console.warn("THREE.Ray: .isIntersectionBox() has been renamed to .intersectsBox()."),
  51741. this.intersectsBox(e)
  51742. }
  51743. },
  51744. isIntersectionPlane: {
  51745. value: function(e) {
  51746. return console.warn("THREE.Ray: .isIntersectionPlane() has been renamed to .intersectsPlane()."),
  51747. this.intersectsPlane(e)
  51748. }
  51749. },
  51750. isIntersectionSphere: {
  51751. value: function(e) {
  51752. return console.warn("THREE.Ray: .isIntersectionSphere() has been renamed to .intersectsSphere()."),
  51753. this.intersectsSphere(e)
  51754. }
  51755. }
  51756. }),
  51757. Object.defineProperties(Ci.Vector3.prototype, {
  51758. setEulerFromRotationMatrix: {
  51759. value: function() {
  51760. console.error("THREE.Vector3: .setEulerFromRotationMatrix() has been removed. Use Euler.setFromRotationMatrix() instead.")
  51761. }
  51762. },
  51763. setEulerFromQuaternion: {
  51764. value: function() {
  51765. console.error("THREE.Vector3: .setEulerFromQuaternion() has been removed. Use Euler.setFromQuaternion() instead.")
  51766. }
  51767. },
  51768. getPositionFromMatrix: {
  51769. value: function(e) {
  51770. return console.warn("THREE.Vector3: .getPositionFromMatrix() has been renamed to .setFromMatrixPosition()."),
  51771. this.setFromMatrixPosition(e)
  51772. }
  51773. },
  51774. getScaleFromMatrix: {
  51775. value: function(e) {
  51776. return console.warn("THREE.Vector3: .getScaleFromMatrix() has been renamed to .setFromMatrixScale()."),
  51777. this.setFromMatrixScale(e)
  51778. }
  51779. },
  51780. getColumnFromMatrix: {
  51781. value: function(e, t) {
  51782. return console.warn("THREE.Vector3: .getColumnFromMatrix() has been renamed to .setFromMatrixColumn()."),
  51783. this.setFromMatrixColumn(e, t)
  51784. }
  51785. }
  51786. }),
  51787. Ci.Face4 = function(e, t, i, n, r, o, a) {
  51788. return console.warn("THREE.Face4 has been removed. A THREE.Face3 will be created instead."),
  51789. new Ci.Face3(e,t,i,r,o,a)
  51790. }
  51791. ,
  51792. Ci.Vertex = function(e, t, i) {
  51793. return console.warn("THREE.Vertex has been removed. Use THREE.Vector3 instead."),
  51794. new Ci.Vector3(e,t,i)
  51795. }
  51796. ,
  51797. Object.defineProperties(Ci.Object3D.prototype, {
  51798. eulerOrder: {
  51799. get: function() {
  51800. return console.warn("THREE.Object3D: .eulerOrder is now .rotation.order."),
  51801. this.rotation.order
  51802. },
  51803. set: function(e) {
  51804. console.warn("THREE.Object3D: .eulerOrder is now .rotation.order."),
  51805. this.rotation.order = e
  51806. }
  51807. },
  51808. getChildByName: {
  51809. value: function(e) {
  51810. return console.warn("THREE.Object3D: .getChildByName() has been renamed to .getObjectByName()."),
  51811. this.getObjectByName(e)
  51812. }
  51813. },
  51814. renderDepth: {
  51815. set: function(e) {
  51816. console.warn("THREE.Object3D: .renderDepth has been removed. Use .renderOrder, instead.")
  51817. }
  51818. },
  51819. translate: {
  51820. value: function(e, t) {
  51821. return console.warn("THREE.Object3D: .translate() has been removed. Use .translateOnAxis( axis, distance ) instead."),
  51822. this.translateOnAxis(t, e)
  51823. }
  51824. },
  51825. useQuaternion: {
  51826. get: function() {
  51827. console.warn("THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.")
  51828. },
  51829. set: function(e) {
  51830. console.warn("THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.")
  51831. }
  51832. }
  51833. }),
  51834. Object.defineProperties(Ci, {
  51835. PointCloud: {
  51836. value: function(e, t) {
  51837. return console.warn("THREE.PointCloud has been renamed to THREE.Points."),
  51838. new Ci.Points(e,t)
  51839. }
  51840. },
  51841. ParticleSystem: {
  51842. value: function(e, t) {
  51843. return console.warn("THREE.ParticleSystem has been renamed to THREE.Points."),
  51844. new Ci.Points(e,t)
  51845. }
  51846. }
  51847. }),
  51848. Object.defineProperties(Ci.Light.prototype, {
  51849. onlyShadow: {
  51850. set: function(e) {
  51851. console.warn("THREE.Light: .onlyShadow has been removed.")
  51852. }
  51853. },
  51854. shadowCameraFov: {
  51855. set: function(e) {
  51856. console.warn("THREE.Light: .shadowCameraFov is now .shadow.camera.fov."),
  51857. this.shadow.camera.fov = e
  51858. }
  51859. },
  51860. shadowCameraLeft: {
  51861. set: function(e) {
  51862. console.warn("THREE.Light: .shadowCameraLeft is now .shadow.camera.left."),
  51863. this.shadow.camera.left = e
  51864. }
  51865. },
  51866. shadowCameraRight: {
  51867. set: function(e) {
  51868. console.warn("THREE.Light: .shadowCameraRight is now .shadow.camera.right."),
  51869. this.shadow.camera.right = e
  51870. }
  51871. },
  51872. shadowCameraTop: {
  51873. set: function(e) {
  51874. console.warn("THREE.Light: .shadowCameraTop is now .shadow.camera.top."),
  51875. this.shadow.camera.top = e
  51876. }
  51877. },
  51878. shadowCameraBottom: {
  51879. set: function(e) {
  51880. console.warn("THREE.Light: .shadowCameraBottom is now .shadow.camera.bottom."),
  51881. this.shadow.camera.bottom = e
  51882. }
  51883. },
  51884. shadowCameraNear: {
  51885. set: function(e) {
  51886. console.warn("THREE.Light: .shadowCameraNear is now .shadow.camera.near."),
  51887. this.shadow.camera.near = e
  51888. }
  51889. },
  51890. shadowCameraFar: {
  51891. set: function(e) {
  51892. console.warn("THREE.Light: .shadowCameraFar is now .shadow.camera.far."),
  51893. this.shadow.camera.far = e
  51894. }
  51895. },
  51896. shadowCameraVisible: {
  51897. set: function(e) {
  51898. console.warn("THREE.Light: .shadowCameraVisible has been removed. Use new THREE.CameraHelper( light.shadow.camera ) instead.")
  51899. }
  51900. },
  51901. shadowBias: {
  51902. set: function(e) {
  51903. console.warn("THREE.Light: .shadowBias is now .shadow.bias."),
  51904. this.shadow.bias = e
  51905. }
  51906. },
  51907. shadowDarkness: {
  51908. set: function(e) {
  51909. console.warn("THREE.Light: .shadowDarkness has been removed.")
  51910. }
  51911. },
  51912. shadowMapWidth: {
  51913. set: function(e) {
  51914. console.warn("THREE.Light: .shadowMapWidth is now .shadow.mapSize.width."),
  51915. this.shadow.mapSize.width = e
  51916. }
  51917. },
  51918. shadowMapHeight: {
  51919. set: function(e) {
  51920. console.warn("THREE.Light: .shadowMapHeight is now .shadow.mapSize.height."),
  51921. this.shadow.mapSize.height = e
  51922. }
  51923. }
  51924. }),
  51925. Object.defineProperties(Ci.BufferAttribute.prototype, {
  51926. length: {
  51927. get: function() {
  51928. return console.warn("THREE.BufferAttribute: .length has been deprecated. Please use .count."),
  51929. this.array.length
  51930. }
  51931. }
  51932. }),
  51933. Object.defineProperties(Ci.BufferGeometry.prototype, {
  51934. drawcalls: {
  51935. get: function() {
  51936. return console.error("THREE.BufferGeometry: .drawcalls has been renamed to .groups."),
  51937. this.groups
  51938. }
  51939. },
  51940. offsets: {
  51941. get: function() {
  51942. return console.warn("THREE.BufferGeometry: .offsets has been renamed to .groups."),
  51943. this.groups
  51944. }
  51945. },
  51946. addIndex: {
  51947. value: function(e) {
  51948. console.warn("THREE.BufferGeometry: .addIndex() has been renamed to .setIndex()."),
  51949. this.setIndex(e)
  51950. }
  51951. },
  51952. addDrawCall: {
  51953. value: function(e, t, i) {
  51954. void 0 !== i && console.warn("THREE.BufferGeometry: .addDrawCall() no longer supports indexOffset."),
  51955. console.warn("THREE.BufferGeometry: .addDrawCall() is now .addGroup()."),
  51956. this.addGroup(e, t)
  51957. }
  51958. },
  51959. clearDrawCalls: {
  51960. value: function() {
  51961. console.warn("THREE.BufferGeometry: .clearDrawCalls() is now .clearGroups()."),
  51962. this.clearGroups()
  51963. }
  51964. },
  51965. computeTangents: {
  51966. value: function() {
  51967. console.warn("THREE.BufferGeometry: .computeTangents() has been removed.")
  51968. }
  51969. },
  51970. computeOffsets: {
  51971. value: function() {
  51972. console.warn("THREE.BufferGeometry: .computeOffsets() has been removed.")
  51973. }
  51974. }
  51975. }),
  51976. Object.defineProperties(Ci.Material.prototype, {
  51977. wrapAround: {
  51978. get: function() {
  51979. console.warn("THREE." + this.type + ": .wrapAround has been removed.")
  51980. },
  51981. set: function(e) {
  51982. console.warn("THREE." + this.type + ": .wrapAround has been removed.")
  51983. }
  51984. },
  51985. wrapRGB: {
  51986. get: function() {
  51987. return console.warn("THREE." + this.type + ": .wrapRGB has been removed."),
  51988. new Ci.Color
  51989. }
  51990. }
  51991. }),
  51992. Object.defineProperties(Ci, {
  51993. PointCloudMaterial: {
  51994. value: function(e) {
  51995. return console.warn("THREE.PointCloudMaterial has been renamed to THREE.PointsMaterial."),
  51996. new Ci.PointsMaterial(e)
  51997. }
  51998. },
  51999. ParticleBasicMaterial: {
  52000. value: function(e) {
  52001. return console.warn("THREE.ParticleBasicMaterial has been renamed to THREE.PointsMaterial."),
  52002. new Ci.PointsMaterial(e)
  52003. }
  52004. },
  52005. ParticleSystemMaterial: {
  52006. value: function(e) {
  52007. return console.warn("THREE.ParticleSystemMaterial has been renamed to THREE.PointsMaterial."),
  52008. new Ci.PointsMaterial(e)
  52009. }
  52010. }
  52011. }),
  52012. Object.defineProperties(Ci.MeshPhongMaterial.prototype, {
  52013. metal: {
  52014. get: function() {
  52015. return console.warn("THREE.MeshPhongMaterial: .metal has been removed. Use THREE.MeshStandardMaterial instead."),
  52016. !1
  52017. },
  52018. set: function(e) {
  52019. console.warn("THREE.MeshPhongMaterial: .metal has been removed. Use THREE.MeshStandardMaterial instead")
  52020. }
  52021. }
  52022. }),
  52023. Object.defineProperties(Ci.ShaderMaterial.prototype, {
  52024. derivatives: {
  52025. get: function() {
  52026. return console.warn("THREE.ShaderMaterial: .derivatives has been moved to .extensions.derivatives."),
  52027. this.extensions.derivatives
  52028. },
  52029. set: function(e) {
  52030. console.warn("THREE. ShaderMaterial: .derivatives has been moved to .extensions.derivatives."),
  52031. this.extensions.derivatives = e
  52032. }
  52033. }
  52034. }),
  52035. Object.defineProperties(Ci.WebGLRenderer.prototype, {
  52036. supportsFloatTextures: {
  52037. value: function() {
  52038. return console.warn("THREE.WebGLRenderer: .supportsFloatTextures() is now .extensions.get( 'OES_texture_float' )."),
  52039. this.extensions.get("OES_texture_float")
  52040. }
  52041. },
  52042. supportsHalfFloatTextures: {
  52043. value: function() {
  52044. return console.warn("THREE.WebGLRenderer: .supportsHalfFloatTextures() is now .extensions.get( 'OES_texture_half_float' )."),
  52045. this.extensions.get("OES_texture_half_float")
  52046. }
  52047. },
  52048. supportsStandardDerivatives: {
  52049. value: function() {
  52050. return console.warn("THREE.WebGLRenderer: .supportsStandardDerivatives() is now .extensions.get( 'OES_standard_derivatives' )."),
  52051. this.extensions.get("OES_standard_derivatives")
  52052. }
  52053. },
  52054. supportsCompressedTextureS3TC: {
  52055. value: function() {
  52056. return console.warn("THREE.WebGLRenderer: .supportsCompressedTextureS3TC() is now .extensions.get( 'WEBGL_compressed_texture_s3tc' )."),
  52057. this.extensions.get("WEBGL_compressed_texture_s3tc")
  52058. }
  52059. },
  52060. supportsCompressedTexturePVRTC: {
  52061. value: function() {
  52062. return console.warn("THREE.WebGLRenderer: .supportsCompressedTexturePVRTC() is now .extensions.get( 'WEBGL_compressed_texture_pvrtc' )."),
  52063. this.extensions.get("WEBGL_compressed_texture_pvrtc")
  52064. }
  52065. },
  52066. supportsBlendMinMax: {
  52067. value: function() {
  52068. return console.warn("THREE.WebGLRenderer: .supportsBlendMinMax() is now .extensions.get( 'EXT_blend_minmax' )."),
  52069. this.extensions.get("EXT_blend_minmax")
  52070. }
  52071. },
  52072. supportsVertexTextures: {
  52073. value: function() {
  52074. return this.capabilities.vertexTextures
  52075. }
  52076. },
  52077. supportsInstancedArrays: {
  52078. value: function() {
  52079. return console.warn("THREE.WebGLRenderer: .supportsInstancedArrays() is now .extensions.get( 'ANGLE_instanced_arrays' )."),
  52080. this.extensions.get("ANGLE_instanced_arrays")
  52081. }
  52082. },
  52083. enableScissorTest: {
  52084. value: function(e) {
  52085. console.warn("THREE.WebGLRenderer: .enableScissorTest() is now .setScissorTest()."),
  52086. this.setScissorTest(e)
  52087. }
  52088. },
  52089. initMaterial: {
  52090. value: function() {
  52091. console.warn("THREE.WebGLRenderer: .initMaterial() has been removed.")
  52092. }
  52093. },
  52094. addPrePlugin: {
  52095. value: function() {
  52096. console.warn("THREE.WebGLRenderer: .addPrePlugin() has been removed.")
  52097. }
  52098. },
  52099. addPostPlugin: {
  52100. value: function() {
  52101. console.warn("THREE.WebGLRenderer: .addPostPlugin() has been removed.")
  52102. }
  52103. },
  52104. updateShadowMap: {
  52105. value: function() {
  52106. console.warn("THREE.WebGLRenderer: .updateShadowMap() has been removed.")
  52107. }
  52108. },
  52109. shadowMapEnabled: {
  52110. get: function() {
  52111. return this.shadowMap.enabled
  52112. },
  52113. set: function(e) {
  52114. console.warn("THREE.WebGLRenderer: .shadowMapEnabled is now .shadowMap.enabled."),
  52115. this.shadowMap.enabled = e
  52116. }
  52117. },
  52118. shadowMapType: {
  52119. get: function() {
  52120. return this.shadowMap.type
  52121. },
  52122. set: function(e) {
  52123. console.warn("THREE.WebGLRenderer: .shadowMapType is now .shadowMap.type."),
  52124. this.shadowMap.type = e
  52125. }
  52126. },
  52127. shadowMapCullFace: {
  52128. get: function() {
  52129. return this.shadowMap.cullFace
  52130. },
  52131. set: function(e) {
  52132. console.warn("THREE.WebGLRenderer: .shadowMapCullFace is now .shadowMap.cullFace."),
  52133. this.shadowMap.cullFace = e
  52134. }
  52135. }
  52136. }),
  52137. Object.defineProperties(Ci.WebGLRenderTarget.prototype, {
  52138. wrapS: {
  52139. get: function() {
  52140. return console.warn("THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS."),
  52141. this.texture.wrapS
  52142. },
  52143. set: function(e) {
  52144. console.warn("THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS."),
  52145. this.texture.wrapS = e
  52146. }
  52147. },
  52148. wrapT: {
  52149. get: function() {
  52150. return console.warn("THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT."),
  52151. this.texture.wrapT
  52152. },
  52153. set: function(e) {
  52154. console.warn("THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT."),
  52155. this.texture.wrapT = e
  52156. }
  52157. },
  52158. magFilter: {
  52159. get: function() {
  52160. return console.warn("THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter."),
  52161. this.texture.magFilter
  52162. },
  52163. set: function(e) {
  52164. console.warn("THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter."),
  52165. this.texture.magFilter = e
  52166. }
  52167. },
  52168. minFilter: {
  52169. get: function() {
  52170. return console.warn("THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter."),
  52171. this.texture.minFilter
  52172. },
  52173. set: function(e) {
  52174. console.warn("THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter."),
  52175. this.texture.minFilter = e
  52176. }
  52177. },
  52178. anisotropy: {
  52179. get: function() {
  52180. return console.warn("THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy."),
  52181. this.texture.anisotropy
  52182. },
  52183. set: function(e) {
  52184. console.warn("THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy."),
  52185. this.texture.anisotropy = e
  52186. }
  52187. },
  52188. offset: {
  52189. get: function() {
  52190. return console.warn("THREE.WebGLRenderTarget: .offset is now .texture.offset."),
  52191. this.texture.offset
  52192. },
  52193. set: function(e) {
  52194. console.warn("THREE.WebGLRenderTarget: .offset is now .texture.offset."),
  52195. this.texture.offset = e
  52196. }
  52197. },
  52198. repeat: {
  52199. get: function() {
  52200. return console.warn("THREE.WebGLRenderTarget: .repeat is now .texture.repeat."),
  52201. this.texture.repeat
  52202. },
  52203. set: function(e) {
  52204. console.warn("THREE.WebGLRenderTarget: .repeat is now .texture.repeat."),
  52205. this.texture.repeat = e
  52206. }
  52207. },
  52208. format: {
  52209. get: function() {
  52210. return console.warn("THREE.WebGLRenderTarget: .format is now .texture.format."),
  52211. this.texture.format
  52212. },
  52213. set: function(e) {
  52214. console.warn("THREE.WebGLRenderTarget: .format is now .texture.format."),
  52215. this.texture.format = e
  52216. }
  52217. },
  52218. type: {
  52219. get: function() {
  52220. return console.warn("THREE.WebGLRenderTarget: .type is now .texture.type."),
  52221. this.texture.type
  52222. },
  52223. set: function(e) {
  52224. console.warn("THREE.WebGLRenderTarget: .type is now .texture.type."),
  52225. this.texture.type = e
  52226. }
  52227. },
  52228. generateMipmaps: {
  52229. get: function() {
  52230. return console.warn("THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps."),
  52231. this.texture.generateMipmaps
  52232. },
  52233. set: function(e) {
  52234. console.warn("THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps."),
  52235. this.texture.generateMipmaps = e
  52236. }
  52237. }
  52238. }),
  52239. Ci.GeometryUtils = {
  52240. merge: function(e, t, i) {
  52241. var n;
  52242. console.warn("THREE.GeometryUtils: .merge() has been moved to Geometry. Use geometry.merge( geometry2, matrix, materialIndexOffset ) instead."),
  52243. t instanceof Ci.Mesh && (t.matrixAutoUpdate && t.updateMatrix(),
  52244. n = t.matrix,
  52245. t = t.geometry),
  52246. e.merge(t, n, i)
  52247. },
  52248. center: function(e) {
  52249. return console.warn("THREE.GeometryUtils: .center() has been moved to Geometry. Use geometry.center() instead."),
  52250. e.center()
  52251. }
  52252. },
  52253. Ci.ImageUtils = {
  52254. crossOrigin: void 0,
  52255. loadTexture: function(e, t, i, n) {
  52256. console.warn("THREE.ImageUtils.loadTexture has been deprecated. Use THREE.TextureLoader() instead.");
  52257. var r = new Ci.TextureLoader;
  52258. r.setCrossOrigin(this.crossOrigin);
  52259. var o = r.load(e, i, void 0, n);
  52260. return t && (o.mapping = t),
  52261. o
  52262. },
  52263. loadTextureCube: function(e, t, i, n) {
  52264. console.warn("THREE.ImageUtils.loadTextureCube has been deprecated. Use THREE.CubeTextureLoader() instead.");
  52265. var r = new Ci.CubeTextureLoader;
  52266. r.setCrossOrigin(this.crossOrigin);
  52267. var o = r.load(e, i, void 0, n);
  52268. return t && (o.mapping = t),
  52269. o
  52270. },
  52271. loadCompressedTexture: function() {
  52272. console.error("THREE.ImageUtils.loadCompressedTexture has been removed. Use THREE.DDSLoader instead.")
  52273. },
  52274. loadCompressedTextureCube: function() {
  52275. console.error("THREE.ImageUtils.loadCompressedTextureCube has been removed. Use THREE.DDSLoader instead.")
  52276. }
  52277. },
  52278. Ci.Projector = function() {
  52279. console.error("THREE.Projector has been moved to /examples/js/renderers/Projector.js."),
  52280. this.projectVector = function(e, t) {
  52281. console.warn("THREE.Projector: .projectVector() is now vector.project()."),
  52282. e.project(t)
  52283. }
  52284. ,
  52285. this.unprojectVector = function(e, t) {
  52286. console.warn("THREE.Projector: .unprojectVector() is now vector.unproject()."),
  52287. e.unproject(t)
  52288. }
  52289. ,
  52290. this.pickingRay = function(e, t) {
  52291. console.error("THREE.Projector: .pickingRay() is now raycaster.setFromCamera().")
  52292. }
  52293. }
  52294. ,
  52295. Ci.CanvasRenderer = function() {
  52296. console.error("THREE.CanvasRenderer has been moved to /examples/js/renderers/CanvasRenderer.js"),
  52297. this.domElement = document.createElement("canvas"),
  52298. this.clear = function() {}
  52299. ,
  52300. this.render = function() {}
  52301. ,
  52302. this.setClearColor = function() {}
  52303. ,
  52304. this.setSize = function() {}
  52305. }
  52306. ,
  52307. Ci.MeshFaceMaterial = Ci.MultiMaterial,
  52308. Ci.CurveUtils = {
  52309. tangentQuadraticBezier: function(e, t, i, n) {
  52310. return 2 * (1 - e) * (i - t) + 2 * e * (n - i)
  52311. },
  52312. tangentCubicBezier: function(e, t, i, n, r) {
  52313. 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
  52314. },
  52315. tangentSpline: function(e, t, i, n, r) {
  52316. return 6 * e * e - 6 * e + (3 * e * e - 4 * e + 1) + (-6 * e * e + 6 * e) + (3 * e * e - 2 * e)
  52317. },
  52318. interpolate: function(e, t, i, n, r) {
  52319. var o = .5 * (i - e)
  52320. , a = .5 * (n - t)
  52321. , s = r * r;
  52322. return (2 * t - 2 * i + o + a) * (r * s) + (-3 * t + 3 * i - 2 * o - a) * s + o * r + t
  52323. }
  52324. },
  52325. Ci.SceneUtils = {
  52326. createMultiMaterialObject: function(e, t) {
  52327. for (var i = new Ci.Group, n = 0, r = t.length; n < r; n++)
  52328. i.add(new Ci.Mesh(e,t[n]));
  52329. return i
  52330. },
  52331. detach: function(e, t, i) {
  52332. e.applyMatrix(t.matrixWorld),
  52333. t.remove(e),
  52334. i.add(e)
  52335. },
  52336. attach: function(e, t, i) {
  52337. var n = new Ci.Matrix4;
  52338. n.getInverse(i.matrixWorld),
  52339. e.applyMatrix(n),
  52340. t.remove(e),
  52341. i.add(e)
  52342. }
  52343. },
  52344. Ci.ShapeUtils = {
  52345. area: function(e) {
  52346. for (var t = e.length, i = 0, n = t - 1, r = 0; r < t; n = r++)
  52347. i += e[n].x * e[r].y - e[r].x * e[n].y;
  52348. return .5 * i
  52349. },
  52350. triangulate: function(e, t) {
  52351. var i = e.length;
  52352. if (i < 3)
  52353. return null;
  52354. var n, r, o, a = [], s = [], l = [];
  52355. if (0 < Ci.ShapeUtils.area(e))
  52356. for (r = 0; r < i; r++)
  52357. s[r] = r;
  52358. else
  52359. for (r = 0; r < i; r++)
  52360. s[r] = i - 1 - r;
  52361. var c = i
  52362. , h = 2 * c;
  52363. for (r = c - 1; 2 < c; ) {
  52364. if (h-- <= 0)
  52365. return console.warn("THREE.ShapeUtils: Unable to triangulate polygon! in triangulate()"),
  52366. t ? l : a;
  52367. if (c <= (n = r) && (n = 0),
  52368. c <= (r = n + 1) && (r = 0),
  52369. c <= (o = r + 1) && (o = 0),
  52370. Si(e, n, r, o, c, s)) {
  52371. var u, d, p, f, g;
  52372. for (u = s[n],
  52373. d = s[r],
  52374. p = s[o],
  52375. a.push([e[u], e[d], e[p]]),
  52376. l.push([s[n], s[r], s[o]]),
  52377. g = (f = r) + 1; g < c; f++,
  52378. g++)
  52379. s[f] = s[g];
  52380. h = 2 * --c
  52381. }
  52382. }
  52383. return t ? l : a
  52384. },
  52385. triangulateShape: function(e, t) {
  52386. function w(e, t, i) {
  52387. 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
  52388. }
  52389. function b(e, t, i, n, r) {
  52390. var o = t.x - e.x
  52391. , a = t.y - e.y
  52392. , s = n.x - i.x
  52393. , l = n.y - i.y
  52394. , c = e.x - i.x
  52395. , h = e.y - i.y
  52396. , u = a * s - o * l
  52397. , d = a * c - o * h;
  52398. if (Math.abs(u) > Number.EPSILON) {
  52399. var p;
  52400. if (0 < u) {
  52401. if (d < 0 || u < d)
  52402. return [];
  52403. if ((p = l * c - s * h) < 0 || u < p)
  52404. return []
  52405. } else {
  52406. if (0 < d || d < u)
  52407. return [];
  52408. if (0 < (p = l * c - s * h) || p < u)
  52409. return []
  52410. }
  52411. if (0 === p)
  52412. return !r || 0 != d && d != u ? [e] : [];
  52413. if (p === u)
  52414. return !r || 0 != d && d != u ? [t] : [];
  52415. if (0 == d)
  52416. return [i];
  52417. if (d == u)
  52418. return [n];
  52419. var f = p / u;
  52420. return [{
  52421. x: e.x + f * o,
  52422. y: e.y + f * a
  52423. }]
  52424. }
  52425. if (0 != d || l * c != s * h)
  52426. return [];
  52427. var g, m, v, y, A, C, I, E, _ = 0 == o && 0 == a, b = 0 == s && 0 == l;
  52428. 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,
  52429. (m = t).x) : (v = (g = t).x,
  52430. (m = e).x),
  52431. i.x < n.x ? (I = (A = i).x,
  52432. (C = n).x) : (I = (A = n).x,
  52433. (C = i).x)) : (y = e.y < t.y ? (v = (g = e).y,
  52434. (m = t).y) : (v = (g = t).y,
  52435. (m = e).y),
  52436. i.y < n.y ? (I = (A = i).y,
  52437. (C = n).y) : (I = (A = n).y,
  52438. (C = i).y)),
  52439. 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])
  52440. }
  52441. function T(e, t, i, n) {
  52442. var r = t.x - e.x
  52443. , o = t.y - e.y
  52444. , a = i.x - e.x
  52445. , s = i.y - e.y
  52446. , l = n.x - e.x
  52447. , c = n.y - e.y
  52448. , h = r * s - o * a
  52449. , u = r * c - o * l;
  52450. if (Math.abs(h) > Number.EPSILON) {
  52451. var d = l * s - c * a;
  52452. return 0 < h ? 0 <= u && 0 <= d : 0 <= u || 0 <= d
  52453. }
  52454. return 0 < u
  52455. }
  52456. for (var i, n, r, o, a, s, l = {}, c = e.concat(), h = 0, u = t.length; h < u; h++)
  52457. Array.prototype.push.apply(c, t[h]);
  52458. for (i = 0,
  52459. n = c.length; i < n; i++)
  52460. void 0 !== l[a = c[i].x + ":" + c[i].y] && console.warn("THREE.Shape: Duplicate point", a),
  52461. l[a] = i;
  52462. var d = function(e, a) {
  52463. function t(e, t) {
  52464. var i = m.length - 1
  52465. , n = e - 1;
  52466. n < 0 && (n = i);
  52467. var r = e + 1;
  52468. i < r && (r = 0);
  52469. var o = T(m[e], m[n], m[r], c[t]);
  52470. if (!o)
  52471. return !1;
  52472. var a = c.length - 1
  52473. , s = t - 1;
  52474. s < 0 && (s = a);
  52475. var l = t + 1;
  52476. return a < l && (l = 0),
  52477. !!(o = T(c[t], c[s], c[l], m[e]))
  52478. }
  52479. function i(e, t) {
  52480. var i, n;
  52481. for (i = 0; i < m.length; i++)
  52482. if (n = i + 1,
  52483. n %= m.length,
  52484. 0 < b(e, t, m[i], m[n], !0).length)
  52485. return !0;
  52486. return !1
  52487. }
  52488. function n(e, t) {
  52489. var i, n, r, o;
  52490. for (i = 0; i < v.length; i++)
  52491. for (n = a[v[i]],
  52492. r = 0; r < n.length; r++)
  52493. if (o = r + 1,
  52494. o %= n.length,
  52495. 0 < b(e, t, n[r], n[o], !0).length)
  52496. return !0;
  52497. return !1
  52498. }
  52499. 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++)
  52500. v.push(A);
  52501. for (var I = 0, E = 2 * v.length; 0 < v.length; ) {
  52502. if (--E < 0) {
  52503. console.log("Infinite Loop! Holes left:" + v.length + ", Probably Hole outside Shape!");
  52504. break
  52505. }
  52506. for (o = I; o < m.length; o++) {
  52507. s = m[o],
  52508. r = -1;
  52509. for (A = 0; A < v.length; A++)
  52510. if (h = v[A],
  52511. void 0 === y[u = s.x + ":" + s.y + ":" + h]) {
  52512. c = a[h];
  52513. for (var _ = 0; _ < c.length; _++)
  52514. if (l = c[_],
  52515. t(o, _) && !i(s, l) && !n(s, l)) {
  52516. r = _,
  52517. v.splice(A, 1),
  52518. d = m.slice(0, o + 1),
  52519. p = m.slice(o),
  52520. f = c.slice(r),
  52521. g = c.slice(0, r + 1),
  52522. m = d.concat(f).concat(g).concat(p),
  52523. I = o;
  52524. break
  52525. }
  52526. if (0 <= r)
  52527. break;
  52528. y[u] = !0
  52529. }
  52530. if (0 <= r)
  52531. break
  52532. }
  52533. }
  52534. return m
  52535. }(e, t)
  52536. , p = Ci.ShapeUtils.triangulate(d, !1);
  52537. for (i = 0,
  52538. n = p.length; i < n; i++)
  52539. for (o = p[i],
  52540. r = 0; r < 3; r++)
  52541. void 0 !== (s = l[a = o[r].x + ":" + o[r].y]) && (o[r] = s);
  52542. return p.concat()
  52543. },
  52544. isClockWise: function(e) {
  52545. return Ci.ShapeUtils.area(e) < 0
  52546. },
  52547. b2: function(e, t, i, n) {
  52548. return function(e, t) {
  52549. var i = 1 - e;
  52550. return i * i * t
  52551. }(e, t) + function(e, t) {
  52552. return 2 * (1 - e) * e * t
  52553. }(e, i) + function(e, t) {
  52554. return e * e * t
  52555. }(e, n)
  52556. },
  52557. b3: function(e, t, i, n, r) {
  52558. return function(e, t) {
  52559. var i = 1 - e;
  52560. return i * i * i * t
  52561. }(e, t) + function(e, t) {
  52562. var i = 1 - e;
  52563. return 3 * i * i * e * t
  52564. }(e, i) + function(e, t) {
  52565. return 3 * (1 - e) * e * e * t
  52566. }(e, n) + function(e, t) {
  52567. return e * e * e * t
  52568. }(e, r)
  52569. }
  52570. },
  52571. Ci.Curve = function() {}
  52572. ,
  52573. Ci.Curve.prototype = {
  52574. constructor: Ci.Curve,
  52575. getPoint: function(e) {
  52576. return console.warn("THREE.Curve: Warning, getPoint() not implemented!"),
  52577. null
  52578. },
  52579. getPointAt: function(e) {
  52580. var t = this.getUtoTmapping(e);
  52581. return this.getPoint(t)
  52582. },
  52583. getPoints: function(e) {
  52584. e = e || 5;
  52585. var t, i = [];
  52586. for (t = 0; t <= e; t++)
  52587. i.push(this.getPoint(t / e));
  52588. return i
  52589. },
  52590. getSpacedPoints: function(e) {
  52591. e = e || 5;
  52592. var t, i = [];
  52593. for (t = 0; t <= e; t++)
  52594. i.push(this.getPointAt(t / e));
  52595. return i
  52596. },
  52597. getLength: function() {
  52598. var e = this.getLengths();
  52599. return e[e.length - 1]
  52600. },
  52601. getLengths: function(e) {
  52602. if (e = e || (this.__arcLengthDivisions ? this.__arcLengthDivisions : 200),
  52603. this.cacheArcLengths && this.cacheArcLengths.length === e + 1 && !this.needsUpdate)
  52604. return this.cacheArcLengths;
  52605. this.needsUpdate = !1;
  52606. var t, i, n = [], r = this.getPoint(0), o = 0;
  52607. for (n.push(0),
  52608. i = 1; i <= e; i++)
  52609. o += (t = this.getPoint(i / e)).distanceTo(r),
  52610. n.push(o),
  52611. r = t;
  52612. return this.cacheArcLengths = n
  52613. },
  52614. updateArcLengths: function() {
  52615. this.needsUpdate = !0,
  52616. this.getLengths()
  52617. },
  52618. getUtoTmapping: function(e, t) {
  52619. var i, n = this.getLengths(), r = 0, o = n.length;
  52620. i = t || e * n[o - 1];
  52621. for (var a, s = 0, l = o - 1; s <= l; )
  52622. if ((a = n[r = Math.floor(s + (l - s) / 2)] - i) < 0)
  52623. s = r + 1;
  52624. else {
  52625. if (!(0 < a)) {
  52626. l = r;
  52627. break
  52628. }
  52629. l = r - 1
  52630. }
  52631. if (n[r = l] === i)
  52632. return r / (o - 1);
  52633. var c = n[r];
  52634. return (r + (i - c) / (n[r + 1] - c)) / (o - 1)
  52635. },
  52636. getTangent: function(e) {
  52637. var t = e - 1e-4
  52638. , i = e + 1e-4;
  52639. t < 0 && (t = 0),
  52640. 1 < i && (i = 1);
  52641. var n = this.getPoint(t);
  52642. return this.getPoint(i).clone().sub(n).normalize()
  52643. },
  52644. getTangentAt: function(e) {
  52645. var t = this.getUtoTmapping(e);
  52646. return this.getTangent(t)
  52647. }
  52648. },
  52649. Ci.Curve.create = function(e, t) {
  52650. return e.prototype = Object.create(Ci.Curve.prototype),
  52651. (e.prototype.constructor = e).prototype.getPoint = t,
  52652. e
  52653. }
  52654. ,
  52655. Ci.CurvePath = function() {
  52656. this.curves = [],
  52657. this.autoClose = !1
  52658. }
  52659. ,
  52660. Ci.CurvePath.prototype = Object.create(Ci.Curve.prototype),
  52661. Ci.CurvePath.prototype.constructor = Ci.CurvePath,
  52662. Ci.CurvePath.prototype.add = function(e) {
  52663. this.curves.push(e)
  52664. }
  52665. ,
  52666. Ci.CurvePath.prototype.closePath = function() {
  52667. var e = this.curves[0].getPoint(0)
  52668. , t = this.curves[this.curves.length - 1].getPoint(1);
  52669. e.equals(t) || this.curves.push(new Ci.LineCurve(t,e))
  52670. }
  52671. ,
  52672. Ci.CurvePath.prototype.getPoint = function(e) {
  52673. for (var t = e * this.getLength(), i = this.getCurveLengths(), n = 0; n < i.length; ) {
  52674. if (i[n] >= t) {
  52675. var r = i[n] - t
  52676. , o = this.curves[n]
  52677. , a = 1 - r / o.getLength();
  52678. return o.getPointAt(a)
  52679. }
  52680. n++
  52681. }
  52682. return null
  52683. }
  52684. ,
  52685. Ci.CurvePath.prototype.getLength = function() {
  52686. var e = this.getCurveLengths();
  52687. return e[e.length - 1]
  52688. }
  52689. ,
  52690. Ci.CurvePath.prototype.getCurveLengths = function() {
  52691. if (this.cacheLengths && this.cacheLengths.length === this.curves.length)
  52692. return this.cacheLengths;
  52693. for (var e = [], t = 0, i = 0, n = this.curves.length; i < n; i++)
  52694. t += this.curves[i].getLength(),
  52695. e.push(t);
  52696. return this.cacheLengths = e
  52697. }
  52698. ,
  52699. Ci.CurvePath.prototype.createPointsGeometry = function(e) {
  52700. var t = this.getPoints(e);
  52701. return this.createGeometry(t)
  52702. }
  52703. ,
  52704. Ci.CurvePath.prototype.createSpacedPointsGeometry = function(e) {
  52705. var t = this.getSpacedPoints(e);
  52706. return this.createGeometry(t)
  52707. }
  52708. ,
  52709. Ci.CurvePath.prototype.createGeometry = function(e) {
  52710. for (var t = new Ci.Geometry, i = 0, n = e.length; i < n; i++) {
  52711. var r = e[i];
  52712. t.vertices.push(new Ci.Vector3(r.x,r.y,r.z || 0))
  52713. }
  52714. return t
  52715. }
  52716. ,
  52717. Ci.Font = function(e) {
  52718. this.data = e
  52719. }
  52720. ,
  52721. Ci.Font.prototype = {
  52722. constructor: Ci.Font,
  52723. generateShapes: function(e, s, b) {
  52724. function l(e, t, i) {
  52725. var n = w.glyphs[e] || w.glyphs["?"];
  52726. if (n) {
  52727. 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;
  52728. if (n.o)
  52729. for (var A = n._cachedOutline || (n._cachedOutline = n.o.split(" ")), C = 0, I = A.length; C < I; ) {
  52730. switch (A[C++]) {
  52731. case "m":
  52732. r = A[C++] * t + i,
  52733. o = A[C++] * t,
  52734. g.moveTo(r, o);
  52735. break;
  52736. case "l":
  52737. r = A[C++] * t + i,
  52738. o = A[C++] * t,
  52739. g.lineTo(r, o);
  52740. break;
  52741. case "q":
  52742. if (a = A[C++] * t + i,
  52743. s = A[C++] * t,
  52744. h = A[C++] * t + i,
  52745. u = A[C++] * t,
  52746. g.quadraticCurveTo(h, u, a, s),
  52747. f = m[m.length - 1]) {
  52748. l = f.x,
  52749. c = f.y;
  52750. for (var E = 1; E <= b; E++) {
  52751. v(_ = E / b, l, h, a),
  52752. v(_, c, u, s)
  52753. }
  52754. }
  52755. break;
  52756. case "b":
  52757. if (a = A[C++] * t + i,
  52758. s = A[C++] * t,
  52759. h = A[C++] * t + i,
  52760. u = A[C++] * t,
  52761. d = A[C++] * t + i,
  52762. p = A[C++] * t,
  52763. g.bezierCurveTo(h, u, d, p, a, s),
  52764. f = m[m.length - 1]) {
  52765. l = f.x,
  52766. c = f.y;
  52767. for (E = 1; E <= b; E++) {
  52768. var _;
  52769. y(_ = E / b, l, h, d, a),
  52770. y(_, c, u, p, s)
  52771. }
  52772. }
  52773. }
  52774. }
  52775. return {
  52776. offset: n.ha * t,
  52777. path: g
  52778. }
  52779. }
  52780. }
  52781. void 0 === s && (s = 100),
  52782. void 0 === b && (b = 4);
  52783. for (var w = this.data, t = function(e) {
  52784. for (var t = String(e).split(""), i = s / w.resolution, n = 0, r = [], o = 0; o < t.length; o++) {
  52785. var a = l(t[o], i, n);
  52786. n += a.offset,
  52787. r.push(a.path)
  52788. }
  52789. return r
  52790. }(e), i = [], n = 0, r = t.length; n < r; n++)
  52791. Array.prototype.push.apply(i, t[n].toShapes());
  52792. return i
  52793. }
  52794. },
  52795. Ci.Path = function(e) {
  52796. Ci.CurvePath.call(this),
  52797. this.actions = [],
  52798. e && this.fromPoints(e)
  52799. }
  52800. ,
  52801. Ci.Path.prototype = Object.create(Ci.CurvePath.prototype),
  52802. Ci.Path.prototype.constructor = Ci.Path,
  52803. Ci.Path.prototype.fromPoints = function(e) {
  52804. this.moveTo(e[0].x, e[0].y);
  52805. for (var t = 1, i = e.length; t < i; t++)
  52806. this.lineTo(e[t].x, e[t].y)
  52807. }
  52808. ,
  52809. Ci.Path.prototype.moveTo = function(e, t) {
  52810. this.actions.push({
  52811. action: "moveTo",
  52812. args: [e, t]
  52813. })
  52814. }
  52815. ,
  52816. Ci.Path.prototype.lineTo = function(e, t) {
  52817. var i = this.actions[this.actions.length - 1].args
  52818. , n = i[i.length - 2]
  52819. , r = i[i.length - 1]
  52820. , o = new Ci.LineCurve(new Ci.Vector2(n,r),new Ci.Vector2(e,t));
  52821. this.curves.push(o),
  52822. this.actions.push({
  52823. action: "lineTo",
  52824. args: [e, t]
  52825. })
  52826. }
  52827. ,
  52828. Ci.Path.prototype.quadraticCurveTo = function(e, t, i, n) {
  52829. var r = this.actions[this.actions.length - 1].args
  52830. , o = r[r.length - 2]
  52831. , a = r[r.length - 1]
  52832. , s = new Ci.QuadraticBezierCurve(new Ci.Vector2(o,a),new Ci.Vector2(e,t),new Ci.Vector2(i,n));
  52833. this.curves.push(s),
  52834. this.actions.push({
  52835. action: "quadraticCurveTo",
  52836. args: [e, t, i, n]
  52837. })
  52838. }
  52839. ,
  52840. Ci.Path.prototype.bezierCurveTo = function(e, t, i, n, r, o) {
  52841. var a = this.actions[this.actions.length - 1].args
  52842. , s = a[a.length - 2]
  52843. , l = a[a.length - 1]
  52844. , c = new Ci.CubicBezierCurve(new Ci.Vector2(s,l),new Ci.Vector2(e,t),new Ci.Vector2(i,n),new Ci.Vector2(r,o));
  52845. this.curves.push(c),
  52846. this.actions.push({
  52847. action: "bezierCurveTo",
  52848. args: [e, t, i, n, r, o]
  52849. })
  52850. }
  52851. ,
  52852. Ci.Path.prototype.splineThru = function(e) {
  52853. var t = Array.prototype.slice.call(arguments)
  52854. , i = this.actions[this.actions.length - 1].args
  52855. , n = i[i.length - 2]
  52856. , r = i[i.length - 1]
  52857. , o = [new Ci.Vector2(n,r)];
  52858. Array.prototype.push.apply(o, e);
  52859. var a = new Ci.SplineCurve(o);
  52860. this.curves.push(a),
  52861. this.actions.push({
  52862. action: "splineThru",
  52863. args: t
  52864. })
  52865. }
  52866. ,
  52867. Ci.Path.prototype.arc = function(e, t, i, n, r, o) {
  52868. var a = this.actions[this.actions.length - 1].args
  52869. , s = a[a.length - 2]
  52870. , l = a[a.length - 1];
  52871. this.absarc(e + s, t + l, i, n, r, o)
  52872. }
  52873. ,
  52874. Ci.Path.prototype.absarc = function(e, t, i, n, r, o) {
  52875. this.absellipse(e, t, i, i, n, r, o)
  52876. }
  52877. ,
  52878. Ci.Path.prototype.ellipse = function(e, t, i, n, r, o, a, s) {
  52879. var l = this.actions[this.actions.length - 1].args
  52880. , c = l[l.length - 2]
  52881. , h = l[l.length - 1];
  52882. this.absellipse(e + c, t + h, i, n, r, o, a, s)
  52883. }
  52884. ,
  52885. Ci.Path.prototype.absellipse = function(e, t, i, n, r, o, a, s) {
  52886. var l = [e, t, i, n, r, o, a, s || 0]
  52887. , c = new Ci.EllipseCurve(e,t,i,n,r,o,a,s);
  52888. this.curves.push(c);
  52889. var h = c.getPoint(1);
  52890. l.push(h.x),
  52891. l.push(h.y),
  52892. this.actions.push({
  52893. action: "ellipse",
  52894. args: l
  52895. })
  52896. }
  52897. ,
  52898. Ci.Path.prototype.getSpacedPoints = function(e) {
  52899. e = e || 40;
  52900. for (var t = [], i = 0; i < e; i++)
  52901. t.push(this.getPoint(i / e));
  52902. return this.autoClose && t.push(t[0]),
  52903. t
  52904. }
  52905. ,
  52906. Ci.Path.prototype.getPoints = function(e) {
  52907. e = e || 12;
  52908. 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++) {
  52909. var v = this.actions[g]
  52910. , y = v.action
  52911. , A = v.args;
  52912. switch (y) {
  52913. case "moveTo":
  52914. case "lineTo":
  52915. f.push(new Ci.Vector2(A[0],A[1]));
  52916. break;
  52917. case "quadraticCurveTo":
  52918. t = A[2],
  52919. i = A[3],
  52920. o = A[0],
  52921. a = A[1],
  52922. l = 0 < f.length ? (s = (c = f[f.length - 1]).x,
  52923. c.y) : (s = (c = this.actions[g - 1].args)[c.length - 2],
  52924. c[c.length - 1]);
  52925. for (var C = 1; C <= e; C++) {
  52926. h = d(O = C / e, s, o, t),
  52927. u = d(O, l, a, i),
  52928. f.push(new Ci.Vector2(h,u))
  52929. }
  52930. break;
  52931. case "bezierCurveTo":
  52932. t = A[4],
  52933. i = A[5],
  52934. o = A[0],
  52935. a = A[1],
  52936. n = A[2],
  52937. r = A[3],
  52938. l = 0 < f.length ? (s = (c = f[f.length - 1]).x,
  52939. c.y) : (s = (c = this.actions[g - 1].args)[c.length - 2],
  52940. c[c.length - 1]);
  52941. for (C = 1; C <= e; C++) {
  52942. h = p(O = C / e, s, o, n, t),
  52943. u = p(O, l, a, r, i),
  52944. f.push(new Ci.Vector2(h,u))
  52945. }
  52946. break;
  52947. case "splineThru":
  52948. c = this.actions[g - 1].args;
  52949. var I = [new Ci.Vector2(c[c.length - 2],c[c.length - 1])]
  52950. , E = e * A[0].length;
  52951. I = I.concat(A[0]);
  52952. var _ = new Ci.SplineCurve(I);
  52953. for (C = 1; C <= E; C++)
  52954. f.push(_.getPointAt(C / E));
  52955. break;
  52956. case "arc":
  52957. var b = A[0]
  52958. , w = A[1]
  52959. , T = A[2]
  52960. , x = A[3]
  52961. , S = A[4]
  52962. , M = !!A[5]
  52963. , R = S - x
  52964. , P = 2 * e;
  52965. for (C = 1; C <= P; C++) {
  52966. var O = C / P;
  52967. M || (O = 1 - O),
  52968. L = x + O * R,
  52969. h = b + T * Math.cos(L),
  52970. u = w + T * Math.sin(L),
  52971. f.push(new Ci.Vector2(h,u))
  52972. }
  52973. break;
  52974. case "ellipse":
  52975. b = A[0],
  52976. w = A[1];
  52977. var L, D, N, F = A[2], B = A[3], V = (x = A[4],
  52978. S = A[5],
  52979. M = !!A[6],
  52980. A[7]);
  52981. R = S - x,
  52982. P = 2 * e;
  52983. 0 !== V && (D = Math.cos(V),
  52984. N = Math.sin(V));
  52985. for (C = 1; C <= P; C++) {
  52986. O = C / P;
  52987. if (M || (O = 1 - O),
  52988. L = x + O * R,
  52989. h = b + F * Math.cos(L),
  52990. u = w + B * Math.sin(L),
  52991. 0 !== V) {
  52992. var k = h;
  52993. h = (k - b) * D - (u - w) * N + b,
  52994. u = (k - b) * N + (u - w) * D + w
  52995. }
  52996. f.push(new Ci.Vector2(h,u))
  52997. }
  52998. }
  52999. }
  53000. var U = f[f.length - 1];
  53001. 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),
  53002. this.autoClose && f.push(f[0]),
  53003. f
  53004. }
  53005. ,
  53006. Ci.Path.prototype.toShapes = function(e, t) {
  53007. function i(e) {
  53008. for (var t = [], i = 0, n = e.length; i < n; i++) {
  53009. var r = e[i]
  53010. , o = new Ci.Shape;
  53011. o.actions = r.actions,
  53012. o.curves = r.curves,
  53013. t.push(o)
  53014. }
  53015. return t
  53016. }
  53017. function n(e, t) {
  53018. for (var i = t.length, n = !1, r = i - 1, o = 0; o < i; r = o++) {
  53019. var a = t[r]
  53020. , s = t[o]
  53021. , l = s.x - a.x
  53022. , c = s.y - a.y;
  53023. if (Math.abs(c) > Number.EPSILON) {
  53024. if (c < 0 && (a = t[o],
  53025. l = -l,
  53026. s = t[r],
  53027. c = -c),
  53028. e.y < a.y || e.y > s.y)
  53029. continue;
  53030. if (e.y === a.y) {
  53031. if (e.x === a.x)
  53032. return !0
  53033. } else {
  53034. var h = c * (e.x - a.x) - l * (e.y - a.y);
  53035. if (0 == h)
  53036. return !0;
  53037. if (h < 0)
  53038. continue;
  53039. n = !n
  53040. }
  53041. } else {
  53042. if (e.y !== a.y)
  53043. continue;
  53044. if (s.x <= e.x && e.x <= a.x || a.x <= e.x && e.x <= s.x)
  53045. return !0
  53046. }
  53047. }
  53048. return n
  53049. }
  53050. var r = Ci.ShapeUtils.isClockWise
  53051. , o = function(e) {
  53052. for (var t = [], i = new Ci.Path, n = 0, r = e.length; n < r; n++) {
  53053. var o = e[n]
  53054. , a = o.args
  53055. , s = o.action;
  53056. "moveTo" === s && 0 !== i.actions.length && (t.push(i),
  53057. i = new Ci.Path),
  53058. i[s].apply(i, a)
  53059. }
  53060. return 0 !== i.actions.length && t.push(i),
  53061. t
  53062. }(this.actions);
  53063. if (0 === o.length)
  53064. return [];
  53065. if (!0 === t)
  53066. return i(o);
  53067. var a, s, l, c = [];
  53068. if (1 === o.length)
  53069. return s = o[0],
  53070. (l = new Ci.Shape).actions = s.actions,
  53071. l.curves = s.curves,
  53072. c.push(l),
  53073. c;
  53074. var h = !r(o[0].getPoints());
  53075. h = e ? !h : h;
  53076. var u, d = [], p = [], f = [], g = 0;
  53077. p[g] = void 0,
  53078. f[g] = [];
  53079. for (var m = 0, v = o.length; m < v; m++)
  53080. a = r(u = (s = o[m]).getPoints()),
  53081. (a = e ? !a : a) ? (!h && p[g] && g++,
  53082. p[g] = {
  53083. s: new Ci.Shape,
  53084. p: u
  53085. },
  53086. p[g].s.actions = s.actions,
  53087. p[g].s.curves = s.curves,
  53088. h && g++,
  53089. f[g] = []) : f[g].push({
  53090. h: s,
  53091. p: u[0]
  53092. });
  53093. if (!p[0])
  53094. return i(o);
  53095. if (1 < p.length) {
  53096. for (var y = !1, A = [], C = 0, I = p.length; C < I; C++)
  53097. d[C] = [];
  53098. for (C = 0,
  53099. I = p.length; C < I; C++)
  53100. for (var E = f[C], _ = 0; _ < E.length; _++) {
  53101. for (var b = E[_], w = !0, T = 0; T < p.length; T++)
  53102. n(b.p, p[T].p) && (C !== T && A.push({
  53103. froms: C,
  53104. tos: T,
  53105. hole: _
  53106. }),
  53107. w ? (w = !1,
  53108. d[T].push(b)) : y = !0);
  53109. w && d[C].push(b)
  53110. }
  53111. 0 < A.length && (y || (f = d))
  53112. }
  53113. m = 0;
  53114. for (var x, S = p.length; m < S; m++) {
  53115. l = p[m].s,
  53116. c.push(l);
  53117. for (var M = 0, R = (x = f[m]).length; M < R; M++)
  53118. l.holes.push(x[M].h)
  53119. }
  53120. return c
  53121. }
  53122. ,
  53123. Ci.Shape = function() {
  53124. Ci.Path.apply(this, arguments),
  53125. this.holes = []
  53126. }
  53127. ,
  53128. Ci.Shape.prototype = Object.create(Ci.Path.prototype),
  53129. Ci.Shape.prototype.constructor = Ci.Shape,
  53130. Ci.Shape.prototype.extrude = function(e) {
  53131. return new Ci.ExtrudeGeometry(this,e)
  53132. }
  53133. ,
  53134. Ci.Shape.prototype.makeGeometry = function(e) {
  53135. return new Ci.ShapeGeometry(this,e)
  53136. }
  53137. ,
  53138. Ci.Shape.prototype.getPointsHoles = function(e) {
  53139. for (var t = [], i = 0, n = this.holes.length; i < n; i++)
  53140. t[i] = this.holes[i].getPoints(e);
  53141. return t
  53142. }
  53143. ,
  53144. Ci.Shape.prototype.extractAllPoints = function(e) {
  53145. return {
  53146. shape: this.getPoints(e),
  53147. holes: this.getPointsHoles(e)
  53148. }
  53149. }
  53150. ,
  53151. Ci.Shape.prototype.extractPoints = function(e) {
  53152. return this.extractAllPoints(e)
  53153. }
  53154. ,
  53155. Ci.LineCurve = function(e, t) {
  53156. this.v1 = e,
  53157. this.v2 = t
  53158. }
  53159. ,
  53160. Ci.LineCurve.prototype = Object.create(Ci.Curve.prototype),
  53161. Ci.LineCurve.prototype.constructor = Ci.LineCurve,
  53162. Ci.LineCurve.prototype.getPoint = function(e) {
  53163. var t = this.v2.clone().sub(this.v1);
  53164. return t.multiplyScalar(e).add(this.v1),
  53165. t
  53166. }
  53167. ,
  53168. Ci.LineCurve.prototype.getPointAt = function(e) {
  53169. return this.getPoint(e)
  53170. }
  53171. ,
  53172. Ci.LineCurve.prototype.getTangent = function(e) {
  53173. return this.v2.clone().sub(this.v1).normalize()
  53174. }
  53175. ,
  53176. Ci.QuadraticBezierCurve = function(e, t, i) {
  53177. this.v0 = e,
  53178. this.v1 = t,
  53179. this.v2 = i
  53180. }
  53181. ,
  53182. Ci.QuadraticBezierCurve.prototype = Object.create(Ci.Curve.prototype),
  53183. Ci.QuadraticBezierCurve.prototype.constructor = Ci.QuadraticBezierCurve,
  53184. Ci.QuadraticBezierCurve.prototype.getPoint = function(e) {
  53185. var t = Ci.ShapeUtils.b2;
  53186. 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))
  53187. }
  53188. ,
  53189. Ci.QuadraticBezierCurve.prototype.getTangent = function(e) {
  53190. var t = Ci.CurveUtils.tangentQuadraticBezier;
  53191. 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()
  53192. }
  53193. ,
  53194. Ci.CubicBezierCurve = function(e, t, i, n) {
  53195. this.v0 = e,
  53196. this.v1 = t,
  53197. this.v2 = i,
  53198. this.v3 = n
  53199. }
  53200. ,
  53201. Ci.CubicBezierCurve.prototype = Object.create(Ci.Curve.prototype),
  53202. Ci.CubicBezierCurve.prototype.constructor = Ci.CubicBezierCurve,
  53203. Ci.CubicBezierCurve.prototype.getPoint = function(e) {
  53204. var t = Ci.ShapeUtils.b3;
  53205. 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))
  53206. }
  53207. ,
  53208. Ci.CubicBezierCurve.prototype.getTangent = function(e) {
  53209. var t = Ci.CurveUtils.tangentCubicBezier;
  53210. 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()
  53211. }
  53212. ,
  53213. Ci.SplineCurve = function(e) {
  53214. this.points = null == e ? [] : e
  53215. }
  53216. ,
  53217. Ci.SplineCurve.prototype = Object.create(Ci.Curve.prototype),
  53218. Ci.SplineCurve.prototype.constructor = Ci.SplineCurve,
  53219. Ci.SplineCurve.prototype.getPoint = function(e) {
  53220. var t = this.points
  53221. , i = (t.length - 1) * e
  53222. , n = Math.floor(i)
  53223. , r = i - n
  53224. , o = t[0 === n ? n : n - 1]
  53225. , a = t[n]
  53226. , s = t[n > t.length - 2 ? t.length - 1 : n + 1]
  53227. , l = t[n > t.length - 3 ? t.length - 1 : n + 2]
  53228. , c = Ci.CurveUtils.interpolate;
  53229. return new Ci.Vector2(c(o.x, a.x, s.x, l.x, r),c(o.y, a.y, s.y, l.y, r))
  53230. }
  53231. ,
  53232. Ci.EllipseCurve = function(e, t, i, n, r, o, a, s) {
  53233. this.aX = e,
  53234. this.aY = t,
  53235. this.xRadius = i,
  53236. this.yRadius = n,
  53237. this.aStartAngle = r,
  53238. this.aEndAngle = o,
  53239. this.aClockwise = a,
  53240. this.aRotation = s || 0
  53241. }
  53242. ,
  53243. Ci.EllipseCurve.prototype = Object.create(Ci.Curve.prototype),
  53244. Ci.EllipseCurve.prototype.constructor = Ci.EllipseCurve,
  53245. Ci.EllipseCurve.prototype.getPoint = function(e) {
  53246. var t, i = this.aEndAngle - this.aStartAngle;
  53247. i < 0 && (i += 2 * Math.PI),
  53248. i > 2 * Math.PI && (i -= 2 * Math.PI),
  53249. t = !0 === this.aClockwise ? this.aEndAngle + (1 - e) * (2 * Math.PI - i) : this.aStartAngle + e * i;
  53250. var n = this.aX + this.xRadius * Math.cos(t)
  53251. , r = this.aY + this.yRadius * Math.sin(t);
  53252. if (0 !== this.aRotation) {
  53253. var o = Math.cos(this.aRotation)
  53254. , a = Math.sin(this.aRotation)
  53255. , s = n
  53256. , l = r;
  53257. n = (s - this.aX) * o - (l - this.aY) * a + this.aX,
  53258. r = (s - this.aX) * a + (l - this.aY) * o + this.aY
  53259. }
  53260. return new Ci.Vector2(n,r)
  53261. }
  53262. ,
  53263. Ci.ArcCurve = function(e, t, i, n, r, o) {
  53264. Ci.EllipseCurve.call(this, e, t, i, i, n, r, o)
  53265. }
  53266. ,
  53267. Ci.ArcCurve.prototype = Object.create(Ci.EllipseCurve.prototype),
  53268. Ci.ArcCurve.prototype.constructor = Ci.ArcCurve,
  53269. Ci.LineCurve3 = Ci.Curve.create(function(e, t) {
  53270. this.v1 = e,
  53271. this.v2 = t
  53272. }, function(e) {
  53273. var t = new Ci.Vector3;
  53274. return t.subVectors(this.v2, this.v1),
  53275. t.multiplyScalar(e),
  53276. t.add(this.v1),
  53277. t
  53278. }),
  53279. Ci.QuadraticBezierCurve3 = Ci.Curve.create(function(e, t, i) {
  53280. this.v0 = e,
  53281. this.v1 = t,
  53282. this.v2 = i
  53283. }, function(e) {
  53284. var t = Ci.ShapeUtils.b2;
  53285. 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))
  53286. }),
  53287. Ci.CubicBezierCurve3 = Ci.Curve.create(function(e, t, i, n) {
  53288. this.v0 = e,
  53289. this.v1 = t,
  53290. this.v2 = i,
  53291. this.v3 = n
  53292. }, function(e) {
  53293. var t = Ci.ShapeUtils.b3;
  53294. 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))
  53295. }),
  53296. Ci.SplineCurve3 = Ci.Curve.create(function(e) {
  53297. console.warn("THREE.SplineCurve3 will be deprecated. Please use THREE.CatmullRomCurve3"),
  53298. this.points = null == e ? [] : e
  53299. }, function(e) {
  53300. var t = this.points
  53301. , i = (t.length - 1) * e
  53302. , n = Math.floor(i)
  53303. , r = i - n
  53304. , o = t[0 == n ? n : n - 1]
  53305. , a = t[n]
  53306. , s = t[n > t.length - 2 ? t.length - 1 : n + 1]
  53307. , l = t[n > t.length - 3 ? t.length - 1 : n + 2]
  53308. , c = Ci.CurveUtils.interpolate;
  53309. 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))
  53310. }),
  53311. Ci.CatmullRomCurve3 = (qt = new Ci.Vector3,
  53312. Xt = new xi,
  53313. Zt = new xi,
  53314. Kt = new xi,
  53315. xi.prototype.init = function(e, t, i, n) {
  53316. this.c0 = e,
  53317. this.c1 = i,
  53318. this.c2 = -3 * e + 3 * t - 2 * i - n,
  53319. this.c3 = 2 * e - 2 * t + i + n
  53320. }
  53321. ,
  53322. xi.prototype.initNonuniformCatmullRom = function(e, t, i, n, r, o, a) {
  53323. var s = (t - e) / r - (i - e) / (r + o) + (i - t) / o
  53324. , l = (i - t) / o - (n - t) / (o + a) + (n - i) / a;
  53325. s *= o,
  53326. l *= o,
  53327. this.init(t, i, s, l)
  53328. }
  53329. ,
  53330. xi.prototype.initCatmullRom = function(e, t, i, n, r) {
  53331. this.init(t, i, r * (i - e), r * (n - t))
  53332. }
  53333. ,
  53334. xi.prototype.calc = function(e) {
  53335. var t = e * e
  53336. , i = t * e;
  53337. return this.c0 + this.c1 * e + this.c2 * t + this.c3 * i
  53338. }
  53339. ,
  53340. Ci.Curve.create(function(e) {
  53341. this.points = e || [],
  53342. this.closed = !1
  53343. }, function(e) {
  53344. var t, i, n, r, o, a, s, l, c = this.points;
  53345. if ((r = c.length) < 2 && console.log("duh, you need at least 2 points"),
  53346. n = (t = (r - (this.closed ? 0 : 1)) * e) - (i = Math.floor(t)),
  53347. this.closed ? i += 0 < i ? 0 : (Math.floor(Math.abs(i) / c.length) + 1) * c.length : 0 === n && i === r - 1 && (i = r - 2,
  53348. n = 1),
  53349. o = this.closed || 0 < i ? c[(i - 1) % r] : (qt.subVectors(c[0], c[1]).add(c[0]),
  53350. qt),
  53351. a = c[i % r],
  53352. s = c[(i + 1) % r],
  53353. l = this.closed || i + 2 < r ? c[(i + 2) % r] : (qt.subVectors(c[r - 1], c[r - 2]).add(c[r - 1]),
  53354. qt),
  53355. void 0 === this.type || "centripetal" === this.type || "chordal" === this.type) {
  53356. var h = "chordal" === this.type ? .5 : .25
  53357. , u = Math.pow(o.distanceToSquared(a), h)
  53358. , d = Math.pow(a.distanceToSquared(s), h)
  53359. , p = Math.pow(s.distanceToSquared(l), h);
  53360. d < 1e-4 && (d = 1),
  53361. u < 1e-4 && (u = d),
  53362. p < 1e-4 && (p = d),
  53363. Xt.initNonuniformCatmullRom(o.x, a.x, s.x, l.x, u, d, p),
  53364. Zt.initNonuniformCatmullRom(o.y, a.y, s.y, l.y, u, d, p),
  53365. Kt.initNonuniformCatmullRom(o.z, a.z, s.z, l.z, u, d, p)
  53366. } else if ("catmullrom" === this.type) {
  53367. var f = void 0 !== this.tension ? this.tension : .5;
  53368. Xt.initCatmullRom(o.x, a.x, s.x, l.x, f),
  53369. Zt.initCatmullRom(o.y, a.y, s.y, l.y, f),
  53370. Kt.initCatmullRom(o.z, a.z, s.z, l.z, f)
  53371. }
  53372. return new Ci.Vector3(Xt.calc(n),Zt.calc(n),Kt.calc(n))
  53373. })),
  53374. Ci.ClosedSplineCurve3 = function(e) {
  53375. console.warn("THREE.ClosedSplineCurve3 has been deprecated. Please use THREE.CatmullRomCurve3."),
  53376. Ci.CatmullRomCurve3.call(this, e),
  53377. this.type = "catmullrom",
  53378. this.closed = !0
  53379. }
  53380. ,
  53381. Ci.ClosedSplineCurve3.prototype = Object.create(Ci.CatmullRomCurve3.prototype),
  53382. Ci.BoxGeometry = function(e, t, i, n, r, o) {
  53383. Ci.Geometry.call(this),
  53384. this.type = "BoxGeometry",
  53385. this.parameters = {
  53386. width: e,
  53387. height: t,
  53388. depth: i,
  53389. widthSegments: n,
  53390. heightSegments: r,
  53391. depthSegments: o
  53392. },
  53393. this.fromBufferGeometry(new Ci.BoxBufferGeometry(e,t,i,n,r,o)),
  53394. this.mergeVertices()
  53395. }
  53396. ,
  53397. Ci.BoxGeometry.prototype = Object.create(Ci.Geometry.prototype),
  53398. Ci.BoxGeometry.prototype.constructor = Ci.BoxGeometry,
  53399. Ci.CubeGeometry = Ci.BoxGeometry,
  53400. Ci.BoxBufferGeometry = function(e, t, i, n, r, o) {
  53401. function a(e, t, i, n, r, o, a, s, l, c, h) {
  53402. 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++)
  53403. for (var E = I * d - f, _ = 0; _ < m; _++) {
  53404. var b = _ * u - p;
  53405. C[e] = b * n,
  53406. C[t] = E * r,
  53407. C[i] = g,
  53408. P[D] = C.x,
  53409. P[D + 1] = C.y,
  53410. P[D + 2] = C.z,
  53411. C[e] = 0,
  53412. C[t] = 0,
  53413. C[i] = 0 < s ? 1 : -1,
  53414. O[D] = C.x,
  53415. O[D + 1] = C.y,
  53416. O[D + 2] = C.z,
  53417. L[N] = _ / l,
  53418. L[N + 1] = 1 - I / c,
  53419. D += 3,
  53420. N += 2,
  53421. y += 1
  53422. }
  53423. for (I = 0; I < c; I++)
  53424. for (_ = 0; _ < l; _++) {
  53425. var w = B + _ + m * I
  53426. , T = B + _ + m * (I + 1)
  53427. , x = B + (_ + 1) + m * (I + 1)
  53428. , S = B + (_ + 1) + m * I;
  53429. R[F] = w,
  53430. R[F + 1] = T,
  53431. R[F + 2] = S,
  53432. R[F + 3] = T,
  53433. R[F + 4] = x,
  53434. R[F + 5] = S,
  53435. F += 6,
  53436. A += 6
  53437. }
  53438. M.addGroup(V, A, h),
  53439. V += A,
  53440. B += y
  53441. }
  53442. Ci.BufferGeometry.call(this),
  53443. this.type = "BoxBufferGeometry",
  53444. this.parameters = {
  53445. width: e,
  53446. height: t,
  53447. depth: i,
  53448. widthSegments: n,
  53449. heightSegments: r,
  53450. depthSegments: o
  53451. };
  53452. var M = this;
  53453. n = Math.floor(n) || 1,
  53454. r = Math.floor(r) || 1,
  53455. o = Math.floor(o) || 1;
  53456. var s, l, c, h, u = (h = 0,
  53457. h += (s = n) * (l = r) * 2,
  53458. h += s * (c = o) * 2,
  53459. 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;
  53460. a("z", "y", "x", -1, -1, i, t, e, o, r, 0),
  53461. a("z", "y", "x", 1, -1, i, t, -e, o, r, 1),
  53462. a("x", "z", "y", 1, 1, e, i, t, n, o, 2),
  53463. a("x", "z", "y", 1, -1, e, i, -t, n, o, 3),
  53464. a("x", "y", "z", 1, -1, e, t, i, n, r, 4),
  53465. a("x", "y", "z", -1, -1, e, t, -i, n, r, 5),
  53466. this.setIndex(new Ci.BufferAttribute(R,1)),
  53467. this.addAttribute("position", new Ci.BufferAttribute(P,3)),
  53468. this.addAttribute("normal", new Ci.BufferAttribute(O,3)),
  53469. this.addAttribute("uv", new Ci.BufferAttribute(L,2))
  53470. }
  53471. ,
  53472. Ci.BoxBufferGeometry.prototype = Object.create(Ci.BufferGeometry.prototype),
  53473. Ci.BoxBufferGeometry.prototype.constructor = Ci.BoxBufferGeometry,
  53474. Ci.CircleGeometry = function(e, t, i, n) {
  53475. Ci.Geometry.call(this),
  53476. this.type = "CircleGeometry",
  53477. this.parameters = {
  53478. radius: e,
  53479. segments: t,
  53480. thetaStart: i,
  53481. thetaLength: n
  53482. },
  53483. this.fromBufferGeometry(new Ci.CircleBufferGeometry(e,t,i,n))
  53484. }
  53485. ,
  53486. Ci.CircleGeometry.prototype = Object.create(Ci.Geometry.prototype),
  53487. Ci.CircleGeometry.prototype.constructor = Ci.CircleGeometry,
  53488. Ci.CircleBufferGeometry = function(e, t, i, n) {
  53489. Ci.BufferGeometry.call(this),
  53490. this.type = "CircleBufferGeometry",
  53491. this.parameters = {
  53492. radius: e,
  53493. segments: t,
  53494. thetaStart: i,
  53495. thetaLength: n
  53496. },
  53497. e = e || 50,
  53498. t = void 0 !== t ? Math.max(3, t) : 8,
  53499. i = void 0 !== i ? i : 0,
  53500. n = void 0 !== n ? n : 2 * Math.PI;
  53501. var r = t + 2
  53502. , o = new Float32Array(3 * r)
  53503. , a = new Float32Array(3 * r)
  53504. , s = new Float32Array(2 * r);
  53505. a[2] = 1,
  53506. s[0] = .5,
  53507. s[1] = .5;
  53508. for (var l = 0, c = 3, h = 2; l <= t; l++,
  53509. c += 3,
  53510. h += 2) {
  53511. var u = i + l / t * n;
  53512. o[c] = e * Math.cos(u),
  53513. o[c + 1] = e * Math.sin(u),
  53514. a[c + 2] = 1,
  53515. s[h] = (o[c] / e + 1) / 2,
  53516. s[h + 1] = (o[c + 1] / e + 1) / 2
  53517. }
  53518. var d = [];
  53519. for (c = 1; c <= t; c++)
  53520. d.push(c, c + 1, 0);
  53521. this.setIndex(new Ci.BufferAttribute(new Uint16Array(d),1)),
  53522. this.addAttribute("position", new Ci.BufferAttribute(o,3)),
  53523. this.addAttribute("normal", new Ci.BufferAttribute(a,3)),
  53524. this.addAttribute("uv", new Ci.BufferAttribute(s,2)),
  53525. this.boundingSphere = new Ci.Sphere(new Ci.Vector3,e)
  53526. }
  53527. ,
  53528. Ci.CircleBufferGeometry.prototype = Object.create(Ci.BufferGeometry.prototype),
  53529. Ci.CircleBufferGeometry.prototype.constructor = Ci.CircleBufferGeometry,
  53530. Ci.CylinderBufferGeometry = function(p, f, g, m, v, e, y, A) {
  53531. function t(e) {
  53532. var t, i, n, r = new Ci.Vector2, o = new Ci.Vector3, a = !0 === e ? p : f, s = !0 === e ? 1 : -1;
  53533. for (i = b,
  53534. t = 1; t <= m; t++)
  53535. I.setXYZ(b, 0, x * s, 0),
  53536. E.setXYZ(b, 0, s, 0),
  53537. !0 === e ? (r.x = t / m,
  53538. r.y = 0) : (r.x = (t - 1) / m,
  53539. r.y = 1),
  53540. _.setXY(b, r.x, r.y),
  53541. b++;
  53542. for (n = b,
  53543. t = 0; t <= m; t++) {
  53544. var l = t / m;
  53545. o.x = a * Math.sin(l * A + y),
  53546. o.y = x * s,
  53547. o.z = a * Math.cos(l * A + y),
  53548. I.setXYZ(b, o.x, o.y, o.z),
  53549. E.setXYZ(b, 0, s, 0),
  53550. _.setXY(b, l, !0 === e ? 1 : 0),
  53551. b++
  53552. }
  53553. for (t = 0; t < m; t++) {
  53554. var c = i + t
  53555. , h = n + t;
  53556. !0 === e ? (C.setX(w, h),
  53557. w++,
  53558. C.setX(w, h + 1)) : (C.setX(w, h + 1),
  53559. w++,
  53560. C.setX(w, h)),
  53561. w++,
  53562. C.setX(w, c),
  53563. w++
  53564. }
  53565. }
  53566. Ci.BufferGeometry.call(this),
  53567. this.type = "CylinderBufferGeometry",
  53568. this.parameters = {
  53569. radiusTop: p,
  53570. radiusBottom: f,
  53571. height: g,
  53572. radialSegments: m,
  53573. heightSegments: v,
  53574. openEnded: e,
  53575. thetaStart: y,
  53576. thetaLength: A
  53577. },
  53578. p = void 0 !== p ? p : 20,
  53579. f = void 0 !== f ? f : 20,
  53580. g = void 0 !== g ? g : 100,
  53581. m = Math.floor(m) || 8,
  53582. v = Math.floor(v) || 1,
  53583. e = void 0 !== e && e,
  53584. y = void 0 !== y ? y : 0,
  53585. A = void 0 !== A ? A : 2 * Math.PI;
  53586. var i, n, r = (n = (m + 1) * (v + 1),
  53587. !1 === e && (n += 2 * (m + 1) + 2 * m),
  53588. n), o = (i = m * v * 2 * 3,
  53589. !1 === e && (i += 2 * m * 3),
  53590. 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;
  53591. (function() {
  53592. var e, t, i = new Ci.Vector3, n = new Ci.Vector3, r = (f - p) / g;
  53593. for (t = 0; t <= v; t++) {
  53594. var o = []
  53595. , a = t / v
  53596. , s = a * (f - p) + p;
  53597. for (e = 0; e <= m; e++) {
  53598. var l = e / m;
  53599. n.x = s * Math.sin(l * A + y),
  53600. n.y = -a * g + x,
  53601. n.z = s * Math.cos(l * A + y),
  53602. I.setXYZ(b, n.x, n.y, n.z),
  53603. i.copy(n),
  53604. (0 === p && 0 === t || 0 === f && t === v) && (i.x = Math.sin(l * A + y),
  53605. i.z = Math.cos(l * A + y)),
  53606. i.setY(Math.sqrt(i.x * i.x + i.z * i.z) * r).normalize(),
  53607. E.setXYZ(b, i.x, i.y, i.z),
  53608. _.setXY(b, l, 1 - a),
  53609. o.push(b),
  53610. b++
  53611. }
  53612. T.push(o)
  53613. }
  53614. for (e = 0; e < m; e++)
  53615. for (t = 0; t < v; t++) {
  53616. var c = T[t][e]
  53617. , h = T[t + 1][e]
  53618. , u = T[t + 1][e + 1]
  53619. , d = T[t][e + 1];
  53620. C.setX(w, c),
  53621. w++,
  53622. C.setX(w, h),
  53623. w++,
  53624. C.setX(w, d),
  53625. w++,
  53626. C.setX(w, h),
  53627. w++,
  53628. C.setX(w, u),
  53629. w++,
  53630. C.setX(w, d),
  53631. w++
  53632. }
  53633. }
  53634. )(),
  53635. !1 === e && (0 < p && t(!0),
  53636. 0 < f && t(!1)),
  53637. this.setIndex(C),
  53638. this.addAttribute("position", I),
  53639. this.addAttribute("normal", E),
  53640. this.addAttribute("uv", _)
  53641. }
  53642. ,
  53643. Ci.CylinderBufferGeometry.prototype = Object.create(Ci.BufferGeometry.prototype),
  53644. Ci.CylinderBufferGeometry.prototype.constructor = Ci.CylinderBufferGeometry,
  53645. Ci.CylinderGeometry = function(e, t, i, n, r, o, a, s) {
  53646. Ci.Geometry.call(this),
  53647. this.type = "CylinderGeometry",
  53648. this.parameters = {
  53649. radiusTop: e,
  53650. radiusBottom: t,
  53651. height: i,
  53652. radialSegments: n,
  53653. heightSegments: r,
  53654. openEnded: o,
  53655. thetaStart: a,
  53656. thetaLength: s
  53657. },
  53658. this.fromBufferGeometry(new Ci.CylinderBufferGeometry(e,t,i,n,r,o,a,s)),
  53659. this.mergeVertices()
  53660. }
  53661. ,
  53662. Ci.CylinderGeometry.prototype = Object.create(Ci.Geometry.prototype),
  53663. Ci.CylinderGeometry.prototype.constructor = Ci.CylinderGeometry,
  53664. Ci.EdgesGeometry = function(e, t) {
  53665. function i(e, t) {
  53666. return e - t
  53667. }
  53668. Ci.BufferGeometry.call(this),
  53669. t = void 0 !== t ? t : 1;
  53670. var n, r = Math.cos(Ci.Math.degToRad(t)), o = [0, 0], a = {}, s = ["a", "b", "c"];
  53671. e instanceof Ci.BufferGeometry ? (n = new Ci.Geometry).fromBufferGeometry(e) : n = e.clone(),
  53672. n.mergeVertices(),
  53673. n.computeFaceNormals();
  53674. for (var l = n.vertices, c = n.faces, h = 0, u = c.length; h < u; h++)
  53675. for (var d = c[h], p = 0; p < 3; p++) {
  53676. o[0] = d[s[p]],
  53677. o[1] = d[s[(p + 1) % 3]],
  53678. o.sort(i),
  53679. void 0 === a[g = o.toString()] ? a[g] = {
  53680. vert1: o[0],
  53681. vert2: o[1],
  53682. face1: h,
  53683. face2: void 0
  53684. } : a[g].face2 = h
  53685. }
  53686. var f = [];
  53687. for (var g in a) {
  53688. var m = a[g];
  53689. if (void 0 === m.face2 || c[m.face1].normal.dot(c[m.face2].normal) <= r) {
  53690. var v = l[m.vert1];
  53691. f.push(v.x),
  53692. f.push(v.y),
  53693. f.push(v.z),
  53694. v = l[m.vert2],
  53695. f.push(v.x),
  53696. f.push(v.y),
  53697. f.push(v.z)
  53698. }
  53699. }
  53700. this.addAttribute("position", new Ci.BufferAttribute(new Float32Array(f),3))
  53701. }
  53702. ,
  53703. Ci.EdgesGeometry.prototype = Object.create(Ci.BufferGeometry.prototype),
  53704. Ci.EdgesGeometry.prototype.constructor = Ci.EdgesGeometry,
  53705. Ci.ExtrudeGeometry = function(e, t) {
  53706. return void 0 === e ? void (e = []) : (Ci.Geometry.call(this),
  53707. this.type = "ExtrudeGeometry",
  53708. e = Array.isArray(e) ? e : [e],
  53709. this.addShapeList(e, t),
  53710. void this.computeFaceNormals())
  53711. }
  53712. ;
  53713. Ci.ExtrudeGeometry.prototype = Object.create(Ci.Geometry.prototype),
  53714. Ci.ExtrudeGeometry.prototype.constructor = Ci.ExtrudeGeometry,
  53715. Ci.ExtrudeGeometry.prototype.addShapeList = function(e, t) {
  53716. for (var i = e.length, n = 0; n < i; n++) {
  53717. var r = e[n];
  53718. this.addShape(r, t)
  53719. }
  53720. }
  53721. ,
  53722. Ci.ExtrudeGeometry.prototype.addShape = function(e, t) {
  53723. function i(e, t, i) {
  53724. return t || console.error("THREE.ExtrudeGeometry: vec does not exist"),
  53725. t.clone().multiplyScalar(i).add(e)
  53726. }
  53727. function n(e, t, i) {
  53728. 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;
  53729. if (Math.abs(u) > Number.EPSILON) {
  53730. var d = Math.sqrt(h)
  53731. , p = Math.sqrt(l * l + c * c)
  53732. , f = t.x - s / d
  53733. , g = t.y + a / d
  53734. , m = ((i.x - c / p - f) * c - (i.y + l / p - g) * l) / (a * c - s * l)
  53735. , v = (n = f + a * m - e.x) * n + (r = g + s * m - e.y) * r;
  53736. if (v <= 2)
  53737. return new Ci.Vector2(n,r);
  53738. o = Math.sqrt(v / 2)
  53739. } else {
  53740. var y = !1;
  53741. a > Number.EPSILON ? l > Number.EPSILON && (y = !0) : a < -Number.EPSILON ? l < -Number.EPSILON && (y = !0) : Math.sign(s) === Math.sign(c) && (y = !0),
  53742. o = y ? (n = -s,
  53743. r = a,
  53744. Math.sqrt(h)) : (n = a,
  53745. r = s,
  53746. Math.sqrt(h / 2))
  53747. }
  53748. return new Ci.Vector2(n / o,r / o)
  53749. }
  53750. function r(e, t) {
  53751. var i, n;
  53752. for (G = e.length; 0 <= --G; ) {
  53753. (n = (i = G) - 1) < 0 && (n = e.length - 1);
  53754. var r = 0
  53755. , o = A + 2 * m;
  53756. for (r = 0; r < o; r++) {
  53757. var a = U * r
  53758. , s = U * (r + 1);
  53759. l(t + i + a, t + n + a, t + n + s, t + i + s, e, r, o, i, n)
  53760. }
  53761. }
  53762. }
  53763. function o(e, t, i) {
  53764. T.vertices.push(new Ci.Vector3(e,t,i))
  53765. }
  53766. function a(e, t, i) {
  53767. e += x,
  53768. t += x,
  53769. i += x,
  53770. T.faces.push(new Ci.Face3(e,t,i,null,null,0));
  53771. var n = E.generateTopUV(T, e, t, i);
  53772. T.faceVertexUvs[0].push(n)
  53773. }
  53774. function l(e, t, i, n) {
  53775. e += x,
  53776. t += x,
  53777. i += x,
  53778. n += x,
  53779. T.faces.push(new Ci.Face3(e,t,n,null,null,1)),
  53780. T.faces.push(new Ci.Face3(t,i,n,null,null,1));
  53781. var r = E.generateSideWallUV(T, e, t, i, n);
  53782. T.faceVertexUvs[0].push([r[0], r[1], r[3]]),
  53783. T.faceVertexUvs[0].push([r[1], r[2], r[3]])
  53784. }
  53785. 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;
  53786. C && (s = C.getSpacedPoints(A),
  53787. v = !(I = !0),
  53788. c = void 0 !== t.frames ? t.frames : new Ci.TubeGeometry.FrenetFrames(C,A,!1),
  53789. h = new Ci.Vector3,
  53790. u = new Ci.Vector3,
  53791. d = new Ci.Vector3),
  53792. v || (g = f = m = 0);
  53793. var _, b, w, T = this, x = this.vertices.length, S = e.extractPoints(y), M = S.shape, R = S.holes, P = !Ci.ShapeUtils.isClockWise(M);
  53794. if (P) {
  53795. for (M = M.reverse(),
  53796. b = 0,
  53797. w = R.length; b < w; b++)
  53798. _ = R[b],
  53799. Ci.ShapeUtils.isClockWise(_) && (R[b] = _.reverse());
  53800. P = !1
  53801. }
  53802. var O = Ci.ShapeUtils.triangulateShape(M, R)
  53803. , L = M;
  53804. for (b = 0,
  53805. w = R.length; b < w; b++)
  53806. _ = R[b],
  53807. M = M.concat(_);
  53808. 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++,
  53809. j++,
  53810. Y++)
  53811. j === W && (j = 0),
  53812. Y === W && (Y = 0),
  53813. z[G] = n(L[G], L[j], L[Y]);
  53814. var q, X, Z = [], K = z.concat();
  53815. for (b = 0,
  53816. w = R.length; b < w; b++) {
  53817. for (_ = R[b],
  53818. q = [],
  53819. G = 0,
  53820. j = (W = _.length) - 1,
  53821. Y = G + 1; G < W; G++,
  53822. j++,
  53823. Y++)
  53824. j === W && (j = 0),
  53825. Y === W && (Y = 0),
  53826. q[G] = n(_[G], _[j], _[Y]);
  53827. Z.push(q),
  53828. K = K.concat(q)
  53829. }
  53830. for (D = 0; D < m; D++) {
  53831. for (B = f * (1 - (F = D / m)),
  53832. N = g * Math.sin(F * Math.PI / 2),
  53833. G = 0,
  53834. W = L.length; G < W; G++)
  53835. o((V = i(L[G], z[G], N)).x, V.y, -B);
  53836. for (b = 0,
  53837. w = R.length; b < w; b++)
  53838. for (_ = R[b],
  53839. q = Z[b],
  53840. G = 0,
  53841. W = _.length; G < W; G++)
  53842. o((V = i(_[G], q[G], N)).x, V.y, -B)
  53843. }
  53844. for (N = g,
  53845. G = 0; G < U; G++)
  53846. V = v ? i(M[G], K[G], N) : M[G],
  53847. I ? (u.copy(c.normals[0]).multiplyScalar(V.x),
  53848. h.copy(c.binormals[0]).multiplyScalar(V.y),
  53849. d.copy(s[0]).add(u).add(h),
  53850. o(d.x, d.y, d.z)) : o(V.x, V.y, 0);
  53851. for (X = 1; X <= A; X++)
  53852. for (G = 0; G < U; G++)
  53853. V = v ? i(M[G], K[G], N) : M[G],
  53854. I ? (u.copy(c.normals[X]).multiplyScalar(V.x),
  53855. h.copy(c.binormals[X]).multiplyScalar(V.y),
  53856. d.copy(s[X]).add(u).add(h),
  53857. o(d.x, d.y, d.z)) : o(V.x, V.y, p / A * X);
  53858. for (D = m - 1; 0 <= D; D--) {
  53859. for (B = f * (1 - (F = D / m)),
  53860. N = g * Math.sin(F * Math.PI / 2),
  53861. G = 0,
  53862. W = L.length; G < W; G++)
  53863. o((V = i(L[G], z[G], N)).x, V.y, p + B);
  53864. for (b = 0,
  53865. w = R.length; b < w; b++)
  53866. for (_ = R[b],
  53867. q = Z[b],
  53868. G = 0,
  53869. W = _.length; G < W; G++)
  53870. V = i(_[G], q[G], N),
  53871. I ? o(V.x, V.y + s[A - 1].y, s[A - 1].x + B) : o(V.x, V.y, p + B)
  53872. }
  53873. (function() {
  53874. if (v) {
  53875. var e = 0
  53876. , t = U * e;
  53877. for (G = 0; G < H; G++)
  53878. a((k = O[G])[2] + t, k[1] + t, k[0] + t);
  53879. for (t = U * (e = A + 2 * m),
  53880. G = 0; G < H; G++)
  53881. a((k = O[G])[0] + t, k[1] + t, k[2] + t)
  53882. } else {
  53883. for (G = 0; G < H; G++)
  53884. a((k = O[G])[2], k[1], k[0]);
  53885. for (G = 0; G < H; G++)
  53886. a((k = O[G])[0] + U * A, k[1] + U * A, k[2] + U * A)
  53887. }
  53888. }
  53889. )(),
  53890. function() {
  53891. var e = 0;
  53892. for (r(L, e),
  53893. e += L.length,
  53894. b = 0,
  53895. w = R.length; b < w; b++)
  53896. r(_ = R[b], e),
  53897. e += _.length
  53898. }()
  53899. }
  53900. ,
  53901. Ci.ExtrudeGeometry.WorldUVGenerator = {
  53902. generateTopUV: function(e, t, i, n) {
  53903. var r = e.vertices
  53904. , o = r[t]
  53905. , a = r[i]
  53906. , s = r[n];
  53907. return [new Ci.Vector2(o.x,o.y), new Ci.Vector2(a.x,a.y), new Ci.Vector2(s.x,s.y)]
  53908. },
  53909. generateSideWallUV: function(e, t, i, n, r) {
  53910. var o = e.vertices
  53911. , a = o[t]
  53912. , s = o[i]
  53913. , l = o[n]
  53914. , c = o[r];
  53915. 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)]
  53916. }
  53917. },
  53918. Ci.ShapeGeometry = function(e, t) {
  53919. Ci.Geometry.call(this),
  53920. !(this.type = "ShapeGeometry") === Array.isArray(e) && (e = [e]),
  53921. this.addShapeList(e, t),
  53922. this.computeFaceNormals()
  53923. }
  53924. ,
  53925. Ci.ShapeGeometry.prototype = Object.create(Ci.Geometry.prototype),
  53926. Ci.ShapeGeometry.prototype.constructor = Ci.ShapeGeometry,
  53927. Ci.ShapeGeometry.prototype.addShapeList = function(e, t) {
  53928. for (var i = 0, n = e.length; i < n; i++)
  53929. this.addShape(e[i], t);
  53930. return this
  53931. }
  53932. ,
  53933. Ci.ShapeGeometry.prototype.addShape = function(e, t) {
  53934. void 0 === t && (t = {});
  53935. 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);
  53936. if (d) {
  53937. for (h = h.reverse(),
  53938. i = 0,
  53939. n = u.length; i < n; i++)
  53940. r = u[i],
  53941. Ci.ShapeUtils.isClockWise(r) && (u[i] = r.reverse());
  53942. d = !1
  53943. }
  53944. var p = Ci.ShapeUtils.triangulateShape(h, u);
  53945. for (i = 0,
  53946. n = u.length; i < n; i++)
  53947. r = u[i],
  53948. h = h.concat(r);
  53949. var f, g, m = h.length, v = p.length;
  53950. for (i = 0; i < m; i++)
  53951. f = h[i],
  53952. this.vertices.push(new Ci.Vector3(f.x,f.y,0));
  53953. for (i = 0; i < v; i++) {
  53954. var y = (g = p[i])[0] + l
  53955. , A = g[1] + l
  53956. , C = g[2] + l;
  53957. this.faces.push(new Ci.Face3(y,A,C,null,null,a)),
  53958. this.faceVertexUvs[0].push(s.generateTopUV(this, y, A, C))
  53959. }
  53960. }
  53961. ,
  53962. Ci.LatheBufferGeometry = function(e, t, i, n) {
  53963. Ci.BufferGeometry.call(this),
  53964. this.type = "LatheBufferGeometry",
  53965. this.parameters = {
  53966. points: e,
  53967. segments: t,
  53968. phiStart: i,
  53969. phiLength: n
  53970. },
  53971. t = Math.floor(t) || 12,
  53972. i = i || 0,
  53973. n = n || 2 * Math.PI,
  53974. n = Ci.Math.clamp(n, 0, 2 * Math.PI);
  53975. 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,
  53976. 1 / t), g = new Ci.Vector3, m = new Ci.Vector2;
  53977. for (o = 0; o <= t; o++) {
  53978. var v = i + o * f * n
  53979. , y = Math.sin(v)
  53980. , A = Math.cos(v);
  53981. for (a = 0; a <= e.length - 1; a++)
  53982. g.x = e[a].x * y,
  53983. g.y = e[a].y,
  53984. g.z = e[a].x * A,
  53985. h.setXYZ(d, g.x, g.y, g.z),
  53986. m.x = o / t,
  53987. m.y = a / (e.length - 1),
  53988. u.setXY(d, m.x, m.y),
  53989. d++
  53990. }
  53991. for (o = 0; o < t; o++)
  53992. for (a = 0; a < e.length - 1; a++) {
  53993. var C = r = a + o * e.length
  53994. , I = r + e.length
  53995. , E = r + e.length + 1
  53996. , _ = r + 1;
  53997. c.setX(p, C),
  53998. p++,
  53999. c.setX(p, I),
  54000. p++,
  54001. c.setX(p, _),
  54002. p++,
  54003. c.setX(p, I),
  54004. p++,
  54005. c.setX(p, E),
  54006. p++,
  54007. c.setX(p, _),
  54008. p++
  54009. }
  54010. if (this.setIndex(c),
  54011. this.addAttribute("position", h),
  54012. this.addAttribute("uv", u),
  54013. this.computeVertexNormals(),
  54014. n === 2 * Math.PI) {
  54015. var b = this.attributes.normal.array
  54016. , w = new Ci.Vector3
  54017. , T = new Ci.Vector3
  54018. , x = new Ci.Vector3;
  54019. for (r = t * e.length * 3,
  54020. a = o = 0; o < e.length; o++,
  54021. a += 3)
  54022. w.x = b[a + 0],
  54023. w.y = b[a + 1],
  54024. w.z = b[a + 2],
  54025. T.x = b[r + a + 0],
  54026. T.y = b[r + a + 1],
  54027. T.z = b[r + a + 2],
  54028. x.addVectors(w, T).normalize(),
  54029. b[a + 0] = b[r + a + 0] = x.x,
  54030. b[a + 1] = b[r + a + 1] = x.y,
  54031. b[a + 2] = b[r + a + 2] = x.z
  54032. }
  54033. }
  54034. ,
  54035. Ci.LatheBufferGeometry.prototype = Object.create(Ci.BufferGeometry.prototype),
  54036. Ci.LatheBufferGeometry.prototype.constructor = Ci.LatheBufferGeometry,
  54037. Ci.LatheGeometry = function(e, t, i, n) {
  54038. Ci.Geometry.call(this),
  54039. this.type = "LatheGeometry",
  54040. this.parameters = {
  54041. points: e,
  54042. segments: t,
  54043. phiStart: i,
  54044. phiLength: n
  54045. },
  54046. this.fromBufferGeometry(new Ci.LatheBufferGeometry(e,t,i,n)),
  54047. this.mergeVertices()
  54048. }
  54049. ,
  54050. Ci.LatheGeometry.prototype = Object.create(Ci.Geometry.prototype),
  54051. Ci.LatheGeometry.prototype.constructor = Ci.LatheGeometry,
  54052. Ci.PlaneGeometry = function(e, t, i, n) {
  54053. Ci.Geometry.call(this),
  54054. this.type = "PlaneGeometry",
  54055. this.parameters = {
  54056. width: e,
  54057. height: t,
  54058. widthSegments: i,
  54059. heightSegments: n
  54060. },
  54061. this.fromBufferGeometry(new Ci.PlaneBufferGeometry(e,t,i,n))
  54062. }
  54063. ,
  54064. Ci.PlaneGeometry.prototype = Object.create(Ci.Geometry.prototype),
  54065. Ci.PlaneGeometry.prototype.constructor = Ci.PlaneGeometry,
  54066. Ci.PlaneBufferGeometry = function(e, t, i, n) {
  54067. Ci.BufferGeometry.call(this),
  54068. this.type = "PlaneBufferGeometry",
  54069. this.parameters = {
  54070. width: e,
  54071. height: t,
  54072. widthSegments: i,
  54073. heightSegments: n
  54074. };
  54075. 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++)
  54076. for (var y = v * u - o, A = 0; A < l; A++) {
  54077. var C = A * h - r;
  54078. d[g] = C,
  54079. d[g + 1] = -y,
  54080. p[g + 2] = 1,
  54081. f[m] = A / a,
  54082. f[m + 1] = 1 - v / s,
  54083. g += 3,
  54084. m += 2
  54085. }
  54086. g = 0;
  54087. var I = new (65535 < d.length / 3 ? Uint32Array : Uint16Array)(a * s * 6);
  54088. for (v = 0; v < s; v++)
  54089. for (A = 0; A < a; A++) {
  54090. var E = A + l * v
  54091. , _ = A + l * (v + 1)
  54092. , b = A + 1 + l * (v + 1)
  54093. , w = A + 1 + l * v;
  54094. I[g] = E,
  54095. I[g + 1] = _,
  54096. I[g + 2] = w,
  54097. I[g + 3] = _,
  54098. I[g + 4] = b,
  54099. I[g + 5] = w,
  54100. g += 6
  54101. }
  54102. this.setIndex(new Ci.BufferAttribute(I,1)),
  54103. this.addAttribute("position", new Ci.BufferAttribute(d,3)),
  54104. this.addAttribute("normal", new Ci.BufferAttribute(p,3)),
  54105. this.addAttribute("uv", new Ci.BufferAttribute(f,2))
  54106. }
  54107. ,
  54108. Ci.PlaneBufferGeometry.prototype = Object.create(Ci.BufferGeometry.prototype),
  54109. Ci.PlaneBufferGeometry.prototype.constructor = Ci.PlaneBufferGeometry,
  54110. Ci.RingBufferGeometry = function(e, t, i, n, r, o) {
  54111. Ci.BufferGeometry.call(this),
  54112. this.type = "RingBufferGeometry",
  54113. this.parameters = {
  54114. innerRadius: e,
  54115. outerRadius: t,
  54116. thetaSegments: i,
  54117. phiSegments: n,
  54118. thetaStart: r,
  54119. thetaLength: o
  54120. },
  54121. e = e || 20,
  54122. t = t || 50,
  54123. r = void 0 !== r ? r : 0,
  54124. o = void 0 !== o ? o : 2 * Math.PI;
  54125. 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;
  54126. for (s = 0; s <= n; s++) {
  54127. for (l = 0; l <= i; l++)
  54128. a = r + l / i * o,
  54129. A.x = v * Math.cos(a),
  54130. A.y = v * Math.sin(a),
  54131. d.setXYZ(g, A.x, A.y, A.z),
  54132. p.setXYZ(g, 0, 0, 1),
  54133. C.x = (A.x / t + 1) / 2,
  54134. C.y = (A.y / t + 1) / 2,
  54135. f.setXY(g, C.x, C.y),
  54136. g++;
  54137. v += y
  54138. }
  54139. for (s = 0; s < n; s++) {
  54140. var I = s * (i + 1);
  54141. for (l = 0; l < i; l++) {
  54142. var E = a = l + I
  54143. , _ = a + i + 1
  54144. , b = a + i + 2
  54145. , w = a + 1;
  54146. u.setX(m, E),
  54147. m++,
  54148. u.setX(m, _),
  54149. m++,
  54150. u.setX(m, b),
  54151. m++,
  54152. u.setX(m, E),
  54153. m++,
  54154. u.setX(m, b),
  54155. m++,
  54156. u.setX(m, w),
  54157. m++
  54158. }
  54159. }
  54160. this.setIndex(u),
  54161. this.addAttribute("position", d),
  54162. this.addAttribute("normal", p),
  54163. this.addAttribute("uv", f)
  54164. }
  54165. ,
  54166. Ci.RingBufferGeometry.prototype = Object.create(Ci.BufferGeometry.prototype),
  54167. Ci.RingBufferGeometry.prototype.constructor = Ci.RingBufferGeometry,
  54168. Ci.RingGeometry = function(e, t, i, n, r, o) {
  54169. Ci.Geometry.call(this),
  54170. this.type = "RingGeometry",
  54171. this.parameters = {
  54172. innerRadius: e,
  54173. outerRadius: t,
  54174. thetaSegments: i,
  54175. phiSegments: n,
  54176. thetaStart: r,
  54177. thetaLength: o
  54178. },
  54179. this.fromBufferGeometry(new Ci.RingBufferGeometry(e,t,i,n,r,o))
  54180. }
  54181. ,
  54182. Ci.RingGeometry.prototype = Object.create(Ci.Geometry.prototype),
  54183. Ci.RingGeometry.prototype.constructor = Ci.RingGeometry,
  54184. Ci.SphereGeometry = function(e, t, i, n, r, o, a) {
  54185. Ci.Geometry.call(this),
  54186. this.type = "SphereGeometry",
  54187. this.parameters = {
  54188. radius: e,
  54189. widthSegments: t,
  54190. heightSegments: i,
  54191. phiStart: n,
  54192. phiLength: r,
  54193. thetaStart: o,
  54194. thetaLength: a
  54195. },
  54196. this.fromBufferGeometry(new Ci.SphereBufferGeometry(e,t,i,n,r,o,a))
  54197. }
  54198. ,
  54199. Ci.SphereGeometry.prototype = Object.create(Ci.Geometry.prototype),
  54200. Ci.SphereGeometry.prototype.constructor = Ci.SphereGeometry,
  54201. Ci.SphereBufferGeometry = function(e, t, i, n, r, o, a) {
  54202. Ci.BufferGeometry.call(this),
  54203. this.type = "SphereBufferGeometry",
  54204. this.parameters = {
  54205. radius: e,
  54206. widthSegments: t,
  54207. heightSegments: i,
  54208. phiStart: n,
  54209. phiLength: r,
  54210. thetaStart: o,
  54211. thetaLength: a
  54212. },
  54213. e = e || 50,
  54214. t = Math.max(3, Math.floor(t) || 8),
  54215. i = Math.max(2, Math.floor(i) || 6),
  54216. n = void 0 !== n ? n : 0,
  54217. r = void 0 !== r ? r : 2 * Math.PI;
  54218. 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++) {
  54219. for (var m = [], v = g / i, y = 0; y <= t; y++) {
  54220. var A = y / t
  54221. , C = -e * Math.cos(n + A * r) * Math.sin(o + v * a)
  54222. , I = e * Math.cos(o + v * a)
  54223. , E = e * Math.sin(n + A * r) * Math.sin(o + v * a);
  54224. f.set(C, I, E).normalize(),
  54225. c.setXYZ(d, C, I, E),
  54226. h.setXYZ(d, f.x, f.y, f.z),
  54227. u.setXY(d, A, 1 - v),
  54228. m.push(d),
  54229. d++
  54230. }
  54231. p.push(m)
  54232. }
  54233. var _ = [];
  54234. for (g = 0; g < i; g++)
  54235. for (y = 0; y < t; y++) {
  54236. var b = p[g][y + 1]
  54237. , w = p[g][y]
  54238. , T = p[g + 1][y]
  54239. , x = p[g + 1][y + 1];
  54240. (0 !== g || 0 < o) && _.push(b, w, x),
  54241. (g !== i - 1 || s < Math.PI) && _.push(w, T, x)
  54242. }
  54243. this.setIndex(new (65535 < c.count ? Ci.Uint32Attribute : Ci.Uint16Attribute)(_,1)),
  54244. this.addAttribute("position", c),
  54245. this.addAttribute("normal", h),
  54246. this.addAttribute("uv", u),
  54247. this.boundingSphere = new Ci.Sphere(new Ci.Vector3,e)
  54248. }
  54249. ,
  54250. Ci.SphereBufferGeometry.prototype = Object.create(Ci.BufferGeometry.prototype),
  54251. Ci.SphereBufferGeometry.prototype.constructor = Ci.SphereBufferGeometry,
  54252. Ci.TextGeometry = function(e, t) {
  54253. var i = (t = t || {}).font;
  54254. if (i instanceof Ci.Font == 0)
  54255. return console.error("THREE.TextGeometry: font parameter is not an instance of THREE.Font."),
  54256. new Ci.Geometry;
  54257. var n = i.generateShapes(e, t.size, t.curveSegments);
  54258. t.amount = void 0 !== t.height ? t.height : 50,
  54259. void 0 === t.bevelThickness && (t.bevelThickness = 10),
  54260. void 0 === t.bevelSize && (t.bevelSize = 8),
  54261. void 0 === t.bevelEnabled && (t.bevelEnabled = !1),
  54262. Ci.ExtrudeGeometry.call(this, n, t),
  54263. this.type = "TextGeometry"
  54264. }
  54265. ,
  54266. Ci.TextGeometry.prototype = Object.create(Ci.ExtrudeGeometry.prototype),
  54267. Ci.TextGeometry.prototype.constructor = Ci.TextGeometry,
  54268. Ci.TorusBufferGeometry = function(e, t, i, n, r) {
  54269. Ci.BufferGeometry.call(this),
  54270. this.type = "TorusBufferGeometry",
  54271. this.parameters = {
  54272. radius: e,
  54273. tube: t,
  54274. radialSegments: i,
  54275. tubularSegments: n,
  54276. arc: r
  54277. },
  54278. e = e || 100,
  54279. t = t || 40,
  54280. i = Math.floor(i) || 8,
  54281. n = Math.floor(n) || 6,
  54282. r = r || 2 * Math.PI;
  54283. 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;
  54284. for (o = 0; o <= i; o++)
  54285. for (a = 0; a <= n; a++) {
  54286. var A = a / n * r
  54287. , C = o / i * Math.PI * 2;
  54288. v.x = (e + t * Math.cos(C)) * Math.cos(A),
  54289. v.y = (e + t * Math.cos(C)) * Math.sin(A),
  54290. v.z = t * Math.sin(C),
  54291. h[p] = v.x,
  54292. h[p + 1] = v.y,
  54293. h[p + 2] = v.z,
  54294. m.x = e * Math.cos(A),
  54295. m.y = e * Math.sin(A),
  54296. y.subVectors(v, m).normalize(),
  54297. u[p] = y.x,
  54298. u[p + 1] = y.y,
  54299. u[p + 2] = y.z,
  54300. d[f] = a / n,
  54301. d[f + 1] = o / i,
  54302. p += 3,
  54303. f += 2
  54304. }
  54305. for (o = 1; o <= i; o++)
  54306. for (a = 1; a <= n; a++) {
  54307. var I = (n + 1) * o + a - 1
  54308. , E = (n + 1) * (o - 1) + a - 1
  54309. , _ = (n + 1) * (o - 1) + a
  54310. , b = (n + 1) * o + a;
  54311. c[g] = I,
  54312. c[g + 1] = E,
  54313. c[g + 2] = b,
  54314. c[g + 3] = E,
  54315. c[g + 4] = _,
  54316. c[g + 5] = b,
  54317. g += 6
  54318. }
  54319. this.setIndex(new Ci.BufferAttribute(c,1)),
  54320. this.addAttribute("position", new Ci.BufferAttribute(h,3)),
  54321. this.addAttribute("normal", new Ci.BufferAttribute(u,3)),
  54322. this.addAttribute("uv", new Ci.BufferAttribute(d,2))
  54323. }
  54324. ,
  54325. Ci.TorusBufferGeometry.prototype = Object.create(Ci.BufferGeometry.prototype),
  54326. Ci.TorusBufferGeometry.prototype.constructor = Ci.TorusBufferGeometry,
  54327. Ci.TorusGeometry = function(e, t, i, n, r) {
  54328. Ci.Geometry.call(this),
  54329. this.type = "TorusGeometry",
  54330. this.parameters = {
  54331. radius: e,
  54332. tube: t,
  54333. radialSegments: i,
  54334. tubularSegments: n,
  54335. arc: r
  54336. },
  54337. this.fromBufferGeometry(new Ci.TorusBufferGeometry(e,t,i,n,r))
  54338. }
  54339. ,
  54340. Ci.TorusGeometry.prototype = Object.create(Ci.Geometry.prototype),
  54341. Ci.TorusGeometry.prototype.constructor = Ci.TorusGeometry,
  54342. Ci.TorusKnotBufferGeometry = function(e, t, i, n, r, o) {
  54343. function a(e, t, i, n, r) {
  54344. var o = Math.cos(e)
  54345. , a = Math.sin(e)
  54346. , s = i / t * e
  54347. , l = Math.cos(s);
  54348. r.x = n * (2 + l) * .5 * o,
  54349. r.y = n * (2 + l) * a * .5,
  54350. r.z = n * Math.sin(s) * .5
  54351. }
  54352. Ci.BufferGeometry.call(this),
  54353. this.type = "TorusKnotBufferGeometry",
  54354. this.parameters = {
  54355. radius: e,
  54356. tube: t,
  54357. tubularSegments: i,
  54358. radialSegments: n,
  54359. p: r,
  54360. q: o
  54361. },
  54362. e = e || 100,
  54363. t = t || 40,
  54364. i = Math.floor(i) || 64,
  54365. r = r || 2,
  54366. o = o || 3;
  54367. 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;
  54368. for (s = 0; s <= i; ++s) {
  54369. var w = s / i * r * Math.PI * 2;
  54370. for (a(w, r, o, e, C),
  54371. a(.01 + w, r, o, e, I),
  54372. _.subVectors(I, C),
  54373. b.addVectors(I, C),
  54374. E.crossVectors(_, b),
  54375. b.crossVectors(E, _),
  54376. E.normalize(),
  54377. b.normalize(),
  54378. l = 0; l <= n; ++l) {
  54379. var T = l / n * Math.PI * 2
  54380. , x = -t * Math.cos(T)
  54381. , S = t * Math.sin(T);
  54382. v.x = C.x + (x * b.x + S * E.x),
  54383. v.y = C.y + (x * b.y + S * E.y),
  54384. v.z = C.z + (x * b.z + S * E.z),
  54385. d.setXYZ(g, v.x, v.y, v.z),
  54386. y.subVectors(v, C).normalize(),
  54387. p.setXYZ(g, y.x, y.y, y.z),
  54388. A.x = s / i,
  54389. A.y = l / n,
  54390. f.setXY(g, A.x, A.y),
  54391. g++
  54392. }
  54393. }
  54394. for (l = 1; l <= i; l++)
  54395. for (s = 1; s <= n; s++) {
  54396. var M = (n + 1) * (l - 1) + (s - 1)
  54397. , R = (n + 1) * l + (s - 1)
  54398. , P = (n + 1) * l + s
  54399. , O = (n + 1) * (l - 1) + s;
  54400. u.setX(m, M),
  54401. m++,
  54402. u.setX(m, R),
  54403. m++,
  54404. u.setX(m, O),
  54405. m++,
  54406. u.setX(m, R),
  54407. m++,
  54408. u.setX(m, P),
  54409. m++,
  54410. u.setX(m, O),
  54411. m++
  54412. }
  54413. this.setIndex(u),
  54414. this.addAttribute("position", d),
  54415. this.addAttribute("normal", p),
  54416. this.addAttribute("uv", f)
  54417. }
  54418. ,
  54419. Ci.TorusKnotBufferGeometry.prototype = Object.create(Ci.BufferGeometry.prototype),
  54420. Ci.TorusKnotBufferGeometry.prototype.constructor = Ci.TorusKnotBufferGeometry,
  54421. Ci.TorusKnotGeometry = function(e, t, i, n, r, o, a) {
  54422. Ci.Geometry.call(this),
  54423. this.type = "TorusKnotGeometry",
  54424. this.parameters = {
  54425. radius: e,
  54426. tube: t,
  54427. tubularSegments: i,
  54428. radialSegments: n,
  54429. p: r,
  54430. q: o
  54431. },
  54432. void 0 !== a && console.warn("THREE.TorusKnotGeometry: heightScale has been deprecated. Use .scale( x, y, z ) instead."),
  54433. this.fromBufferGeometry(new Ci.TorusKnotBufferGeometry(e,t,i,n,r,o)),
  54434. this.mergeVertices()
  54435. }
  54436. ,
  54437. Ci.TorusKnotGeometry.prototype = Object.create(Ci.Geometry.prototype),
  54438. Ci.TorusKnotGeometry.prototype.constructor = Ci.TorusKnotGeometry,
  54439. Ci.TubeGeometry = function(e, t, i, n, r, o) {
  54440. Ci.Geometry.call(this),
  54441. this.type = "TubeGeometry",
  54442. this.parameters = {
  54443. path: e,
  54444. segments: t,
  54445. radius: i,
  54446. radialSegments: n,
  54447. closed: r,
  54448. taper: o
  54449. },
  54450. t = t || 64,
  54451. i = i || 1,
  54452. n = n || 8,
  54453. r = r || !1,
  54454. o = o || Ci.TubeGeometry.NoTaper;
  54455. 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;
  54456. for (this.tangents = D,
  54457. this.normals = N,
  54458. this.binormals = F,
  54459. f = 0; f < P; f++)
  54460. for (M[f] = [],
  54461. l = f / (P - 1),
  54462. p = e.getPointAt(l),
  54463. D[f],
  54464. a = N[f],
  54465. s = F[f],
  54466. h = i * o(l),
  54467. g = 0; g < n; g++)
  54468. c = g / n * 2 * Math.PI,
  54469. u = -h * Math.cos(c),
  54470. d = h * Math.sin(c),
  54471. O.copy(p),
  54472. O.x += u * a.x + d * s.x,
  54473. O.y += u * a.y + d * s.y,
  54474. O.z += u * a.z + d * s.z,
  54475. M[f][g] = (T = O.x,
  54476. x = O.y,
  54477. S = O.z,
  54478. R.vertices.push(new Ci.Vector3(T,x,S)) - 1);
  54479. for (f = 0; f < t; f++)
  54480. for (g = 0; g < n; g++)
  54481. m = r ? (f + 1) % t : f + 1,
  54482. v = (g + 1) % n,
  54483. y = M[f][g],
  54484. A = M[m][g],
  54485. C = M[m][v],
  54486. I = M[f][v],
  54487. E = new Ci.Vector2(f / t,g / n),
  54488. _ = new Ci.Vector2((f + 1) / t,g / n),
  54489. b = new Ci.Vector2((f + 1) / t,(g + 1) / n),
  54490. w = new Ci.Vector2(f / t,(g + 1) / n),
  54491. this.faces.push(new Ci.Face3(y,A,I)),
  54492. this.faceVertexUvs[0].push([E, _, w]),
  54493. this.faces.push(new Ci.Face3(A,C,I)),
  54494. this.faceVertexUvs[0].push([_.clone(), b, w.clone()]);
  54495. this.computeFaceNormals(),
  54496. this.computeVertexNormals()
  54497. }
  54498. ,
  54499. Ci.TubeGeometry.prototype = Object.create(Ci.Geometry.prototype),
  54500. Ci.TubeGeometry.prototype.constructor = Ci.TubeGeometry,
  54501. Ci.TubeGeometry.NoTaper = function(e) {
  54502. return 1
  54503. }
  54504. ,
  54505. Ci.TubeGeometry.SinusoidalTaper = function(e) {
  54506. return Math.sin(Math.PI * e)
  54507. }
  54508. ,
  54509. Ci.TubeGeometry.FrenetFrames = function(e, t, i) {
  54510. 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;
  54511. for (this.tangents = u,
  54512. this.normals = d,
  54513. this.binormals = p,
  54514. l = 0; l < m; l++)
  54515. c = l / (m - 1),
  54516. u[l] = e.getTangentAt(c),
  54517. u[l].normalize();
  54518. for (d[0] = new Ci.Vector3,
  54519. p[0] = new Ci.Vector3,
  54520. r = Number.MAX_VALUE,
  54521. o = Math.abs(u[0].x),
  54522. a = Math.abs(u[0].y),
  54523. s = Math.abs(u[0].z),
  54524. o <= r && (r = o,
  54525. h.set(1, 0, 0)),
  54526. a <= r && (r = a,
  54527. h.set(0, 1, 0)),
  54528. s <= r && h.set(0, 0, 1),
  54529. f.crossVectors(u[0], h).normalize(),
  54530. d[0].crossVectors(u[0], f),
  54531. p[0].crossVectors(u[0], d[0]),
  54532. l = 1; l < m; l++)
  54533. d[l] = d[l - 1].clone(),
  54534. p[l] = p[l - 1].clone(),
  54535. f.crossVectors(u[l - 1], u[l]),
  54536. f.length() > Number.EPSILON && (f.normalize(),
  54537. n = Math.acos(Ci.Math.clamp(u[l - 1].dot(u[l]), -1, 1)),
  54538. d[l].applyMatrix4(g.makeRotationAxis(f, n))),
  54539. p[l].crossVectors(u[l], d[l]);
  54540. if (i)
  54541. for (n = Math.acos(Ci.Math.clamp(d[0].dot(d[m - 1]), -1, 1)),
  54542. n /= m - 1,
  54543. 0 < u[0].dot(f.crossVectors(d[0], d[m - 1])) && (n = -n),
  54544. l = 1; l < m; l++)
  54545. d[l].applyMatrix4(g.makeRotationAxis(u[l], n * l)),
  54546. p[l].crossVectors(u[l], d[l])
  54547. }
  54548. ,
  54549. Ci.PolyhedronGeometry = function(e, t, i, n) {
  54550. function f(e) {
  54551. var t = e.normalize().clone();
  54552. t.index = m.vertices.push(t) - 1;
  54553. var i = a(e) / 2 / Math.PI + .5
  54554. , n = function(e) {
  54555. return Math.atan2(-e.y, Math.sqrt(e.x * e.x + e.z * e.z))
  54556. }(e) / Math.PI + .5;
  54557. return t.uv = new Ci.Vector2(i,1 - n),
  54558. t
  54559. }
  54560. function g(e, t, i, n) {
  54561. var r = new Ci.Face3(e.index,t.index,i.index,[e.clone(), t.clone(), i.clone()],void 0,n);
  54562. m.faces.push(r),
  54563. y.copy(e).add(t).add(i).divideScalar(3);
  54564. var o = a(y);
  54565. m.faceVertexUvs[0].push([s(e.uv, e, o), s(t.uv, t, o), s(i.uv, i, o)])
  54566. }
  54567. function r(e, t) {
  54568. 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++) {
  54569. a[l] = [];
  54570. 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++)
  54571. a[l][d] = 0 === d && l === i ? c : f(c.clone().lerp(h, d / u))
  54572. }
  54573. for (l = 0; l < i; l++)
  54574. for (d = 0; d < 2 * (i - l) - 1; d++) {
  54575. var p = Math.floor(d / 2);
  54576. 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)
  54577. }
  54578. }
  54579. function a(e) {
  54580. return Math.atan2(e.z, -e.x)
  54581. }
  54582. function s(e, t, i) {
  54583. return i < 0 && 1 === e.x && (e = new Ci.Vector2(e.x - 1,e.y)),
  54584. 0 === t.x && 0 === t.z && (e = new Ci.Vector2(i / 2 / Math.PI + .5,e.y)),
  54585. e.clone()
  54586. }
  54587. Ci.Geometry.call(this),
  54588. this.type = "PolyhedronGeometry",
  54589. this.parameters = {
  54590. vertices: e,
  54591. indices: t,
  54592. radius: i,
  54593. detail: n
  54594. },
  54595. i = i || 1,
  54596. n = n || 0;
  54597. for (var m = this, o = 0, l = e.length; o < l; o += 3)
  54598. f(new Ci.Vector3(e[o],e[o + 1],e[o + 2]));
  54599. var c = this.vertices
  54600. , h = []
  54601. , u = (o = 0,
  54602. 0);
  54603. for (l = t.length; o < l; o += 3,
  54604. u++) {
  54605. var d = c[t[o]]
  54606. , p = c[t[o + 1]]
  54607. , v = c[t[o + 2]];
  54608. h[u] = new Ci.Face3(d.index,p.index,v.index,[d.clone(), p.clone(), v.clone()],void 0,u)
  54609. }
  54610. var y = new Ci.Vector3;
  54611. for (o = 0,
  54612. l = h.length; o < l; o++)
  54613. r(h[o], n);
  54614. for (o = 0,
  54615. l = this.faceVertexUvs[0].length; o < l; o++) {
  54616. var A = this.faceVertexUvs[0][o]
  54617. , C = A[0].x
  54618. , I = A[1].x
  54619. , E = A[2].x
  54620. , _ = Math.max(C, I, E)
  54621. , b = Math.min(C, I, E);
  54622. .9 < _ && b < .1 && (C < .2 && (A[0].x += 1),
  54623. I < .2 && (A[1].x += 1),
  54624. E < .2 && (A[2].x += 1))
  54625. }
  54626. for (o = 0,
  54627. l = this.vertices.length; o < l; o++)
  54628. this.vertices[o].multiplyScalar(i);
  54629. this.mergeVertices(),
  54630. this.computeFaceNormals(),
  54631. this.boundingSphere = new Ci.Sphere(new Ci.Vector3,i)
  54632. }
  54633. ,
  54634. Ci.PolyhedronGeometry.prototype = Object.create(Ci.Geometry.prototype),
  54635. Ci.PolyhedronGeometry.prototype.constructor = Ci.PolyhedronGeometry,
  54636. Ci.DodecahedronGeometry = function(e, t) {
  54637. var i = (1 + Math.sqrt(5)) / 2
  54638. , n = 1 / i
  54639. , 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];
  54640. 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),
  54641. this.type = "DodecahedronGeometry",
  54642. this.parameters = {
  54643. radius: e,
  54644. detail: t
  54645. }
  54646. }
  54647. ,
  54648. Ci.DodecahedronGeometry.prototype = Object.create(Ci.PolyhedronGeometry.prototype),
  54649. Ci.DodecahedronGeometry.prototype.constructor = Ci.DodecahedronGeometry,
  54650. Ci.IcosahedronGeometry = function(e, t) {
  54651. var i = (1 + Math.sqrt(5)) / 2
  54652. , 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];
  54653. 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),
  54654. this.type = "IcosahedronGeometry",
  54655. this.parameters = {
  54656. radius: e,
  54657. detail: t
  54658. }
  54659. }
  54660. ,
  54661. Ci.IcosahedronGeometry.prototype = Object.create(Ci.PolyhedronGeometry.prototype),
  54662. Ci.IcosahedronGeometry.prototype.constructor = Ci.IcosahedronGeometry,
  54663. Ci.OctahedronGeometry = function(e, t) {
  54664. 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),
  54665. this.type = "OctahedronGeometry",
  54666. this.parameters = {
  54667. radius: e,
  54668. detail: t
  54669. }
  54670. }
  54671. ,
  54672. Ci.OctahedronGeometry.prototype = Object.create(Ci.PolyhedronGeometry.prototype),
  54673. Ci.OctahedronGeometry.prototype.constructor = Ci.OctahedronGeometry,
  54674. Ci.TetrahedronGeometry = function(e, t) {
  54675. 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),
  54676. this.type = "TetrahedronGeometry",
  54677. this.parameters = {
  54678. radius: e,
  54679. detail: t
  54680. }
  54681. }
  54682. ,
  54683. Ci.TetrahedronGeometry.prototype = Object.create(Ci.PolyhedronGeometry.prototype),
  54684. Ci.TetrahedronGeometry.prototype.constructor = Ci.TetrahedronGeometry,
  54685. Ci.ParametricGeometry = function(e, t, i) {
  54686. Ci.Geometry.call(this),
  54687. this.type = "ParametricGeometry",
  54688. this.parameters = {
  54689. func: e,
  54690. slices: t,
  54691. stacks: i
  54692. };
  54693. 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;
  54694. for (n = 0; n <= i; n++)
  54695. for (a = n / i,
  54696. r = 0; r <= t; r++)
  54697. o = e(r / t, a),
  54698. g.push(o);
  54699. for (n = 0; n < i; n++)
  54700. for (r = 0; r < t; r++)
  54701. l = (s = n * y + r) + 1,
  54702. c = (n + 1) * y + r + 1,
  54703. h = (n + 1) * y + r,
  54704. u = new Ci.Vector2(r / t,n / i),
  54705. d = new Ci.Vector2((r + 1) / t,n / i),
  54706. p = new Ci.Vector2((r + 1) / t,(n + 1) / i),
  54707. f = new Ci.Vector2(r / t,(n + 1) / i),
  54708. m.push(new Ci.Face3(s,l,h)),
  54709. v.push([u, d, f]),
  54710. m.push(new Ci.Face3(l,c,h)),
  54711. v.push([d.clone(), p, f.clone()]);
  54712. this.computeFaceNormals(),
  54713. this.computeVertexNormals()
  54714. }
  54715. ,
  54716. Ci.ParametricGeometry.prototype = Object.create(Ci.Geometry.prototype),
  54717. Ci.ParametricGeometry.prototype.constructor = Ci.ParametricGeometry,
  54718. Ci.WireframeGeometry = function(e) {
  54719. function t(e, t) {
  54720. return e - t
  54721. }
  54722. Ci.BufferGeometry.call(this);
  54723. var i = [0, 0]
  54724. , n = {}
  54725. , r = ["a", "b", "c"];
  54726. if (e instanceof Ci.Geometry) {
  54727. for (var o = e.vertices, a = e.faces, s = 0, l = new Uint32Array(6 * a.length), c = 0, h = a.length; c < h; c++)
  54728. for (var u = a[c], d = 0; d < 3; d++) {
  54729. i[0] = u[r[d]],
  54730. i[1] = u[r[(d + 1) % 3]],
  54731. i.sort(t),
  54732. void 0 === n[E = i.toString()] && (l[2 * s] = i[0],
  54733. l[2 * s + 1] = i[1],
  54734. n[E] = !0,
  54735. s++)
  54736. }
  54737. var p = new Float32Array(2 * s * 3);
  54738. for (c = 0,
  54739. h = s; c < h; c++)
  54740. for (d = 0; d < 2; d++) {
  54741. var f = o[l[2 * c + d]];
  54742. p[(_ = 6 * c + 3 * d) + 0] = f.x,
  54743. p[_ + 1] = f.y,
  54744. p[_ + 2] = f.z
  54745. }
  54746. this.addAttribute("position", new Ci.BufferAttribute(p,3))
  54747. } else if (e instanceof Ci.BufferGeometry)
  54748. if (null !== e.index) {
  54749. var g = e.index.array
  54750. , m = (o = e.attributes.position,
  54751. e.groups);
  54752. s = 0;
  54753. 0 === m.length && e.addGroup(0, g.length);
  54754. l = new Uint32Array(2 * g.length);
  54755. for (var v = 0, y = m.length; v < y; ++v)
  54756. for (var A = m[v], C = A.start, I = (c = C,
  54757. C + A.count); c < I; c += 3)
  54758. for (d = 0; d < 3; d++) {
  54759. var E;
  54760. i[0] = g[c + d],
  54761. i[1] = g[c + (d + 1) % 3],
  54762. i.sort(t),
  54763. void 0 === n[E = i.toString()] && (l[2 * s] = i[0],
  54764. l[2 * s + 1] = i[1],
  54765. n[E] = !0,
  54766. s++)
  54767. }
  54768. for (p = new Float32Array(2 * s * 3),
  54769. c = 0,
  54770. h = s; c < h; c++)
  54771. for (d = 0; d < 2; d++) {
  54772. var _ = 6 * c + 3 * d
  54773. , b = l[2 * c + d];
  54774. p[_ + 0] = o.getX(b),
  54775. p[_ + 1] = o.getY(b),
  54776. p[_ + 2] = o.getZ(b)
  54777. }
  54778. this.addAttribute("position", new Ci.BufferAttribute(p,3))
  54779. } else {
  54780. var w = (s = (o = e.attributes.position.array).length / 3) / 3;
  54781. for (p = new Float32Array(2 * s * 3),
  54782. c = 0,
  54783. h = w; c < h; c++)
  54784. for (d = 0; d < 3; d++) {
  54785. var T = 9 * c + 3 * d;
  54786. p[(_ = 18 * c + 6 * d) + 0] = o[T],
  54787. p[_ + 1] = o[1 + T],
  54788. p[_ + 2] = o[2 + T];
  54789. b = 9 * c + (d + 1) % 3 * 3;
  54790. p[_ + 3] = o[b],
  54791. p[_ + 4] = o[b + 1],
  54792. p[_ + 5] = o[b + 2]
  54793. }
  54794. this.addAttribute("position", new Ci.BufferAttribute(p,3))
  54795. }
  54796. }
  54797. ,
  54798. Ci.WireframeGeometry.prototype = Object.create(Ci.BufferGeometry.prototype),
  54799. Ci.WireframeGeometry.prototype.constructor = Ci.WireframeGeometry,
  54800. Ci.AxisHelper = function(e) {
  54801. e = e || 1;
  54802. var t = new Float32Array([0, 0, 0, e, 0, 0, 0, 0, 0, 0, e, 0, 0, 0, 0, 0, 0, e])
  54803. , i = new Float32Array([1, 0, 0, 1, .6, 0, 0, 1, 0, .6, 1, 0, 0, 0, 1, 0, .6, 1])
  54804. , n = new Ci.BufferGeometry;
  54805. n.addAttribute("position", new Ci.BufferAttribute(t,3)),
  54806. n.addAttribute("color", new Ci.BufferAttribute(i,3));
  54807. var r = new Ci.LineBasicMaterial({
  54808. vertexColors: Ci.VertexColors
  54809. });
  54810. Ci.LineSegments.call(this, n, r)
  54811. }
  54812. ,
  54813. Ci.AxisHelper.prototype = Object.create(Ci.LineSegments.prototype),
  54814. Ci.AxisHelper.prototype.constructor = Ci.AxisHelper,
  54815. Ci.ArrowHelper = function() {
  54816. var a = new Ci.Geometry;
  54817. a.vertices.push(new Ci.Vector3(0,0,0), new Ci.Vector3(0,1,0));
  54818. var s = new Ci.CylinderGeometry(0,.5,1,5,1);
  54819. return s.translate(0, -.5, 0),
  54820. function(e, t, i, n, r, o) {
  54821. Ci.Object3D.call(this),
  54822. void 0 === n && (n = 16776960),
  54823. void 0 === i && (i = 1),
  54824. void 0 === r && (r = .2 * i),
  54825. void 0 === o && (o = .2 * r),
  54826. this.position.copy(t),
  54827. this.line = new Ci.Line(a,new Ci.LineBasicMaterial({
  54828. color: n
  54829. })),
  54830. this.line.matrixAutoUpdate = !1,
  54831. this.add(this.line),
  54832. this.cone = new Ci.Mesh(s,new Ci.MeshBasicMaterial({
  54833. color: n
  54834. })),
  54835. this.cone.matrixAutoUpdate = !1,
  54836. this.add(this.cone),
  54837. this.setDirection(e),
  54838. this.setLength(i, r, o)
  54839. }
  54840. }(),
  54841. Ci.ArrowHelper.prototype = Object.create(Ci.Object3D.prototype),
  54842. Ci.ArrowHelper.prototype.constructor = Ci.ArrowHelper,
  54843. Ci.ArrowHelper.prototype.setDirection = (Ai = new Ci.Vector3,
  54844. function(e) {
  54845. .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(),
  54846. yi = Math.acos(e.y),
  54847. this.quaternion.setFromAxisAngle(Ai, yi))
  54848. }
  54849. ),
  54850. Ci.ArrowHelper.prototype.setLength = function(e, t, i) {
  54851. void 0 === t && (t = .2 * e),
  54852. void 0 === i && (i = .2 * t),
  54853. this.line.scale.set(1, Math.max(0, e - t), 1),
  54854. this.line.updateMatrix(),
  54855. this.cone.scale.set(i, t, i),
  54856. this.cone.position.y = e,
  54857. this.cone.updateMatrix()
  54858. }
  54859. ,
  54860. Ci.ArrowHelper.prototype.setColor = function(e) {
  54861. this.line.material.color.set(e),
  54862. this.cone.material.color.set(e)
  54863. }
  54864. ,
  54865. Ci.BoxHelper = function(e) {
  54866. 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])
  54867. , i = new Float32Array(24)
  54868. , n = new Ci.BufferGeometry;
  54869. n.setIndex(new Ci.BufferAttribute(t,1)),
  54870. n.addAttribute("position", new Ci.BufferAttribute(i,3)),
  54871. Ci.LineSegments.call(this, n, new Ci.LineBasicMaterial({
  54872. color: 16776960
  54873. })),
  54874. void 0 !== e && this.update(e)
  54875. }
  54876. ,
  54877. Ci.BoxHelper.prototype = Object.create(Ci.LineSegments.prototype),
  54878. Ci.BoxHelper.prototype.constructor = Ci.BoxHelper,
  54879. Ci.BoxHelper.prototype.update = (vi = new Ci.Box3,
  54880. function(e) {
  54881. if (vi.setFromObject(e),
  54882. !vi.isEmpty()) {
  54883. var t = vi.min
  54884. , i = vi.max
  54885. , n = this.geometry.attributes.position
  54886. , r = n.array;
  54887. r[0] = i.x,
  54888. r[1] = i.y,
  54889. r[2] = i.z,
  54890. r[3] = t.x,
  54891. r[4] = i.y,
  54892. r[5] = i.z,
  54893. r[6] = t.x,
  54894. r[7] = t.y,
  54895. r[8] = i.z,
  54896. r[9] = i.x,
  54897. r[10] = t.y,
  54898. r[11] = i.z,
  54899. r[12] = i.x,
  54900. r[13] = i.y,
  54901. r[14] = t.z,
  54902. r[15] = t.x,
  54903. r[16] = i.y,
  54904. r[17] = t.z,
  54905. r[18] = t.x,
  54906. r[19] = t.y,
  54907. r[20] = t.z,
  54908. r[21] = i.x,
  54909. r[22] = t.y,
  54910. r[23] = t.z,
  54911. n.needsUpdate = !0,
  54912. this.geometry.computeBoundingSphere()
  54913. }
  54914. }
  54915. ),
  54916. Ci.BoundingBoxHelper = function(e, t) {
  54917. var i = void 0 !== t ? t : 8947848;
  54918. this.object = e,
  54919. this.box = new Ci.Box3,
  54920. Ci.Mesh.call(this, new Ci.BoxGeometry(1,1,1), new Ci.MeshBasicMaterial({
  54921. color: i,
  54922. wireframe: !0
  54923. }))
  54924. }
  54925. ,
  54926. Ci.BoundingBoxHelper.prototype = Object.create(Ci.Mesh.prototype),
  54927. Ci.BoundingBoxHelper.prototype.constructor = Ci.BoundingBoxHelper,
  54928. Ci.BoundingBoxHelper.prototype.update = function() {
  54929. this.box.setFromObject(this.object),
  54930. this.box.size(this.scale),
  54931. this.box.center(this.position)
  54932. }
  54933. ,
  54934. Ci.CameraHelper = function(e) {
  54935. function t(e, t, i) {
  54936. n(e, i),
  54937. n(t, i)
  54938. }
  54939. function n(e, t) {
  54940. i.vertices.push(new Ci.Vector3),
  54941. i.colors.push(new Ci.Color(t)),
  54942. void 0 === o[e] && (o[e] = []),
  54943. o[e].push(i.vertices.length - 1)
  54944. }
  54945. var i = new Ci.Geometry
  54946. , r = new Ci.LineBasicMaterial({
  54947. color: 16777215,
  54948. vertexColors: Ci.FaceColors
  54949. })
  54950. , o = {}
  54951. , a = 16755200
  54952. , s = 16711680
  54953. , l = 3355443;
  54954. t("n1", "n2", a),
  54955. t("n2", "n4", a),
  54956. t("n4", "n3", a),
  54957. t("n3", "n1", a),
  54958. t("f1", "f2", a),
  54959. t("f2", "f4", a),
  54960. t("f4", "f3", a),
  54961. t("f3", "f1", a),
  54962. t("n1", "f1", a),
  54963. t("n2", "f2", a),
  54964. t("n3", "f3", a),
  54965. t("n4", "f4", a),
  54966. t("p", "n1", s),
  54967. t("p", "n2", s),
  54968. t("p", "n3", s),
  54969. t("p", "n4", s),
  54970. t("u1", "u2", 43775),
  54971. t("u2", "u3", 43775),
  54972. t("u3", "u1", 43775),
  54973. t("c", "t", 16777215),
  54974. t("p", "c", l),
  54975. t("cn1", "cn2", l),
  54976. t("cn3", "cn4", l),
  54977. t("cf1", "cf2", l),
  54978. t("cf3", "cf4", l),
  54979. Ci.LineSegments.call(this, i, r),
  54980. this.camera = e,
  54981. this.camera.updateProjectionMatrix(),
  54982. this.matrix = e.matrixWorld,
  54983. this.matrixAutoUpdate = !1,
  54984. this.pointMap = o,
  54985. this.update()
  54986. }
  54987. ,
  54988. Ci.CameraHelper.prototype = Object.create(Ci.LineSegments.prototype),
  54989. Ci.CameraHelper.prototype.constructor = Ci.CameraHelper,
  54990. Ci.CameraHelper.prototype.update = (gi = new Ci.Vector3,
  54991. mi = new Ci.Camera,
  54992. function() {
  54993. pi = this.geometry,
  54994. fi = this.pointMap,
  54995. mi.projectionMatrix.copy(this.camera.projectionMatrix),
  54996. Ni("c", 0, 0, -1),
  54997. Ni("t", 0, 0, 1),
  54998. Ni("n1", -1, -1, -1),
  54999. Ni("n2", 1, -1, -1),
  55000. Ni("n3", -1, 1, -1),
  55001. Ni("n4", 1, 1, -1),
  55002. Ni("f1", -1, -1, 1),
  55003. Ni("f2", 1, -1, 1),
  55004. Ni("f3", -1, 1, 1),
  55005. Ni("f4", 1, 1, 1),
  55006. Ni("u1", .7, 1.1, -1),
  55007. Ni("u2", -.7, 1.1, -1),
  55008. Ni("u3", 0, 2, -1),
  55009. Ni("cf1", -1, 0, 1),
  55010. Ni("cf2", 1, 0, 1),
  55011. Ni("cf3", 0, -1, 1),
  55012. Ni("cf4", 0, 1, 1),
  55013. Ni("cn1", -1, 0, -1),
  55014. Ni("cn2", 1, 0, -1),
  55015. Ni("cn3", 0, -1, -1),
  55016. Ni("cn4", 0, 1, -1),
  55017. pi.verticesNeedUpdate = !0
  55018. }
  55019. ),
  55020. Ci.DirectionalLightHelper = function(e, t) {
  55021. Ci.Object3D.call(this),
  55022. this.light = e,
  55023. this.light.updateMatrixWorld(),
  55024. this.matrix = e.matrixWorld,
  55025. this.matrixAutoUpdate = !1,
  55026. t = t || 1;
  55027. var i = new Ci.Geometry;
  55028. 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));
  55029. var n = new Ci.LineBasicMaterial({
  55030. fog: !1
  55031. });
  55032. n.color.copy(this.light.color).multiplyScalar(this.light.intensity),
  55033. this.lightPlane = new Ci.Line(i,n),
  55034. this.add(this.lightPlane),
  55035. (i = new Ci.Geometry).vertices.push(new Ci.Vector3, new Ci.Vector3),
  55036. (n = new Ci.LineBasicMaterial({
  55037. fog: !1
  55038. })).color.copy(this.light.color).multiplyScalar(this.light.intensity),
  55039. this.targetLine = new Ci.Line(i,n),
  55040. this.add(this.targetLine),
  55041. this.update()
  55042. }
  55043. ,
  55044. Ci.DirectionalLightHelper.prototype = Object.create(Ci.Object3D.prototype),
  55045. Ci.DirectionalLightHelper.prototype.constructor = Ci.DirectionalLightHelper,
  55046. Ci.DirectionalLightHelper.prototype.dispose = function() {
  55047. this.lightPlane.geometry.dispose(),
  55048. this.lightPlane.material.dispose(),
  55049. this.targetLine.geometry.dispose(),
  55050. this.targetLine.material.dispose()
  55051. }
  55052. ,
  55053. Ci.DirectionalLightHelper.prototype.update = (hi = new Ci.Vector3,
  55054. ui = new Ci.Vector3,
  55055. di = new Ci.Vector3,
  55056. function() {
  55057. hi.setFromMatrixPosition(this.light.matrixWorld),
  55058. ui.setFromMatrixPosition(this.light.target.matrixWorld),
  55059. di.subVectors(ui, hi),
  55060. this.lightPlane.lookAt(di),
  55061. this.lightPlane.material.color.copy(this.light.color).multiplyScalar(this.light.intensity),
  55062. this.targetLine.geometry.vertices[1].copy(di),
  55063. this.targetLine.geometry.verticesNeedUpdate = !0,
  55064. this.targetLine.material.color.copy(this.lightPlane.material.color)
  55065. }
  55066. ),
  55067. Ci.EdgesHelper = function(e, t, i) {
  55068. var n = void 0 !== t ? t : 16777215;
  55069. Ci.LineSegments.call(this, new Ci.EdgesGeometry(e.geometry,i), new Ci.LineBasicMaterial({
  55070. color: n
  55071. })),
  55072. this.matrix = e.matrixWorld,
  55073. this.matrixAutoUpdate = !1
  55074. }
  55075. ,
  55076. Ci.EdgesHelper.prototype = Object.create(Ci.LineSegments.prototype),
  55077. Ci.EdgesHelper.prototype.constructor = Ci.EdgesHelper,
  55078. Ci.FaceNormalsHelper = function(e, t, i, n) {
  55079. this.object = e,
  55080. this.size = void 0 !== t ? t : 1;
  55081. var r = void 0 !== i ? i : 16776960
  55082. , o = void 0 !== n ? n : 1
  55083. , a = 0
  55084. , s = this.object.geometry;
  55085. s instanceof Ci.Geometry ? a = s.faces.length : console.warn("THREE.FaceNormalsHelper: only THREE.Geometry is supported. Use THREE.VertexNormalsHelper, instead.");
  55086. var l = new Ci.BufferGeometry
  55087. , c = new Ci.Float32Attribute(2 * a * 3,3);
  55088. l.addAttribute("position", c),
  55089. Ci.LineSegments.call(this, l, new Ci.LineBasicMaterial({
  55090. color: r,
  55091. linewidth: o
  55092. })),
  55093. this.matrixAutoUpdate = !1,
  55094. this.update()
  55095. }
  55096. ,
  55097. Ci.FaceNormalsHelper.prototype = Object.create(Ci.LineSegments.prototype),
  55098. Ci.FaceNormalsHelper.prototype.constructor = Ci.FaceNormalsHelper,
  55099. Ci.FaceNormalsHelper.prototype.update = (si = new Ci.Vector3,
  55100. li = new Ci.Vector3,
  55101. ci = new Ci.Matrix3,
  55102. function() {
  55103. this.object.updateMatrixWorld(!0),
  55104. ci.getNormalMatrix(this.object.matrixWorld);
  55105. 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++) {
  55106. var l = r[a]
  55107. , c = l.normal;
  55108. si.copy(n[l.a]).add(n[l.b]).add(n[l.c]).divideScalar(3).applyMatrix4(e),
  55109. li.copy(c).applyMatrix3(ci).normalize().multiplyScalar(this.size).add(si),
  55110. t.setXYZ(o, si.x, si.y, si.z),
  55111. o += 1,
  55112. t.setXYZ(o, li.x, li.y, li.z),
  55113. o += 1
  55114. }
  55115. return t.needsUpdate = !0,
  55116. this
  55117. }
  55118. ),
  55119. Ci.GridHelper = function(e, t) {
  55120. var i = new Ci.Geometry
  55121. , n = new Ci.LineBasicMaterial({
  55122. vertexColors: Ci.VertexColors
  55123. });
  55124. this.color1 = new Ci.Color(4473924),
  55125. this.color2 = new Ci.Color(8947848);
  55126. for (var r = -e; r <= e; r += t) {
  55127. 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));
  55128. var o = 0 === r ? this.color1 : this.color2;
  55129. i.colors.push(o, o, o, o)
  55130. }
  55131. Ci.LineSegments.call(this, i, n)
  55132. }
  55133. ,
  55134. Ci.GridHelper.prototype = Object.create(Ci.LineSegments.prototype),
  55135. Ci.GridHelper.prototype.constructor = Ci.GridHelper,
  55136. Ci.GridHelper.prototype.setColors = function(e, t) {
  55137. this.color1.set(e),
  55138. this.color2.set(t),
  55139. this.geometry.colorsNeedUpdate = !0
  55140. }
  55141. ,
  55142. Ci.HemisphereLightHelper = function(e, t) {
  55143. Ci.Object3D.call(this),
  55144. this.light = e,
  55145. this.light.updateMatrixWorld(),
  55146. this.matrix = e.matrixWorld,
  55147. this.matrixAutoUpdate = !1,
  55148. this.colors = [new Ci.Color, new Ci.Color];
  55149. var i = new Ci.SphereGeometry(t,4,2);
  55150. i.rotateX(-Math.PI / 2);
  55151. for (var n = 0; n < 8; n++)
  55152. i.faces[n].color = this.colors[n < 4 ? 0 : 1];
  55153. var r = new Ci.MeshBasicMaterial({
  55154. vertexColors: Ci.FaceColors,
  55155. wireframe: !0
  55156. });
  55157. this.lightSphere = new Ci.Mesh(i,r),
  55158. this.add(this.lightSphere),
  55159. this.update()
  55160. }
  55161. ,
  55162. Ci.HemisphereLightHelper.prototype = Object.create(Ci.Object3D.prototype),
  55163. Ci.HemisphereLightHelper.prototype.constructor = Ci.HemisphereLightHelper,
  55164. Ci.HemisphereLightHelper.prototype.dispose = function() {
  55165. this.lightSphere.geometry.dispose(),
  55166. this.lightSphere.material.dispose()
  55167. }
  55168. ,
  55169. Ci.HemisphereLightHelper.prototype.update = (ai = new Ci.Vector3,
  55170. function() {
  55171. this.colors[0].copy(this.light.color).multiplyScalar(this.light.intensity),
  55172. this.colors[1].copy(this.light.groundColor).multiplyScalar(this.light.intensity),
  55173. this.lightSphere.lookAt(ai.setFromMatrixPosition(this.light.matrixWorld).negate()),
  55174. this.lightSphere.geometry.colorsNeedUpdate = !0
  55175. }
  55176. ),
  55177. Ci.PointLightHelper = function(e, t) {
  55178. this.light = e,
  55179. this.light.updateMatrixWorld();
  55180. var i = new Ci.SphereGeometry(t,4,2)
  55181. , n = new Ci.MeshBasicMaterial({
  55182. wireframe: !0,
  55183. fog: !1
  55184. });
  55185. n.color.copy(this.light.color).multiplyScalar(this.light.intensity),
  55186. Ci.Mesh.call(this, i, n),
  55187. this.matrix = this.light.matrixWorld,
  55188. this.matrixAutoUpdate = !1
  55189. }
  55190. ,
  55191. Ci.PointLightHelper.prototype = Object.create(Ci.Mesh.prototype),
  55192. Ci.PointLightHelper.prototype.constructor = Ci.PointLightHelper,
  55193. Ci.PointLightHelper.prototype.dispose = function() {
  55194. this.geometry.dispose(),
  55195. this.material.dispose()
  55196. }
  55197. ,
  55198. Ci.PointLightHelper.prototype.update = function() {
  55199. this.material.color.copy(this.light.color).multiplyScalar(this.light.intensity)
  55200. }
  55201. ,
  55202. Ci.SkeletonHelper = function(e) {
  55203. this.bones = this.getBoneList(e);
  55204. for (var t = new Ci.Geometry, i = 0; i < this.bones.length; i++) {
  55205. this.bones[i].parent instanceof Ci.Bone && (t.vertices.push(new Ci.Vector3),
  55206. t.vertices.push(new Ci.Vector3),
  55207. t.colors.push(new Ci.Color(0,0,1)),
  55208. t.colors.push(new Ci.Color(0,1,0)))
  55209. }
  55210. t.dynamic = !0;
  55211. var n = new Ci.LineBasicMaterial({
  55212. vertexColors: Ci.VertexColors,
  55213. depthTest: !1,
  55214. depthWrite: !1,
  55215. transparent: !0
  55216. });
  55217. Ci.LineSegments.call(this, t, n),
  55218. this.root = e,
  55219. this.matrix = e.matrixWorld,
  55220. this.matrixAutoUpdate = !1,
  55221. this.update()
  55222. }
  55223. ,
  55224. Ci.SkeletonHelper.prototype = Object.create(Ci.LineSegments.prototype),
  55225. Ci.SkeletonHelper.prototype.constructor = Ci.SkeletonHelper,
  55226. Ci.SkeletonHelper.prototype.getBoneList = function(e) {
  55227. var t = [];
  55228. e instanceof Ci.Bone && t.push(e);
  55229. for (var i = 0; i < e.children.length; i++)
  55230. t.push.apply(t, this.getBoneList(e.children[i]));
  55231. return t
  55232. }
  55233. ,
  55234. Ci.SkeletonHelper.prototype.update = function() {
  55235. 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++) {
  55236. var o = this.bones[r];
  55237. o.parent instanceof Ci.Bone && (i.multiplyMatrices(t, o.matrixWorld),
  55238. e.vertices[n].setFromMatrixPosition(i),
  55239. i.multiplyMatrices(t, o.parent.matrixWorld),
  55240. e.vertices[n + 1].setFromMatrixPosition(i),
  55241. n += 2)
  55242. }
  55243. e.verticesNeedUpdate = !0,
  55244. e.computeBoundingSphere()
  55245. }
  55246. ,
  55247. Ci.SpotLightHelper = function(e) {
  55248. Ci.Object3D.call(this),
  55249. this.light = e,
  55250. this.light.updateMatrixWorld(),
  55251. this.matrix = e.matrixWorld,
  55252. this.matrixAutoUpdate = !1;
  55253. var t = new Ci.CylinderGeometry(0,1,1,8,1,!0);
  55254. t.translate(0, -.5, 0),
  55255. t.rotateX(-Math.PI / 2);
  55256. var i = new Ci.MeshBasicMaterial({
  55257. wireframe: !0,
  55258. fog: !1
  55259. });
  55260. this.cone = new Ci.Mesh(t,i),
  55261. this.add(this.cone),
  55262. this.update()
  55263. }
  55264. ,
  55265. Ci.SpotLightHelper.prototype = Object.create(Ci.Object3D.prototype),
  55266. Ci.SpotLightHelper.prototype.constructor = Ci.SpotLightHelper,
  55267. Ci.SpotLightHelper.prototype.dispose = function() {
  55268. this.cone.geometry.dispose(),
  55269. this.cone.material.dispose()
  55270. }
  55271. ,
  55272. Ci.SpotLightHelper.prototype.update = (ri = new Ci.Vector3,
  55273. oi = new Ci.Vector3,
  55274. function() {
  55275. var e = this.light.distance ? this.light.distance : 1e4
  55276. , t = e * Math.tan(this.light.angle);
  55277. this.cone.scale.set(t, t, e),
  55278. ri.setFromMatrixPosition(this.light.matrixWorld),
  55279. oi.setFromMatrixPosition(this.light.target.matrixWorld),
  55280. this.cone.lookAt(oi.sub(ri)),
  55281. this.cone.material.color.copy(this.light.color).multiplyScalar(this.light.intensity)
  55282. }
  55283. ),
  55284. Ci.VertexNormalsHelper = function(e, t, i, n) {
  55285. this.object = e,
  55286. this.size = void 0 !== t ? t : 1;
  55287. var r = void 0 !== i ? i : 16711680
  55288. , o = void 0 !== n ? n : 1
  55289. , a = 0
  55290. , s = this.object.geometry;
  55291. s instanceof Ci.Geometry ? a = 3 * s.faces.length : s instanceof Ci.BufferGeometry && (a = s.attributes.normal.count);
  55292. var l = new Ci.BufferGeometry
  55293. , c = new Ci.Float32Attribute(2 * a * 3,3);
  55294. l.addAttribute("position", c),
  55295. Ci.LineSegments.call(this, l, new Ci.LineBasicMaterial({
  55296. color: r,
  55297. linewidth: o
  55298. })),
  55299. this.matrixAutoUpdate = !1,
  55300. this.update()
  55301. }
  55302. ,
  55303. Ci.VertexNormalsHelper.prototype = Object.create(Ci.LineSegments.prototype),
  55304. Ci.VertexNormalsHelper.prototype.constructor = Ci.VertexNormalsHelper,
  55305. Ci.VertexNormalsHelper.prototype.update = (ti = new Ci.Vector3,
  55306. ii = new Ci.Vector3,
  55307. ni = new Ci.Matrix3,
  55308. function() {
  55309. var e = ["a", "b", "c"];
  55310. this.object.updateMatrixWorld(!0),
  55311. ni.getNormalMatrix(this.object.matrixWorld);
  55312. var t = this.object.matrixWorld
  55313. , i = this.geometry.attributes.position
  55314. , n = this.object.geometry;
  55315. if (n instanceof Ci.Geometry)
  55316. for (var r = n.vertices, o = n.faces, a = 0, s = 0, l = o.length; s < l; s++)
  55317. for (var c = o[s], h = 0, u = c.vertexNormals.length; h < u; h++) {
  55318. var d = r[c[e[h]]]
  55319. , p = c.vertexNormals[h];
  55320. ti.copy(d).applyMatrix4(t),
  55321. ii.copy(p).applyMatrix3(ni).normalize().multiplyScalar(this.size).add(ti),
  55322. i.setXYZ(a, ti.x, ti.y, ti.z),
  55323. a += 1,
  55324. i.setXYZ(a, ii.x, ii.y, ii.z),
  55325. a += 1
  55326. }
  55327. else if (n instanceof Ci.BufferGeometry) {
  55328. var f = n.attributes.position
  55329. , g = n.attributes.normal;
  55330. for (h = a = 0,
  55331. u = f.count; h < u; h++)
  55332. ti.set(f.getX(h), f.getY(h), f.getZ(h)).applyMatrix4(t),
  55333. ii.set(g.getX(h), g.getY(h), g.getZ(h)),
  55334. ii.applyMatrix3(ni).normalize().multiplyScalar(this.size).add(ti),
  55335. i.setXYZ(a, ti.x, ti.y, ti.z),
  55336. a += 1,
  55337. i.setXYZ(a, ii.x, ii.y, ii.z),
  55338. a += 1
  55339. }
  55340. return i.needsUpdate = !0,
  55341. this
  55342. }
  55343. ),
  55344. Ci.WireframeHelper = function(e, t) {
  55345. var i = void 0 !== t ? t : 16777215;
  55346. Ci.LineSegments.call(this, new Ci.WireframeGeometry(e.geometry), new Ci.LineBasicMaterial({
  55347. color: i
  55348. })),
  55349. this.matrix = e.matrixWorld,
  55350. this.matrixAutoUpdate = !1
  55351. }
  55352. ,
  55353. Ci.WireframeHelper.prototype = Object.create(Ci.LineSegments.prototype),
  55354. Ci.WireframeHelper.prototype.constructor = Ci.WireframeHelper,
  55355. Ci.ImmediateRenderObject = function(e) {
  55356. Ci.Object3D.call(this),
  55357. this.material = e,
  55358. this.render = function(e) {}
  55359. }
  55360. ,
  55361. Ci.ImmediateRenderObject.prototype = Object.create(Ci.Object3D.prototype),
  55362. Ci.ImmediateRenderObject.prototype.constructor = Ci.ImmediateRenderObject,
  55363. Ci.MorphBlendMesh = function(e, t) {
  55364. Ci.Mesh.call(this, e, t),
  55365. this.animationsMap = {},
  55366. this.animationsList = [];
  55367. var i = this.geometry.morphTargets.length
  55368. , n = i - 1
  55369. , r = i / 1;
  55370. this.createAnimation("__default", 0, n, r),
  55371. this.setAnimationWeight("__default", 1)
  55372. }
  55373. ,
  55374. Ci.MorphBlendMesh.prototype = Object.create(Ci.Mesh.prototype),
  55375. Ci.MorphBlendMesh.prototype.constructor = Ci.MorphBlendMesh,
  55376. Ci.MorphBlendMesh.prototype.createAnimation = function(e, t, i, n) {
  55377. var r = {
  55378. start: t,
  55379. end: i,
  55380. length: i - t + 1,
  55381. fps: n,
  55382. duration: (i - t) / n,
  55383. lastFrame: 0,
  55384. currentFrame: 0,
  55385. active: !1,
  55386. time: 0,
  55387. direction: 1,
  55388. weight: 1,
  55389. directionBackwards: !1,
  55390. mirroredLoop: !1
  55391. };
  55392. this.animationsMap[e] = r,
  55393. this.animationsList.push(r)
  55394. }
  55395. ,
  55396. Ci.MorphBlendMesh.prototype.autoCreateAnimations = function(e) {
  55397. for (var t, i = /([a-z]+)_?(\d+)/i, n = {}, r = this.geometry, o = 0, a = r.morphTargets.length; o < a; o++) {
  55398. var s = r.morphTargets[o].name.match(i);
  55399. if (s && 1 < s.length)
  55400. n[l = s[1]] || (n[l] = {
  55401. start: 1 / 0,
  55402. end: -1 / 0
  55403. }),
  55404. o < (c = n[l]).start && (c.start = o),
  55405. o > c.end && (c.end = o),
  55406. t = t || l
  55407. }
  55408. for (var l in n) {
  55409. var c = n[l];
  55410. this.createAnimation(l, c.start, c.end, e)
  55411. }
  55412. this.firstAnimation = t
  55413. }
  55414. ,
  55415. Ci.MorphBlendMesh.prototype.setAnimationDirectionForward = function(e) {
  55416. var t = this.animationsMap[e];
  55417. t && (t.direction = 1,
  55418. t.directionBackwards = !1)
  55419. }
  55420. ,
  55421. Ci.MorphBlendMesh.prototype.setAnimationDirectionBackward = function(e) {
  55422. var t = this.animationsMap[e];
  55423. t && (t.direction = -1,
  55424. t.directionBackwards = !0)
  55425. }
  55426. ,
  55427. Ci.MorphBlendMesh.prototype.setAnimationFPS = function(e, t) {
  55428. var i = this.animationsMap[e];
  55429. i && (i.fps = t,
  55430. i.duration = (i.end - i.start) / i.fps)
  55431. }
  55432. ,
  55433. Ci.MorphBlendMesh.prototype.setAnimationDuration = function(e, t) {
  55434. var i = this.animationsMap[e];
  55435. i && (i.duration = t,
  55436. i.fps = (i.end - i.start) / i.duration)
  55437. }
  55438. ,
  55439. Ci.MorphBlendMesh.prototype.setAnimationWeight = function(e, t) {
  55440. var i = this.animationsMap[e];
  55441. i && (i.weight = t)
  55442. }
  55443. ,
  55444. Ci.MorphBlendMesh.prototype.setAnimationTime = function(e, t) {
  55445. var i = this.animationsMap[e];
  55446. i && (i.time = t)
  55447. }
  55448. ,
  55449. Ci.MorphBlendMesh.prototype.getAnimationTime = function(e) {
  55450. var t = 0
  55451. , i = this.animationsMap[e];
  55452. return i && (t = i.time),
  55453. t
  55454. }
  55455. ,
  55456. Ci.MorphBlendMesh.prototype.getAnimationDuration = function(e) {
  55457. var t = -1
  55458. , i = this.animationsMap[e];
  55459. return i && (t = i.duration),
  55460. t
  55461. }
  55462. ,
  55463. Ci.MorphBlendMesh.prototype.playAnimation = function(e) {
  55464. var t = this.animationsMap[e];
  55465. t ? (t.time = 0,
  55466. t.active = !0) : console.warn("THREE.MorphBlendMesh: animation[" + e + "] undefined in .playAnimation()")
  55467. }
  55468. ,
  55469. Ci.MorphBlendMesh.prototype.stopAnimation = function(e) {
  55470. var t = this.animationsMap[e];
  55471. t && (t.active = !1)
  55472. }
  55473. ,
  55474. Ci.MorphBlendMesh.prototype.update = function(e) {
  55475. for (var t = 0, i = this.animationsList.length; t < i; t++) {
  55476. var n = this.animationsList[t];
  55477. if (n.active) {
  55478. var r = n.duration / n.length;
  55479. n.time += n.direction * e,
  55480. n.mirroredLoop ? (n.time > n.duration || n.time < 0) && (n.direction *= -1,
  55481. n.time > n.duration && (n.time = n.duration,
  55482. n.directionBackwards = !0),
  55483. n.time < 0 && (n.time = 0,
  55484. n.directionBackwards = !1)) : (n.time = n.time % n.duration,
  55485. n.time < 0 && (n.time += n.duration));
  55486. var o = n.start + Ci.Math.clamp(Math.floor(n.time / r), 0, n.length - 1)
  55487. , a = n.weight;
  55488. o !== n.currentFrame && (this.morphTargetInfluences[n.lastFrame] = 0,
  55489. this.morphTargetInfluences[n.currentFrame] = 1 * a,
  55490. this.morphTargetInfluences[o] = 0,
  55491. n.lastFrame = n.currentFrame,
  55492. n.currentFrame = o);
  55493. var s = n.time % r / r;
  55494. n.directionBackwards && (s = 1 - s),
  55495. n.currentFrame !== n.lastFrame ? (this.morphTargetInfluences[n.currentFrame] = s * a,
  55496. this.morphTargetInfluences[n.lastFrame] = (1 - s) * a) : this.morphTargetInfluences[n.currentFrame] = a
  55497. }
  55498. }
  55499. }
  55500. ,
  55501. void 0 !== i ? (void 0 !== t && t.exports && (i = t.exports = Ci),
  55502. i.THREE = Ci) : this.THREE = Ci
  55503. window.THREE = Ci
  55504. getObjLoader()
  55505. }
  55506. , {}]
  55507. }, {}, [116]);