main_2020_edit.js 2.5 MB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477947894799480948194829483948494859486948794889489949094919492949394949495949694979498949995009501950295039504950595069507950895099510951195129513951495159516951795189519952095219522952395249525952695279528952995309531953295339534953595369537953895399540954195429543954495459546954795489549955095519552955395549555955695579558955995609561956295639564956595669567956895699570957195729573957495759576957795789579958095819582958395849585958695879588958995909591959295939594959595969597959895999600960196029603960496059606960796089609961096119612961396149615961696179618961996209621962296239624962596269627962896299630963196329633963496359636963796389639964096419642964396449645964696479648964996509651965296539654965596569657965896599660966196629663966496659666966796689669967096719672967396749675967696779678967996809681968296839684968596869687968896899690969196929693969496959696969796989699970097019702970397049705970697079708970997109711971297139714971597169717971897199720972197229723972497259726972797289729973097319732973397349735973697379738973997409741974297439744974597469747974897499750975197529753975497559756975797589759976097619762976397649765976697679768976997709771977297739774977597769777977897799780978197829783978497859786978797889789979097919792979397949795979697979798979998009801980298039804980598069807980898099810981198129813981498159816981798189819982098219822982398249825982698279828982998309831983298339834983598369837983898399840984198429843984498459846984798489849985098519852985398549855985698579858985998609861986298639864986598669867986898699870987198729873987498759876987798789879988098819882988398849885988698879888988998909891989298939894989598969897989898999900990199029903990499059906990799089909991099119912991399149915991699179918991999209921992299239924992599269927992899299930993199329933993499359936993799389939994099419942994399449945994699479948994999509951995299539954995599569957995899599960996199629963996499659966996799689969997099719972997399749975997699779978997999809981998299839984998599869987998899899990999199929993999499959996999799989999100001000110002100031000410005100061000710008100091001010011100121001310014100151001610017100181001910020100211002210023100241002510026100271002810029100301003110032100331003410035100361003710038100391004010041100421004310044100451004610047100481004910050100511005210053100541005510056100571005810059100601006110062100631006410065100661006710068100691007010071100721007310074100751007610077100781007910080100811008210083100841008510086100871008810089100901009110092100931009410095100961009710098100991010010101101021010310104101051010610107101081010910110101111011210113101141011510116101171011810119101201012110122101231012410125101261012710128101291013010131101321013310134101351013610137101381013910140101411014210143101441014510146101471014810149101501015110152101531015410155101561015710158101591016010161101621016310164101651016610167101681016910170101711017210173101741017510176101771017810179101801018110182101831018410185101861018710188101891019010191101921019310194101951019610197101981019910200102011020210203102041020510206102071020810209102101021110212102131021410215102161021710218102191022010221102221022310224102251022610227102281022910230102311023210233102341023510236102371023810239102401024110242102431024410245102461024710248102491025010251102521025310254102551025610257102581025910260102611026210263102641026510266102671026810269102701027110272102731027410275102761027710278102791028010281102821028310284102851028610287102881028910290102911029210293102941029510296102971029810299103001030110302103031030410305103061030710308103091031010311103121031310314103151031610317103181031910320103211032210323103241032510326103271032810329103301033110332103331033410335103361033710338103391034010341103421034310344103451034610347103481034910350103511035210353103541035510356103571035810359103601036110362103631036410365103661036710368103691037010371103721037310374103751037610377103781037910380103811038210383103841038510386103871038810389103901039110392103931039410395103961039710398103991040010401104021040310404104051040610407104081040910410104111041210413104141041510416104171041810419104201042110422104231042410425104261042710428104291043010431104321043310434104351043610437104381043910440104411044210443104441044510446104471044810449104501045110452104531045410455104561045710458104591046010461104621046310464104651046610467104681046910470104711047210473104741047510476104771047810479104801048110482104831048410485104861048710488104891049010491104921049310494104951049610497104981049910500105011050210503105041050510506105071050810509105101051110512105131051410515105161051710518105191052010521105221052310524105251052610527105281052910530105311053210533105341053510536105371053810539105401054110542105431054410545105461054710548105491055010551105521055310554105551055610557105581055910560105611056210563105641056510566105671056810569105701057110572105731057410575105761057710578105791058010581105821058310584105851058610587105881058910590105911059210593105941059510596105971059810599106001060110602106031060410605106061060710608106091061010611106121061310614106151061610617106181061910620106211062210623106241062510626106271062810629106301063110632106331063410635106361063710638106391064010641106421064310644106451064610647106481064910650106511065210653106541065510656106571065810659106601066110662106631066410665106661066710668106691067010671106721067310674106751067610677106781067910680106811068210683106841068510686106871068810689106901069110692106931069410695106961069710698106991070010701107021070310704107051070610707107081070910710107111071210713107141071510716107171071810719107201072110722107231072410725107261072710728107291073010731107321073310734107351073610737107381073910740107411074210743107441074510746107471074810749107501075110752107531075410755107561075710758107591076010761107621076310764107651076610767107681076910770107711077210773107741077510776107771077810779107801078110782107831078410785107861078710788107891079010791107921079310794107951079610797107981079910800108011080210803108041080510806108071080810809108101081110812108131081410815108161081710818108191082010821108221082310824108251082610827108281082910830108311083210833108341083510836108371083810839108401084110842108431084410845108461084710848108491085010851108521085310854108551085610857108581085910860108611086210863108641086510866108671086810869108701087110872108731087410875108761087710878108791088010881108821088310884108851088610887108881088910890108911089210893108941089510896108971089810899109001090110902109031090410905109061090710908109091091010911109121091310914109151091610917109181091910920109211092210923109241092510926109271092810929109301093110932109331093410935109361093710938109391094010941109421094310944109451094610947109481094910950109511095210953109541095510956109571095810959109601096110962109631096410965109661096710968109691097010971109721097310974109751097610977109781097910980109811098210983109841098510986109871098810989109901099110992109931099410995109961099710998109991100011001110021100311004110051100611007110081100911010110111101211013110141101511016110171101811019110201102111022110231102411025110261102711028110291103011031110321103311034110351103611037110381103911040110411104211043110441104511046110471104811049110501105111052110531105411055110561105711058110591106011061110621106311064110651106611067110681106911070110711107211073110741107511076110771107811079110801108111082110831108411085110861108711088110891109011091110921109311094110951109611097110981109911100111011110211103111041110511106111071110811109111101111111112111131111411115111161111711118111191112011121111221112311124111251112611127111281112911130111311113211133111341113511136111371113811139111401114111142111431114411145111461114711148111491115011151111521115311154111551115611157111581115911160111611116211163111641116511166111671116811169111701117111172111731117411175111761117711178111791118011181111821118311184111851118611187111881118911190111911119211193111941119511196111971119811199112001120111202112031120411205112061120711208112091121011211112121121311214112151121611217112181121911220112211122211223112241122511226112271122811229112301123111232112331123411235112361123711238112391124011241112421124311244112451124611247112481124911250112511125211253112541125511256112571125811259112601126111262112631126411265112661126711268112691127011271112721127311274112751127611277112781127911280112811128211283112841128511286112871128811289112901129111292112931129411295112961129711298112991130011301113021130311304113051130611307113081130911310113111131211313113141131511316113171131811319113201132111322113231132411325113261132711328113291133011331113321133311334113351133611337113381133911340113411134211343113441134511346113471134811349113501135111352113531135411355113561135711358113591136011361113621136311364113651136611367113681136911370113711137211373113741137511376113771137811379113801138111382113831138411385113861138711388113891139011391113921139311394113951139611397113981139911400114011140211403114041140511406114071140811409114101141111412114131141411415114161141711418114191142011421114221142311424114251142611427114281142911430114311143211433114341143511436114371143811439114401144111442114431144411445114461144711448114491145011451114521145311454114551145611457114581145911460114611146211463114641146511466114671146811469114701147111472114731147411475114761147711478114791148011481114821148311484114851148611487114881148911490114911149211493114941149511496114971149811499115001150111502115031150411505115061150711508115091151011511115121151311514115151151611517115181151911520115211152211523115241152511526115271152811529115301153111532115331153411535115361153711538115391154011541115421154311544115451154611547115481154911550115511155211553115541155511556115571155811559115601156111562115631156411565115661156711568115691157011571115721157311574115751157611577115781157911580115811158211583115841158511586115871158811589115901159111592115931159411595115961159711598115991160011601116021160311604116051160611607116081160911610116111161211613116141161511616116171161811619116201162111622116231162411625116261162711628116291163011631116321163311634116351163611637116381163911640116411164211643116441164511646116471164811649116501165111652116531165411655116561165711658116591166011661116621166311664116651166611667116681166911670116711167211673116741167511676116771167811679116801168111682116831168411685116861168711688116891169011691116921169311694116951169611697116981169911700117011170211703117041170511706117071170811709117101171111712117131171411715117161171711718117191172011721117221172311724117251172611727117281172911730117311173211733117341173511736117371173811739117401174111742117431174411745117461174711748117491175011751117521175311754117551175611757117581175911760117611176211763117641176511766117671176811769117701177111772117731177411775117761177711778117791178011781117821178311784117851178611787117881178911790117911179211793117941179511796117971179811799118001180111802118031180411805118061180711808118091181011811118121181311814118151181611817118181181911820118211182211823118241182511826118271182811829118301183111832118331183411835118361183711838118391184011841118421184311844118451184611847118481184911850118511185211853118541185511856118571185811859118601186111862118631186411865118661186711868118691187011871118721187311874118751187611877118781187911880118811188211883118841188511886118871188811889118901189111892118931189411895118961189711898118991190011901119021190311904119051190611907119081190911910119111191211913119141191511916119171191811919119201192111922119231192411925119261192711928119291193011931119321193311934119351193611937119381193911940119411194211943119441194511946119471194811949119501195111952119531195411955119561195711958119591196011961119621196311964119651196611967119681196911970119711197211973119741197511976119771197811979119801198111982119831198411985119861198711988119891199011991119921199311994119951199611997119981199912000120011200212003120041200512006120071200812009120101201112012120131201412015120161201712018120191202012021120221202312024120251202612027120281202912030120311203212033120341203512036120371203812039120401204112042120431204412045120461204712048120491205012051120521205312054120551205612057120581205912060120611206212063120641206512066120671206812069120701207112072120731207412075120761207712078120791208012081120821208312084120851208612087120881208912090120911209212093120941209512096120971209812099121001210112102121031210412105121061210712108121091211012111121121211312114121151211612117121181211912120121211212212123121241212512126121271212812129121301213112132121331213412135121361213712138121391214012141121421214312144121451214612147121481214912150121511215212153121541215512156121571215812159121601216112162121631216412165121661216712168121691217012171121721217312174121751217612177121781217912180121811218212183121841218512186121871218812189121901219112192121931219412195121961219712198121991220012201122021220312204122051220612207122081220912210122111221212213122141221512216122171221812219122201222112222122231222412225122261222712228122291223012231122321223312234122351223612237122381223912240122411224212243122441224512246122471224812249122501225112252122531225412255122561225712258122591226012261122621226312264122651226612267122681226912270122711227212273122741227512276122771227812279122801228112282122831228412285122861228712288122891229012291122921229312294122951229612297122981229912300123011230212303123041230512306123071230812309123101231112312123131231412315123161231712318123191232012321123221232312324123251232612327123281232912330123311233212333123341233512336123371233812339123401234112342123431234412345123461234712348123491235012351123521235312354123551235612357123581235912360123611236212363123641236512366123671236812369123701237112372123731237412375123761237712378123791238012381123821238312384123851238612387123881238912390123911239212393123941239512396123971239812399124001240112402124031240412405124061240712408124091241012411124121241312414124151241612417124181241912420124211242212423124241242512426124271242812429124301243112432124331243412435124361243712438124391244012441124421244312444124451244612447124481244912450124511245212453124541245512456124571245812459124601246112462124631246412465124661246712468124691247012471124721247312474124751247612477124781247912480124811248212483124841248512486124871248812489124901249112492124931249412495124961249712498124991250012501125021250312504125051250612507125081250912510125111251212513125141251512516125171251812519125201252112522125231252412525125261252712528125291253012531125321253312534125351253612537125381253912540125411254212543125441254512546125471254812549125501255112552125531255412555125561255712558125591256012561125621256312564125651256612567125681256912570125711257212573125741257512576125771257812579125801258112582125831258412585125861258712588125891259012591125921259312594125951259612597125981259912600126011260212603126041260512606126071260812609126101261112612126131261412615126161261712618126191262012621126221262312624126251262612627126281262912630126311263212633126341263512636126371263812639126401264112642126431264412645126461264712648126491265012651126521265312654126551265612657126581265912660126611266212663126641266512666126671266812669126701267112672126731267412675126761267712678126791268012681126821268312684126851268612687126881268912690126911269212693126941269512696126971269812699127001270112702127031270412705127061270712708127091271012711127121271312714127151271612717127181271912720127211272212723127241272512726127271272812729127301273112732127331273412735127361273712738127391274012741127421274312744127451274612747127481274912750127511275212753127541275512756127571275812759127601276112762127631276412765127661276712768127691277012771127721277312774127751277612777127781277912780127811278212783127841278512786127871278812789127901279112792127931279412795127961279712798127991280012801128021280312804128051280612807128081280912810128111281212813128141281512816128171281812819128201282112822128231282412825128261282712828128291283012831128321283312834128351283612837128381283912840128411284212843128441284512846128471284812849128501285112852128531285412855128561285712858128591286012861128621286312864128651286612867128681286912870128711287212873128741287512876128771287812879128801288112882128831288412885128861288712888128891289012891128921289312894128951289612897128981289912900129011290212903129041290512906129071290812909129101291112912129131291412915129161291712918129191292012921129221292312924129251292612927129281292912930129311293212933129341293512936129371293812939129401294112942129431294412945129461294712948129491295012951129521295312954129551295612957129581295912960129611296212963129641296512966129671296812969129701297112972129731297412975129761297712978129791298012981129821298312984129851298612987129881298912990129911299212993129941299512996129971299812999130001300113002130031300413005130061300713008130091301013011130121301313014130151301613017130181301913020130211302213023130241302513026130271302813029130301303113032130331303413035130361303713038130391304013041130421304313044130451304613047130481304913050130511305213053130541305513056130571305813059130601306113062130631306413065130661306713068130691307013071130721307313074130751307613077130781307913080130811308213083130841308513086130871308813089130901309113092130931309413095130961309713098130991310013101131021310313104131051310613107131081310913110131111311213113131141311513116131171311813119131201312113122131231312413125131261312713128131291313013131131321313313134131351313613137131381313913140131411314213143131441314513146131471314813149131501315113152131531315413155131561315713158131591316013161131621316313164131651316613167131681316913170131711317213173131741317513176131771317813179131801318113182131831318413185131861318713188131891319013191131921319313194131951319613197131981319913200132011320213203132041320513206132071320813209132101321113212132131321413215132161321713218132191322013221132221322313224132251322613227132281322913230132311323213233132341323513236132371323813239132401324113242132431324413245132461324713248132491325013251132521325313254132551325613257132581325913260132611326213263132641326513266132671326813269132701327113272132731327413275132761327713278132791328013281132821328313284132851328613287132881328913290132911329213293132941329513296132971329813299133001330113302133031330413305133061330713308133091331013311133121331313314133151331613317133181331913320133211332213323133241332513326133271332813329133301333113332133331333413335133361333713338133391334013341133421334313344133451334613347133481334913350133511335213353133541335513356133571335813359133601336113362133631336413365133661336713368133691337013371133721337313374133751337613377133781337913380133811338213383133841338513386133871338813389133901339113392133931339413395133961339713398133991340013401134021340313404134051340613407134081340913410134111341213413134141341513416134171341813419134201342113422134231342413425134261342713428134291343013431134321343313434134351343613437134381343913440134411344213443134441344513446134471344813449134501345113452134531345413455134561345713458134591346013461134621346313464134651346613467134681346913470134711347213473134741347513476134771347813479134801348113482134831348413485134861348713488134891349013491134921349313494134951349613497134981349913500135011350213503135041350513506135071350813509135101351113512135131351413515135161351713518135191352013521135221352313524135251352613527135281352913530135311353213533135341353513536135371353813539135401354113542135431354413545135461354713548135491355013551135521355313554135551355613557135581355913560135611356213563135641356513566135671356813569135701357113572135731357413575135761357713578135791358013581135821358313584135851358613587135881358913590135911359213593135941359513596135971359813599136001360113602136031360413605136061360713608136091361013611136121361313614136151361613617136181361913620136211362213623136241362513626136271362813629136301363113632136331363413635136361363713638136391364013641136421364313644136451364613647136481364913650136511365213653136541365513656136571365813659136601366113662136631366413665136661366713668136691367013671136721367313674136751367613677136781367913680136811368213683136841368513686136871368813689136901369113692136931369413695136961369713698136991370013701137021370313704137051370613707137081370913710137111371213713137141371513716137171371813719137201372113722137231372413725137261372713728137291373013731137321373313734137351373613737137381373913740137411374213743137441374513746137471374813749137501375113752137531375413755137561375713758137591376013761137621376313764137651376613767137681376913770137711377213773137741377513776137771377813779137801378113782137831378413785137861378713788137891379013791137921379313794137951379613797137981379913800138011380213803138041380513806138071380813809138101381113812138131381413815138161381713818138191382013821138221382313824138251382613827138281382913830138311383213833138341383513836138371383813839138401384113842138431384413845138461384713848138491385013851138521385313854138551385613857138581385913860138611386213863138641386513866138671386813869138701387113872138731387413875138761387713878138791388013881138821388313884138851388613887138881388913890138911389213893138941389513896138971389813899139001390113902139031390413905139061390713908139091391013911139121391313914139151391613917139181391913920139211392213923139241392513926139271392813929139301393113932139331393413935139361393713938139391394013941139421394313944139451394613947139481394913950139511395213953139541395513956139571395813959139601396113962139631396413965139661396713968139691397013971139721397313974139751397613977139781397913980139811398213983139841398513986139871398813989139901399113992139931399413995139961399713998139991400014001140021400314004140051400614007140081400914010140111401214013140141401514016140171401814019140201402114022140231402414025140261402714028140291403014031140321403314034140351403614037140381403914040140411404214043140441404514046140471404814049140501405114052140531405414055140561405714058140591406014061140621406314064140651406614067140681406914070140711407214073140741407514076140771407814079140801408114082140831408414085140861408714088140891409014091140921409314094140951409614097140981409914100141011410214103141041410514106141071410814109141101411114112141131411414115141161411714118141191412014121141221412314124141251412614127141281412914130141311413214133141341413514136141371413814139141401414114142141431414414145141461414714148141491415014151141521415314154141551415614157141581415914160141611416214163141641416514166141671416814169141701417114172141731417414175141761417714178141791418014181141821418314184141851418614187141881418914190141911419214193141941419514196141971419814199142001420114202142031420414205142061420714208142091421014211142121421314214142151421614217142181421914220142211422214223142241422514226142271422814229142301423114232142331423414235142361423714238142391424014241142421424314244142451424614247142481424914250142511425214253142541425514256142571425814259142601426114262142631426414265142661426714268142691427014271142721427314274142751427614277142781427914280142811428214283142841428514286142871428814289142901429114292142931429414295142961429714298142991430014301143021430314304143051430614307143081430914310143111431214313143141431514316143171431814319143201432114322143231432414325143261432714328143291433014331143321433314334143351433614337143381433914340143411434214343143441434514346143471434814349143501435114352143531435414355143561435714358143591436014361143621436314364143651436614367143681436914370143711437214373143741437514376143771437814379143801438114382143831438414385143861438714388143891439014391143921439314394143951439614397143981439914400144011440214403144041440514406144071440814409144101441114412144131441414415144161441714418144191442014421144221442314424144251442614427144281442914430144311443214433144341443514436144371443814439144401444114442144431444414445144461444714448144491445014451144521445314454144551445614457144581445914460144611446214463144641446514466144671446814469144701447114472144731447414475144761447714478144791448014481144821448314484144851448614487144881448914490144911449214493144941449514496144971449814499145001450114502145031450414505145061450714508145091451014511145121451314514145151451614517145181451914520145211452214523145241452514526145271452814529145301453114532145331453414535145361453714538145391454014541145421454314544145451454614547145481454914550145511455214553145541455514556145571455814559145601456114562145631456414565145661456714568145691457014571145721457314574145751457614577145781457914580145811458214583145841458514586145871458814589145901459114592145931459414595145961459714598145991460014601146021460314604146051460614607146081460914610146111461214613146141461514616146171461814619146201462114622146231462414625146261462714628146291463014631146321463314634146351463614637146381463914640146411464214643146441464514646146471464814649146501465114652146531465414655146561465714658146591466014661146621466314664146651466614667146681466914670146711467214673146741467514676146771467814679146801468114682146831468414685146861468714688146891469014691146921469314694146951469614697146981469914700147011470214703147041470514706147071470814709147101471114712147131471414715147161471714718147191472014721147221472314724147251472614727147281472914730147311473214733147341473514736147371473814739147401474114742147431474414745147461474714748147491475014751147521475314754147551475614757147581475914760147611476214763147641476514766147671476814769147701477114772147731477414775147761477714778147791478014781147821478314784147851478614787147881478914790147911479214793147941479514796147971479814799148001480114802148031480414805148061480714808148091481014811148121481314814148151481614817148181481914820148211482214823148241482514826148271482814829148301483114832148331483414835148361483714838148391484014841148421484314844148451484614847148481484914850148511485214853148541485514856148571485814859148601486114862148631486414865148661486714868148691487014871148721487314874148751487614877148781487914880148811488214883148841488514886148871488814889148901489114892148931489414895148961489714898148991490014901149021490314904149051490614907149081490914910149111491214913149141491514916149171491814919149201492114922149231492414925149261492714928149291493014931149321493314934149351493614937149381493914940149411494214943149441494514946149471494814949149501495114952149531495414955149561495714958149591496014961149621496314964149651496614967149681496914970149711497214973149741497514976149771497814979149801498114982149831498414985149861498714988149891499014991149921499314994149951499614997149981499915000150011500215003150041500515006150071500815009150101501115012150131501415015150161501715018150191502015021150221502315024150251502615027150281502915030150311503215033150341503515036150371503815039150401504115042150431504415045150461504715048150491505015051150521505315054150551505615057150581505915060150611506215063150641506515066150671506815069150701507115072150731507415075150761507715078150791508015081150821508315084150851508615087150881508915090150911509215093150941509515096150971509815099151001510115102151031510415105151061510715108151091511015111151121511315114151151511615117151181511915120151211512215123151241512515126151271512815129151301513115132151331513415135151361513715138151391514015141151421514315144151451514615147151481514915150151511515215153151541515515156151571515815159151601516115162151631516415165151661516715168151691517015171151721517315174151751517615177151781517915180151811518215183151841518515186151871518815189151901519115192151931519415195151961519715198151991520015201152021520315204152051520615207152081520915210152111521215213152141521515216152171521815219152201522115222152231522415225152261522715228152291523015231152321523315234152351523615237152381523915240152411524215243152441524515246152471524815249152501525115252152531525415255152561525715258152591526015261152621526315264152651526615267152681526915270152711527215273152741527515276152771527815279152801528115282152831528415285152861528715288152891529015291152921529315294152951529615297152981529915300153011530215303153041530515306153071530815309153101531115312153131531415315153161531715318153191532015321153221532315324153251532615327153281532915330153311533215333153341533515336153371533815339153401534115342153431534415345153461534715348153491535015351153521535315354153551535615357153581535915360153611536215363153641536515366153671536815369153701537115372153731537415375153761537715378153791538015381153821538315384153851538615387153881538915390153911539215393153941539515396153971539815399154001540115402154031540415405154061540715408154091541015411154121541315414154151541615417154181541915420154211542215423154241542515426154271542815429154301543115432154331543415435154361543715438154391544015441154421544315444154451544615447154481544915450154511545215453154541545515456154571545815459154601546115462154631546415465154661546715468154691547015471154721547315474154751547615477154781547915480154811548215483154841548515486154871548815489154901549115492154931549415495154961549715498154991550015501155021550315504155051550615507155081550915510155111551215513155141551515516155171551815519155201552115522155231552415525155261552715528155291553015531155321553315534155351553615537155381553915540155411554215543155441554515546155471554815549155501555115552155531555415555155561555715558155591556015561155621556315564155651556615567155681556915570155711557215573155741557515576155771557815579155801558115582155831558415585155861558715588155891559015591155921559315594155951559615597155981559915600156011560215603156041560515606156071560815609156101561115612156131561415615156161561715618156191562015621156221562315624156251562615627156281562915630156311563215633156341563515636156371563815639156401564115642156431564415645156461564715648156491565015651156521565315654156551565615657156581565915660156611566215663156641566515666156671566815669156701567115672156731567415675156761567715678156791568015681156821568315684156851568615687156881568915690156911569215693156941569515696156971569815699157001570115702157031570415705157061570715708157091571015711157121571315714157151571615717157181571915720157211572215723157241572515726157271572815729157301573115732157331573415735157361573715738157391574015741157421574315744157451574615747157481574915750157511575215753157541575515756157571575815759157601576115762157631576415765157661576715768157691577015771157721577315774157751577615777157781577915780157811578215783157841578515786157871578815789157901579115792157931579415795157961579715798157991580015801158021580315804158051580615807158081580915810158111581215813158141581515816158171581815819158201582115822158231582415825158261582715828158291583015831158321583315834158351583615837158381583915840158411584215843158441584515846158471584815849158501585115852158531585415855158561585715858158591586015861158621586315864158651586615867158681586915870158711587215873158741587515876158771587815879158801588115882158831588415885158861588715888158891589015891158921589315894158951589615897158981589915900159011590215903159041590515906159071590815909159101591115912159131591415915159161591715918159191592015921159221592315924159251592615927159281592915930159311593215933159341593515936159371593815939159401594115942159431594415945159461594715948159491595015951159521595315954159551595615957159581595915960159611596215963159641596515966159671596815969159701597115972159731597415975159761597715978159791598015981159821598315984159851598615987159881598915990159911599215993159941599515996159971599815999160001600116002160031600416005160061600716008160091601016011160121601316014160151601616017160181601916020160211602216023160241602516026160271602816029160301603116032160331603416035160361603716038160391604016041160421604316044160451604616047160481604916050160511605216053160541605516056160571605816059160601606116062160631606416065160661606716068160691607016071160721607316074160751607616077160781607916080160811608216083160841608516086160871608816089160901609116092160931609416095160961609716098160991610016101161021610316104161051610616107161081610916110161111611216113161141611516116161171611816119161201612116122161231612416125161261612716128161291613016131161321613316134161351613616137161381613916140161411614216143161441614516146161471614816149161501615116152161531615416155161561615716158161591616016161161621616316164161651616616167161681616916170161711617216173161741617516176161771617816179161801618116182161831618416185161861618716188161891619016191161921619316194161951619616197161981619916200162011620216203162041620516206162071620816209162101621116212162131621416215162161621716218162191622016221162221622316224162251622616227162281622916230162311623216233162341623516236162371623816239162401624116242162431624416245162461624716248162491625016251162521625316254162551625616257162581625916260162611626216263162641626516266162671626816269162701627116272162731627416275162761627716278162791628016281162821628316284162851628616287162881628916290162911629216293162941629516296162971629816299163001630116302163031630416305163061630716308163091631016311163121631316314163151631616317163181631916320163211632216323163241632516326163271632816329163301633116332163331633416335163361633716338163391634016341163421634316344163451634616347163481634916350163511635216353163541635516356163571635816359163601636116362163631636416365163661636716368163691637016371163721637316374163751637616377163781637916380163811638216383163841638516386163871638816389163901639116392163931639416395163961639716398163991640016401164021640316404164051640616407164081640916410164111641216413164141641516416164171641816419164201642116422164231642416425164261642716428164291643016431164321643316434164351643616437164381643916440164411644216443164441644516446164471644816449164501645116452164531645416455164561645716458164591646016461164621646316464164651646616467164681646916470164711647216473164741647516476164771647816479164801648116482164831648416485164861648716488164891649016491164921649316494164951649616497164981649916500165011650216503165041650516506165071650816509165101651116512165131651416515165161651716518165191652016521165221652316524165251652616527165281652916530165311653216533165341653516536165371653816539165401654116542165431654416545165461654716548165491655016551165521655316554165551655616557165581655916560165611656216563165641656516566165671656816569165701657116572165731657416575165761657716578165791658016581165821658316584165851658616587165881658916590165911659216593165941659516596165971659816599166001660116602166031660416605166061660716608166091661016611166121661316614166151661616617166181661916620166211662216623166241662516626166271662816629166301663116632166331663416635166361663716638166391664016641166421664316644166451664616647166481664916650166511665216653166541665516656166571665816659166601666116662166631666416665166661666716668166691667016671166721667316674166751667616677166781667916680166811668216683166841668516686166871668816689166901669116692166931669416695166961669716698166991670016701167021670316704167051670616707167081670916710167111671216713167141671516716167171671816719167201672116722167231672416725167261672716728167291673016731167321673316734167351673616737167381673916740167411674216743167441674516746167471674816749167501675116752167531675416755167561675716758167591676016761167621676316764167651676616767167681676916770167711677216773167741677516776167771677816779167801678116782167831678416785167861678716788167891679016791167921679316794167951679616797167981679916800168011680216803168041680516806168071680816809168101681116812168131681416815168161681716818168191682016821168221682316824168251682616827168281682916830168311683216833168341683516836168371683816839168401684116842168431684416845168461684716848168491685016851168521685316854168551685616857168581685916860168611686216863168641686516866168671686816869168701687116872168731687416875168761687716878168791688016881168821688316884168851688616887168881688916890168911689216893168941689516896168971689816899169001690116902169031690416905169061690716908169091691016911169121691316914169151691616917169181691916920169211692216923169241692516926169271692816929169301693116932169331693416935169361693716938169391694016941169421694316944169451694616947169481694916950169511695216953169541695516956169571695816959169601696116962169631696416965169661696716968169691697016971169721697316974169751697616977169781697916980169811698216983169841698516986169871698816989169901699116992169931699416995169961699716998169991700017001170021700317004170051700617007170081700917010170111701217013170141701517016170171701817019170201702117022170231702417025170261702717028170291703017031170321703317034170351703617037170381703917040170411704217043170441704517046170471704817049170501705117052170531705417055170561705717058170591706017061170621706317064170651706617067170681706917070170711707217073170741707517076170771707817079170801708117082170831708417085170861708717088170891709017091170921709317094170951709617097170981709917100171011710217103171041710517106171071710817109171101711117112171131711417115171161711717118171191712017121171221712317124171251712617127171281712917130171311713217133171341713517136171371713817139171401714117142171431714417145171461714717148171491715017151171521715317154171551715617157171581715917160171611716217163171641716517166171671716817169171701717117172171731717417175171761717717178171791718017181171821718317184171851718617187171881718917190171911719217193171941719517196171971719817199172001720117202172031720417205172061720717208172091721017211172121721317214172151721617217172181721917220172211722217223172241722517226172271722817229172301723117232172331723417235172361723717238172391724017241172421724317244172451724617247172481724917250172511725217253172541725517256172571725817259172601726117262172631726417265172661726717268172691727017271172721727317274172751727617277172781727917280172811728217283172841728517286172871728817289172901729117292172931729417295172961729717298172991730017301173021730317304173051730617307173081730917310173111731217313173141731517316173171731817319173201732117322173231732417325173261732717328173291733017331173321733317334173351733617337173381733917340173411734217343173441734517346173471734817349173501735117352173531735417355173561735717358173591736017361173621736317364173651736617367173681736917370173711737217373173741737517376173771737817379173801738117382173831738417385173861738717388173891739017391173921739317394173951739617397173981739917400174011740217403174041740517406174071740817409174101741117412174131741417415174161741717418174191742017421174221742317424174251742617427174281742917430174311743217433174341743517436174371743817439174401744117442174431744417445174461744717448174491745017451174521745317454174551745617457174581745917460174611746217463174641746517466174671746817469174701747117472174731747417475174761747717478174791748017481174821748317484174851748617487174881748917490174911749217493174941749517496174971749817499175001750117502175031750417505175061750717508175091751017511175121751317514175151751617517175181751917520175211752217523175241752517526175271752817529175301753117532175331753417535175361753717538175391754017541175421754317544175451754617547175481754917550175511755217553175541755517556175571755817559175601756117562175631756417565175661756717568175691757017571175721757317574175751757617577175781757917580175811758217583175841758517586175871758817589175901759117592175931759417595175961759717598175991760017601176021760317604176051760617607176081760917610176111761217613176141761517616176171761817619176201762117622176231762417625176261762717628176291763017631176321763317634176351763617637176381763917640176411764217643176441764517646176471764817649176501765117652176531765417655176561765717658176591766017661176621766317664176651766617667176681766917670176711767217673176741767517676176771767817679176801768117682176831768417685176861768717688176891769017691176921769317694176951769617697176981769917700177011770217703177041770517706177071770817709177101771117712177131771417715177161771717718177191772017721177221772317724177251772617727177281772917730177311773217733177341773517736177371773817739177401774117742177431774417745177461774717748177491775017751177521775317754177551775617757177581775917760177611776217763177641776517766177671776817769177701777117772177731777417775177761777717778177791778017781177821778317784177851778617787177881778917790177911779217793177941779517796177971779817799178001780117802178031780417805178061780717808178091781017811178121781317814178151781617817178181781917820178211782217823178241782517826178271782817829178301783117832178331783417835178361783717838178391784017841178421784317844178451784617847178481784917850178511785217853178541785517856178571785817859178601786117862178631786417865178661786717868178691787017871178721787317874178751787617877178781787917880178811788217883178841788517886178871788817889178901789117892178931789417895178961789717898178991790017901179021790317904179051790617907179081790917910179111791217913179141791517916179171791817919179201792117922179231792417925179261792717928179291793017931179321793317934179351793617937179381793917940179411794217943179441794517946179471794817949179501795117952179531795417955179561795717958179591796017961179621796317964179651796617967179681796917970179711797217973179741797517976179771797817979179801798117982179831798417985179861798717988179891799017991179921799317994179951799617997179981799918000180011800218003180041800518006180071800818009180101801118012180131801418015180161801718018180191802018021180221802318024180251802618027180281802918030180311803218033180341803518036180371803818039180401804118042180431804418045180461804718048180491805018051180521805318054180551805618057180581805918060180611806218063180641806518066180671806818069180701807118072180731807418075180761807718078180791808018081180821808318084180851808618087180881808918090180911809218093180941809518096180971809818099181001810118102181031810418105181061810718108181091811018111181121811318114181151811618117181181811918120181211812218123181241812518126181271812818129181301813118132181331813418135181361813718138181391814018141181421814318144181451814618147181481814918150181511815218153181541815518156181571815818159181601816118162181631816418165181661816718168181691817018171181721817318174181751817618177181781817918180181811818218183181841818518186181871818818189181901819118192181931819418195181961819718198181991820018201182021820318204182051820618207182081820918210182111821218213182141821518216182171821818219182201822118222182231822418225182261822718228182291823018231182321823318234182351823618237182381823918240182411824218243182441824518246182471824818249182501825118252182531825418255182561825718258182591826018261182621826318264182651826618267182681826918270182711827218273182741827518276182771827818279182801828118282182831828418285182861828718288182891829018291182921829318294182951829618297182981829918300183011830218303183041830518306183071830818309183101831118312183131831418315183161831718318183191832018321183221832318324183251832618327183281832918330183311833218333183341833518336183371833818339183401834118342183431834418345183461834718348183491835018351183521835318354183551835618357183581835918360183611836218363183641836518366183671836818369183701837118372183731837418375183761837718378183791838018381183821838318384183851838618387183881838918390183911839218393183941839518396183971839818399184001840118402184031840418405184061840718408184091841018411184121841318414184151841618417184181841918420184211842218423184241842518426184271842818429184301843118432184331843418435184361843718438184391844018441184421844318444184451844618447184481844918450184511845218453184541845518456184571845818459184601846118462184631846418465184661846718468184691847018471184721847318474184751847618477184781847918480184811848218483184841848518486184871848818489184901849118492184931849418495184961849718498184991850018501185021850318504185051850618507185081850918510185111851218513185141851518516185171851818519185201852118522185231852418525185261852718528185291853018531185321853318534185351853618537185381853918540185411854218543185441854518546185471854818549185501855118552185531855418555185561855718558185591856018561185621856318564185651856618567185681856918570185711857218573185741857518576185771857818579185801858118582185831858418585185861858718588185891859018591185921859318594185951859618597185981859918600186011860218603186041860518606186071860818609186101861118612186131861418615186161861718618186191862018621186221862318624186251862618627186281862918630186311863218633186341863518636186371863818639186401864118642186431864418645186461864718648186491865018651186521865318654186551865618657186581865918660186611866218663186641866518666186671866818669186701867118672186731867418675186761867718678186791868018681186821868318684186851868618687186881868918690186911869218693186941869518696186971869818699187001870118702187031870418705187061870718708187091871018711187121871318714187151871618717187181871918720187211872218723187241872518726187271872818729187301873118732187331873418735187361873718738187391874018741187421874318744187451874618747187481874918750187511875218753187541875518756187571875818759187601876118762187631876418765187661876718768187691877018771187721877318774187751877618777187781877918780187811878218783187841878518786187871878818789187901879118792187931879418795187961879718798187991880018801188021880318804188051880618807188081880918810188111881218813188141881518816188171881818819188201882118822188231882418825188261882718828188291883018831188321883318834188351883618837188381883918840188411884218843188441884518846188471884818849188501885118852188531885418855188561885718858188591886018861188621886318864188651886618867188681886918870188711887218873188741887518876188771887818879188801888118882188831888418885188861888718888188891889018891188921889318894188951889618897188981889918900189011890218903189041890518906189071890818909189101891118912189131891418915189161891718918189191892018921189221892318924189251892618927189281892918930189311893218933189341893518936189371893818939189401894118942189431894418945189461894718948189491895018951189521895318954189551895618957189581895918960189611896218963189641896518966189671896818969189701897118972189731897418975189761897718978189791898018981189821898318984189851898618987189881898918990189911899218993189941899518996189971899818999190001900119002190031900419005190061900719008190091901019011190121901319014190151901619017190181901919020190211902219023190241902519026190271902819029190301903119032190331903419035190361903719038190391904019041190421904319044190451904619047190481904919050190511905219053190541905519056190571905819059190601906119062190631906419065190661906719068190691907019071190721907319074190751907619077190781907919080190811908219083190841908519086190871908819089190901909119092190931909419095190961909719098190991910019101191021910319104191051910619107191081910919110191111911219113191141911519116191171911819119191201912119122191231912419125191261912719128191291913019131191321913319134191351913619137191381913919140191411914219143191441914519146191471914819149191501915119152191531915419155191561915719158191591916019161191621916319164191651916619167191681916919170191711917219173191741917519176191771917819179191801918119182191831918419185191861918719188191891919019191191921919319194191951919619197191981919919200192011920219203192041920519206192071920819209192101921119212192131921419215192161921719218192191922019221192221922319224192251922619227192281922919230192311923219233192341923519236192371923819239192401924119242192431924419245192461924719248192491925019251192521925319254192551925619257192581925919260192611926219263192641926519266192671926819269192701927119272192731927419275192761927719278192791928019281192821928319284192851928619287192881928919290192911929219293192941929519296192971929819299193001930119302193031930419305193061930719308193091931019311193121931319314193151931619317193181931919320193211932219323193241932519326193271932819329193301933119332193331933419335193361933719338193391934019341193421934319344193451934619347193481934919350193511935219353193541935519356193571935819359193601936119362193631936419365193661936719368193691937019371193721937319374193751937619377193781937919380193811938219383193841938519386193871938819389193901939119392193931939419395193961939719398193991940019401194021940319404194051940619407194081940919410194111941219413194141941519416194171941819419194201942119422194231942419425194261942719428194291943019431194321943319434194351943619437194381943919440194411944219443194441944519446194471944819449194501945119452194531945419455194561945719458194591946019461194621946319464194651946619467194681946919470194711947219473194741947519476194771947819479194801948119482194831948419485194861948719488194891949019491194921949319494194951949619497194981949919500195011950219503195041950519506195071950819509195101951119512195131951419515195161951719518195191952019521195221952319524195251952619527195281952919530195311953219533195341953519536195371953819539195401954119542195431954419545195461954719548195491955019551195521955319554195551955619557195581955919560195611956219563195641956519566195671956819569195701957119572195731957419575195761957719578195791958019581195821958319584195851958619587195881958919590195911959219593195941959519596195971959819599196001960119602196031960419605196061960719608196091961019611196121961319614196151961619617196181961919620196211962219623196241962519626196271962819629196301963119632196331963419635196361963719638196391964019641196421964319644196451964619647196481964919650196511965219653196541965519656196571965819659196601966119662196631966419665196661966719668196691967019671196721967319674196751967619677196781967919680196811968219683196841968519686196871968819689196901969119692196931969419695196961969719698196991970019701197021970319704197051970619707197081970919710197111971219713197141971519716197171971819719197201972119722197231972419725197261972719728197291973019731197321973319734197351973619737197381973919740197411974219743197441974519746197471974819749197501975119752197531975419755197561975719758197591976019761197621976319764197651976619767197681976919770197711977219773197741977519776197771977819779197801978119782197831978419785197861978719788197891979019791197921979319794197951979619797197981979919800198011980219803198041980519806198071980819809198101981119812198131981419815198161981719818198191982019821198221982319824198251982619827198281982919830198311983219833198341983519836198371983819839198401984119842198431984419845198461984719848198491985019851198521985319854198551985619857198581985919860198611986219863198641986519866198671986819869198701987119872198731987419875198761987719878198791988019881198821988319884198851988619887198881988919890198911989219893198941989519896198971989819899199001990119902199031990419905199061990719908199091991019911199121991319914199151991619917199181991919920199211992219923199241992519926199271992819929199301993119932199331993419935199361993719938199391994019941199421994319944199451994619947199481994919950199511995219953199541995519956199571995819959199601996119962199631996419965199661996719968199691997019971199721997319974199751997619977199781997919980199811998219983199841998519986199871998819989199901999119992199931999419995199961999719998199992000020001200022000320004200052000620007200082000920010200112001220013200142001520016200172001820019200202002120022200232002420025200262002720028200292003020031200322003320034200352003620037200382003920040200412004220043200442004520046200472004820049200502005120052200532005420055200562005720058200592006020061200622006320064200652006620067200682006920070200712007220073200742007520076200772007820079200802008120082200832008420085200862008720088200892009020091200922009320094200952009620097200982009920100201012010220103201042010520106201072010820109201102011120112201132011420115201162011720118201192012020121201222012320124201252012620127201282012920130201312013220133201342013520136201372013820139201402014120142201432014420145201462014720148201492015020151201522015320154201552015620157201582015920160201612016220163201642016520166201672016820169201702017120172201732017420175201762017720178201792018020181201822018320184201852018620187201882018920190201912019220193201942019520196201972019820199202002020120202202032020420205202062020720208202092021020211202122021320214202152021620217202182021920220202212022220223202242022520226202272022820229202302023120232202332023420235202362023720238202392024020241202422024320244202452024620247202482024920250202512025220253202542025520256202572025820259202602026120262202632026420265202662026720268202692027020271202722027320274202752027620277202782027920280202812028220283202842028520286202872028820289202902029120292202932029420295202962029720298202992030020301203022030320304203052030620307203082030920310203112031220313203142031520316203172031820319203202032120322203232032420325203262032720328203292033020331203322033320334203352033620337203382033920340203412034220343203442034520346203472034820349203502035120352203532035420355203562035720358203592036020361203622036320364203652036620367203682036920370203712037220373203742037520376203772037820379203802038120382203832038420385203862038720388203892039020391203922039320394203952039620397203982039920400204012040220403204042040520406204072040820409204102041120412204132041420415204162041720418204192042020421204222042320424204252042620427204282042920430204312043220433204342043520436204372043820439204402044120442204432044420445204462044720448204492045020451204522045320454204552045620457204582045920460204612046220463204642046520466204672046820469204702047120472204732047420475204762047720478204792048020481204822048320484204852048620487204882048920490204912049220493204942049520496204972049820499205002050120502205032050420505205062050720508205092051020511205122051320514205152051620517205182051920520205212052220523205242052520526205272052820529205302053120532205332053420535205362053720538205392054020541205422054320544205452054620547205482054920550205512055220553205542055520556205572055820559205602056120562205632056420565205662056720568205692057020571205722057320574205752057620577205782057920580205812058220583205842058520586205872058820589205902059120592205932059420595205962059720598205992060020601206022060320604206052060620607206082060920610206112061220613206142061520616206172061820619206202062120622206232062420625206262062720628206292063020631206322063320634206352063620637206382063920640206412064220643206442064520646206472064820649206502065120652206532065420655206562065720658206592066020661206622066320664206652066620667206682066920670206712067220673206742067520676206772067820679206802068120682206832068420685206862068720688206892069020691206922069320694206952069620697206982069920700207012070220703207042070520706207072070820709207102071120712207132071420715207162071720718207192072020721207222072320724207252072620727207282072920730207312073220733207342073520736207372073820739207402074120742207432074420745207462074720748207492075020751207522075320754207552075620757207582075920760207612076220763207642076520766207672076820769207702077120772207732077420775207762077720778207792078020781207822078320784207852078620787207882078920790207912079220793207942079520796207972079820799208002080120802208032080420805208062080720808208092081020811208122081320814208152081620817208182081920820208212082220823208242082520826208272082820829208302083120832208332083420835208362083720838208392084020841208422084320844208452084620847208482084920850208512085220853208542085520856208572085820859208602086120862208632086420865208662086720868208692087020871208722087320874208752087620877208782087920880208812088220883208842088520886208872088820889208902089120892208932089420895208962089720898208992090020901209022090320904209052090620907209082090920910209112091220913209142091520916209172091820919209202092120922209232092420925209262092720928209292093020931209322093320934209352093620937209382093920940209412094220943209442094520946209472094820949209502095120952209532095420955209562095720958209592096020961209622096320964209652096620967209682096920970209712097220973209742097520976209772097820979209802098120982209832098420985209862098720988209892099020991209922099320994209952099620997209982099921000210012100221003210042100521006210072100821009210102101121012210132101421015210162101721018210192102021021210222102321024210252102621027210282102921030210312103221033210342103521036210372103821039210402104121042210432104421045210462104721048210492105021051210522105321054210552105621057210582105921060210612106221063210642106521066210672106821069210702107121072210732107421075210762107721078210792108021081210822108321084210852108621087210882108921090210912109221093210942109521096210972109821099211002110121102211032110421105211062110721108211092111021111211122111321114211152111621117211182111921120211212112221123211242112521126211272112821129211302113121132211332113421135211362113721138211392114021141211422114321144211452114621147211482114921150211512115221153211542115521156211572115821159211602116121162211632116421165211662116721168211692117021171211722117321174211752117621177211782117921180211812118221183211842118521186211872118821189211902119121192211932119421195211962119721198211992120021201212022120321204212052120621207212082120921210212112121221213212142121521216212172121821219212202122121222212232122421225212262122721228212292123021231212322123321234212352123621237212382123921240212412124221243212442124521246212472124821249212502125121252212532125421255212562125721258212592126021261212622126321264212652126621267212682126921270212712127221273212742127521276212772127821279212802128121282212832128421285212862128721288212892129021291212922129321294212952129621297212982129921300213012130221303213042130521306213072130821309213102131121312213132131421315213162131721318213192132021321213222132321324213252132621327213282132921330213312133221333213342133521336213372133821339213402134121342213432134421345213462134721348213492135021351213522135321354213552135621357213582135921360213612136221363213642136521366213672136821369213702137121372213732137421375213762137721378213792138021381213822138321384213852138621387213882138921390213912139221393213942139521396213972139821399214002140121402214032140421405214062140721408214092141021411214122141321414214152141621417214182141921420214212142221423214242142521426214272142821429214302143121432214332143421435214362143721438214392144021441214422144321444214452144621447214482144921450214512145221453214542145521456214572145821459214602146121462214632146421465214662146721468214692147021471214722147321474214752147621477214782147921480214812148221483214842148521486214872148821489214902149121492214932149421495214962149721498214992150021501215022150321504215052150621507215082150921510215112151221513215142151521516215172151821519215202152121522215232152421525215262152721528215292153021531215322153321534215352153621537215382153921540215412154221543215442154521546215472154821549215502155121552215532155421555215562155721558215592156021561215622156321564215652156621567215682156921570215712157221573215742157521576215772157821579215802158121582215832158421585215862158721588215892159021591215922159321594215952159621597215982159921600216012160221603216042160521606216072160821609216102161121612216132161421615216162161721618216192162021621216222162321624216252162621627216282162921630216312163221633216342163521636216372163821639216402164121642216432164421645216462164721648216492165021651216522165321654216552165621657216582165921660216612166221663216642166521666216672166821669216702167121672216732167421675216762167721678216792168021681216822168321684216852168621687216882168921690216912169221693216942169521696216972169821699217002170121702217032170421705217062170721708217092171021711217122171321714217152171621717217182171921720217212172221723217242172521726217272172821729217302173121732217332173421735217362173721738217392174021741217422174321744217452174621747217482174921750217512175221753217542175521756217572175821759217602176121762217632176421765217662176721768217692177021771217722177321774217752177621777217782177921780217812178221783217842178521786217872178821789217902179121792217932179421795217962179721798217992180021801218022180321804218052180621807218082180921810218112181221813218142181521816218172181821819218202182121822218232182421825218262182721828218292183021831218322183321834218352183621837218382183921840218412184221843218442184521846218472184821849218502185121852218532185421855218562185721858218592186021861218622186321864218652186621867218682186921870218712187221873218742187521876218772187821879218802188121882218832188421885218862188721888218892189021891218922189321894218952189621897218982189921900219012190221903219042190521906219072190821909219102191121912219132191421915219162191721918219192192021921219222192321924219252192621927219282192921930219312193221933219342193521936219372193821939219402194121942219432194421945219462194721948219492195021951219522195321954219552195621957219582195921960219612196221963219642196521966219672196821969219702197121972219732197421975219762197721978219792198021981219822198321984219852198621987219882198921990219912199221993219942199521996219972199821999220002200122002220032200422005220062200722008220092201022011220122201322014220152201622017220182201922020220212202222023220242202522026220272202822029220302203122032220332203422035220362203722038220392204022041220422204322044220452204622047220482204922050220512205222053220542205522056220572205822059220602206122062220632206422065220662206722068220692207022071220722207322074220752207622077220782207922080220812208222083220842208522086220872208822089220902209122092220932209422095220962209722098220992210022101221022210322104221052210622107221082210922110221112211222113221142211522116221172211822119221202212122122221232212422125221262212722128221292213022131221322213322134221352213622137221382213922140221412214222143221442214522146221472214822149221502215122152221532215422155221562215722158221592216022161221622216322164221652216622167221682216922170221712217222173221742217522176221772217822179221802218122182221832218422185221862218722188221892219022191221922219322194221952219622197221982219922200222012220222203222042220522206222072220822209222102221122212222132221422215222162221722218222192222022221222222222322224222252222622227222282222922230222312223222233222342223522236222372223822239222402224122242222432224422245222462224722248222492225022251222522225322254222552225622257222582225922260222612226222263222642226522266222672226822269222702227122272222732227422275222762227722278222792228022281222822228322284222852228622287222882228922290222912229222293222942229522296222972229822299223002230122302223032230422305223062230722308223092231022311223122231322314223152231622317223182231922320223212232222323223242232522326223272232822329223302233122332223332233422335223362233722338223392234022341223422234322344223452234622347223482234922350223512235222353223542235522356223572235822359223602236122362223632236422365223662236722368223692237022371223722237322374223752237622377223782237922380223812238222383223842238522386223872238822389223902239122392223932239422395223962239722398223992240022401224022240322404224052240622407224082240922410224112241222413224142241522416224172241822419224202242122422224232242422425224262242722428224292243022431224322243322434224352243622437224382243922440224412244222443224442244522446224472244822449224502245122452224532245422455224562245722458224592246022461224622246322464224652246622467224682246922470224712247222473224742247522476224772247822479224802248122482224832248422485224862248722488224892249022491224922249322494224952249622497224982249922500225012250222503225042250522506225072250822509225102251122512225132251422515225162251722518225192252022521225222252322524225252252622527225282252922530225312253222533225342253522536225372253822539225402254122542225432254422545225462254722548225492255022551225522255322554225552255622557225582255922560225612256222563225642256522566225672256822569225702257122572225732257422575225762257722578225792258022581225822258322584225852258622587225882258922590225912259222593225942259522596225972259822599226002260122602226032260422605226062260722608226092261022611226122261322614226152261622617226182261922620226212262222623226242262522626226272262822629226302263122632226332263422635226362263722638226392264022641226422264322644226452264622647226482264922650226512265222653226542265522656226572265822659226602266122662226632266422665226662266722668226692267022671226722267322674226752267622677226782267922680226812268222683226842268522686226872268822689226902269122692226932269422695226962269722698226992270022701227022270322704227052270622707227082270922710227112271222713227142271522716227172271822719227202272122722227232272422725227262272722728227292273022731227322273322734227352273622737227382273922740227412274222743227442274522746227472274822749227502275122752227532275422755227562275722758227592276022761227622276322764227652276622767227682276922770227712277222773227742277522776227772277822779227802278122782227832278422785227862278722788227892279022791227922279322794227952279622797227982279922800228012280222803228042280522806228072280822809228102281122812228132281422815228162281722818228192282022821228222282322824228252282622827228282282922830228312283222833228342283522836228372283822839228402284122842228432284422845228462284722848228492285022851228522285322854228552285622857228582285922860228612286222863228642286522866228672286822869228702287122872228732287422875228762287722878228792288022881228822288322884228852288622887228882288922890228912289222893228942289522896228972289822899229002290122902229032290422905229062290722908229092291022911229122291322914229152291622917229182291922920229212292222923229242292522926229272292822929229302293122932229332293422935229362293722938229392294022941229422294322944229452294622947229482294922950229512295222953229542295522956229572295822959229602296122962229632296422965229662296722968229692297022971229722297322974229752297622977229782297922980229812298222983229842298522986229872298822989229902299122992229932299422995229962299722998229992300023001230022300323004230052300623007230082300923010230112301223013230142301523016230172301823019230202302123022230232302423025230262302723028230292303023031230322303323034230352303623037230382303923040230412304223043230442304523046230472304823049230502305123052230532305423055230562305723058230592306023061230622306323064230652306623067230682306923070230712307223073230742307523076230772307823079230802308123082230832308423085230862308723088230892309023091230922309323094230952309623097230982309923100231012310223103231042310523106231072310823109231102311123112231132311423115231162311723118231192312023121231222312323124231252312623127231282312923130231312313223133231342313523136231372313823139231402314123142231432314423145231462314723148231492315023151231522315323154231552315623157231582315923160231612316223163231642316523166231672316823169231702317123172231732317423175231762317723178231792318023181231822318323184231852318623187231882318923190231912319223193231942319523196231972319823199232002320123202232032320423205232062320723208232092321023211232122321323214232152321623217232182321923220232212322223223232242322523226232272322823229232302323123232232332323423235232362323723238232392324023241232422324323244232452324623247232482324923250232512325223253232542325523256232572325823259232602326123262232632326423265232662326723268232692327023271232722327323274232752327623277232782327923280232812328223283232842328523286232872328823289232902329123292232932329423295232962329723298232992330023301233022330323304233052330623307233082330923310233112331223313233142331523316233172331823319233202332123322233232332423325233262332723328233292333023331233322333323334233352333623337233382333923340233412334223343233442334523346233472334823349233502335123352233532335423355233562335723358233592336023361233622336323364233652336623367233682336923370233712337223373233742337523376233772337823379233802338123382233832338423385233862338723388233892339023391233922339323394233952339623397233982339923400234012340223403234042340523406234072340823409234102341123412234132341423415234162341723418234192342023421234222342323424234252342623427234282342923430234312343223433234342343523436234372343823439234402344123442234432344423445234462344723448234492345023451234522345323454234552345623457234582345923460234612346223463234642346523466234672346823469234702347123472234732347423475234762347723478234792348023481234822348323484234852348623487234882348923490234912349223493234942349523496234972349823499235002350123502235032350423505235062350723508235092351023511235122351323514235152351623517235182351923520235212352223523235242352523526235272352823529235302353123532235332353423535235362353723538235392354023541235422354323544235452354623547235482354923550235512355223553235542355523556235572355823559235602356123562235632356423565235662356723568235692357023571235722357323574235752357623577235782357923580235812358223583235842358523586235872358823589235902359123592235932359423595235962359723598235992360023601236022360323604236052360623607236082360923610236112361223613236142361523616236172361823619236202362123622236232362423625236262362723628236292363023631236322363323634236352363623637236382363923640236412364223643236442364523646236472364823649236502365123652236532365423655236562365723658236592366023661236622366323664236652366623667236682366923670236712367223673236742367523676236772367823679236802368123682236832368423685236862368723688236892369023691236922369323694236952369623697236982369923700237012370223703237042370523706237072370823709237102371123712237132371423715237162371723718237192372023721237222372323724237252372623727237282372923730237312373223733237342373523736237372373823739237402374123742237432374423745237462374723748237492375023751237522375323754237552375623757237582375923760237612376223763237642376523766237672376823769237702377123772237732377423775237762377723778237792378023781237822378323784237852378623787237882378923790237912379223793237942379523796237972379823799238002380123802238032380423805238062380723808238092381023811238122381323814238152381623817238182381923820238212382223823238242382523826238272382823829238302383123832238332383423835238362383723838238392384023841238422384323844238452384623847238482384923850238512385223853238542385523856238572385823859238602386123862238632386423865238662386723868238692387023871238722387323874238752387623877238782387923880238812388223883238842388523886238872388823889238902389123892238932389423895238962389723898238992390023901239022390323904239052390623907239082390923910239112391223913239142391523916239172391823919239202392123922239232392423925239262392723928239292393023931239322393323934239352393623937239382393923940239412394223943239442394523946239472394823949239502395123952239532395423955239562395723958239592396023961239622396323964239652396623967239682396923970239712397223973239742397523976239772397823979239802398123982239832398423985239862398723988239892399023991239922399323994239952399623997239982399924000240012400224003240042400524006240072400824009240102401124012240132401424015240162401724018240192402024021240222402324024240252402624027240282402924030240312403224033240342403524036240372403824039240402404124042240432404424045240462404724048240492405024051240522405324054240552405624057240582405924060240612406224063240642406524066240672406824069240702407124072240732407424075240762407724078240792408024081240822408324084240852408624087240882408924090240912409224093240942409524096240972409824099241002410124102241032410424105241062410724108241092411024111241122411324114241152411624117241182411924120241212412224123241242412524126241272412824129241302413124132241332413424135241362413724138241392414024141241422414324144241452414624147241482414924150241512415224153241542415524156241572415824159241602416124162241632416424165241662416724168241692417024171241722417324174241752417624177241782417924180241812418224183241842418524186241872418824189241902419124192241932419424195241962419724198241992420024201242022420324204242052420624207242082420924210242112421224213242142421524216242172421824219242202422124222242232422424225242262422724228242292423024231242322423324234242352423624237242382423924240242412424224243242442424524246242472424824249242502425124252242532425424255242562425724258242592426024261242622426324264242652426624267242682426924270242712427224273242742427524276242772427824279242802428124282242832428424285242862428724288242892429024291242922429324294242952429624297242982429924300243012430224303243042430524306243072430824309243102431124312243132431424315243162431724318243192432024321243222432324324243252432624327243282432924330243312433224333243342433524336243372433824339243402434124342243432434424345243462434724348243492435024351243522435324354243552435624357243582435924360243612436224363243642436524366243672436824369243702437124372243732437424375243762437724378243792438024381243822438324384243852438624387243882438924390243912439224393243942439524396243972439824399244002440124402244032440424405244062440724408244092441024411244122441324414244152441624417244182441924420244212442224423244242442524426244272442824429244302443124432244332443424435244362443724438244392444024441244422444324444244452444624447244482444924450244512445224453244542445524456244572445824459244602446124462244632446424465244662446724468244692447024471244722447324474244752447624477244782447924480244812448224483244842448524486244872448824489244902449124492244932449424495244962449724498244992450024501245022450324504245052450624507245082450924510245112451224513245142451524516245172451824519245202452124522245232452424525245262452724528245292453024531245322453324534245352453624537245382453924540245412454224543245442454524546245472454824549245502455124552245532455424555245562455724558245592456024561245622456324564245652456624567245682456924570245712457224573245742457524576245772457824579245802458124582245832458424585245862458724588245892459024591245922459324594245952459624597245982459924600246012460224603246042460524606246072460824609246102461124612246132461424615246162461724618246192462024621246222462324624246252462624627246282462924630246312463224633246342463524636246372463824639246402464124642246432464424645246462464724648246492465024651246522465324654246552465624657246582465924660246612466224663246642466524666246672466824669246702467124672246732467424675246762467724678246792468024681246822468324684246852468624687246882468924690246912469224693246942469524696246972469824699247002470124702247032470424705247062470724708247092471024711247122471324714247152471624717247182471924720247212472224723247242472524726247272472824729247302473124732247332473424735247362473724738247392474024741247422474324744247452474624747247482474924750247512475224753247542475524756247572475824759247602476124762247632476424765247662476724768247692477024771247722477324774247752477624777247782477924780247812478224783247842478524786247872478824789247902479124792247932479424795247962479724798247992480024801248022480324804248052480624807248082480924810248112481224813248142481524816248172481824819248202482124822248232482424825248262482724828248292483024831248322483324834248352483624837248382483924840248412484224843248442484524846248472484824849248502485124852248532485424855248562485724858248592486024861248622486324864248652486624867248682486924870248712487224873248742487524876248772487824879248802488124882248832488424885248862488724888248892489024891248922489324894248952489624897248982489924900249012490224903249042490524906249072490824909249102491124912249132491424915249162491724918249192492024921249222492324924249252492624927249282492924930249312493224933249342493524936249372493824939249402494124942249432494424945249462494724948249492495024951249522495324954249552495624957249582495924960249612496224963249642496524966249672496824969249702497124972249732497424975249762497724978249792498024981249822498324984249852498624987249882498924990249912499224993249942499524996249972499824999250002500125002250032500425005250062500725008250092501025011250122501325014250152501625017250182501925020250212502225023250242502525026250272502825029250302503125032250332503425035250362503725038250392504025041250422504325044250452504625047250482504925050250512505225053250542505525056250572505825059250602506125062250632506425065250662506725068250692507025071250722507325074250752507625077250782507925080250812508225083250842508525086250872508825089250902509125092250932509425095250962509725098250992510025101251022510325104251052510625107251082510925110251112511225113251142511525116251172511825119251202512125122251232512425125251262512725128251292513025131251322513325134251352513625137251382513925140251412514225143251442514525146251472514825149251502515125152251532515425155251562515725158251592516025161251622516325164251652516625167251682516925170251712517225173251742517525176251772517825179251802518125182251832518425185251862518725188251892519025191251922519325194251952519625197251982519925200252012520225203252042520525206252072520825209252102521125212252132521425215252162521725218252192522025221252222522325224252252522625227252282522925230252312523225233252342523525236252372523825239252402524125242252432524425245252462524725248252492525025251252522525325254252552525625257252582525925260252612526225263252642526525266252672526825269252702527125272252732527425275252762527725278252792528025281252822528325284252852528625287252882528925290252912529225293252942529525296252972529825299253002530125302253032530425305253062530725308253092531025311253122531325314253152531625317253182531925320253212532225323253242532525326253272532825329253302533125332253332533425335253362533725338253392534025341253422534325344253452534625347253482534925350253512535225353253542535525356253572535825359253602536125362253632536425365253662536725368253692537025371253722537325374253752537625377253782537925380253812538225383253842538525386253872538825389253902539125392253932539425395253962539725398253992540025401254022540325404254052540625407254082540925410254112541225413254142541525416254172541825419254202542125422254232542425425254262542725428254292543025431254322543325434254352543625437254382543925440254412544225443254442544525446254472544825449254502545125452254532545425455254562545725458254592546025461254622546325464254652546625467254682546925470254712547225473254742547525476254772547825479254802548125482254832548425485254862548725488254892549025491254922549325494254952549625497254982549925500255012550225503255042550525506255072550825509255102551125512255132551425515255162551725518255192552025521255222552325524255252552625527255282552925530255312553225533255342553525536255372553825539255402554125542255432554425545255462554725548255492555025551255522555325554255552555625557255582555925560255612556225563255642556525566255672556825569255702557125572255732557425575255762557725578255792558025581255822558325584255852558625587255882558925590255912559225593255942559525596255972559825599256002560125602256032560425605256062560725608256092561025611256122561325614256152561625617256182561925620256212562225623256242562525626256272562825629256302563125632256332563425635256362563725638256392564025641256422564325644256452564625647256482564925650256512565225653256542565525656256572565825659256602566125662256632566425665256662566725668256692567025671256722567325674256752567625677256782567925680256812568225683256842568525686256872568825689256902569125692256932569425695256962569725698256992570025701257022570325704257052570625707257082570925710257112571225713257142571525716257172571825719257202572125722257232572425725257262572725728257292573025731257322573325734257352573625737257382573925740257412574225743257442574525746257472574825749257502575125752257532575425755257562575725758257592576025761257622576325764257652576625767257682576925770257712577225773257742577525776257772577825779257802578125782257832578425785257862578725788257892579025791257922579325794257952579625797257982579925800258012580225803258042580525806258072580825809258102581125812258132581425815258162581725818258192582025821258222582325824258252582625827258282582925830258312583225833258342583525836258372583825839258402584125842258432584425845258462584725848258492585025851258522585325854258552585625857258582585925860258612586225863258642586525866258672586825869258702587125872258732587425875258762587725878258792588025881258822588325884258852588625887258882588925890258912589225893258942589525896258972589825899259002590125902259032590425905259062590725908259092591025911259122591325914259152591625917259182591925920259212592225923259242592525926259272592825929259302593125932259332593425935259362593725938259392594025941259422594325944259452594625947259482594925950259512595225953259542595525956259572595825959259602596125962259632596425965259662596725968259692597025971259722597325974259752597625977259782597925980259812598225983259842598525986259872598825989259902599125992259932599425995259962599725998259992600026001260022600326004260052600626007260082600926010260112601226013260142601526016260172601826019260202602126022260232602426025260262602726028260292603026031260322603326034260352603626037260382603926040260412604226043260442604526046260472604826049260502605126052260532605426055260562605726058260592606026061260622606326064260652606626067260682606926070260712607226073260742607526076260772607826079260802608126082260832608426085260862608726088260892609026091260922609326094260952609626097260982609926100261012610226103261042610526106261072610826109261102611126112261132611426115261162611726118261192612026121261222612326124261252612626127261282612926130261312613226133261342613526136261372613826139261402614126142261432614426145261462614726148261492615026151261522615326154261552615626157261582615926160261612616226163261642616526166261672616826169261702617126172261732617426175261762617726178261792618026181261822618326184261852618626187261882618926190261912619226193261942619526196261972619826199262002620126202262032620426205262062620726208262092621026211262122621326214262152621626217262182621926220262212622226223262242622526226262272622826229262302623126232262332623426235262362623726238262392624026241262422624326244262452624626247262482624926250262512625226253262542625526256262572625826259262602626126262262632626426265262662626726268262692627026271262722627326274262752627626277262782627926280262812628226283262842628526286262872628826289262902629126292262932629426295262962629726298262992630026301263022630326304263052630626307263082630926310263112631226313263142631526316263172631826319263202632126322263232632426325263262632726328263292633026331263322633326334263352633626337263382633926340263412634226343263442634526346263472634826349263502635126352263532635426355263562635726358263592636026361263622636326364263652636626367263682636926370263712637226373263742637526376263772637826379263802638126382263832638426385263862638726388263892639026391263922639326394263952639626397263982639926400264012640226403264042640526406264072640826409264102641126412264132641426415264162641726418264192642026421264222642326424264252642626427264282642926430264312643226433264342643526436264372643826439264402644126442264432644426445264462644726448264492645026451264522645326454264552645626457264582645926460264612646226463264642646526466264672646826469264702647126472264732647426475264762647726478264792648026481264822648326484264852648626487264882648926490264912649226493264942649526496264972649826499265002650126502265032650426505265062650726508265092651026511265122651326514265152651626517265182651926520265212652226523265242652526526265272652826529265302653126532265332653426535265362653726538265392654026541265422654326544265452654626547265482654926550265512655226553265542655526556265572655826559265602656126562265632656426565265662656726568265692657026571265722657326574265752657626577265782657926580265812658226583265842658526586265872658826589265902659126592265932659426595265962659726598265992660026601266022660326604266052660626607266082660926610266112661226613266142661526616266172661826619266202662126622266232662426625266262662726628266292663026631266322663326634266352663626637266382663926640266412664226643266442664526646266472664826649266502665126652266532665426655266562665726658266592666026661266622666326664266652666626667266682666926670266712667226673266742667526676266772667826679266802668126682266832668426685266862668726688266892669026691266922669326694266952669626697266982669926700267012670226703267042670526706267072670826709267102671126712267132671426715267162671726718267192672026721267222672326724267252672626727267282672926730267312673226733267342673526736267372673826739267402674126742267432674426745267462674726748267492675026751267522675326754267552675626757267582675926760267612676226763267642676526766267672676826769267702677126772267732677426775267762677726778267792678026781267822678326784267852678626787267882678926790267912679226793267942679526796267972679826799268002680126802268032680426805268062680726808268092681026811268122681326814268152681626817268182681926820268212682226823268242682526826268272682826829268302683126832268332683426835268362683726838268392684026841268422684326844268452684626847268482684926850268512685226853268542685526856268572685826859268602686126862268632686426865268662686726868268692687026871268722687326874268752687626877268782687926880268812688226883268842688526886268872688826889268902689126892268932689426895268962689726898268992690026901269022690326904269052690626907269082690926910269112691226913269142691526916269172691826919269202692126922269232692426925269262692726928269292693026931269322693326934269352693626937269382693926940269412694226943269442694526946269472694826949269502695126952269532695426955269562695726958269592696026961269622696326964269652696626967269682696926970269712697226973269742697526976269772697826979269802698126982269832698426985269862698726988269892699026991269922699326994269952699626997269982699927000270012700227003270042700527006270072700827009270102701127012270132701427015270162701727018270192702027021270222702327024270252702627027270282702927030270312703227033270342703527036270372703827039270402704127042270432704427045270462704727048270492705027051270522705327054270552705627057270582705927060270612706227063270642706527066270672706827069270702707127072270732707427075270762707727078270792708027081270822708327084270852708627087270882708927090270912709227093270942709527096270972709827099271002710127102271032710427105271062710727108271092711027111271122711327114271152711627117271182711927120271212712227123271242712527126271272712827129271302713127132271332713427135271362713727138271392714027141271422714327144271452714627147271482714927150271512715227153271542715527156271572715827159271602716127162271632716427165271662716727168271692717027171271722717327174271752717627177271782717927180271812718227183271842718527186271872718827189271902719127192271932719427195271962719727198271992720027201272022720327204272052720627207272082720927210272112721227213272142721527216272172721827219272202722127222272232722427225272262722727228272292723027231272322723327234272352723627237272382723927240272412724227243272442724527246272472724827249272502725127252272532725427255272562725727258272592726027261272622726327264272652726627267272682726927270272712727227273272742727527276272772727827279272802728127282272832728427285272862728727288272892729027291272922729327294272952729627297272982729927300273012730227303273042730527306273072730827309273102731127312273132731427315273162731727318273192732027321273222732327324273252732627327273282732927330273312733227333273342733527336273372733827339273402734127342273432734427345273462734727348273492735027351273522735327354273552735627357273582735927360273612736227363273642736527366273672736827369273702737127372273732737427375273762737727378273792738027381273822738327384273852738627387273882738927390273912739227393273942739527396273972739827399274002740127402274032740427405274062740727408274092741027411274122741327414274152741627417274182741927420274212742227423274242742527426274272742827429274302743127432274332743427435274362743727438274392744027441274422744327444274452744627447274482744927450274512745227453274542745527456274572745827459274602746127462274632746427465274662746727468274692747027471274722747327474274752747627477274782747927480274812748227483274842748527486274872748827489274902749127492274932749427495274962749727498274992750027501275022750327504275052750627507275082750927510275112751227513275142751527516275172751827519275202752127522275232752427525275262752727528275292753027531275322753327534275352753627537275382753927540275412754227543275442754527546275472754827549275502755127552275532755427555275562755727558275592756027561275622756327564275652756627567275682756927570275712757227573275742757527576275772757827579275802758127582275832758427585275862758727588275892759027591275922759327594275952759627597275982759927600276012760227603276042760527606276072760827609276102761127612276132761427615276162761727618276192762027621276222762327624276252762627627276282762927630276312763227633276342763527636276372763827639276402764127642276432764427645276462764727648276492765027651276522765327654276552765627657276582765927660276612766227663276642766527666276672766827669276702767127672276732767427675276762767727678276792768027681276822768327684276852768627687276882768927690276912769227693276942769527696276972769827699277002770127702277032770427705277062770727708277092771027711277122771327714277152771627717277182771927720277212772227723277242772527726277272772827729277302773127732277332773427735277362773727738277392774027741277422774327744277452774627747277482774927750277512775227753277542775527756277572775827759277602776127762277632776427765277662776727768277692777027771277722777327774277752777627777277782777927780277812778227783277842778527786277872778827789277902779127792277932779427795277962779727798277992780027801278022780327804278052780627807278082780927810278112781227813278142781527816278172781827819278202782127822278232782427825278262782727828278292783027831278322783327834278352783627837278382783927840278412784227843278442784527846278472784827849278502785127852278532785427855278562785727858278592786027861278622786327864278652786627867278682786927870278712787227873278742787527876278772787827879278802788127882278832788427885278862788727888278892789027891278922789327894278952789627897278982789927900279012790227903279042790527906279072790827909279102791127912279132791427915279162791727918279192792027921279222792327924279252792627927279282792927930279312793227933279342793527936279372793827939279402794127942279432794427945279462794727948279492795027951279522795327954279552795627957279582795927960279612796227963279642796527966279672796827969279702797127972279732797427975279762797727978279792798027981279822798327984279852798627987279882798927990279912799227993279942799527996279972799827999280002800128002280032800428005280062800728008280092801028011280122801328014280152801628017280182801928020280212802228023280242802528026280272802828029280302803128032280332803428035280362803728038280392804028041280422804328044280452804628047280482804928050280512805228053280542805528056280572805828059280602806128062280632806428065280662806728068280692807028071280722807328074280752807628077280782807928080280812808228083280842808528086280872808828089280902809128092280932809428095280962809728098280992810028101281022810328104281052810628107281082810928110281112811228113281142811528116281172811828119281202812128122281232812428125281262812728128281292813028131281322813328134281352813628137281382813928140281412814228143281442814528146281472814828149281502815128152281532815428155281562815728158281592816028161281622816328164281652816628167281682816928170281712817228173281742817528176281772817828179281802818128182281832818428185281862818728188281892819028191281922819328194281952819628197281982819928200282012820228203282042820528206282072820828209282102821128212282132821428215282162821728218282192822028221282222822328224282252822628227282282822928230282312823228233282342823528236282372823828239282402824128242282432824428245282462824728248282492825028251282522825328254282552825628257282582825928260282612826228263282642826528266282672826828269282702827128272282732827428275282762827728278282792828028281282822828328284282852828628287282882828928290282912829228293282942829528296282972829828299283002830128302283032830428305283062830728308283092831028311283122831328314283152831628317283182831928320283212832228323283242832528326283272832828329283302833128332283332833428335283362833728338283392834028341283422834328344283452834628347283482834928350283512835228353283542835528356283572835828359283602836128362283632836428365283662836728368283692837028371283722837328374283752837628377283782837928380283812838228383283842838528386283872838828389283902839128392283932839428395283962839728398283992840028401284022840328404284052840628407284082840928410284112841228413284142841528416284172841828419284202842128422284232842428425284262842728428284292843028431284322843328434284352843628437284382843928440284412844228443284442844528446284472844828449284502845128452284532845428455284562845728458284592846028461284622846328464284652846628467284682846928470284712847228473284742847528476284772847828479284802848128482284832848428485284862848728488284892849028491284922849328494284952849628497284982849928500285012850228503285042850528506285072850828509285102851128512285132851428515285162851728518285192852028521285222852328524285252852628527285282852928530285312853228533285342853528536285372853828539285402854128542285432854428545285462854728548285492855028551285522855328554285552855628557285582855928560285612856228563285642856528566285672856828569285702857128572285732857428575285762857728578285792858028581285822858328584285852858628587285882858928590285912859228593285942859528596285972859828599286002860128602286032860428605286062860728608286092861028611286122861328614286152861628617286182861928620286212862228623286242862528626286272862828629286302863128632286332863428635286362863728638286392864028641286422864328644286452864628647286482864928650286512865228653286542865528656286572865828659286602866128662286632866428665286662866728668286692867028671286722867328674286752867628677286782867928680286812868228683286842868528686286872868828689286902869128692286932869428695286962869728698286992870028701287022870328704287052870628707287082870928710287112871228713287142871528716287172871828719287202872128722287232872428725287262872728728287292873028731287322873328734287352873628737287382873928740287412874228743287442874528746287472874828749287502875128752287532875428755287562875728758287592876028761287622876328764287652876628767287682876928770287712877228773287742877528776287772877828779287802878128782287832878428785287862878728788287892879028791287922879328794287952879628797287982879928800288012880228803288042880528806288072880828809288102881128812288132881428815288162881728818288192882028821288222882328824288252882628827288282882928830288312883228833288342883528836288372883828839288402884128842288432884428845288462884728848288492885028851288522885328854288552885628857288582885928860288612886228863288642886528866288672886828869288702887128872288732887428875288762887728878288792888028881288822888328884288852888628887288882888928890288912889228893288942889528896288972889828899289002890128902289032890428905289062890728908289092891028911289122891328914289152891628917289182891928920289212892228923289242892528926289272892828929289302893128932289332893428935289362893728938289392894028941289422894328944289452894628947289482894928950289512895228953289542895528956289572895828959289602896128962289632896428965289662896728968289692897028971289722897328974289752897628977289782897928980289812898228983289842898528986289872898828989289902899128992289932899428995289962899728998289992900029001290022900329004290052900629007290082900929010290112901229013290142901529016290172901829019290202902129022290232902429025290262902729028290292903029031290322903329034290352903629037290382903929040290412904229043290442904529046290472904829049290502905129052290532905429055290562905729058290592906029061290622906329064290652906629067290682906929070290712907229073290742907529076290772907829079290802908129082290832908429085290862908729088290892909029091290922909329094290952909629097290982909929100291012910229103291042910529106291072910829109291102911129112291132911429115291162911729118291192912029121291222912329124291252912629127291282912929130291312913229133291342913529136291372913829139291402914129142291432914429145291462914729148291492915029151291522915329154291552915629157291582915929160291612916229163291642916529166291672916829169291702917129172291732917429175291762917729178291792918029181291822918329184291852918629187291882918929190291912919229193291942919529196291972919829199292002920129202292032920429205292062920729208292092921029211292122921329214292152921629217292182921929220292212922229223292242922529226292272922829229292302923129232292332923429235292362923729238292392924029241292422924329244292452924629247292482924929250292512925229253292542925529256292572925829259292602926129262292632926429265292662926729268292692927029271292722927329274292752927629277292782927929280292812928229283292842928529286292872928829289292902929129292292932929429295292962929729298292992930029301293022930329304293052930629307293082930929310293112931229313293142931529316293172931829319293202932129322293232932429325293262932729328293292933029331293322933329334293352933629337293382933929340293412934229343293442934529346293472934829349293502935129352293532935429355293562935729358293592936029361293622936329364293652936629367293682936929370293712937229373293742937529376293772937829379293802938129382293832938429385293862938729388293892939029391293922939329394293952939629397293982939929400294012940229403294042940529406294072940829409294102941129412294132941429415294162941729418294192942029421294222942329424294252942629427294282942929430294312943229433294342943529436294372943829439294402944129442294432944429445294462944729448294492945029451294522945329454294552945629457294582945929460294612946229463294642946529466294672946829469294702947129472294732947429475294762947729478294792948029481294822948329484294852948629487294882948929490294912949229493294942949529496294972949829499295002950129502295032950429505295062950729508295092951029511295122951329514295152951629517295182951929520295212952229523295242952529526295272952829529295302953129532295332953429535295362953729538295392954029541295422954329544295452954629547295482954929550295512955229553295542955529556295572955829559295602956129562295632956429565295662956729568295692957029571295722957329574295752957629577295782957929580295812958229583295842958529586295872958829589295902959129592295932959429595295962959729598295992960029601296022960329604296052960629607296082960929610296112961229613296142961529616296172961829619296202962129622296232962429625296262962729628296292963029631296322963329634296352963629637296382963929640296412964229643296442964529646296472964829649296502965129652296532965429655296562965729658296592966029661296622966329664296652966629667296682966929670296712967229673296742967529676296772967829679296802968129682296832968429685296862968729688296892969029691296922969329694296952969629697296982969929700297012970229703297042970529706297072970829709297102971129712297132971429715297162971729718297192972029721297222972329724297252972629727297282972929730297312973229733297342973529736297372973829739297402974129742297432974429745297462974729748297492975029751297522975329754297552975629757297582975929760297612976229763297642976529766297672976829769297702977129772297732977429775297762977729778297792978029781297822978329784297852978629787297882978929790297912979229793297942979529796297972979829799298002980129802298032980429805298062980729808298092981029811298122981329814298152981629817298182981929820298212982229823298242982529826298272982829829298302983129832298332983429835298362983729838298392984029841298422984329844298452984629847298482984929850298512985229853298542985529856298572985829859298602986129862298632986429865298662986729868298692987029871298722987329874298752987629877298782987929880298812988229883298842988529886298872988829889298902989129892298932989429895298962989729898298992990029901299022990329904299052990629907299082990929910299112991229913299142991529916299172991829919299202992129922299232992429925299262992729928299292993029931299322993329934299352993629937299382993929940299412994229943299442994529946299472994829949299502995129952299532995429955299562995729958299592996029961299622996329964299652996629967299682996929970299712997229973299742997529976299772997829979299802998129982299832998429985299862998729988299892999029991299922999329994299952999629997299982999930000300013000230003300043000530006300073000830009300103001130012300133001430015300163001730018300193002030021300223002330024300253002630027300283002930030300313003230033300343003530036300373003830039300403004130042300433004430045300463004730048300493005030051300523005330054300553005630057300583005930060300613006230063300643006530066300673006830069300703007130072300733007430075300763007730078300793008030081300823008330084300853008630087300883008930090300913009230093300943009530096300973009830099301003010130102301033010430105301063010730108301093011030111301123011330114301153011630117301183011930120301213012230123301243012530126301273012830129301303013130132301333013430135301363013730138301393014030141301423014330144301453014630147301483014930150301513015230153301543015530156301573015830159301603016130162301633016430165301663016730168301693017030171301723017330174301753017630177301783017930180301813018230183301843018530186301873018830189301903019130192301933019430195301963019730198301993020030201302023020330204302053020630207302083020930210302113021230213302143021530216302173021830219302203022130222302233022430225302263022730228302293023030231302323023330234302353023630237302383023930240302413024230243302443024530246302473024830249302503025130252302533025430255302563025730258302593026030261302623026330264302653026630267302683026930270302713027230273302743027530276302773027830279302803028130282302833028430285302863028730288302893029030291302923029330294302953029630297302983029930300303013030230303303043030530306303073030830309303103031130312303133031430315303163031730318303193032030321303223032330324303253032630327303283032930330303313033230333303343033530336303373033830339303403034130342303433034430345303463034730348303493035030351303523035330354303553035630357303583035930360303613036230363303643036530366303673036830369303703037130372303733037430375303763037730378303793038030381303823038330384303853038630387303883038930390303913039230393303943039530396303973039830399304003040130402304033040430405304063040730408304093041030411304123041330414304153041630417304183041930420304213042230423304243042530426304273042830429304303043130432304333043430435304363043730438304393044030441304423044330444304453044630447304483044930450304513045230453304543045530456304573045830459304603046130462304633046430465304663046730468304693047030471304723047330474304753047630477304783047930480304813048230483304843048530486304873048830489304903049130492304933049430495304963049730498304993050030501305023050330504305053050630507305083050930510305113051230513305143051530516305173051830519305203052130522305233052430525305263052730528305293053030531305323053330534305353053630537305383053930540305413054230543305443054530546305473054830549305503055130552305533055430555305563055730558305593056030561305623056330564305653056630567305683056930570305713057230573305743057530576305773057830579305803058130582305833058430585305863058730588305893059030591305923059330594305953059630597305983059930600306013060230603306043060530606306073060830609306103061130612306133061430615306163061730618306193062030621306223062330624306253062630627306283062930630306313063230633306343063530636306373063830639306403064130642306433064430645306463064730648306493065030651306523065330654306553065630657306583065930660306613066230663306643066530666306673066830669306703067130672306733067430675306763067730678306793068030681306823068330684306853068630687306883068930690306913069230693306943069530696306973069830699307003070130702307033070430705307063070730708307093071030711307123071330714307153071630717307183071930720307213072230723307243072530726307273072830729307303073130732307333073430735307363073730738307393074030741307423074330744307453074630747307483074930750307513075230753307543075530756307573075830759307603076130762307633076430765307663076730768307693077030771307723077330774307753077630777307783077930780307813078230783307843078530786307873078830789307903079130792307933079430795307963079730798307993080030801308023080330804308053080630807308083080930810308113081230813308143081530816308173081830819308203082130822308233082430825308263082730828308293083030831308323083330834308353083630837308383083930840308413084230843308443084530846308473084830849308503085130852308533085430855308563085730858308593086030861308623086330864308653086630867308683086930870308713087230873308743087530876308773087830879308803088130882308833088430885308863088730888308893089030891308923089330894308953089630897308983089930900309013090230903309043090530906309073090830909309103091130912309133091430915309163091730918309193092030921309223092330924309253092630927309283092930930309313093230933309343093530936309373093830939309403094130942309433094430945309463094730948309493095030951309523095330954309553095630957309583095930960309613096230963309643096530966309673096830969309703097130972309733097430975309763097730978309793098030981309823098330984309853098630987309883098930990309913099230993309943099530996309973099830999310003100131002310033100431005310063100731008310093101031011310123101331014310153101631017310183101931020310213102231023310243102531026310273102831029310303103131032310333103431035310363103731038310393104031041310423104331044310453104631047310483104931050310513105231053310543105531056310573105831059310603106131062310633106431065310663106731068310693107031071310723107331074310753107631077310783107931080310813108231083310843108531086310873108831089310903109131092310933109431095310963109731098310993110031101311023110331104311053110631107311083110931110311113111231113311143111531116311173111831119311203112131122311233112431125311263112731128311293113031131311323113331134311353113631137311383113931140311413114231143311443114531146311473114831149311503115131152311533115431155311563115731158311593116031161311623116331164311653116631167311683116931170311713117231173311743117531176311773117831179311803118131182311833118431185311863118731188311893119031191311923119331194311953119631197311983119931200312013120231203312043120531206312073120831209312103121131212312133121431215312163121731218312193122031221312223122331224312253122631227312283122931230312313123231233312343123531236312373123831239312403124131242312433124431245312463124731248312493125031251312523125331254312553125631257312583125931260312613126231263312643126531266312673126831269312703127131272312733127431275312763127731278312793128031281312823128331284312853128631287312883128931290312913129231293312943129531296312973129831299313003130131302313033130431305313063130731308313093131031311313123131331314313153131631317313183131931320313213132231323313243132531326313273132831329313303133131332313333133431335313363133731338313393134031341313423134331344313453134631347313483134931350313513135231353313543135531356313573135831359313603136131362313633136431365313663136731368313693137031371313723137331374313753137631377313783137931380313813138231383313843138531386313873138831389313903139131392313933139431395313963139731398313993140031401314023140331404314053140631407314083140931410314113141231413314143141531416314173141831419314203142131422314233142431425314263142731428314293143031431314323143331434314353143631437314383143931440314413144231443314443144531446314473144831449314503145131452314533145431455314563145731458314593146031461314623146331464314653146631467314683146931470314713147231473314743147531476314773147831479314803148131482314833148431485314863148731488314893149031491314923149331494314953149631497314983149931500315013150231503315043150531506315073150831509315103151131512315133151431515315163151731518315193152031521315223152331524315253152631527315283152931530315313153231533315343153531536315373153831539315403154131542315433154431545315463154731548315493155031551315523155331554315553155631557315583155931560315613156231563315643156531566315673156831569315703157131572315733157431575315763157731578315793158031581315823158331584315853158631587315883158931590315913159231593315943159531596315973159831599316003160131602316033160431605316063160731608316093161031611316123161331614316153161631617316183161931620316213162231623316243162531626316273162831629316303163131632316333163431635316363163731638316393164031641316423164331644316453164631647316483164931650316513165231653316543165531656316573165831659316603166131662316633166431665316663166731668316693167031671316723167331674316753167631677316783167931680316813168231683316843168531686316873168831689316903169131692316933169431695316963169731698316993170031701317023170331704317053170631707317083170931710317113171231713317143171531716317173171831719317203172131722317233172431725317263172731728317293173031731317323173331734317353173631737317383173931740317413174231743317443174531746317473174831749317503175131752317533175431755317563175731758317593176031761317623176331764317653176631767317683176931770317713177231773317743177531776317773177831779317803178131782317833178431785317863178731788317893179031791317923179331794317953179631797317983179931800318013180231803318043180531806318073180831809318103181131812318133181431815318163181731818318193182031821318223182331824318253182631827318283182931830318313183231833318343183531836318373183831839318403184131842318433184431845318463184731848318493185031851318523185331854318553185631857318583185931860318613186231863318643186531866318673186831869318703187131872318733187431875318763187731878318793188031881318823188331884318853188631887318883188931890318913189231893318943189531896318973189831899319003190131902319033190431905319063190731908319093191031911319123191331914319153191631917319183191931920319213192231923319243192531926319273192831929319303193131932319333193431935319363193731938319393194031941319423194331944319453194631947319483194931950319513195231953319543195531956319573195831959319603196131962319633196431965319663196731968319693197031971319723197331974319753197631977319783197931980319813198231983319843198531986319873198831989319903199131992319933199431995319963199731998319993200032001320023200332004320053200632007320083200932010320113201232013320143201532016320173201832019320203202132022320233202432025320263202732028320293203032031320323203332034320353203632037320383203932040320413204232043320443204532046320473204832049320503205132052320533205432055320563205732058320593206032061320623206332064320653206632067320683206932070320713207232073320743207532076320773207832079320803208132082320833208432085320863208732088320893209032091320923209332094320953209632097320983209932100321013210232103321043210532106321073210832109321103211132112321133211432115321163211732118321193212032121321223212332124321253212632127321283212932130321313213232133321343213532136321373213832139321403214132142321433214432145321463214732148321493215032151321523215332154321553215632157321583215932160321613216232163321643216532166321673216832169321703217132172321733217432175321763217732178321793218032181321823218332184321853218632187321883218932190321913219232193321943219532196321973219832199322003220132202322033220432205322063220732208322093221032211322123221332214322153221632217322183221932220322213222232223322243222532226322273222832229322303223132232322333223432235322363223732238322393224032241322423224332244322453224632247322483224932250322513225232253322543225532256322573225832259322603226132262322633226432265322663226732268322693227032271322723227332274322753227632277322783227932280322813228232283322843228532286322873228832289322903229132292322933229432295322963229732298322993230032301323023230332304323053230632307323083230932310323113231232313323143231532316323173231832319323203232132322323233232432325323263232732328323293233032331323323233332334323353233632337323383233932340323413234232343323443234532346323473234832349323503235132352323533235432355323563235732358323593236032361323623236332364323653236632367323683236932370323713237232373323743237532376323773237832379323803238132382323833238432385323863238732388323893239032391323923239332394323953239632397323983239932400324013240232403324043240532406324073240832409324103241132412324133241432415324163241732418324193242032421324223242332424324253242632427324283242932430324313243232433324343243532436324373243832439324403244132442324433244432445324463244732448324493245032451324523245332454324553245632457324583245932460324613246232463324643246532466324673246832469324703247132472324733247432475324763247732478324793248032481324823248332484324853248632487324883248932490324913249232493324943249532496324973249832499325003250132502325033250432505325063250732508325093251032511325123251332514325153251632517325183251932520325213252232523325243252532526325273252832529325303253132532325333253432535325363253732538325393254032541325423254332544325453254632547325483254932550325513255232553325543255532556325573255832559325603256132562325633256432565325663256732568325693257032571325723257332574325753257632577325783257932580325813258232583325843258532586325873258832589325903259132592325933259432595325963259732598325993260032601326023260332604326053260632607326083260932610326113261232613326143261532616326173261832619326203262132622326233262432625326263262732628326293263032631326323263332634326353263632637326383263932640326413264232643326443264532646326473264832649326503265132652326533265432655326563265732658326593266032661326623266332664326653266632667326683266932670326713267232673326743267532676326773267832679326803268132682326833268432685326863268732688326893269032691326923269332694326953269632697326983269932700327013270232703327043270532706327073270832709327103271132712327133271432715327163271732718327193272032721327223272332724327253272632727327283272932730327313273232733327343273532736327373273832739327403274132742327433274432745327463274732748327493275032751327523275332754327553275632757327583275932760327613276232763327643276532766327673276832769327703277132772327733277432775327763277732778327793278032781327823278332784327853278632787327883278932790327913279232793327943279532796327973279832799328003280132802328033280432805328063280732808328093281032811328123281332814328153281632817328183281932820328213282232823328243282532826328273282832829328303283132832328333283432835328363283732838328393284032841328423284332844328453284632847328483284932850328513285232853328543285532856328573285832859328603286132862328633286432865328663286732868328693287032871328723287332874328753287632877328783287932880328813288232883328843288532886328873288832889328903289132892328933289432895328963289732898328993290032901329023290332904329053290632907329083290932910329113291232913329143291532916329173291832919329203292132922329233292432925329263292732928329293293032931329323293332934329353293632937329383293932940329413294232943329443294532946329473294832949329503295132952329533295432955329563295732958329593296032961329623296332964329653296632967329683296932970329713297232973329743297532976329773297832979329803298132982329833298432985329863298732988329893299032991329923299332994329953299632997329983299933000330013300233003330043300533006330073300833009330103301133012330133301433015330163301733018330193302033021330223302333024330253302633027330283302933030330313303233033330343303533036330373303833039330403304133042330433304433045330463304733048330493305033051330523305333054330553305633057330583305933060330613306233063330643306533066330673306833069330703307133072330733307433075330763307733078330793308033081330823308333084330853308633087330883308933090330913309233093330943309533096330973309833099331003310133102331033310433105331063310733108331093311033111331123311333114331153311633117331183311933120331213312233123331243312533126331273312833129331303313133132331333313433135331363313733138331393314033141331423314333144331453314633147331483314933150331513315233153331543315533156331573315833159331603316133162331633316433165331663316733168331693317033171331723317333174331753317633177331783317933180331813318233183331843318533186331873318833189331903319133192331933319433195331963319733198331993320033201332023320333204332053320633207332083320933210332113321233213332143321533216332173321833219332203322133222332233322433225332263322733228332293323033231332323323333234332353323633237332383323933240332413324233243332443324533246332473324833249332503325133252332533325433255332563325733258332593326033261332623326333264332653326633267332683326933270332713327233273332743327533276332773327833279332803328133282332833328433285332863328733288332893329033291332923329333294332953329633297332983329933300333013330233303333043330533306333073330833309333103331133312333133331433315333163331733318333193332033321333223332333324333253332633327333283332933330333313333233333333343333533336333373333833339333403334133342333433334433345333463334733348333493335033351333523335333354333553335633357333583335933360333613336233363333643336533366333673336833369333703337133372333733337433375333763337733378333793338033381333823338333384333853338633387333883338933390333913339233393333943339533396333973339833399334003340133402334033340433405334063340733408334093341033411334123341333414334153341633417334183341933420334213342233423334243342533426334273342833429334303343133432334333343433435334363343733438334393344033441334423344333444334453344633447334483344933450334513345233453334543345533456334573345833459334603346133462334633346433465334663346733468334693347033471334723347333474334753347633477334783347933480334813348233483334843348533486334873348833489334903349133492334933349433495334963349733498334993350033501335023350333504335053350633507335083350933510335113351233513335143351533516335173351833519335203352133522335233352433525335263352733528335293353033531335323353333534335353353633537335383353933540335413354233543335443354533546335473354833549335503355133552335533355433555335563355733558335593356033561335623356333564335653356633567335683356933570335713357233573335743357533576335773357833579335803358133582335833358433585335863358733588335893359033591335923359333594335953359633597335983359933600336013360233603336043360533606336073360833609336103361133612336133361433615336163361733618336193362033621336223362333624336253362633627336283362933630336313363233633336343363533636336373363833639336403364133642336433364433645336463364733648336493365033651336523365333654336553365633657336583365933660336613366233663336643366533666336673366833669336703367133672336733367433675336763367733678336793368033681336823368333684336853368633687336883368933690336913369233693336943369533696336973369833699337003370133702337033370433705337063370733708337093371033711337123371333714337153371633717337183371933720337213372233723337243372533726337273372833729337303373133732337333373433735337363373733738337393374033741337423374333744337453374633747337483374933750337513375233753337543375533756337573375833759337603376133762337633376433765337663376733768337693377033771337723377333774337753377633777337783377933780337813378233783337843378533786337873378833789337903379133792337933379433795337963379733798337993380033801338023380333804338053380633807338083380933810338113381233813338143381533816338173381833819338203382133822338233382433825338263382733828338293383033831338323383333834338353383633837338383383933840338413384233843338443384533846338473384833849338503385133852338533385433855338563385733858338593386033861338623386333864338653386633867338683386933870338713387233873338743387533876338773387833879338803388133882338833388433885338863388733888338893389033891338923389333894338953389633897338983389933900339013390233903339043390533906339073390833909339103391133912339133391433915339163391733918339193392033921339223392333924339253392633927339283392933930339313393233933339343393533936339373393833939339403394133942339433394433945339463394733948339493395033951339523395333954339553395633957339583395933960339613396233963339643396533966339673396833969339703397133972339733397433975339763397733978339793398033981339823398333984339853398633987339883398933990339913399233993339943399533996339973399833999340003400134002340033400434005340063400734008340093401034011340123401334014340153401634017340183401934020340213402234023340243402534026340273402834029340303403134032340333403434035340363403734038340393404034041340423404334044340453404634047340483404934050340513405234053340543405534056340573405834059340603406134062340633406434065340663406734068340693407034071340723407334074340753407634077340783407934080340813408234083340843408534086340873408834089340903409134092340933409434095340963409734098340993410034101341023410334104341053410634107341083410934110341113411234113341143411534116341173411834119341203412134122341233412434125341263412734128341293413034131341323413334134341353413634137341383413934140341413414234143341443414534146341473414834149341503415134152341533415434155341563415734158341593416034161341623416334164341653416634167341683416934170341713417234173341743417534176341773417834179341803418134182341833418434185341863418734188341893419034191341923419334194341953419634197341983419934200342013420234203342043420534206342073420834209342103421134212342133421434215342163421734218342193422034221342223422334224342253422634227342283422934230342313423234233342343423534236342373423834239342403424134242342433424434245342463424734248342493425034251342523425334254342553425634257342583425934260342613426234263342643426534266342673426834269342703427134272342733427434275342763427734278342793428034281342823428334284342853428634287342883428934290342913429234293342943429534296342973429834299343003430134302343033430434305343063430734308343093431034311343123431334314343153431634317343183431934320343213432234323343243432534326343273432834329343303433134332343333433434335343363433734338343393434034341343423434334344343453434634347343483434934350343513435234353343543435534356343573435834359343603436134362343633436434365343663436734368343693437034371343723437334374343753437634377343783437934380343813438234383343843438534386343873438834389343903439134392343933439434395343963439734398343993440034401344023440334404344053440634407344083440934410344113441234413344143441534416344173441834419344203442134422344233442434425344263442734428344293443034431344323443334434344353443634437344383443934440344413444234443344443444534446344473444834449344503445134452344533445434455344563445734458344593446034461344623446334464344653446634467344683446934470344713447234473344743447534476344773447834479344803448134482344833448434485344863448734488344893449034491344923449334494344953449634497344983449934500345013450234503345043450534506345073450834509345103451134512345133451434515345163451734518345193452034521345223452334524345253452634527345283452934530345313453234533345343453534536345373453834539345403454134542345433454434545345463454734548345493455034551345523455334554345553455634557345583455934560345613456234563345643456534566345673456834569345703457134572345733457434575345763457734578345793458034581345823458334584345853458634587345883458934590345913459234593345943459534596345973459834599346003460134602346033460434605346063460734608346093461034611346123461334614346153461634617346183461934620346213462234623346243462534626346273462834629346303463134632346333463434635346363463734638346393464034641346423464334644346453464634647346483464934650346513465234653346543465534656346573465834659346603466134662346633466434665346663466734668346693467034671346723467334674346753467634677346783467934680346813468234683346843468534686346873468834689346903469134692346933469434695346963469734698346993470034701347023470334704347053470634707347083470934710347113471234713347143471534716347173471834719347203472134722347233472434725347263472734728347293473034731347323473334734347353473634737347383473934740347413474234743347443474534746347473474834749347503475134752347533475434755347563475734758347593476034761347623476334764347653476634767347683476934770347713477234773347743477534776347773477834779347803478134782347833478434785347863478734788347893479034791347923479334794347953479634797347983479934800348013480234803348043480534806348073480834809348103481134812348133481434815348163481734818348193482034821348223482334824348253482634827348283482934830348313483234833348343483534836348373483834839348403484134842348433484434845348463484734848348493485034851348523485334854348553485634857348583485934860348613486234863348643486534866348673486834869348703487134872348733487434875348763487734878348793488034881348823488334884348853488634887348883488934890348913489234893348943489534896348973489834899349003490134902349033490434905349063490734908349093491034911349123491334914349153491634917349183491934920349213492234923349243492534926349273492834929349303493134932349333493434935349363493734938349393494034941349423494334944349453494634947349483494934950349513495234953349543495534956349573495834959349603496134962349633496434965349663496734968349693497034971349723497334974349753497634977349783497934980349813498234983349843498534986349873498834989349903499134992349933499434995349963499734998349993500035001350023500335004350053500635007350083500935010350113501235013350143501535016350173501835019350203502135022350233502435025350263502735028350293503035031350323503335034350353503635037350383503935040350413504235043350443504535046350473504835049350503505135052350533505435055350563505735058350593506035061350623506335064350653506635067350683506935070350713507235073350743507535076350773507835079350803508135082350833508435085350863508735088350893509035091350923509335094350953509635097350983509935100351013510235103351043510535106351073510835109351103511135112351133511435115351163511735118351193512035121351223512335124351253512635127351283512935130351313513235133351343513535136351373513835139351403514135142351433514435145351463514735148351493515035151351523515335154351553515635157351583515935160351613516235163351643516535166351673516835169351703517135172351733517435175351763517735178351793518035181351823518335184351853518635187351883518935190351913519235193351943519535196351973519835199352003520135202352033520435205352063520735208352093521035211352123521335214352153521635217352183521935220352213522235223352243522535226352273522835229352303523135232352333523435235352363523735238352393524035241352423524335244352453524635247352483524935250352513525235253352543525535256352573525835259352603526135262352633526435265352663526735268352693527035271352723527335274352753527635277352783527935280352813528235283352843528535286352873528835289352903529135292352933529435295352963529735298352993530035301353023530335304353053530635307353083530935310353113531235313353143531535316353173531835319353203532135322353233532435325353263532735328353293533035331353323533335334353353533635337353383533935340353413534235343353443534535346353473534835349353503535135352353533535435355353563535735358353593536035361353623536335364353653536635367353683536935370353713537235373353743537535376353773537835379353803538135382353833538435385353863538735388353893539035391353923539335394353953539635397353983539935400354013540235403354043540535406354073540835409354103541135412354133541435415354163541735418354193542035421354223542335424354253542635427354283542935430354313543235433354343543535436354373543835439354403544135442354433544435445354463544735448354493545035451354523545335454354553545635457354583545935460354613546235463354643546535466354673546835469354703547135472354733547435475354763547735478354793548035481354823548335484354853548635487354883548935490354913549235493354943549535496354973549835499355003550135502355033550435505355063550735508355093551035511355123551335514355153551635517355183551935520355213552235523355243552535526355273552835529355303553135532355333553435535355363553735538355393554035541355423554335544355453554635547355483554935550355513555235553355543555535556355573555835559355603556135562355633556435565355663556735568355693557035571355723557335574355753557635577355783557935580355813558235583355843558535586355873558835589355903559135592355933559435595355963559735598355993560035601356023560335604356053560635607356083560935610356113561235613356143561535616356173561835619356203562135622356233562435625356263562735628356293563035631356323563335634356353563635637356383563935640356413564235643356443564535646356473564835649356503565135652356533565435655356563565735658356593566035661356623566335664356653566635667356683566935670356713567235673356743567535676356773567835679356803568135682356833568435685356863568735688356893569035691356923569335694356953569635697356983569935700357013570235703357043570535706357073570835709357103571135712357133571435715357163571735718357193572035721357223572335724357253572635727357283572935730357313573235733357343573535736357373573835739357403574135742357433574435745357463574735748357493575035751357523575335754357553575635757357583575935760357613576235763357643576535766357673576835769357703577135772357733577435775357763577735778357793578035781357823578335784357853578635787357883578935790357913579235793357943579535796357973579835799358003580135802358033580435805358063580735808358093581035811358123581335814358153581635817358183581935820358213582235823358243582535826358273582835829358303583135832358333583435835358363583735838358393584035841358423584335844358453584635847358483584935850358513585235853358543585535856358573585835859358603586135862358633586435865358663586735868358693587035871358723587335874358753587635877358783587935880358813588235883358843588535886358873588835889358903589135892358933589435895358963589735898358993590035901359023590335904359053590635907359083590935910359113591235913359143591535916359173591835919359203592135922359233592435925359263592735928359293593035931359323593335934359353593635937359383593935940359413594235943359443594535946359473594835949359503595135952359533595435955359563595735958359593596035961359623596335964359653596635967359683596935970359713597235973359743597535976359773597835979359803598135982359833598435985359863598735988359893599035991359923599335994359953599635997359983599936000360013600236003360043600536006360073600836009360103601136012360133601436015360163601736018360193602036021360223602336024360253602636027360283602936030360313603236033360343603536036360373603836039360403604136042360433604436045360463604736048360493605036051360523605336054360553605636057360583605936060360613606236063360643606536066360673606836069360703607136072360733607436075360763607736078360793608036081360823608336084360853608636087360883608936090360913609236093360943609536096360973609836099361003610136102361033610436105361063610736108361093611036111361123611336114361153611636117361183611936120361213612236123361243612536126361273612836129361303613136132361333613436135361363613736138361393614036141361423614336144361453614636147361483614936150361513615236153361543615536156361573615836159361603616136162361633616436165361663616736168361693617036171361723617336174361753617636177361783617936180361813618236183361843618536186361873618836189361903619136192361933619436195361963619736198361993620036201362023620336204362053620636207362083620936210362113621236213362143621536216362173621836219362203622136222362233622436225362263622736228362293623036231362323623336234362353623636237362383623936240362413624236243362443624536246362473624836249362503625136252362533625436255362563625736258362593626036261362623626336264362653626636267362683626936270362713627236273362743627536276362773627836279362803628136282362833628436285362863628736288362893629036291362923629336294362953629636297362983629936300363013630236303363043630536306363073630836309363103631136312363133631436315363163631736318363193632036321363223632336324363253632636327363283632936330363313633236333363343633536336363373633836339363403634136342363433634436345363463634736348363493635036351363523635336354363553635636357363583635936360363613636236363363643636536366363673636836369363703637136372363733637436375363763637736378363793638036381363823638336384363853638636387363883638936390363913639236393363943639536396363973639836399364003640136402364033640436405364063640736408364093641036411364123641336414364153641636417364183641936420364213642236423364243642536426364273642836429364303643136432364333643436435364363643736438364393644036441364423644336444364453644636447364483644936450364513645236453364543645536456364573645836459364603646136462364633646436465364663646736468364693647036471364723647336474364753647636477364783647936480364813648236483364843648536486364873648836489364903649136492364933649436495364963649736498364993650036501365023650336504365053650636507365083650936510365113651236513365143651536516365173651836519365203652136522365233652436525365263652736528365293653036531365323653336534365353653636537365383653936540365413654236543365443654536546365473654836549365503655136552365533655436555365563655736558365593656036561365623656336564365653656636567365683656936570365713657236573365743657536576365773657836579365803658136582365833658436585365863658736588365893659036591365923659336594365953659636597365983659936600366013660236603366043660536606366073660836609366103661136612366133661436615366163661736618366193662036621366223662336624366253662636627366283662936630366313663236633366343663536636366373663836639366403664136642366433664436645366463664736648366493665036651366523665336654366553665636657366583665936660366613666236663366643666536666366673666836669366703667136672366733667436675366763667736678366793668036681366823668336684366853668636687366883668936690366913669236693366943669536696366973669836699367003670136702367033670436705367063670736708367093671036711367123671336714367153671636717367183671936720367213672236723367243672536726367273672836729367303673136732367333673436735367363673736738367393674036741367423674336744367453674636747367483674936750367513675236753367543675536756367573675836759367603676136762367633676436765367663676736768367693677036771367723677336774367753677636777367783677936780367813678236783367843678536786367873678836789367903679136792367933679436795367963679736798367993680036801368023680336804368053680636807368083680936810368113681236813368143681536816368173681836819368203682136822368233682436825368263682736828368293683036831368323683336834368353683636837368383683936840368413684236843368443684536846368473684836849368503685136852368533685436855368563685736858368593686036861368623686336864368653686636867368683686936870368713687236873368743687536876368773687836879368803688136882368833688436885368863688736888368893689036891368923689336894368953689636897368983689936900369013690236903369043690536906369073690836909369103691136912369133691436915369163691736918369193692036921369223692336924369253692636927369283692936930369313693236933369343693536936369373693836939369403694136942369433694436945369463694736948369493695036951369523695336954369553695636957369583695936960369613696236963369643696536966369673696836969369703697136972369733697436975369763697736978369793698036981369823698336984369853698636987369883698936990369913699236993369943699536996369973699836999370003700137002370033700437005370063700737008370093701037011370123701337014370153701637017370183701937020370213702237023370243702537026370273702837029370303703137032370333703437035370363703737038370393704037041370423704337044370453704637047370483704937050370513705237053370543705537056370573705837059370603706137062370633706437065370663706737068370693707037071370723707337074370753707637077370783707937080370813708237083370843708537086370873708837089370903709137092370933709437095370963709737098370993710037101371023710337104371053710637107371083710937110371113711237113371143711537116371173711837119371203712137122371233712437125371263712737128371293713037131371323713337134371353713637137371383713937140371413714237143371443714537146371473714837149371503715137152371533715437155371563715737158371593716037161371623716337164371653716637167371683716937170371713717237173371743717537176371773717837179371803718137182371833718437185371863718737188371893719037191371923719337194371953719637197371983719937200372013720237203372043720537206372073720837209372103721137212372133721437215372163721737218372193722037221372223722337224372253722637227372283722937230372313723237233372343723537236372373723837239372403724137242372433724437245372463724737248372493725037251372523725337254372553725637257372583725937260372613726237263372643726537266372673726837269372703727137272372733727437275372763727737278372793728037281372823728337284372853728637287372883728937290372913729237293372943729537296372973729837299373003730137302373033730437305373063730737308373093731037311373123731337314373153731637317373183731937320373213732237323373243732537326373273732837329373303733137332373333733437335373363733737338373393734037341373423734337344373453734637347373483734937350373513735237353373543735537356373573735837359373603736137362373633736437365373663736737368373693737037371373723737337374373753737637377373783737937380373813738237383373843738537386373873738837389373903739137392373933739437395373963739737398373993740037401374023740337404374053740637407374083740937410374113741237413374143741537416374173741837419374203742137422374233742437425374263742737428374293743037431374323743337434374353743637437374383743937440374413744237443374443744537446374473744837449374503745137452374533745437455374563745737458374593746037461374623746337464374653746637467374683746937470374713747237473374743747537476374773747837479374803748137482374833748437485374863748737488374893749037491374923749337494374953749637497374983749937500375013750237503375043750537506375073750837509375103751137512375133751437515375163751737518375193752037521375223752337524375253752637527375283752937530375313753237533375343753537536375373753837539375403754137542375433754437545375463754737548375493755037551375523755337554375553755637557375583755937560375613756237563375643756537566375673756837569375703757137572375733757437575375763757737578375793758037581375823758337584375853758637587375883758937590375913759237593375943759537596375973759837599376003760137602376033760437605376063760737608376093761037611376123761337614376153761637617376183761937620376213762237623376243762537626376273762837629376303763137632376333763437635376363763737638376393764037641376423764337644376453764637647376483764937650376513765237653376543765537656376573765837659376603766137662376633766437665376663766737668376693767037671376723767337674376753767637677376783767937680376813768237683376843768537686376873768837689376903769137692376933769437695376963769737698376993770037701377023770337704377053770637707377083770937710377113771237713377143771537716377173771837719377203772137722377233772437725377263772737728377293773037731377323773337734377353773637737377383773937740377413774237743377443774537746377473774837749377503775137752377533775437755377563775737758377593776037761377623776337764377653776637767377683776937770377713777237773377743777537776377773777837779377803778137782377833778437785377863778737788377893779037791377923779337794377953779637797377983779937800378013780237803378043780537806378073780837809378103781137812378133781437815378163781737818378193782037821378223782337824378253782637827378283782937830378313783237833378343783537836378373783837839378403784137842378433784437845378463784737848378493785037851378523785337854378553785637857378583785937860378613786237863378643786537866378673786837869378703787137872378733787437875378763787737878378793788037881378823788337884378853788637887378883788937890378913789237893378943789537896378973789837899379003790137902379033790437905379063790737908379093791037911379123791337914379153791637917379183791937920379213792237923379243792537926379273792837929379303793137932379333793437935379363793737938379393794037941379423794337944379453794637947379483794937950379513795237953379543795537956379573795837959379603796137962379633796437965379663796737968379693797037971379723797337974379753797637977379783797937980379813798237983379843798537986379873798837989379903799137992379933799437995379963799737998379993800038001380023800338004380053800638007380083800938010380113801238013380143801538016380173801838019380203802138022380233802438025380263802738028380293803038031380323803338034380353803638037380383803938040380413804238043380443804538046380473804838049380503805138052380533805438055380563805738058380593806038061380623806338064380653806638067380683806938070380713807238073380743807538076380773807838079380803808138082380833808438085380863808738088380893809038091380923809338094380953809638097380983809938100381013810238103381043810538106381073810838109381103811138112381133811438115381163811738118381193812038121381223812338124381253812638127381283812938130381313813238133381343813538136381373813838139381403814138142381433814438145381463814738148381493815038151381523815338154381553815638157381583815938160381613816238163381643816538166381673816838169381703817138172381733817438175381763817738178381793818038181381823818338184381853818638187381883818938190381913819238193381943819538196381973819838199382003820138202382033820438205382063820738208382093821038211382123821338214382153821638217382183821938220382213822238223382243822538226382273822838229382303823138232382333823438235382363823738238382393824038241382423824338244382453824638247382483824938250382513825238253382543825538256382573825838259382603826138262382633826438265382663826738268382693827038271382723827338274382753827638277382783827938280382813828238283382843828538286382873828838289382903829138292382933829438295382963829738298382993830038301383023830338304383053830638307383083830938310383113831238313383143831538316383173831838319383203832138322383233832438325383263832738328383293833038331383323833338334383353833638337383383833938340383413834238343383443834538346383473834838349383503835138352383533835438355383563835738358383593836038361383623836338364383653836638367383683836938370383713837238373383743837538376383773837838379383803838138382383833838438385383863838738388383893839038391383923839338394383953839638397383983839938400384013840238403384043840538406384073840838409384103841138412384133841438415384163841738418384193842038421384223842338424384253842638427384283842938430384313843238433384343843538436384373843838439384403844138442384433844438445384463844738448384493845038451384523845338454384553845638457384583845938460384613846238463384643846538466384673846838469384703847138472384733847438475384763847738478384793848038481384823848338484384853848638487384883848938490384913849238493384943849538496384973849838499385003850138502385033850438505385063850738508385093851038511385123851338514385153851638517385183851938520385213852238523385243852538526385273852838529385303853138532385333853438535385363853738538385393854038541385423854338544385453854638547385483854938550385513855238553385543855538556385573855838559385603856138562385633856438565385663856738568385693857038571385723857338574385753857638577385783857938580385813858238583385843858538586385873858838589385903859138592385933859438595385963859738598385993860038601386023860338604386053860638607386083860938610386113861238613386143861538616386173861838619386203862138622386233862438625386263862738628386293863038631386323863338634386353863638637386383863938640386413864238643386443864538646386473864838649386503865138652386533865438655386563865738658386593866038661386623866338664386653866638667386683866938670386713867238673386743867538676386773867838679386803868138682386833868438685386863868738688386893869038691386923869338694386953869638697386983869938700387013870238703387043870538706387073870838709387103871138712387133871438715387163871738718387193872038721387223872338724387253872638727387283872938730387313873238733387343873538736387373873838739387403874138742387433874438745387463874738748387493875038751387523875338754387553875638757387583875938760387613876238763387643876538766387673876838769387703877138772387733877438775387763877738778387793878038781387823878338784387853878638787387883878938790387913879238793387943879538796387973879838799388003880138802388033880438805388063880738808388093881038811388123881338814388153881638817388183881938820388213882238823388243882538826388273882838829388303883138832388333883438835388363883738838388393884038841388423884338844388453884638847388483884938850388513885238853388543885538856388573885838859388603886138862388633886438865388663886738868388693887038871388723887338874388753887638877388783887938880388813888238883388843888538886388873888838889388903889138892388933889438895388963889738898388993890038901389023890338904389053890638907389083890938910389113891238913389143891538916389173891838919389203892138922389233892438925389263892738928389293893038931389323893338934389353893638937389383893938940389413894238943389443894538946389473894838949389503895138952389533895438955389563895738958389593896038961389623896338964389653896638967389683896938970389713897238973389743897538976389773897838979389803898138982389833898438985389863898738988389893899038991389923899338994389953899638997389983899939000390013900239003390043900539006390073900839009390103901139012390133901439015390163901739018390193902039021390223902339024390253902639027390283902939030390313903239033390343903539036390373903839039390403904139042390433904439045390463904739048390493905039051390523905339054390553905639057390583905939060390613906239063390643906539066390673906839069390703907139072390733907439075390763907739078390793908039081390823908339084390853908639087390883908939090390913909239093390943909539096390973909839099391003910139102391033910439105391063910739108391093911039111391123911339114391153911639117391183911939120391213912239123391243912539126391273912839129391303913139132391333913439135391363913739138391393914039141391423914339144391453914639147391483914939150391513915239153391543915539156391573915839159391603916139162391633916439165391663916739168391693917039171391723917339174391753917639177391783917939180391813918239183391843918539186391873918839189391903919139192391933919439195391963919739198391993920039201392023920339204392053920639207392083920939210392113921239213392143921539216392173921839219392203922139222392233922439225392263922739228392293923039231392323923339234392353923639237392383923939240392413924239243392443924539246392473924839249392503925139252392533925439255392563925739258392593926039261392623926339264392653926639267392683926939270392713927239273392743927539276392773927839279392803928139282392833928439285392863928739288392893929039291392923929339294392953929639297392983929939300393013930239303393043930539306393073930839309393103931139312393133931439315393163931739318393193932039321393223932339324393253932639327393283932939330393313933239333393343933539336393373933839339393403934139342393433934439345393463934739348393493935039351393523935339354393553935639357393583935939360393613936239363393643936539366393673936839369393703937139372393733937439375393763937739378393793938039381393823938339384393853938639387393883938939390393913939239393393943939539396393973939839399394003940139402394033940439405394063940739408394093941039411394123941339414394153941639417394183941939420394213942239423394243942539426394273942839429394303943139432394333943439435394363943739438394393944039441394423944339444394453944639447394483944939450394513945239453394543945539456394573945839459394603946139462394633946439465394663946739468394693947039471394723947339474394753947639477394783947939480394813948239483394843948539486394873948839489394903949139492394933949439495394963949739498394993950039501395023950339504395053950639507395083950939510395113951239513395143951539516395173951839519395203952139522395233952439525395263952739528395293953039531395323953339534395353953639537395383953939540395413954239543395443954539546395473954839549395503955139552395533955439555395563955739558395593956039561395623956339564395653956639567395683956939570395713957239573395743957539576395773957839579395803958139582395833958439585395863958739588395893959039591395923959339594395953959639597395983959939600396013960239603396043960539606396073960839609396103961139612396133961439615396163961739618396193962039621396223962339624396253962639627396283962939630396313963239633396343963539636396373963839639396403964139642396433964439645396463964739648396493965039651396523965339654396553965639657396583965939660396613966239663396643966539666396673966839669396703967139672396733967439675396763967739678396793968039681396823968339684396853968639687396883968939690396913969239693396943969539696396973969839699397003970139702397033970439705397063970739708397093971039711397123971339714397153971639717397183971939720397213972239723397243972539726397273972839729397303973139732397333973439735397363973739738397393974039741397423974339744397453974639747397483974939750397513975239753397543975539756397573975839759397603976139762397633976439765397663976739768397693977039771397723977339774397753977639777397783977939780397813978239783397843978539786397873978839789397903979139792397933979439795397963979739798397993980039801398023980339804398053980639807398083980939810398113981239813398143981539816398173981839819398203982139822398233982439825398263982739828398293983039831398323983339834398353983639837398383983939840398413984239843398443984539846398473984839849398503985139852398533985439855398563985739858398593986039861398623986339864398653986639867398683986939870398713987239873398743987539876398773987839879398803988139882398833988439885398863988739888398893989039891398923989339894398953989639897398983989939900399013990239903399043990539906399073990839909399103991139912399133991439915399163991739918399193992039921399223992339924399253992639927399283992939930399313993239933399343993539936399373993839939399403994139942399433994439945399463994739948399493995039951399523995339954399553995639957399583995939960399613996239963399643996539966399673996839969399703997139972399733997439975399763997739978399793998039981399823998339984399853998639987399883998939990399913999239993399943999539996399973999839999400004000140002400034000440005400064000740008400094001040011400124001340014400154001640017400184001940020400214002240023400244002540026400274002840029400304003140032400334003440035400364003740038400394004040041400424004340044400454004640047400484004940050400514005240053400544005540056400574005840059400604006140062400634006440065400664006740068400694007040071400724007340074400754007640077400784007940080400814008240083400844008540086400874008840089400904009140092400934009440095400964009740098400994010040101401024010340104401054010640107401084010940110401114011240113401144011540116401174011840119401204012140122401234012440125401264012740128401294013040131401324013340134401354013640137401384013940140401414014240143401444014540146401474014840149401504015140152401534015440155401564015740158401594016040161401624016340164401654016640167401684016940170401714017240173401744017540176401774017840179401804018140182401834018440185401864018740188401894019040191401924019340194401954019640197401984019940200402014020240203402044020540206402074020840209402104021140212402134021440215402164021740218402194022040221402224022340224402254022640227402284022940230402314023240233402344023540236402374023840239402404024140242402434024440245402464024740248402494025040251402524025340254402554025640257402584025940260402614026240263402644026540266402674026840269402704027140272402734027440275402764027740278402794028040281402824028340284402854028640287402884028940290402914029240293402944029540296402974029840299403004030140302403034030440305403064030740308403094031040311403124031340314403154031640317403184031940320403214032240323403244032540326403274032840329403304033140332403334033440335403364033740338403394034040341403424034340344403454034640347403484034940350403514035240353403544035540356403574035840359403604036140362403634036440365403664036740368403694037040371403724037340374403754037640377403784037940380403814038240383403844038540386403874038840389403904039140392403934039440395403964039740398403994040040401404024040340404404054040640407404084040940410404114041240413404144041540416404174041840419404204042140422404234042440425404264042740428404294043040431404324043340434404354043640437404384043940440404414044240443404444044540446404474044840449404504045140452404534045440455404564045740458404594046040461404624046340464404654046640467404684046940470404714047240473404744047540476404774047840479404804048140482404834048440485404864048740488404894049040491404924049340494404954049640497404984049940500405014050240503405044050540506405074050840509405104051140512405134051440515405164051740518405194052040521405224052340524405254052640527405284052940530405314053240533405344053540536405374053840539405404054140542405434054440545405464054740548405494055040551405524055340554405554055640557405584055940560405614056240563405644056540566405674056840569405704057140572405734057440575405764057740578405794058040581405824058340584405854058640587405884058940590405914059240593405944059540596405974059840599406004060140602406034060440605406064060740608406094061040611406124061340614406154061640617406184061940620406214062240623406244062540626406274062840629406304063140632406334063440635406364063740638406394064040641406424064340644406454064640647406484064940650406514065240653406544065540656406574065840659406604066140662406634066440665406664066740668406694067040671406724067340674406754067640677406784067940680406814068240683406844068540686406874068840689406904069140692406934069440695406964069740698406994070040701407024070340704407054070640707407084070940710407114071240713407144071540716407174071840719407204072140722407234072440725407264072740728407294073040731407324073340734407354073640737407384073940740407414074240743407444074540746407474074840749407504075140752407534075440755407564075740758407594076040761407624076340764407654076640767407684076940770407714077240773407744077540776407774077840779407804078140782407834078440785407864078740788407894079040791407924079340794407954079640797407984079940800408014080240803408044080540806408074080840809408104081140812408134081440815408164081740818408194082040821408224082340824408254082640827408284082940830408314083240833408344083540836408374083840839408404084140842408434084440845408464084740848408494085040851408524085340854408554085640857408584085940860408614086240863408644086540866408674086840869408704087140872408734087440875408764087740878408794088040881408824088340884408854088640887408884088940890408914089240893408944089540896408974089840899409004090140902409034090440905409064090740908409094091040911409124091340914409154091640917409184091940920409214092240923409244092540926409274092840929409304093140932409334093440935409364093740938409394094040941409424094340944409454094640947409484094940950409514095240953409544095540956409574095840959409604096140962409634096440965409664096740968409694097040971409724097340974409754097640977409784097940980409814098240983409844098540986409874098840989409904099140992409934099440995409964099740998409994100041001410024100341004410054100641007410084100941010410114101241013410144101541016410174101841019410204102141022410234102441025410264102741028410294103041031410324103341034410354103641037410384103941040410414104241043410444104541046410474104841049410504105141052410534105441055410564105741058410594106041061410624106341064410654106641067410684106941070410714107241073410744107541076410774107841079410804108141082410834108441085410864108741088410894109041091410924109341094410954109641097410984109941100411014110241103411044110541106411074110841109411104111141112411134111441115411164111741118411194112041121411224112341124411254112641127411284112941130411314113241133411344113541136411374113841139411404114141142411434114441145411464114741148411494115041151411524115341154411554115641157411584115941160411614116241163411644116541166411674116841169411704117141172411734117441175411764117741178411794118041181411824118341184411854118641187411884118941190411914119241193411944119541196411974119841199412004120141202412034120441205412064120741208412094121041211412124121341214412154121641217412184121941220412214122241223412244122541226412274122841229412304123141232412334123441235412364123741238412394124041241412424124341244412454124641247412484124941250412514125241253412544125541256412574125841259412604126141262412634126441265412664126741268412694127041271412724127341274412754127641277412784127941280412814128241283412844128541286412874128841289412904129141292412934129441295412964129741298412994130041301413024130341304413054130641307413084130941310413114131241313413144131541316413174131841319413204132141322413234132441325413264132741328413294133041331413324133341334413354133641337413384133941340413414134241343413444134541346413474134841349413504135141352413534135441355413564135741358413594136041361413624136341364413654136641367413684136941370413714137241373413744137541376413774137841379413804138141382413834138441385413864138741388413894139041391413924139341394413954139641397413984139941400414014140241403414044140541406414074140841409414104141141412414134141441415414164141741418414194142041421414224142341424414254142641427414284142941430414314143241433414344143541436414374143841439414404144141442414434144441445414464144741448414494145041451414524145341454414554145641457414584145941460414614146241463414644146541466414674146841469414704147141472414734147441475414764147741478414794148041481414824148341484414854148641487414884148941490414914149241493414944149541496414974149841499415004150141502415034150441505415064150741508415094151041511415124151341514415154151641517415184151941520415214152241523415244152541526415274152841529415304153141532415334153441535415364153741538415394154041541415424154341544415454154641547415484154941550415514155241553415544155541556415574155841559415604156141562415634156441565415664156741568415694157041571415724157341574415754157641577415784157941580415814158241583415844158541586415874158841589415904159141592415934159441595415964159741598415994160041601416024160341604416054160641607416084160941610416114161241613416144161541616416174161841619416204162141622416234162441625416264162741628416294163041631416324163341634416354163641637416384163941640416414164241643416444164541646416474164841649416504165141652416534165441655416564165741658416594166041661416624166341664416654166641667416684166941670416714167241673416744167541676416774167841679416804168141682416834168441685416864168741688416894169041691416924169341694416954169641697416984169941700417014170241703417044170541706417074170841709417104171141712417134171441715417164171741718417194172041721417224172341724417254172641727417284172941730417314173241733417344173541736417374173841739417404174141742417434174441745417464174741748417494175041751417524175341754417554175641757417584175941760417614176241763417644176541766417674176841769417704177141772417734177441775417764177741778417794178041781417824178341784417854178641787417884178941790417914179241793417944179541796417974179841799418004180141802418034180441805418064180741808418094181041811418124181341814418154181641817418184181941820418214182241823418244182541826418274182841829418304183141832418334183441835418364183741838418394184041841418424184341844418454184641847418484184941850418514185241853418544185541856418574185841859418604186141862418634186441865418664186741868418694187041871418724187341874418754187641877418784187941880418814188241883418844188541886418874188841889418904189141892418934189441895418964189741898418994190041901419024190341904419054190641907419084190941910419114191241913419144191541916419174191841919419204192141922419234192441925419264192741928419294193041931419324193341934419354193641937419384193941940419414194241943419444194541946419474194841949419504195141952419534195441955419564195741958419594196041961419624196341964419654196641967419684196941970419714197241973419744197541976419774197841979419804198141982419834198441985419864198741988419894199041991419924199341994419954199641997419984199942000420014200242003420044200542006420074200842009420104201142012420134201442015420164201742018420194202042021420224202342024420254202642027420284202942030420314203242033420344203542036420374203842039420404204142042420434204442045420464204742048420494205042051420524205342054420554205642057420584205942060420614206242063420644206542066420674206842069420704207142072420734207442075420764207742078420794208042081420824208342084420854208642087420884208942090420914209242093420944209542096420974209842099421004210142102421034210442105421064210742108421094211042111421124211342114421154211642117421184211942120421214212242123421244212542126421274212842129421304213142132421334213442135421364213742138421394214042141421424214342144421454214642147421484214942150421514215242153421544215542156421574215842159421604216142162421634216442165421664216742168421694217042171421724217342174421754217642177421784217942180421814218242183421844218542186421874218842189421904219142192421934219442195421964219742198421994220042201422024220342204422054220642207422084220942210422114221242213422144221542216422174221842219422204222142222422234222442225422264222742228422294223042231422324223342234422354223642237422384223942240422414224242243422444224542246422474224842249422504225142252422534225442255422564225742258422594226042261422624226342264422654226642267422684226942270422714227242273422744227542276422774227842279422804228142282422834228442285422864228742288422894229042291422924229342294422954229642297422984229942300423014230242303423044230542306423074230842309423104231142312423134231442315423164231742318423194232042321423224232342324423254232642327423284232942330423314233242333423344233542336423374233842339423404234142342423434234442345423464234742348423494235042351423524235342354423554235642357423584235942360423614236242363423644236542366423674236842369423704237142372423734237442375423764237742378423794238042381423824238342384423854238642387423884238942390423914239242393423944239542396423974239842399424004240142402424034240442405424064240742408424094241042411424124241342414424154241642417424184241942420424214242242423424244242542426424274242842429424304243142432424334243442435424364243742438424394244042441424424244342444424454244642447424484244942450424514245242453424544245542456424574245842459424604246142462424634246442465424664246742468424694247042471424724247342474424754247642477424784247942480424814248242483424844248542486424874248842489424904249142492424934249442495424964249742498424994250042501425024250342504425054250642507425084250942510425114251242513425144251542516425174251842519425204252142522425234252442525425264252742528425294253042531425324253342534425354253642537425384253942540425414254242543425444254542546425474254842549425504255142552425534255442555425564255742558425594256042561425624256342564425654256642567425684256942570425714257242573425744257542576425774257842579425804258142582425834258442585425864258742588425894259042591425924259342594425954259642597425984259942600426014260242603426044260542606426074260842609426104261142612426134261442615426164261742618426194262042621426224262342624426254262642627426284262942630426314263242633426344263542636426374263842639426404264142642426434264442645426464264742648426494265042651426524265342654426554265642657426584265942660426614266242663426644266542666426674266842669426704267142672426734267442675426764267742678426794268042681426824268342684426854268642687426884268942690426914269242693426944269542696426974269842699427004270142702427034270442705427064270742708427094271042711427124271342714427154271642717427184271942720427214272242723427244272542726427274272842729427304273142732427334273442735427364273742738427394274042741427424274342744427454274642747427484274942750427514275242753427544275542756427574275842759427604276142762427634276442765427664276742768427694277042771427724277342774427754277642777427784277942780427814278242783427844278542786427874278842789427904279142792427934279442795427964279742798427994280042801428024280342804428054280642807428084280942810428114281242813428144281542816428174281842819428204282142822428234282442825428264282742828428294283042831428324283342834428354283642837428384283942840428414284242843428444284542846428474284842849428504285142852428534285442855428564285742858428594286042861428624286342864428654286642867428684286942870428714287242873428744287542876428774287842879428804288142882428834288442885428864288742888428894289042891428924289342894428954289642897428984289942900429014290242903429044290542906429074290842909429104291142912429134291442915429164291742918429194292042921429224292342924429254292642927429284292942930429314293242933429344293542936429374293842939429404294142942429434294442945429464294742948429494295042951429524295342954429554295642957429584295942960429614296242963429644296542966429674296842969429704297142972429734297442975429764297742978429794298042981429824298342984429854298642987429884298942990429914299242993429944299542996429974299842999430004300143002430034300443005430064300743008430094301043011430124301343014430154301643017430184301943020430214302243023430244302543026430274302843029430304303143032430334303443035430364303743038430394304043041430424304343044430454304643047430484304943050430514305243053430544305543056430574305843059430604306143062430634306443065430664306743068430694307043071430724307343074430754307643077430784307943080430814308243083430844308543086430874308843089430904309143092430934309443095430964309743098430994310043101431024310343104431054310643107431084310943110431114311243113431144311543116431174311843119431204312143122431234312443125431264312743128431294313043131431324313343134431354313643137431384313943140431414314243143431444314543146431474314843149431504315143152431534315443155431564315743158431594316043161431624316343164431654316643167431684316943170431714317243173431744317543176431774317843179431804318143182431834318443185431864318743188431894319043191431924319343194431954319643197431984319943200432014320243203432044320543206432074320843209432104321143212432134321443215432164321743218432194322043221432224322343224432254322643227432284322943230432314323243233432344323543236432374323843239432404324143242432434324443245432464324743248432494325043251432524325343254432554325643257432584325943260432614326243263432644326543266432674326843269432704327143272432734327443275432764327743278432794328043281432824328343284432854328643287432884328943290432914329243293432944329543296432974329843299433004330143302433034330443305433064330743308433094331043311433124331343314433154331643317433184331943320433214332243323433244332543326433274332843329433304333143332433334333443335433364333743338433394334043341433424334343344433454334643347433484334943350433514335243353433544335543356433574335843359433604336143362433634336443365433664336743368433694337043371433724337343374433754337643377433784337943380433814338243383433844338543386433874338843389433904339143392433934339443395433964339743398433994340043401434024340343404434054340643407434084340943410434114341243413434144341543416434174341843419434204342143422434234342443425434264342743428434294343043431434324343343434434354343643437434384343943440434414344243443434444344543446434474344843449434504345143452434534345443455434564345743458434594346043461434624346343464434654346643467434684346943470434714347243473434744347543476434774347843479434804348143482434834348443485434864348743488434894349043491434924349343494434954349643497434984349943500435014350243503435044350543506435074350843509435104351143512435134351443515435164351743518435194352043521435224352343524435254352643527435284352943530435314353243533435344353543536435374353843539435404354143542435434354443545435464354743548435494355043551435524355343554435554355643557435584355943560435614356243563435644356543566435674356843569435704357143572435734357443575435764357743578435794358043581435824358343584435854358643587435884358943590435914359243593435944359543596435974359843599436004360143602436034360443605436064360743608436094361043611436124361343614436154361643617436184361943620436214362243623436244362543626436274362843629436304363143632436334363443635436364363743638436394364043641436424364343644436454364643647436484364943650436514365243653436544365543656436574365843659436604366143662436634366443665436664366743668436694367043671436724367343674436754367643677436784367943680436814368243683436844368543686436874368843689436904369143692436934369443695436964369743698436994370043701437024370343704437054370643707437084370943710437114371243713437144371543716437174371843719437204372143722437234372443725437264372743728437294373043731437324373343734437354373643737437384373943740437414374243743437444374543746437474374843749437504375143752437534375443755437564375743758437594376043761437624376343764437654376643767437684376943770437714377243773437744377543776437774377843779437804378143782437834378443785437864378743788437894379043791437924379343794437954379643797437984379943800438014380243803438044380543806438074380843809438104381143812438134381443815438164381743818438194382043821438224382343824438254382643827438284382943830438314383243833438344383543836438374383843839438404384143842438434384443845438464384743848438494385043851438524385343854438554385643857438584385943860438614386243863438644386543866438674386843869438704387143872438734387443875438764387743878438794388043881438824388343884438854388643887438884388943890438914389243893438944389543896438974389843899439004390143902439034390443905439064390743908439094391043911439124391343914439154391643917439184391943920439214392243923439244392543926439274392843929439304393143932439334393443935439364393743938439394394043941439424394343944439454394643947439484394943950439514395243953439544395543956439574395843959439604396143962439634396443965439664396743968439694397043971439724397343974439754397643977439784397943980439814398243983439844398543986439874398843989439904399143992439934399443995439964399743998439994400044001440024400344004440054400644007440084400944010440114401244013440144401544016440174401844019440204402144022440234402444025440264402744028440294403044031440324403344034440354403644037440384403944040440414404244043440444404544046440474404844049440504405144052440534405444055440564405744058440594406044061440624406344064440654406644067440684406944070440714407244073440744407544076440774407844079440804408144082440834408444085440864408744088440894409044091440924409344094440954409644097440984409944100441014410244103441044410544106441074410844109441104411144112441134411444115441164411744118441194412044121441224412344124441254412644127441284412944130441314413244133441344413544136441374413844139441404414144142441434414444145441464414744148441494415044151441524415344154441554415644157441584415944160441614416244163441644416544166441674416844169441704417144172441734417444175441764417744178441794418044181441824418344184441854418644187441884418944190441914419244193441944419544196441974419844199442004420144202442034420444205442064420744208442094421044211442124421344214442154421644217442184421944220442214422244223442244422544226442274422844229442304423144232442334423444235442364423744238442394424044241442424424344244442454424644247442484424944250442514425244253442544425544256442574425844259442604426144262442634426444265442664426744268442694427044271442724427344274442754427644277442784427944280442814428244283442844428544286442874428844289442904429144292442934429444295442964429744298442994430044301443024430344304443054430644307443084430944310443114431244313443144431544316443174431844319443204432144322443234432444325443264432744328443294433044331443324433344334443354433644337443384433944340443414434244343443444434544346443474434844349443504435144352443534435444355443564435744358443594436044361443624436344364443654436644367443684436944370443714437244373443744437544376443774437844379443804438144382443834438444385443864438744388443894439044391443924439344394443954439644397443984439944400444014440244403444044440544406444074440844409444104441144412444134441444415444164441744418444194442044421444224442344424444254442644427444284442944430444314443244433444344443544436444374443844439444404444144442444434444444445444464444744448444494445044451444524445344454444554445644457444584445944460444614446244463444644446544466444674446844469444704447144472444734447444475444764447744478444794448044481444824448344484444854448644487444884448944490444914449244493444944449544496444974449844499445004450144502445034450444505445064450744508445094451044511445124451344514445154451644517445184451944520445214452244523445244452544526445274452844529445304453144532445334453444535445364453744538445394454044541445424454344544445454454644547445484454944550445514455244553445544455544556445574455844559445604456144562445634456444565445664456744568445694457044571445724457344574445754457644577445784457944580445814458244583445844458544586445874458844589445904459144592445934459444595445964459744598445994460044601446024460344604446054460644607446084460944610446114461244613446144461544616446174461844619446204462144622446234462444625446264462744628446294463044631446324463344634446354463644637446384463944640446414464244643446444464544646446474464844649446504465144652446534465444655446564465744658446594466044661446624466344664446654466644667446684466944670446714467244673446744467544676446774467844679446804468144682446834468444685446864468744688446894469044691446924469344694446954469644697446984469944700447014470244703447044470544706447074470844709447104471144712447134471444715447164471744718447194472044721447224472344724447254472644727447284472944730447314473244733447344473544736447374473844739447404474144742447434474444745447464474744748447494475044751447524475344754447554475644757447584475944760447614476244763447644476544766447674476844769447704477144772447734477444775447764477744778447794478044781447824478344784447854478644787447884478944790447914479244793447944479544796447974479844799448004480144802448034480444805448064480744808448094481044811448124481344814448154481644817448184481944820448214482244823448244482544826448274482844829448304483144832448334483444835448364483744838448394484044841448424484344844448454484644847448484484944850448514485244853448544485544856448574485844859448604486144862448634486444865448664486744868448694487044871448724487344874448754487644877448784487944880448814488244883448844488544886448874488844889448904489144892448934489444895448964489744898448994490044901449024490344904449054490644907449084490944910449114491244913449144491544916449174491844919449204492144922449234492444925449264492744928449294493044931449324493344934449354493644937449384493944940449414494244943449444494544946449474494844949449504495144952449534495444955449564495744958449594496044961449624496344964449654496644967449684496944970449714497244973449744497544976449774497844979449804498144982449834498444985449864498744988449894499044991449924499344994449954499644997449984499945000450014500245003450044500545006450074500845009450104501145012450134501445015450164501745018450194502045021450224502345024450254502645027450284502945030450314503245033450344503545036450374503845039450404504145042450434504445045450464504745048450494505045051450524505345054450554505645057450584505945060450614506245063450644506545066450674506845069450704507145072450734507445075450764507745078450794508045081450824508345084450854508645087450884508945090450914509245093450944509545096450974509845099451004510145102451034510445105451064510745108451094511045111451124511345114451154511645117451184511945120451214512245123451244512545126451274512845129451304513145132451334513445135451364513745138451394514045141451424514345144451454514645147451484514945150451514515245153451544515545156451574515845159451604516145162451634516445165451664516745168451694517045171451724517345174451754517645177451784517945180451814518245183451844518545186451874518845189451904519145192451934519445195451964519745198451994520045201452024520345204452054520645207452084520945210452114521245213452144521545216452174521845219452204522145222452234522445225452264522745228452294523045231452324523345234452354523645237452384523945240452414524245243452444524545246452474524845249452504525145252452534525445255452564525745258452594526045261452624526345264452654526645267452684526945270452714527245273452744527545276452774527845279452804528145282452834528445285452864528745288452894529045291452924529345294452954529645297452984529945300453014530245303453044530545306453074530845309453104531145312453134531445315453164531745318453194532045321453224532345324453254532645327453284532945330453314533245333453344533545336453374533845339453404534145342453434534445345453464534745348453494535045351453524535345354453554535645357453584535945360453614536245363453644536545366453674536845369453704537145372453734537445375453764537745378453794538045381453824538345384453854538645387453884538945390453914539245393453944539545396453974539845399454004540145402454034540445405454064540745408454094541045411454124541345414454154541645417454184541945420454214542245423454244542545426454274542845429454304543145432454334543445435454364543745438454394544045441454424544345444454454544645447454484544945450454514545245453454544545545456454574545845459454604546145462454634546445465454664546745468454694547045471454724547345474454754547645477454784547945480454814548245483454844548545486454874548845489454904549145492454934549445495454964549745498454994550045501455024550345504455054550645507455084550945510455114551245513455144551545516455174551845519455204552145522455234552445525455264552745528455294553045531455324553345534455354553645537455384553945540455414554245543455444554545546455474554845549455504555145552455534555445555455564555745558455594556045561455624556345564455654556645567455684556945570455714557245573455744557545576455774557845579455804558145582455834558445585455864558745588455894559045591455924559345594455954559645597455984559945600456014560245603456044560545606456074560845609456104561145612456134561445615456164561745618456194562045621456224562345624456254562645627456284562945630456314563245633456344563545636456374563845639456404564145642456434564445645456464564745648456494565045651456524565345654456554565645657456584565945660456614566245663456644566545666456674566845669456704567145672456734567445675456764567745678456794568045681456824568345684456854568645687456884568945690456914569245693456944569545696456974569845699457004570145702457034570445705457064570745708457094571045711457124571345714457154571645717457184571945720457214572245723457244572545726457274572845729457304573145732457334573445735457364573745738457394574045741457424574345744457454574645747457484574945750457514575245753457544575545756457574575845759457604576145762457634576445765457664576745768457694577045771457724577345774457754577645777457784577945780457814578245783457844578545786457874578845789457904579145792457934579445795457964579745798457994580045801458024580345804458054580645807458084580945810458114581245813458144581545816458174581845819458204582145822458234582445825458264582745828458294583045831458324583345834458354583645837458384583945840458414584245843458444584545846458474584845849458504585145852458534585445855458564585745858458594586045861458624586345864458654586645867458684586945870458714587245873458744587545876458774587845879458804588145882458834588445885458864588745888458894589045891458924589345894458954589645897458984589945900459014590245903459044590545906459074590845909459104591145912459134591445915459164591745918459194592045921459224592345924459254592645927459284592945930459314593245933459344593545936459374593845939459404594145942459434594445945459464594745948459494595045951459524595345954459554595645957459584595945960459614596245963459644596545966459674596845969459704597145972459734597445975459764597745978459794598045981459824598345984459854598645987459884598945990459914599245993459944599545996459974599845999460004600146002460034600446005460064600746008460094601046011460124601346014460154601646017460184601946020460214602246023460244602546026460274602846029460304603146032460334603446035460364603746038460394604046041460424604346044460454604646047460484604946050460514605246053460544605546056460574605846059460604606146062460634606446065460664606746068460694607046071460724607346074460754607646077460784607946080460814608246083460844608546086460874608846089460904609146092460934609446095460964609746098460994610046101461024610346104461054610646107461084610946110461114611246113461144611546116461174611846119461204612146122461234612446125461264612746128461294613046131461324613346134461354613646137461384613946140461414614246143461444614546146461474614846149461504615146152461534615446155461564615746158461594616046161461624616346164461654616646167461684616946170461714617246173461744617546176461774617846179461804618146182461834618446185461864618746188461894619046191461924619346194461954619646197461984619946200462014620246203462044620546206462074620846209462104621146212462134621446215462164621746218462194622046221462224622346224462254622646227462284622946230462314623246233462344623546236462374623846239462404624146242462434624446245462464624746248462494625046251462524625346254462554625646257462584625946260462614626246263462644626546266462674626846269462704627146272462734627446275462764627746278462794628046281462824628346284462854628646287462884628946290462914629246293462944629546296462974629846299463004630146302463034630446305463064630746308463094631046311463124631346314463154631646317463184631946320463214632246323463244632546326463274632846329463304633146332463334633446335463364633746338463394634046341463424634346344463454634646347463484634946350463514635246353463544635546356463574635846359463604636146362463634636446365463664636746368463694637046371463724637346374463754637646377463784637946380463814638246383463844638546386463874638846389463904639146392463934639446395463964639746398463994640046401464024640346404464054640646407464084640946410464114641246413464144641546416464174641846419464204642146422464234642446425464264642746428464294643046431464324643346434464354643646437464384643946440464414644246443464444644546446464474644846449464504645146452464534645446455464564645746458464594646046461464624646346464464654646646467464684646946470464714647246473464744647546476464774647846479464804648146482464834648446485464864648746488464894649046491464924649346494464954649646497464984649946500465014650246503465044650546506465074650846509465104651146512465134651446515465164651746518465194652046521465224652346524465254652646527465284652946530465314653246533465344653546536465374653846539465404654146542465434654446545465464654746548465494655046551465524655346554465554655646557465584655946560465614656246563465644656546566465674656846569465704657146572465734657446575465764657746578465794658046581465824658346584465854658646587465884658946590465914659246593465944659546596465974659846599466004660146602466034660446605466064660746608466094661046611466124661346614466154661646617466184661946620466214662246623466244662546626466274662846629466304663146632466334663446635466364663746638466394664046641466424664346644466454664646647466484664946650466514665246653466544665546656466574665846659466604666146662466634666446665466664666746668466694667046671466724667346674466754667646677466784667946680466814668246683466844668546686466874668846689466904669146692466934669446695466964669746698466994670046701467024670346704467054670646707467084670946710467114671246713467144671546716467174671846719467204672146722467234672446725467264672746728467294673046731467324673346734467354673646737467384673946740467414674246743467444674546746467474674846749467504675146752467534675446755467564675746758467594676046761467624676346764467654676646767467684676946770467714677246773467744677546776467774677846779467804678146782467834678446785467864678746788467894679046791467924679346794467954679646797467984679946800468014680246803468044680546806468074680846809468104681146812468134681446815468164681746818468194682046821468224682346824468254682646827468284682946830468314683246833468344683546836468374683846839468404684146842468434684446845468464684746848468494685046851468524685346854468554685646857468584685946860468614686246863468644686546866468674686846869468704687146872468734687446875468764687746878468794688046881468824688346884468854688646887468884688946890468914689246893468944689546896468974689846899469004690146902469034690446905469064690746908469094691046911469124691346914469154691646917469184691946920469214692246923469244692546926469274692846929469304693146932469334693446935469364693746938469394694046941469424694346944469454694646947469484694946950469514695246953469544695546956469574695846959469604696146962469634696446965469664696746968469694697046971469724697346974469754697646977469784697946980469814698246983469844698546986469874698846989469904699146992469934699446995469964699746998469994700047001470024700347004470054700647007470084700947010470114701247013470144701547016470174701847019470204702147022470234702447025470264702747028470294703047031470324703347034470354703647037470384703947040470414704247043470444704547046470474704847049470504705147052470534705447055470564705747058470594706047061470624706347064470654706647067470684706947070470714707247073470744707547076470774707847079470804708147082470834708447085470864708747088470894709047091470924709347094470954709647097470984709947100471014710247103471044710547106471074710847109471104711147112471134711447115471164711747118471194712047121471224712347124471254712647127471284712947130471314713247133471344713547136471374713847139471404714147142471434714447145471464714747148471494715047151471524715347154471554715647157471584715947160471614716247163471644716547166471674716847169471704717147172471734717447175471764717747178471794718047181471824718347184471854718647187471884718947190471914719247193471944719547196471974719847199472004720147202472034720447205472064720747208472094721047211472124721347214472154721647217472184721947220472214722247223472244722547226472274722847229472304723147232472334723447235472364723747238472394724047241472424724347244472454724647247472484724947250472514725247253472544725547256472574725847259472604726147262472634726447265472664726747268472694727047271472724727347274472754727647277472784727947280472814728247283472844728547286472874728847289472904729147292472934729447295472964729747298472994730047301473024730347304473054730647307473084730947310473114731247313473144731547316473174731847319473204732147322473234732447325473264732747328473294733047331473324733347334473354733647337473384733947340473414734247343473444734547346473474734847349473504735147352473534735447355473564735747358473594736047361473624736347364473654736647367473684736947370473714737247373473744737547376473774737847379473804738147382473834738447385473864738747388473894739047391473924739347394473954739647397473984739947400474014740247403474044740547406474074740847409474104741147412474134741447415474164741747418474194742047421474224742347424474254742647427474284742947430474314743247433474344743547436474374743847439474404744147442474434744447445474464744747448474494745047451474524745347454474554745647457474584745947460474614746247463474644746547466474674746847469474704747147472474734747447475474764747747478474794748047481474824748347484474854748647487474884748947490474914749247493474944749547496474974749847499475004750147502475034750447505475064750747508475094751047511475124751347514475154751647517475184751947520475214752247523475244752547526475274752847529475304753147532475334753447535475364753747538475394754047541475424754347544475454754647547475484754947550475514755247553475544755547556475574755847559475604756147562475634756447565475664756747568475694757047571475724757347574475754757647577475784757947580475814758247583475844758547586475874758847589475904759147592475934759447595475964759747598475994760047601476024760347604476054760647607476084760947610476114761247613476144761547616476174761847619476204762147622476234762447625476264762747628476294763047631476324763347634476354763647637476384763947640476414764247643476444764547646476474764847649476504765147652476534765447655476564765747658476594766047661476624766347664476654766647667476684766947670476714767247673476744767547676476774767847679476804768147682476834768447685476864768747688476894769047691476924769347694476954769647697476984769947700477014770247703477044770547706477074770847709477104771147712477134771447715477164771747718477194772047721477224772347724477254772647727477284772947730477314773247733477344773547736477374773847739477404774147742477434774447745477464774747748477494775047751477524775347754477554775647757477584775947760477614776247763477644776547766477674776847769477704777147772477734777447775477764777747778477794778047781477824778347784477854778647787477884778947790477914779247793477944779547796477974779847799478004780147802478034780447805478064780747808478094781047811478124781347814478154781647817478184781947820478214782247823478244782547826478274782847829478304783147832478334783447835478364783747838478394784047841478424784347844478454784647847478484784947850478514785247853478544785547856478574785847859478604786147862478634786447865478664786747868478694787047871478724787347874478754787647877478784787947880478814788247883478844788547886478874788847889478904789147892478934789447895478964789747898478994790047901479024790347904479054790647907479084790947910479114791247913479144791547916479174791847919479204792147922479234792447925479264792747928479294793047931479324793347934479354793647937479384793947940479414794247943479444794547946479474794847949479504795147952479534795447955479564795747958479594796047961479624796347964479654796647967479684796947970479714797247973479744797547976479774797847979479804798147982479834798447985479864798747988479894799047991479924799347994479954799647997479984799948000480014800248003480044800548006480074800848009480104801148012480134801448015480164801748018480194802048021480224802348024480254802648027480284802948030480314803248033480344803548036480374803848039480404804148042480434804448045480464804748048480494805048051480524805348054480554805648057480584805948060480614806248063480644806548066480674806848069480704807148072480734807448075480764807748078480794808048081480824808348084480854808648087480884808948090480914809248093480944809548096480974809848099481004810148102481034810448105481064810748108481094811048111481124811348114481154811648117481184811948120481214812248123481244812548126481274812848129481304813148132481334813448135481364813748138481394814048141481424814348144481454814648147481484814948150481514815248153481544815548156481574815848159481604816148162481634816448165481664816748168481694817048171481724817348174481754817648177481784817948180481814818248183481844818548186481874818848189481904819148192481934819448195481964819748198481994820048201482024820348204482054820648207482084820948210482114821248213482144821548216482174821848219482204822148222482234822448225482264822748228482294823048231482324823348234482354823648237482384823948240482414824248243482444824548246482474824848249482504825148252482534825448255482564825748258482594826048261482624826348264482654826648267482684826948270482714827248273482744827548276482774827848279482804828148282482834828448285482864828748288482894829048291482924829348294482954829648297482984829948300483014830248303483044830548306483074830848309483104831148312483134831448315483164831748318483194832048321483224832348324483254832648327483284832948330483314833248333483344833548336483374833848339483404834148342483434834448345483464834748348483494835048351483524835348354483554835648357483584835948360483614836248363483644836548366483674836848369483704837148372483734837448375483764837748378483794838048381483824838348384483854838648387483884838948390483914839248393483944839548396483974839848399484004840148402484034840448405484064840748408484094841048411484124841348414484154841648417484184841948420484214842248423484244842548426484274842848429484304843148432484334843448435484364843748438484394844048441484424844348444484454844648447484484844948450484514845248453484544845548456484574845848459484604846148462484634846448465484664846748468484694847048471484724847348474484754847648477484784847948480484814848248483484844848548486484874848848489484904849148492484934849448495484964849748498484994850048501485024850348504485054850648507485084850948510485114851248513485144851548516485174851848519485204852148522485234852448525485264852748528485294853048531485324853348534485354853648537485384853948540485414854248543485444854548546485474854848549485504855148552485534855448555485564855748558485594856048561485624856348564485654856648567485684856948570485714857248573485744857548576485774857848579485804858148582485834858448585485864858748588485894859048591485924859348594485954859648597485984859948600486014860248603486044860548606486074860848609486104861148612486134861448615486164861748618486194862048621486224862348624486254862648627486284862948630486314863248633486344863548636486374863848639486404864148642486434864448645486464864748648486494865048651486524865348654486554865648657486584865948660486614866248663486644866548666486674866848669486704867148672486734867448675486764867748678486794868048681486824868348684486854868648687486884868948690486914869248693486944869548696486974869848699487004870148702487034870448705487064870748708487094871048711487124871348714487154871648717487184871948720487214872248723487244872548726487274872848729487304873148732487334873448735487364873748738487394874048741487424874348744487454874648747487484874948750487514875248753487544875548756487574875848759487604876148762487634876448765487664876748768487694877048771487724877348774487754877648777487784877948780487814878248783487844878548786487874878848789487904879148792487934879448795487964879748798487994880048801488024880348804488054880648807488084880948810488114881248813488144881548816488174881848819488204882148822488234882448825488264882748828488294883048831488324883348834488354883648837488384883948840488414884248843488444884548846488474884848849488504885148852488534885448855488564885748858488594886048861488624886348864488654886648867488684886948870488714887248873488744887548876488774887848879488804888148882488834888448885488864888748888488894889048891488924889348894488954889648897488984889948900489014890248903489044890548906489074890848909489104891148912489134891448915489164891748918489194892048921489224892348924489254892648927489284892948930489314893248933489344893548936489374893848939489404894148942489434894448945489464894748948489494895048951489524895348954489554895648957489584895948960489614896248963489644896548966489674896848969489704897148972489734897448975489764897748978489794898048981489824898348984489854898648987489884898948990489914899248993489944899548996489974899848999490004900149002490034900449005490064900749008490094901049011490124901349014490154901649017490184901949020490214902249023490244902549026490274902849029490304903149032490334903449035490364903749038490394904049041490424904349044490454904649047490484904949050490514905249053490544905549056490574905849059490604906149062490634906449065490664906749068490694907049071490724907349074490754907649077490784907949080490814908249083490844908549086490874908849089490904909149092490934909449095490964909749098490994910049101491024910349104491054910649107491084910949110491114911249113491144911549116491174911849119491204912149122491234912449125491264912749128491294913049131491324913349134491354913649137491384913949140491414914249143491444914549146491474914849149491504915149152491534915449155491564915749158491594916049161491624916349164491654916649167491684916949170491714917249173491744917549176491774917849179491804918149182491834918449185491864918749188491894919049191491924919349194491954919649197491984919949200492014920249203492044920549206492074920849209492104921149212492134921449215492164921749218492194922049221492224922349224492254922649227492284922949230492314923249233492344923549236492374923849239492404924149242492434924449245492464924749248492494925049251492524925349254492554925649257492584925949260492614926249263492644926549266492674926849269492704927149272492734927449275492764927749278492794928049281492824928349284492854928649287492884928949290492914929249293492944929549296492974929849299493004930149302493034930449305493064930749308493094931049311493124931349314493154931649317493184931949320493214932249323493244932549326493274932849329493304933149332493334933449335493364933749338493394934049341493424934349344493454934649347493484934949350493514935249353493544935549356493574935849359493604936149362493634936449365493664936749368493694937049371493724937349374493754937649377493784937949380493814938249383493844938549386493874938849389493904939149392493934939449395493964939749398493994940049401494024940349404494054940649407494084940949410494114941249413494144941549416494174941849419494204942149422494234942449425494264942749428494294943049431494324943349434494354943649437494384943949440494414944249443494444944549446494474944849449494504945149452494534945449455494564945749458494594946049461494624946349464494654946649467494684946949470494714947249473494744947549476494774947849479494804948149482494834948449485494864948749488494894949049491494924949349494494954949649497494984949949500495014950249503495044950549506495074950849509495104951149512495134951449515495164951749518495194952049521495224952349524495254952649527495284952949530495314953249533495344953549536495374953849539495404954149542495434954449545495464954749548495494955049551495524955349554495554955649557495584955949560495614956249563495644956549566495674956849569495704957149572495734957449575495764957749578495794958049581495824958349584495854958649587495884958949590495914959249593495944959549596495974959849599496004960149602496034960449605496064960749608496094961049611496124961349614496154961649617496184961949620496214962249623496244962549626496274962849629496304963149632496334963449635496364963749638496394964049641496424964349644496454964649647496484964949650496514965249653496544965549656496574965849659496604966149662496634966449665496664966749668496694967049671496724967349674496754967649677496784967949680496814968249683496844968549686496874968849689496904969149692496934969449695496964969749698496994970049701497024970349704497054970649707497084970949710497114971249713497144971549716497174971849719497204972149722497234972449725497264972749728497294973049731497324973349734497354973649737497384973949740497414974249743497444974549746497474974849749497504975149752497534975449755497564975749758497594976049761497624976349764497654976649767497684976949770497714977249773497744977549776497774977849779497804978149782497834978449785497864978749788497894979049791497924979349794497954979649797497984979949800498014980249803498044980549806498074980849809498104981149812498134981449815498164981749818498194982049821498224982349824498254982649827498284982949830498314983249833498344983549836498374983849839498404984149842498434984449845498464984749848498494985049851498524985349854498554985649857498584985949860498614986249863498644986549866498674986849869498704987149872498734987449875498764987749878498794988049881498824988349884498854988649887498884988949890498914989249893498944989549896498974989849899499004990149902499034990449905499064990749908499094991049911499124991349914499154991649917499184991949920499214992249923499244992549926499274992849929499304993149932499334993449935499364993749938499394994049941499424994349944499454994649947499484994949950499514995249953499544995549956499574995849959499604996149962499634996449965499664996749968499694997049971499724997349974499754997649977499784997949980499814998249983499844998549986499874998849989499904999149992499934999449995499964999749998499995000050001500025000350004500055000650007500085000950010500115001250013500145001550016500175001850019500205002150022500235002450025500265002750028500295003050031500325003350034500355003650037500385003950040500415004250043500445004550046500475004850049500505005150052500535005450055500565005750058500595006050061500625006350064500655006650067500685006950070500715007250073500745007550076500775007850079500805008150082500835008450085500865008750088500895009050091500925009350094500955009650097500985009950100501015010250103501045010550106501075010850109501105011150112501135011450115501165011750118501195012050121501225012350124501255012650127501285012950130501315013250133501345013550136501375013850139501405014150142501435014450145501465014750148501495015050151501525015350154501555015650157501585015950160501615016250163501645016550166501675016850169501705017150172501735017450175501765017750178501795018050181501825018350184501855018650187501885018950190501915019250193501945019550196501975019850199502005020150202502035020450205502065020750208502095021050211502125021350214502155021650217502185021950220502215022250223502245022550226502275022850229502305023150232502335023450235502365023750238502395024050241502425024350244502455024650247502485024950250502515025250253502545025550256502575025850259502605026150262502635026450265502665026750268502695027050271502725027350274502755027650277502785027950280502815028250283502845028550286502875028850289502905029150292502935029450295502965029750298502995030050301503025030350304503055030650307503085030950310503115031250313503145031550316503175031850319503205032150322503235032450325503265032750328503295033050331503325033350334503355033650337503385033950340503415034250343503445034550346503475034850349503505035150352503535035450355503565035750358503595036050361503625036350364503655036650367503685036950370503715037250373503745037550376503775037850379503805038150382503835038450385503865038750388503895039050391503925039350394503955039650397503985039950400504015040250403504045040550406504075040850409504105041150412504135041450415504165041750418504195042050421504225042350424504255042650427504285042950430504315043250433504345043550436504375043850439504405044150442504435044450445504465044750448504495045050451504525045350454504555045650457504585045950460504615046250463504645046550466504675046850469504705047150472504735047450475504765047750478504795048050481504825048350484504855048650487504885048950490504915049250493504945049550496504975049850499505005050150502505035050450505505065050750508505095051050511505125051350514505155051650517505185051950520505215052250523505245052550526505275052850529505305053150532505335053450535505365053750538505395054050541505425054350544505455054650547505485054950550505515055250553505545055550556505575055850559505605056150562505635056450565505665056750568505695057050571505725057350574505755057650577505785057950580505815058250583505845058550586505875058850589505905059150592505935059450595505965059750598505995060050601506025060350604506055060650607506085060950610506115061250613506145061550616506175061850619506205062150622506235062450625506265062750628506295063050631506325063350634506355063650637506385063950640506415064250643506445064550646506475064850649506505065150652506535065450655506565065750658506595066050661506625066350664506655066650667506685066950670506715067250673506745067550676506775067850679506805068150682506835068450685506865068750688506895069050691506925069350694506955069650697506985069950700507015070250703507045070550706507075070850709507105071150712507135071450715507165071750718507195072050721507225072350724507255072650727507285072950730507315073250733507345073550736507375073850739507405074150742507435074450745507465074750748507495075050751507525075350754507555075650757507585075950760507615076250763507645076550766507675076850769507705077150772507735077450775507765077750778507795078050781507825078350784507855078650787507885078950790507915079250793507945079550796507975079850799508005080150802508035080450805508065080750808508095081050811508125081350814508155081650817508185081950820508215082250823508245082550826508275082850829508305083150832508335083450835508365083750838508395084050841508425084350844508455084650847508485084950850508515085250853508545085550856508575085850859508605086150862508635086450865508665086750868508695087050871508725087350874508755087650877508785087950880508815088250883508845088550886508875088850889508905089150892508935089450895508965089750898508995090050901509025090350904509055090650907509085090950910509115091250913509145091550916509175091850919509205092150922509235092450925509265092750928509295093050931509325093350934509355093650937509385093950940509415094250943509445094550946509475094850949509505095150952509535095450955509565095750958509595096050961509625096350964509655096650967509685096950970509715097250973509745097550976509775097850979509805098150982509835098450985509865098750988509895099050991509925099350994509955099650997509985099951000510015100251003510045100551006510075100851009510105101151012510135101451015510165101751018510195102051021510225102351024510255102651027510285102951030510315103251033510345103551036510375103851039510405104151042510435104451045510465104751048510495105051051510525105351054510555105651057510585105951060510615106251063510645106551066510675106851069510705107151072510735107451075510765107751078510795108051081510825108351084510855108651087510885108951090510915109251093510945109551096510975109851099511005110151102511035110451105511065110751108511095111051111511125111351114511155111651117511185111951120511215112251123511245112551126511275112851129511305113151132511335113451135511365113751138511395114051141511425114351144511455114651147511485114951150511515115251153511545115551156511575115851159511605116151162511635116451165511665116751168511695117051171511725117351174511755117651177511785117951180511815118251183511845118551186511875118851189511905119151192511935119451195511965119751198511995120051201512025120351204512055120651207512085120951210512115121251213512145121551216512175121851219512205122151222512235122451225512265122751228512295123051231512325123351234512355123651237512385123951240512415124251243512445124551246512475124851249512505125151252512535125451255512565125751258512595126051261512625126351264512655126651267512685126951270512715127251273512745127551276512775127851279512805128151282512835128451285512865128751288512895129051291512925129351294512955129651297512985129951300513015130251303513045130551306513075130851309513105131151312513135131451315513165131751318513195132051321513225132351324513255132651327513285132951330513315133251333513345133551336513375133851339513405134151342513435134451345513465134751348513495135051351513525135351354513555135651357513585135951360513615136251363513645136551366513675136851369513705137151372513735137451375513765137751378513795138051381513825138351384513855138651387513885138951390513915139251393513945139551396513975139851399514005140151402514035140451405514065140751408514095141051411514125141351414514155141651417514185141951420514215142251423514245142551426514275142851429514305143151432514335143451435514365143751438514395144051441514425144351444514455144651447514485144951450514515145251453514545145551456514575145851459514605146151462514635146451465514665146751468514695147051471514725147351474514755147651477514785147951480514815148251483514845148551486514875148851489514905149151492514935149451495514965149751498514995150051501515025150351504515055150651507515085150951510515115151251513515145151551516515175151851519515205152151522515235152451525515265152751528515295153051531515325153351534515355153651537515385153951540515415154251543515445154551546515475154851549515505155151552515535155451555515565155751558515595156051561515625156351564515655156651567515685156951570515715157251573515745157551576515775157851579515805158151582515835158451585515865158751588515895159051591515925159351594515955159651597515985159951600516015160251603516045160551606516075160851609516105161151612516135161451615516165161751618516195162051621516225162351624516255162651627516285162951630516315163251633516345163551636516375163851639516405164151642516435164451645516465164751648516495165051651516525165351654516555165651657516585165951660516615166251663516645166551666516675166851669516705167151672516735167451675516765167751678516795168051681516825168351684516855168651687516885168951690516915169251693516945169551696516975169851699517005170151702517035170451705517065170751708517095171051711517125171351714517155171651717517185171951720517215172251723517245172551726517275172851729517305173151732517335173451735517365173751738517395174051741517425174351744517455174651747517485174951750517515175251753517545175551756517575175851759517605176151762517635176451765517665176751768517695177051771517725177351774517755177651777517785177951780517815178251783517845178551786517875178851789517905179151792517935179451795517965179751798517995180051801518025180351804518055180651807518085180951810518115181251813518145181551816518175181851819518205182151822518235182451825518265182751828518295183051831518325183351834518355183651837518385183951840518415184251843518445184551846518475184851849518505185151852518535185451855518565185751858518595186051861518625186351864518655186651867518685186951870518715187251873518745187551876518775187851879518805188151882518835188451885518865188751888518895189051891518925189351894518955189651897518985189951900519015190251903519045190551906519075190851909519105191151912519135191451915519165191751918519195192051921519225192351924519255192651927519285192951930519315193251933519345193551936519375193851939519405194151942519435194451945519465194751948519495195051951519525195351954519555195651957519585195951960519615196251963519645196551966519675196851969519705197151972519735197451975519765197751978519795198051981519825198351984519855198651987519885198951990519915199251993519945199551996519975199851999520005200152002520035200452005520065200752008520095201052011520125201352014520155201652017520185201952020520215202252023520245202552026520275202852029520305203152032520335203452035520365203752038520395204052041520425204352044520455204652047520485204952050520515205252053520545205552056520575205852059520605206152062520635206452065520665206752068520695207052071520725207352074520755207652077520785207952080520815208252083520845208552086520875208852089520905209152092520935209452095520965209752098520995210052101521025210352104521055210652107521085210952110521115211252113521145211552116521175211852119521205212152122521235212452125521265212752128521295213052131521325213352134521355213652137521385213952140521415214252143521445214552146521475214852149521505215152152521535215452155521565215752158521595216052161521625216352164521655216652167521685216952170521715217252173521745217552176521775217852179521805218152182521835218452185521865218752188521895219052191521925219352194521955219652197521985219952200522015220252203522045220552206522075220852209522105221152212522135221452215522165221752218522195222052221522225222352224522255222652227522285222952230522315223252233522345223552236522375223852239522405224152242522435224452245522465224752248522495225052251522525225352254522555225652257522585225952260522615226252263522645226552266522675226852269522705227152272522735227452275522765227752278522795228052281522825228352284522855228652287522885228952290522915229252293522945229552296522975229852299523005230152302523035230452305523065230752308523095231052311523125231352314523155231652317523185231952320523215232252323523245232552326523275232852329523305233152332523335233452335523365233752338523395234052341523425234352344523455234652347523485234952350523515235252353523545235552356523575235852359523605236152362523635236452365523665236752368523695237052371523725237352374523755237652377523785237952380523815238252383523845238552386523875238852389523905239152392523935239452395523965239752398523995240052401524025240352404524055240652407524085240952410524115241252413524145241552416524175241852419524205242152422524235242452425524265242752428524295243052431524325243352434524355243652437524385243952440524415244252443524445244552446524475244852449524505245152452524535245452455524565245752458524595246052461524625246352464524655246652467524685246952470524715247252473524745247552476524775247852479524805248152482524835248452485524865248752488524895249052491524925249352494524955249652497524985249952500525015250252503525045250552506525075250852509525105251152512525135251452515525165251752518525195252052521525225252352524525255252652527525285252952530525315253252533525345253552536525375253852539525405254152542525435254452545525465254752548525495255052551525525255352554525555255652557525585255952560525615256252563525645256552566525675256852569525705257152572525735257452575525765257752578525795258052581525825258352584525855258652587525885258952590525915259252593525945259552596525975259852599526005260152602526035260452605526065260752608526095261052611526125261352614526155261652617526185261952620526215262252623526245262552626526275262852629526305263152632526335263452635526365263752638526395264052641526425264352644526455264652647526485264952650526515265252653526545265552656526575265852659526605266152662526635266452665526665266752668526695267052671526725267352674526755267652677526785267952680526815268252683526845268552686526875268852689526905269152692526935269452695526965269752698526995270052701527025270352704527055270652707527085270952710527115271252713527145271552716527175271852719527205272152722527235272452725527265272752728527295273052731527325273352734527355273652737527385273952740527415274252743527445274552746527475274852749527505275152752527535275452755527565275752758527595276052761527625276352764527655276652767527685276952770527715277252773527745277552776527775277852779527805278152782527835278452785527865278752788527895279052791527925279352794527955279652797527985279952800528015280252803528045280552806528075280852809528105281152812528135281452815528165281752818528195282052821528225282352824528255282652827528285282952830528315283252833528345283552836528375283852839528405284152842528435284452845528465284752848528495285052851528525285352854528555285652857528585285952860528615286252863528645286552866528675286852869528705287152872528735287452875528765287752878528795288052881528825288352884528855288652887528885288952890528915289252893528945289552896528975289852899529005290152902529035290452905529065290752908529095291052911529125291352914529155291652917529185291952920529215292252923529245292552926529275292852929529305293152932529335293452935529365293752938529395294052941529425294352944529455294652947529485294952950529515295252953529545295552956529575295852959529605296152962529635296452965529665296752968529695297052971529725297352974529755297652977529785297952980529815298252983529845298552986529875298852989529905299152992529935299452995529965299752998529995300053001530025300353004530055300653007530085300953010530115301253013530145301553016530175301853019530205302153022530235302453025530265302753028530295303053031530325303353034530355303653037530385303953040530415304253043530445304553046530475304853049530505305153052530535305453055530565305753058530595306053061530625306353064530655306653067530685306953070530715307253073530745307553076530775307853079530805308153082530835308453085530865308753088530895309053091530925309353094530955309653097530985309953100531015310253103531045310553106531075310853109531105311153112531135311453115531165311753118531195312053121531225312353124531255312653127531285312953130531315313253133531345313553136531375313853139531405314153142531435314453145531465314753148531495315053151531525315353154531555315653157531585315953160531615316253163531645316553166531675316853169531705317153172531735317453175531765317753178531795318053181531825318353184531855318653187531885318953190531915319253193531945319553196531975319853199532005320153202532035320453205532065320753208532095321053211532125321353214532155321653217532185321953220532215322253223532245322553226532275322853229532305323153232532335323453235532365323753238532395324053241532425324353244532455324653247532485324953250532515325253253532545325553256532575325853259532605326153262532635326453265532665326753268532695327053271532725327353274532755327653277532785327953280532815328253283532845328553286532875328853289532905329153292532935329453295532965329753298532995330053301533025330353304533055330653307533085330953310533115331253313533145331553316533175331853319533205332153322533235332453325533265332753328533295333053331533325333353334533355333653337533385333953340533415334253343533445334553346533475334853349533505335153352533535335453355533565335753358533595336053361533625336353364533655336653367533685336953370533715337253373533745337553376533775337853379533805338153382533835338453385533865338753388533895339053391533925339353394533955339653397533985339953400534015340253403534045340553406534075340853409534105341153412534135341453415534165341753418534195342053421534225342353424534255342653427534285342953430534315343253433534345343553436534375343853439534405344153442534435344453445534465344753448534495345053451534525345353454534555345653457534585345953460534615346253463534645346553466534675346853469534705347153472534735347453475534765347753478534795348053481534825348353484534855348653487534885348953490534915349253493534945349553496534975349853499535005350153502535035350453505535065350753508535095351053511535125351353514535155351653517535185351953520535215352253523535245352553526535275352853529535305353153532535335353453535535365353753538535395354053541535425354353544535455354653547535485354953550535515355253553535545355553556535575355853559535605356153562535635356453565535665356753568535695357053571535725357353574535755357653577535785357953580535815358253583535845358553586535875358853589535905359153592535935359453595535965359753598535995360053601536025360353604536055360653607536085360953610536115361253613536145361553616536175361853619536205362153622536235362453625536265362753628536295363053631536325363353634536355363653637536385363953640536415364253643536445364553646536475364853649536505365153652536535365453655536565365753658536595366053661536625366353664536655366653667536685366953670536715367253673536745367553676536775367853679536805368153682536835368453685536865368753688536895369053691536925369353694536955369653697536985369953700537015370253703537045370553706537075370853709537105371153712537135371453715537165371753718537195372053721537225372353724537255372653727537285372953730537315373253733537345373553736537375373853739537405374153742537435374453745537465374753748537495375053751537525375353754537555375653757537585375953760537615376253763537645376553766537675376853769537705377153772537735377453775537765377753778537795378053781537825378353784537855378653787537885378953790537915379253793537945379553796537975379853799538005380153802538035380453805538065380753808538095381053811538125381353814538155381653817538185381953820538215382253823538245382553826538275382853829538305383153832538335383453835538365383753838538395384053841538425384353844538455384653847538485384953850538515385253853538545385553856538575385853859538605386153862538635386453865538665386753868538695387053871538725387353874538755387653877538785387953880538815388253883538845388553886538875388853889538905389153892538935389453895538965389753898538995390053901539025390353904539055390653907539085390953910539115391253913539145391553916539175391853919539205392153922539235392453925539265392753928539295393053931539325393353934539355393653937539385393953940539415394253943539445394553946539475394853949539505395153952539535395453955539565395753958539595396053961539625396353964539655396653967539685396953970539715397253973539745397553976539775397853979539805398153982539835398453985539865398753988539895399053991539925399353994539955399653997539985399954000540015400254003540045400554006540075400854009540105401154012540135401454015540165401754018540195402054021540225402354024540255402654027540285402954030540315403254033540345403554036540375403854039540405404154042540435404454045540465404754048540495405054051540525405354054540555405654057540585405954060540615406254063540645406554066540675406854069540705407154072540735407454075540765407754078540795408054081540825408354084540855408654087540885408954090540915409254093540945409554096540975409854099541005410154102541035410454105541065410754108541095411054111541125411354114541155411654117541185411954120541215412254123541245412554126541275412854129541305413154132541335413454135541365413754138541395414054141541425414354144541455414654147541485414954150541515415254153541545415554156541575415854159541605416154162541635416454165541665416754168541695417054171541725417354174541755417654177541785417954180541815418254183541845418554186541875418854189541905419154192541935419454195541965419754198541995420054201542025420354204542055420654207542085420954210542115421254213542145421554216542175421854219542205422154222542235422454225542265422754228542295423054231542325423354234542355423654237542385423954240542415424254243542445424554246542475424854249542505425154252542535425454255542565425754258542595426054261542625426354264542655426654267542685426954270542715427254273542745427554276542775427854279542805428154282542835428454285542865428754288542895429054291542925429354294542955429654297542985429954300543015430254303543045430554306543075430854309543105431154312543135431454315543165431754318543195432054321543225432354324543255432654327543285432954330543315433254333543345433554336543375433854339543405434154342543435434454345543465434754348543495435054351543525435354354543555435654357543585435954360543615436254363543645436554366543675436854369543705437154372543735437454375543765437754378543795438054381543825438354384543855438654387543885438954390543915439254393543945439554396543975439854399544005440154402544035440454405544065440754408544095441054411544125441354414544155441654417544185441954420544215442254423544245442554426544275442854429544305443154432544335443454435544365443754438544395444054441544425444354444544455444654447544485444954450544515445254453544545445554456544575445854459544605446154462544635446454465544665446754468544695447054471544725447354474544755447654477544785447954480544815448254483544845448554486544875448854489544905449154492544935449454495544965449754498544995450054501545025450354504545055450654507545085450954510545115451254513545145451554516545175451854519545205452154522545235452454525545265452754528545295453054531545325453354534545355453654537545385453954540545415454254543545445454554546545475454854549545505455154552545535455454555545565455754558545595456054561545625456354564545655456654567545685456954570545715457254573545745457554576545775457854579545805458154582545835458454585545865458754588545895459054591545925459354594545955459654597545985459954600546015460254603546045460554606546075460854609546105461154612546135461454615546165461754618546195462054621546225462354624546255462654627546285462954630546315463254633546345463554636546375463854639546405464154642546435464454645546465464754648546495465054651546525465354654546555465654657546585465954660546615466254663546645466554666546675466854669546705467154672546735467454675546765467754678546795468054681546825468354684546855468654687546885468954690546915469254693546945469554696546975469854699547005470154702547035470454705547065470754708547095471054711547125471354714547155471654717547185471954720547215472254723547245472554726547275472854729547305473154732547335473454735547365473754738547395474054741547425474354744547455474654747547485474954750547515475254753547545475554756547575475854759547605476154762547635476454765547665476754768547695477054771547725477354774547755477654777547785477954780547815478254783547845478554786547875478854789547905479154792547935479454795547965479754798547995480054801548025480354804548055480654807548085480954810548115481254813548145481554816548175481854819548205482154822548235482454825548265482754828548295483054831548325483354834548355483654837548385483954840548415484254843548445484554846548475484854849548505485154852548535485454855548565485754858548595486054861548625486354864548655486654867548685486954870548715487254873548745487554876548775487854879548805488154882548835488454885548865488754888548895489054891548925489354894548955489654897548985489954900549015490254903549045490554906549075490854909549105491154912549135491454915549165491754918549195492054921549225492354924549255492654927549285492954930549315493254933549345493554936549375493854939549405494154942549435494454945549465494754948549495495054951549525495354954549555495654957549585495954960549615496254963549645496554966549675496854969549705497154972549735497454975549765497754978549795498054981549825498354984549855498654987549885498954990549915499254993549945499554996549975499854999550005500155002550035500455005550065500755008550095501055011550125501355014550155501655017550185501955020550215502255023550245502555026550275502855029550305503155032550335503455035550365503755038550395504055041550425504355044550455504655047550485504955050550515505255053550545505555056550575505855059550605506155062550635506455065550665506755068550695507055071550725507355074550755507655077550785507955080550815508255083550845508555086550875508855089550905509155092550935509455095550965509755098550995510055101551025510355104551055510655107551085510955110551115511255113551145511555116551175511855119551205512155122551235512455125551265512755128551295513055131551325513355134551355513655137551385513955140551415514255143551445514555146551475514855149551505515155152551535515455155551565515755158551595516055161551625516355164551655516655167551685516955170551715517255173551745517555176551775517855179551805518155182551835518455185551865518755188551895519055191551925519355194551955519655197551985519955200552015520255203552045520555206552075520855209552105521155212552135521455215552165521755218552195522055221552225522355224552255522655227552285522955230552315523255233552345523555236552375523855239552405524155242552435524455245552465524755248552495525055251552525525355254552555525655257552585525955260552615526255263552645526555266552675526855269552705527155272552735527455275552765527755278552795528055281552825528355284552855528655287552885528955290552915529255293552945529555296552975529855299553005530155302553035530455305553065530755308553095531055311553125531355314553155531655317553185531955320553215532255323553245532555326553275532855329553305533155332553335533455335553365533755338553395534055341553425534355344553455534655347553485534955350553515535255353553545535555356553575535855359553605536155362553635536455365553665536755368553695537055371553725537355374553755537655377553785537955380553815538255383553845538555386553875538855389553905539155392553935539455395553965539755398553995540055401554025540355404554055540655407554085540955410554115541255413554145541555416554175541855419554205542155422554235542455425554265542755428554295543055431554325543355434554355543655437554385543955440554415544255443554445544555446554475544855449554505545155452554535545455455554565545755458554595546055461554625546355464554655546655467554685546955470554715547255473554745547555476554775547855479554805548155482554835548455485554865548755488554895549055491554925549355494554955549655497554985549955500555015550255503555045550555506555075550855509555105551155512555135551455515555165551755518555195552055521555225552355524555255552655527555285552955530555315553255533555345553555536555375553855539555405554155542555435554455545555465554755548555495555055551555525555355554555555555655557555585555955560555615556255563555645556555566555675556855569555705557155572555735557455575555765557755578555795558055581555825558355584555855558655587555885558955590555915559255593555945559555596555975559855599556005560155602556035560455605556065560755608556095561055611556125561355614556155561655617556185561955620556215562255623556245562555626556275562855629556305563155632556335563455635556365563755638556395564055641556425564355644556455564655647556485564955650556515565255653556545565555656556575565855659556605566155662556635566455665556665566755668556695567055671556725567355674556755567655677556785567955680556815568255683556845568555686556875568855689556905569155692556935569455695556965569755698556995570055701557025570355704557055570655707557085570955710557115571255713557145571555716557175571855719557205572155722557235572455725557265572755728557295573055731557325573355734557355573655737557385573955740557415574255743557445574555746557475574855749557505575155752557535575455755557565575755758557595576055761557625576355764557655576655767557685576955770557715577255773557745577555776557775577855779557805578155782557835578455785557865578755788557895579055791
  1. if (function() {
  2. "use strict";
  3. function o(e, t) {
  4. return typeof e === t
  5. }
  6. function a(e, t) {
  7. return e instanceof t
  8. }
  9. function s(e) {
  10. return e && e.nodeType
  11. }
  12. function l(e) {
  13. return s(e) ? e : a(e, y) ? e[0] : void 0
  14. }
  15. function e(e, i, n) {
  16. return y.each(e, function(e, t) {
  17. n = i.call(t, n, e, t)
  18. }),
  19. n
  20. }
  21. function t(e, t, i) {
  22. var n, r, o;
  23. if (e === t)
  24. return !0;
  25. if (!e || !t || e.constructor !== t.constructor)
  26. return !1;
  27. for (n = 0,
  28. r = i.length; n < r; n += 1) {
  29. if (e[o = i[n]] && E(e[o].equals) && !e[o].equals(t[o]))
  30. return !1;
  31. if (e[o] !== t[o])
  32. return !1
  33. }
  34. return !0
  35. }
  36. function c(e, t, i, n) {
  37. this.left = w(e),
  38. this.top = w(t),
  39. this.width = w(i),
  40. this.height = w(n),
  41. this.right = this.left + this.width,
  42. this.bottom = this.top + this.height
  43. }
  44. function h(e, t, i, n) {
  45. this.visible = e || 0,
  46. this.viewport = t || 0,
  47. this.possible = i || 0,
  48. this.rects = n && I({}, n) || null
  49. }
  50. function r(e, t) {
  51. this.els = e,
  52. this.viewport = t
  53. }
  54. function n(e, t) {
  55. return e.val - t.val
  56. }
  57. function u(e, t) {
  58. return t.val - e.val
  59. }
  60. function d(e) {
  61. var t = c.ofContent(e, !0)
  62. , i = c.ofViewport(e, !0)
  63. , n = t.width - i.width
  64. , r = t.height - i.height;
  65. this.content = t,
  66. this.viewport = i,
  67. this.width = n <= 0 ? null : i.left / n,
  68. this.height = r <= 0 ? null : i.top / r,
  69. this.left = i.left,
  70. this.top = i.top,
  71. this.right = t.right - i.right,
  72. this.bottom = t.bottom - i.bottom
  73. }
  74. function p(e) {
  75. this.el = e || window
  76. }
  77. function f(e, t) {
  78. this.context = e,
  79. this.viewport = t,
  80. this.init()
  81. }
  82. function g(e, t, i, n) {
  83. this.context = new r(e,t),
  84. this.property = i,
  85. this.descending = n,
  86. this.init()
  87. }
  88. function m(e) {
  89. e && e !== window && e !== document ? (this.context = e,
  90. this.$autoTarget = y(e)) : this.context = window,
  91. this.init()
  92. }
  93. var i, v, y = jQuery, A = y(window), C = y(document), I = y.extend, E = y.isFunction, _ = Math.max, b = Math.min, w = Math.round, T = (i = {},
  94. v = 1,
  95. function(e) {
  96. return e ? (i[e] || (i[e] = v,
  97. v += 1),
  98. i[e]) : 0
  99. }
  100. );
  101. I(c.prototype, {
  102. equals: function(e) {
  103. return t(this, e, ["left", "top", "width", "height"])
  104. },
  105. area: function() {
  106. return this.width * this.height
  107. },
  108. relativeTo: function(e) {
  109. return new c(this.left - e.left,this.top - e.top,this.width,this.height)
  110. },
  111. intersection: function(e) {
  112. if (!a(e, c))
  113. return null;
  114. var t = _(this.left, e.left)
  115. , i = b(this.right, e.right)
  116. , n = _(this.top, e.top)
  117. , r = i - t
  118. , o = b(this.bottom, e.bottom) - n;
  119. return 0 <= r && 0 <= o ? new c(t,n,r,o) : null
  120. },
  121. envelope: function(e) {
  122. if (!a(e, c))
  123. return this;
  124. var t = b(this.left, e.left)
  125. , i = _(this.right, e.right)
  126. , n = b(this.top, e.top);
  127. return new c(t,n,i - t,_(this.bottom, e.bottom) - n)
  128. }
  129. }),
  130. I(c, {
  131. ofContent: function(e, t) {
  132. return e && e !== document && e !== window ? t ? new c(0,0,e.scrollWidth,e.scrollHeight) : new c(e.offsetLeft - e.scrollLeft,e.offsetTop - e.scrollTop,e.scrollWidth,e.scrollHeight) : new c(0,0,C.width(),C.height())
  133. },
  134. ofViewport: function(e, t) {
  135. return e && e !== document && e !== window ? t ? new c(e.scrollLeft,e.scrollTop,e.clientWidth,e.clientHeight) : new c(e.offsetLeft,e.offsetTop,e.clientWidth,e.clientHeight) : new c(A.scrollLeft(),A.scrollTop(),A.width(),A.height())
  136. },
  137. ofElement: function(e) {
  138. var t = y(e);
  139. if (!t.is(":visible"))
  140. return null;
  141. var i = t.offset();
  142. return new c(i.left,i.top,t.outerWidth(),t.outerHeight())
  143. }
  144. }),
  145. I(h.prototype, {
  146. equals: function(e) {
  147. return this.fracsEqual(e) && this.rectsEqual(e)
  148. },
  149. fracsEqual: function(e) {
  150. return t(this, e, ["visible", "viewport", "possible"])
  151. },
  152. rectsEqual: function(e) {
  153. return t(this.rects, e.rects, ["document", "element", "viewport"])
  154. }
  155. }),
  156. I(h, {
  157. of: function(e, t) {
  158. var i, n, r;
  159. return e = s(e) && c.ofElement(e) || e,
  160. t = s(t) && c.ofViewport(t) || t || c.ofViewport(),
  161. e instanceof c && (i = e.intersection(t)) ? (n = i.area(),
  162. r = b(e.width, t.width) * b(e.height, t.height),
  163. new h(n / e.area(),n / t.area(),n / r,{
  164. document: i,
  165. element: i.relativeTo(e),
  166. viewport: i.relativeTo(t)
  167. })) : new h
  168. }
  169. });
  170. var x = ["width", "height", "left", "right", "top", "bottom"]
  171. , S = ["possible", "visible", "viewport"];
  172. I(r.prototype, {
  173. sorted: function(t, e) {
  174. var i = this.viewport;
  175. return y.map(this.els, function(e) {
  176. return {
  177. el: e,
  178. val: function(e, t, i) {
  179. var n;
  180. return 0 <= y.inArray(i, x) ? n = c.ofElement(e) : 0 <= y.inArray(i, S) && (n = h.of(e, t)),
  181. n ? n[i] : 0
  182. }(e, i, t)
  183. }
  184. }).sort(e ? u : n)
  185. },
  186. best: function(e, t) {
  187. return this.els.length ? this.sorted(e, t)[0] : null
  188. }
  189. }),
  190. I(d.prototype, {
  191. equals: function(e) {
  192. return t(this, e, ["width", "height", "left", "top", "right", "bottom", "content", "viewport"])
  193. }
  194. }),
  195. I(p.prototype, {
  196. equals: function(e) {
  197. return t(this, e, ["el"])
  198. },
  199. scrollState: function() {
  200. return new d(this.el)
  201. },
  202. scrollTo: function(e, t, i) {
  203. var n = y(this.el === window ? "html,body" : this.el);
  204. e = e || 0,
  205. t = t || 0,
  206. i = isNaN(i) ? 1e3 : i,
  207. n.stop(!0).animate({
  208. scrollLeft: e,
  209. scrollTop: t
  210. }, i)
  211. },
  212. scroll: function(e, t, i) {
  213. var n = this.el === window ? A : y(this.el);
  214. e = e || 0,
  215. t = t || 0,
  216. this.scrollTo(n.scrollLeft() + e, n.scrollTop() + t, i)
  217. },
  218. scrollToRect: function(e, t, i, n) {
  219. t = t || 0,
  220. i = i || 0,
  221. this.scrollTo(e.left - t, e.top - i, n)
  222. },
  223. scrollToElement: function(e, t, i, n) {
  224. var r = c.ofElement(e).relativeTo(c.ofContent(this.el));
  225. this.scrollToRect(r, t, i, n)
  226. }
  227. });
  228. var M = {
  229. init: function() {
  230. this.callbacks = y.Callbacks("memory unique"),
  231. this.currVal = null,
  232. this.prevVal = null,
  233. this.checkProxy = y.proxy(this.check, this),
  234. this.autoCheck()
  235. },
  236. bind: function(e) {
  237. this.callbacks.add(e)
  238. },
  239. unbind: function(e) {
  240. e ? this.callbacks.remove(e) : this.callbacks.empty()
  241. },
  242. trigger: function() {
  243. this.callbacks.fireWith(this.context, [this.currVal, this.prevVal])
  244. },
  245. check: function(e) {
  246. var t = this.updatedValue(e);
  247. return void 0 !== t && (this.prevVal = this.currVal,
  248. this.currVal = t,
  249. this.trigger(),
  250. !0)
  251. },
  252. $autoTarget: A,
  253. autoEvents: "load resize scroll",
  254. autoCheck: function(e) {
  255. this.$autoTarget[!1 === e ? "off" : "on"](this.autoEvents, this.checkProxy)
  256. }
  257. };
  258. I(f.prototype, M, {
  259. updatedValue: function() {
  260. var e = h.of(this.context, this.viewport);
  261. return this.currVal && this.currVal.equals(e) ? void 0 : e
  262. }
  263. }),
  264. I(g.prototype, M, {
  265. updatedValue: function() {
  266. var e = this.context.best(this.property, this.descending);
  267. return e && (e = 0 < e.val ? e.el : null,
  268. this.currVal !== e) ? e : void 0
  269. }
  270. }),
  271. I(m.prototype, M, {
  272. updatedValue: function() {
  273. var e = new d(this.context);
  274. return this.currVal && this.currVal.equals(e) ? void 0 : e
  275. }
  276. });
  277. var R, P, O, L, D, N, F, B, V, k, U = "fracs";
  278. function H(e, t, i, n) {
  279. return i = N(i) ? i.apply(e, t) : i,
  280. N(n[i]) ? n[i].apply(e, t) : void L.error('Method "' + i + '" does not exist on jQuery.' + R)
  281. }
  282. R = U,
  283. P = {
  284. statics: {
  285. version: "0.15.0",
  286. Rect: c,
  287. Fractions: h,
  288. Group: r,
  289. ScrollState: d,
  290. Viewport: p,
  291. FracsCallbacks: f,
  292. GroupCallbacks: g,
  293. ScrollStateCallbacks: m,
  294. fracs: function(e, t) {
  295. return h.of(e, t)
  296. }
  297. },
  298. methods: {
  299. content: function(e) {
  300. return this.length ? c.ofContent(this[0], e) : null
  301. },
  302. envelope: function() {
  303. return e(this, function(e) {
  304. var t = c.ofElement(this);
  305. return e ? e.envelope(t) : t
  306. })
  307. },
  308. fracs: function(e, i, n) {
  309. o(e, "string") || (n = i,
  310. i = e,
  311. e = null),
  312. E(i) || (n = i,
  313. i = null),
  314. n = l(n);
  315. var r = U + ".fracs." + T(n);
  316. return "unbind" === e ? this.each(function() {
  317. var e = y(this).data(r);
  318. e && e.unbind(i)
  319. }) : "check" === e ? this.each(function() {
  320. var e = y(this).data(r);
  321. e && e.check()
  322. }) : E(i) ? this.each(function() {
  323. var e = y(this)
  324. , t = e.data(r);
  325. t || (t = new f(this,n),
  326. e.data(r, t)),
  327. t.bind(i)
  328. }) : this.length ? h.of(this[0], n) : null
  329. },
  330. intersection: function() {
  331. return e(this, function(e) {
  332. var t = c.ofElement(this);
  333. return e ? e.intersection(t) : t
  334. })
  335. },
  336. max: function(e, t, i) {
  337. return E(t) || (i = t,
  338. t = null),
  339. i = l(i),
  340. t ? (new g(this,i,e,!0).bind(t),
  341. this) : this.pushStack(new r(this,i).best(e, !0).el)
  342. },
  343. min: function(e, t, i) {
  344. return E(t) || (i = t,
  345. t = null),
  346. i = l(i),
  347. t ? (new g(this,i,e).bind(t),
  348. this) : this.pushStack(new r(this,i).best(e).el)
  349. },
  350. rect: function() {
  351. return this.length ? c.ofElement(this[0]) : null
  352. },
  353. scrollState: function(e, i) {
  354. var n = U + ".scrollState";
  355. return o(e, "string") || (i = e,
  356. e = null),
  357. "unbind" === e ? this.each(function() {
  358. var e = y(this).data(n);
  359. e && e.unbind(i)
  360. }) : "check" === e ? this.each(function() {
  361. var e = y(this).data(n);
  362. e && e.check()
  363. }) : E(i) ? this.each(function() {
  364. var e = y(this)
  365. , t = e.data(n);
  366. t || (t = new m(this),
  367. e.data(n, t)),
  368. t.bind(i)
  369. }) : this.length ? new d(this[0]) : null
  370. },
  371. scroll: function(e, t, i) {
  372. return this.each(function() {
  373. new p(this).scroll(e, t, i)
  374. })
  375. },
  376. scrollTo: function(e, t, i, n) {
  377. return y.isNumeric(e) && (n = i,
  378. i = t,
  379. t = e,
  380. e = null),
  381. e = l(e),
  382. this.each(function() {
  383. e ? new p(this).scrollToElement(e, t, i, n) : new p(this).scrollTo(t, i, n)
  384. })
  385. },
  386. scrollToThis: function(e, t, i, n) {
  387. return (n = new p(l(n))).scrollToElement(this[0], e, t, i),
  388. this
  389. },
  390. softLink: function(t, i, n, r) {
  391. return r = new p(l(r)),
  392. this.filter("a[href^=#]").each(function() {
  393. var e = y(this);
  394. e.on("click", function() {
  395. r.scrollToElement(y(e.attr("href"))[0], t, i, n)
  396. })
  397. })
  398. },
  399. sort: function(e, t, i) {
  400. return o(t, "boolean") || (i = t,
  401. t = null),
  402. i = l(i),
  403. this.pushStack(y.map(new r(this,i).sorted(e, !t), function(e) {
  404. return e.el
  405. }))
  406. },
  407. viewport: function(e) {
  408. return this.length ? c.ofViewport(this[0], e) : null
  409. }
  410. },
  411. defaultStatic: "fracs",
  412. defaultMethod: "fracs"
  413. },
  414. O = [].slice,
  415. L = jQuery,
  416. D = L.extend,
  417. N = L.isFunction,
  418. F = D({}, P),
  419. B = function() {
  420. return H(this, O.call(arguments), F.defaultStatic, B)
  421. }
  422. ,
  423. V = function(e) {
  424. return N(V[e]) ? V[e].apply(this, O.call(arguments, 1)) : H(this, O.call(arguments), F.defaultMethod, V)
  425. }
  426. ,
  427. (k = function(e) {
  428. e && (D(B, e.statics),
  429. D(V, e.methods)),
  430. B.modplug = k
  431. }
  432. ).prev = {
  433. statics: L[R],
  434. methods: L.fn[R]
  435. },
  436. k(P),
  437. L[R] = B,
  438. L.fn[R] = V
  439. }(),
  440. "undefined" == typeof jQuery)
  441. throw new Error("Bootstrap's JavaScript requires jQuery");
  442. !function(m) {
  443. "use strict";
  444. function r(e, t) {
  445. this.type = this.options = this.enabled = this.timeout = this.hoverState = this.$element = null,
  446. this.init("tooltip", e, t)
  447. }
  448. r.VERSION = "3.2.0",
  449. r.DEFAULTS = {
  450. animation: !0,
  451. placement: "top",
  452. selector: !1,
  453. template: '<div class="tooltip" role="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>',
  454. trigger: "hover focus",
  455. title: "",
  456. delay: 0,
  457. html: !1,
  458. container: !1,
  459. viewport: {
  460. selector: "body",
  461. padding: 0
  462. }
  463. },
  464. r.prototype.init = function(e, t, i) {
  465. this.enabled = !0,
  466. this.type = e,
  467. this.$element = m(t),
  468. this.options = this.getOptions(i),
  469. this.$viewport = this.options.viewport && m(this.options.viewport.selector || this.options.viewport);
  470. for (var n = this.options.trigger.split(" "), r = n.length; r--; ) {
  471. var o = n[r];
  472. if ("click" == o)
  473. this.$element.on("click." + this.type, this.options.selector, m.proxy(this.toggle, this));
  474. else if ("manual" != o) {
  475. var a = "hover" == o ? "mouseenter" : "focusin"
  476. , s = "hover" == o ? "mouseleave" : "focusout";
  477. this.$element.on(a + "." + this.type, this.options.selector, m.proxy(this.enter, this)),
  478. this.$element.on(s + "." + this.type, this.options.selector, m.proxy(this.leave, this))
  479. }
  480. }
  481. this.options.selector ? this._options = m.extend({}, this.options, {
  482. trigger: "manual",
  483. selector: ""
  484. }) : this.fixTitle()
  485. }
  486. ,
  487. r.prototype.getDefaults = function() {
  488. return r.DEFAULTS
  489. }
  490. ,
  491. r.prototype.getOptions = function(e) {
  492. return (e = m.extend({}, this.getDefaults(), this.$element.data(), e)).delay && "number" == typeof e.delay && (e.delay = {
  493. show: e.delay,
  494. hide: e.delay
  495. }),
  496. e
  497. }
  498. ,
  499. r.prototype.getDelegateOptions = function() {
  500. var i = {}
  501. , n = this.getDefaults();
  502. return this._options && m.each(this._options, function(e, t) {
  503. n[e] != t && (i[e] = t)
  504. }),
  505. i
  506. }
  507. ,
  508. r.prototype.enter = function(e) {
  509. var t = e instanceof this.constructor ? e : m(e.currentTarget).data("bs." + this.type);
  510. return t || (t = new this.constructor(e.currentTarget,this.getDelegateOptions()),
  511. m(e.currentTarget).data("bs." + this.type, t)),
  512. clearTimeout(t.timeout),
  513. t.hoverState = "in",
  514. t.options.delay && t.options.delay.show ? void (t.timeout = setTimeout(function() {}, t.options.delay.show)) : t.show()
  515. }
  516. ,
  517. r.prototype.leave = function(e) {
  518. var t = e instanceof this.constructor ? e : m(e.currentTarget).data("bs." + this.type);
  519. return t || (t = new this.constructor(e.currentTarget,this.getDelegateOptions()),
  520. m(e.currentTarget).data("bs." + this.type, t)),
  521. clearTimeout(t.timeout),
  522. t.hoverState = "out",
  523. t.options.delay && t.options.delay.hide ? void (t.timeout = setTimeout(function() {
  524. "out" == t.hoverState && t.hide()
  525. }, t.options.delay.hide)) : t.hide()
  526. }
  527. ,
  528. r.prototype.show = function() {
  529. var e = m.Event("show.bs." + this.type);
  530. if (this.hasContent() && this.enabled) {
  531. this.$element.trigger(e);
  532. var t = m.contains(document.documentElement, this.$element[0]);
  533. if (e.isDefaultPrevented() || !t)
  534. return;
  535. var i = this
  536. , n = this.tip()
  537. , r = this.getUID(this.type);
  538. this.setContent(),
  539. n.attr("id", r),
  540. this.$element.attr("aria-describedby", r),
  541. this.options.animation && n.addClass("fade");
  542. var o = "function" == typeof this.options.placement ? this.options.placement.call(this, n[0], this.$element[0]) : this.options.placement
  543. , a = /\s?auto?\s?/i
  544. , s = a.test(o);
  545. s && (o = o.replace(a, "") || "top"),
  546. n.detach().css({
  547. top: 0,
  548. left: 0,
  549. display: "block"
  550. }).addClass(o).data("bs." + this.type, this),
  551. this.options.container ? n.appendTo(this.options.container) : n.insertAfter(this.$element);
  552. var l = this.getPosition()
  553. , c = n[0].offsetWidth
  554. , h = n[0].offsetHeight;
  555. if (s) {
  556. var u = o
  557. , d = this.$element.parent()
  558. , p = this.getPosition(d);
  559. o = "bottom" == o && l.top + l.height + h - p.scroll > p.height ? "top" : "top" == o && l.top - p.scroll - h < 0 ? "bottom" : "right" == o && l.right + c > p.width ? "left" : "left" == o && l.left - c < p.left ? "right" : o,
  560. n.removeClass(u).addClass(o)
  561. }
  562. var f = this.getCalculatedOffset(o, l, c, h);
  563. this.applyPlacement(f, o);
  564. var g = function() {
  565. i.$element.trigger("shown.bs." + i.type),
  566. i.hoverState = null
  567. };
  568. m.support.transition && this.$tip.hasClass("fade") ? n.one("bsTransitionEnd", g).emulateTransitionEnd(150) : g()
  569. }
  570. }
  571. ,
  572. r.prototype.applyPlacement = function(e, t) {
  573. var i = this.tip()
  574. , n = i[0].offsetWidth
  575. , r = i[0].offsetHeight
  576. , o = parseInt(i.css("margin-top"), 10)
  577. , a = parseInt(i.css("margin-left"), 10);
  578. isNaN(o) && (o = 0),
  579. isNaN(a) && (a = 0),
  580. e.top = e.top + o,
  581. e.left = e.left + a,
  582. m.offset.setOffset(i[0], m.extend({
  583. using: function(e) {
  584. i.css({
  585. top: Math.round(e.top),
  586. left: Math.round(e.left)
  587. })
  588. }
  589. }, e), 0),
  590. i.addClass("in");
  591. var s = i[0].offsetWidth
  592. , l = i[0].offsetHeight;
  593. "top" == t && l != r && (e.top = e.top + r - l);
  594. var c = this.getViewportAdjustedDelta(t, e, s, l);
  595. c.left ? e.left += c.left : e.top += c.top;
  596. var h = c.left ? 2 * c.left - n + s : 2 * c.top - r + l
  597. , u = c.left ? "left" : "top"
  598. , d = c.left ? "offsetWidth" : "offsetHeight";
  599. i.offset(e),
  600. this.replaceArrow(h, i[0][d], u)
  601. }
  602. ,
  603. r.prototype.replaceArrow = function(e, t, i) {
  604. this.arrow().css(i, e ? 50 * (1 - e / t) + "%" : "")
  605. }
  606. ,
  607. r.prototype.setContent = function() {
  608. var e = this.tip()
  609. , t = this.getTitle();
  610. e.find(".tooltip-inner")[this.options.html ? "html" : "text"](t),
  611. e.removeClass("fade in top bottom left right")
  612. }
  613. ,
  614. r.prototype.hide = function() {
  615. function e() {
  616. "in" != t.hoverState && i.detach(),
  617. t.$element.trigger("hidden.bs." + t.type)
  618. }
  619. var t = this
  620. , i = this.tip()
  621. , n = m.Event("hide.bs." + this.type);
  622. if (this.$element.removeAttr("aria-describedby"),
  623. this.$element.trigger(n),
  624. !n.isDefaultPrevented())
  625. return i.removeClass("in"),
  626. m.support.transition && this.$tip.hasClass("fade") ? i.one("bsTransitionEnd", e).emulateTransitionEnd(150) : e(),
  627. this.hoverState = null,
  628. this
  629. }
  630. ,
  631. r.prototype.fixTitle = function() {
  632. var e = this.$element;
  633. !e.attr("title") && "string" == typeof e.attr("data-original-title") || e.attr("data-original-title", e.attr("title") || "").attr("title", "")
  634. }
  635. ,
  636. r.prototype.hasContent = function() {
  637. return this.getTitle()
  638. }
  639. ,
  640. r.prototype.getPosition = function(e) {
  641. var t = (e = e || this.$element)[0]
  642. , i = "BODY" == t.tagName;
  643. return m.extend({}, "function" == typeof t.getBoundingClientRect ? t.getBoundingClientRect() : null, {
  644. scroll: i ? document.documentElement.scrollTop || document.body.scrollTop : e.scrollTop(),
  645. width: i ? m(window).width() : e.outerWidth(),
  646. height: i ? m(window).height() : e.outerHeight()
  647. }, i ? {
  648. top: 0,
  649. left: 0
  650. } : e.offset())
  651. }
  652. ,
  653. r.prototype.getCalculatedOffset = function(e, t, i, n) {
  654. return "bottom" == e ? {
  655. top: t.top + t.height,
  656. left: t.left + t.width / 2 - i / 2
  657. } : "top" == e ? {
  658. top: t.top - n,
  659. left: t.left + t.width / 2 - i / 2
  660. } : "left" == e ? {
  661. top: t.top + t.height / 2 - n / 2,
  662. left: t.left - i
  663. } : {
  664. top: t.top + t.height / 2 - n / 2,
  665. left: t.left + t.width
  666. }
  667. }
  668. ,
  669. r.prototype.getViewportAdjustedDelta = function(e, t, i, n) {
  670. var r = {
  671. top: 0,
  672. left: 0
  673. };
  674. if (!this.$viewport)
  675. return r;
  676. var o = this.options.viewport && this.options.viewport.padding || 0
  677. , a = this.getPosition(this.$viewport);
  678. if (/right|left/.test(e)) {
  679. var s = t.top - o - a.scroll
  680. , l = t.top + o - a.scroll + n;
  681. s < a.top ? r.top = a.top - s : l > a.top + a.height && (r.top = a.top + a.height - l)
  682. } else {
  683. var c = t.left - o
  684. , h = t.left + o + i;
  685. c < a.left ? r.left = a.left - c : h > a.width && (r.left = a.left + a.width - h)
  686. }
  687. return r
  688. }
  689. ,
  690. r.prototype.getTitle = function() {
  691. var e = this.$element
  692. , t = this.options;
  693. return e.attr("data-original-title") || ("function" == typeof t.title ? t.title.call(e[0]) : t.title)
  694. }
  695. ,
  696. r.prototype.getUID = function(e) {
  697. for (; e += ~~(1e6 * Math.random()),
  698. document.getElementById(e); )
  699. ;
  700. return e
  701. }
  702. ,
  703. r.prototype.tip = function() {
  704. return this.$tip = this.$tip || m(this.options.template)
  705. }
  706. ,
  707. r.prototype.arrow = function() {
  708. return this.$arrow = this.$arrow || this.tip().find(".tooltip-arrow")
  709. }
  710. ,
  711. r.prototype.validate = function() {
  712. this.$element[0].parentNode || (this.hide(),
  713. this.$element = null,
  714. this.options = null)
  715. }
  716. ,
  717. r.prototype.enable = function() {
  718. this.enabled = !0
  719. }
  720. ,
  721. r.prototype.disable = function() {
  722. this.enabled = !1
  723. }
  724. ,
  725. r.prototype.toggleEnabled = function() {
  726. this.enabled = !this.enabled
  727. }
  728. ,
  729. r.prototype.toggle = function(e) {
  730. var t = this;
  731. e && ((t = m(e.currentTarget).data("bs." + this.type)) || (t = new this.constructor(e.currentTarget,this.getDelegateOptions()),
  732. m(e.currentTarget).data("bs." + this.type, t))),
  733. t.tip().hasClass("in") ? t.leave(t) : t.enter(t)
  734. }
  735. ,
  736. r.prototype.destroy = function() {
  737. clearTimeout(this.timeout),
  738. this.hide().$element.off("." + this.type).removeData("bs." + this.type)
  739. }
  740. ;
  741. var e = m.fn.tooltip;
  742. m.fn.tooltip = function(n) {
  743. return this.each(function() {
  744. var e = m(this)
  745. , t = e.data("bs.tooltip")
  746. , i = "object" == typeof n && n;
  747. !t && "destroy" == n || (t || e.data("bs.tooltip", t = new r(this,i)),
  748. "string" == typeof n && t[n]())
  749. })
  750. }
  751. ,
  752. m.fn.tooltip.Constructor = r,
  753. m.fn.tooltip.noConflict = function() {
  754. return m.fn.tooltip = e,
  755. this
  756. }
  757. }(jQuery),
  758. function(e, t, i) {
  759. "undefined" != typeof module && module.exports ? module.exports = i() : "function" == typeof define && define.amd ? define(i) : t.Keen = i()
  760. }(0, this, function() {
  761. "use strict";
  762. function Keen() {
  763. return _init.apply(this, arguments)
  764. }
  765. function _init(e) {
  766. if (_isUndefined(e))
  767. throw new Error("Check out our JavaScript SDK Usage Guide: https://keen.io/docs/clients/javascript/usage-guide/");
  768. if (_isUndefined(e.projectId) || "String" !== _type(e.projectId) || e.projectId.length < 1)
  769. throw new Error("Please provide a projectId");
  770. this.configure(e)
  771. }
  772. function _extend(e) {
  773. for (var t = 1; t < arguments.length; t++)
  774. for (var i in arguments[t])
  775. e[i] = arguments[t][i];
  776. return e
  777. }
  778. function _isUndefined(e) {
  779. return void 0 === e
  780. }
  781. function _type(e) {
  782. var t = e && e.constructor ? e.constructor.toString() : void 0;
  783. return t ? t.match(/function (.*)\(/)[1] : "Null"
  784. }
  785. function _each(e, t, i) {
  786. var n;
  787. if (!e)
  788. return 0;
  789. if (i = i || e,
  790. "array" === _type(e)) {
  791. for (n = 0; n < e.length; n++)
  792. if (!1 === t.call(i, e[n], n, e))
  793. return 0
  794. } else
  795. for (n in e)
  796. if (e.hasOwnProperty(n) && !1 === t.call(i, e[n], n, e))
  797. return 0;
  798. return 1
  799. }
  800. function _parse_params(e) {
  801. for (var t, i = {}, n = /\+/g, r = /([^&=]+)=?([^&]*)/g, o = function(e) {
  802. return decodeURIComponent(e.replace(n, " "))
  803. }, a = e.split("?")[1]; t = r.exec(a); )
  804. i[o(t[1])] = o(t[2]);
  805. return i
  806. }
  807. function _set_protocol(e) {
  808. switch (e) {
  809. case "http":
  810. return "http";
  811. case "auto":
  812. return location.protocol.replace(/:/g, "");
  813. case "https":
  814. case void 0:
  815. default:
  816. return "https"
  817. }
  818. }
  819. function _set_request_type(e) {
  820. var t = e || "jsonp"
  821. , i = !1;
  822. return ("Object" === _type(XMLHttpRequest) || "Function" === _type(XMLHttpRequest)) && "withCredentials"in new XMLHttpRequest && (i = !0),
  823. null == t || "xhr" == t ? i ? "xhr" : "jsonp" : t
  824. }
  825. function _build_url(e) {
  826. return this.client.endpoint + "/projects/" + this.client.projectId + e
  827. }
  828. function _uploadEvent(e, t, i, n, r) {
  829. var o = _build_url.apply(this, ["/events/" + e])
  830. , a = {};
  831. for (var s in i = !1 !== i,
  832. this.client.globalProperties && (a = this.client.globalProperties(e)),
  833. t)
  834. t.hasOwnProperty(s) && (a[s] = t[s]);
  835. switch (this.client.requestType) {
  836. case "xhr":
  837. _request.xhr.apply(this, ["POST", o, null, a, this.client.writeKey, i, n, r]);
  838. break;
  839. case "jsonp":
  840. var l = JSON.stringify(a)
  841. , c = Keen.Base64.encode(l);
  842. o = (o = (o = o + "?api_key=" + this.client.writeKey) + "&data=" + c) + "&modified=" + (new Date).getTime(),
  843. _request.jsonp.apply(this, [o, this.client.writeKey, n, r]);
  844. break;
  845. case "beacon":
  846. l = JSON.stringify(a),
  847. c = Keen.Base64.encode(l);
  848. o = (o = (o = o + "?api_key=" + encodeURIComponent(this.client.writeKey)) + "&data=" + encodeURIComponent(c)) + "&modified=" + encodeURIComponent((new Date).getTime()),
  849. o += "&c=clv1",
  850. _request.beacon.apply(this, [o, null, n, r])
  851. }
  852. }
  853. Keen.prototype.configure = function(e) {
  854. return e.host = _isUndefined(e.host) ? "api.keen.io/3.0" : e.host.replace(/.*?:\/\//g, ""),
  855. e.protocol = _set_protocol(e.protocol),
  856. e.requestType = _set_request_type(e.requestType),
  857. this.client = {
  858. projectId: e.projectId,
  859. writeKey: e.writeKey,
  860. readKey: e.readKey,
  861. globalProperties: null,
  862. endpoint: e.protocol + "://" + e.host,
  863. requestType: e.requestType
  864. },
  865. Keen.trigger("client", this, e),
  866. this.trigger("ready"),
  867. this
  868. }
  869. ;
  870. var _request = {
  871. xhr: function(e, t, i, n, r, o, a, s) {
  872. if (!r)
  873. return Keen.log("Please provide a writeKey for https://keen.io/project/" + this.client.projectId);
  874. var l = new XMLHttpRequest;
  875. if (l.onreadystatechange = function() {
  876. if (4 == l.readyState)
  877. if (200 <= l.status && l.status < 300) {
  878. var e;
  879. try {
  880. e = JSON.parse(l.responseText)
  881. } catch (e) {
  882. Keen.log("Could not JSON parse HTTP response: " + l.responseText),
  883. s && s(l, e)
  884. }
  885. a && e && a(e)
  886. } else
  887. Keen.log("HTTP request failed."),
  888. s && s(l, null)
  889. }
  890. ,
  891. l.open(e, t, o),
  892. r && l.setRequestHeader("Authorization", r),
  893. n && l.setRequestHeader("Content-Type", "application/json"),
  894. i)
  895. for (var c in i)
  896. i.hasOwnProperty(c) && l.setRequestHeader(c, i[c]);
  897. var h = n ? JSON.stringify(n) : null;
  898. l.send(h)
  899. },
  900. jsonp: function(e, t, i, n) {
  901. if (!t)
  902. return Keen.log("Please provide a writeKey for https://keen.io/project/" + this.client.projectId);
  903. if (t && e.indexOf("api_key") < 0) {
  904. var r = 0 < e.indexOf("?") ? "&" : "?";
  905. e = e + r + "api_key=" + t
  906. }
  907. for (var o = "keenJSONPCallback" + (new Date).getTime(); o in window; )
  908. o += "a";
  909. var a = !1;
  910. window[o] = function(e) {
  911. a = !0,
  912. i && e && i(e),
  913. window[o] = void 0
  914. }
  915. ,
  916. e = e + "&jsonp=" + o;
  917. var s = document.createElement("script");
  918. s.id = "keen-jsonp",
  919. s.src = e,
  920. document.getElementsByTagName("head")[0].appendChild(s),
  921. s.onreadystatechange = function() {
  922. !1 === a && "loaded" === this.readyState && (a = !0,
  923. n && n())
  924. }
  925. ,
  926. s.onerror = function() {
  927. !1 === a && (a = !0,
  928. n && n())
  929. }
  930. },
  931. beacon: function(e, t, i, n) {
  932. if (t && e.indexOf("api_key") < 0) {
  933. var r = 0 < e.indexOf("?") ? "&" : "?";
  934. e = e + r + "api_key=" + t
  935. }
  936. var o = document.createElement("img");
  937. o.onload = function() {
  938. if (!0,
  939. "naturalHeight"in this) {
  940. if (this.naturalHeight + this.naturalWidth === 0)
  941. return void this.onerror()
  942. } else if (this.width + this.height === 0)
  943. return void this.onerror();
  944. i && i({
  945. created: !0
  946. })
  947. }
  948. ,
  949. o.onerror = function() {
  950. !0,
  951. n && n()
  952. }
  953. ,
  954. o.src = e
  955. }
  956. }
  957. , Events = Keen.Events = {
  958. on: function(e, t) {
  959. return this.listeners || (this.listeners = {}),
  960. (this.listeners[e] || (this.listeners[e] = [])).push({
  961. callback: t
  962. }),
  963. this
  964. },
  965. off: function(e, t) {
  966. if (!e && !t)
  967. return this.listeners = void 0,
  968. delete this.listeners,
  969. this;
  970. for (var i = this.listeners[e] || [], n = i.length; n--; )
  971. t && t == i[n].callback && this.listeners[e].splice(n, 1),
  972. t && 0 != i.length || (this.listeners[e] = void 0,
  973. delete this.listeners[e]);
  974. return this
  975. },
  976. trigger: function(e) {
  977. if (!this.listeners)
  978. return this;
  979. for (var t = Array.prototype.slice.call(arguments, 1), i = this.listeners[e] || [], n = 0; n < i.length; n++)
  980. i[n].callback.apply(this, t);
  981. return this
  982. }
  983. };
  984. _extend(Keen.prototype, Events),
  985. _extend(Keen, Events),
  986. Keen.loaded = !0,
  987. Keen.utils = {
  988. each: _each,
  989. extend: _extend,
  990. parseParams: _parse_params
  991. },
  992. Keen.ready = function(e) {
  993. Keen.loaded ? e() : Keen.on("ready", e)
  994. }
  995. ,
  996. Keen.log = function(e) {
  997. "object" == typeof console && console.log("[Keen IO]", e)
  998. }
  999. ;
  1000. var Plugins = Keen.Plugins = {}, Hh, Ih;
  1001. Keen.prototype.addEvent = function() {
  1002. _uploadEvent.apply(this, arguments)
  1003. }
  1004. ,
  1005. Keen.prototype.addEventSync = function(e, t, i, n) {
  1006. _uploadEvent.apply(this, [e, t, !1, i, n])
  1007. }
  1008. ,
  1009. Keen.prototype.trackExternalLink = function(e, t, i, n, r) {
  1010. var o = e
  1011. , a = o.metaKey
  1012. , s = o.target
  1013. , l = !1
  1014. , c = function() {};
  1015. return void 0 === n && (n = 500),
  1016. "A" === s.nodeName ? c = function() {
  1017. a || l || (l = !0,
  1018. window.location = s.href)
  1019. }
  1020. : "FORM" === s.nodeName && (c = function() {
  1021. l || (l = !0,
  1022. s.submit())
  1023. }
  1024. ),
  1025. r && (c = function() {
  1026. l || (l = !0,
  1027. r())
  1028. }
  1029. ),
  1030. _uploadEvent.call(this, t, i, c, c),
  1031. setTimeout(function() {
  1032. c()
  1033. }, n),
  1034. !!a && void 0
  1035. }
  1036. ,
  1037. Keen.prototype.setGlobalProperties = function(e) {
  1038. if (!this.client)
  1039. return Keen.log("Check out our JavaScript SDK Usage Guide: https://keen.io/docs/clients/javascript/usage-guide/");
  1040. if (!e || "function" != typeof e)
  1041. throw new Error("Invalid value for global properties: " + e);
  1042. this.client.globalProperties = e
  1043. }
  1044. ,
  1045. Keen.Base64 = {
  1046. map: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",
  1047. encode: function(e) {
  1048. var t, i, n, r, o, a, s, l = "", c = 0, h = this.map;
  1049. for (e = this.utf8.encode(e); c < e.length; )
  1050. t = e.charCodeAt(c++),
  1051. i = e.charCodeAt(c++),
  1052. n = e.charCodeAt(c++),
  1053. r = t >> 2,
  1054. o = (3 & t) << 4 | i >> 4,
  1055. a = isNaN(i) ? 64 : (15 & i) << 2 | n >> 6,
  1056. s = isNaN(i) || isNaN(n) ? 64 : 63 & n,
  1057. l = l + h.charAt(r) + h.charAt(o) + h.charAt(a) + h.charAt(s);
  1058. return l
  1059. },
  1060. decode: function(e) {
  1061. var t, i, n, r, o, a, s = "", l = 0, c = this.map, h = String.fromCharCode;
  1062. for (e = e.replace(/[^A-Za-z0-9\+\/\=]/g, ""); l < e.length; )
  1063. t = c.indexOf(e.charAt(l++)),
  1064. o = (15 & (i = c.indexOf(e.charAt(l++)))) << 4 | (n = c.indexOf(e.charAt(l++))) >> 2,
  1065. a = (3 & n) << 6 | (r = c.indexOf(e.charAt(l++))),
  1066. s = s + (h(t << 2 | i >> 4) + (64 != n ? h(o) : "")) + (64 != r ? h(a) : "");
  1067. return this.utf8.decode(s)
  1068. },
  1069. utf8: {
  1070. encode: function(e) {
  1071. for (var t, i = "", n = 0, r = String.fromCharCode; n < e.length; )
  1072. i += (t = e.charCodeAt(n++)) < 128 ? r(t) : 127 < t && t < 2048 ? r(t >> 6 | 192) + r(63 & t | 128) : r(t >> 12 | 224) + r(t >> 6 & 63 | 128) + r(63 & t | 128);
  1073. return i
  1074. },
  1075. decode: function(e) {
  1076. for (var t, i = "", n = 0, r = String.fromCharCode; n < e.length; )
  1077. i += (t = e.charCodeAt(n)) < 128 ? [r(t), n++][0] : 191 < t && t < 224 ? [r((31 & t) << 6 | 63 & e.charCodeAt(n + 1)), n += 2][0] : [r((15 & t) << 12 | (63 & e.charCodeAt(n + 1)) << 6 | 63 & (c3 = e.charCodeAt(n + 2))), n += 3][0];
  1078. return i
  1079. }
  1080. }
  1081. },
  1082. "object" != typeof JSON && (JSON = {}),
  1083. function() {
  1084. function f(e) {
  1085. return e < 10 ? "0" + e : e
  1086. }
  1087. function quote(e) {
  1088. return escapable.lastIndex = 0,
  1089. escapable.test(e) ? '"' + e.replace(escapable, function(e) {
  1090. var t = meta[e];
  1091. return "string" == typeof t ? t : "\\u" + ("0000" + e.charCodeAt(0).toString(16)).slice(-4)
  1092. }) + '"' : '"' + e + '"'
  1093. }
  1094. function str(e, t) {
  1095. var i, n, r, o, a, s = gap, l = t[e];
  1096. switch (l && "object" == typeof l && "function" == typeof l.toJSON && (l = l.toJSON(e)),
  1097. "function" == typeof rep && (l = rep.call(t, e, l)),
  1098. typeof l) {
  1099. case "string":
  1100. return quote(l);
  1101. case "number":
  1102. return isFinite(l) ? String(l) : "null";
  1103. case "boolean":
  1104. case "null":
  1105. return String(l);
  1106. case "object":
  1107. if (!l)
  1108. return "null";
  1109. if (gap += indent,
  1110. a = [],
  1111. "[object Array]" === Object.prototype.toString.apply(l)) {
  1112. for (o = l.length,
  1113. i = 0; i < o; i += 1)
  1114. a[i] = str(i, l) || "null";
  1115. return r = 0 === a.length ? "[]" : gap ? "[\n" + gap + a.join(",\n" + gap) + "\n" + s + "]" : "[" + a.join(",") + "]",
  1116. gap = s,
  1117. r
  1118. }
  1119. if (rep && "object" == typeof rep)
  1120. for (o = rep.length,
  1121. i = 0; i < o; i += 1)
  1122. "string" == typeof rep[i] && ((r = str(n = rep[i], l)) && a.push(quote(n) + (gap ? ": " : ":") + r));
  1123. else
  1124. for (n in l)
  1125. Object.prototype.hasOwnProperty.call(l, n) && ((r = str(n, l)) && a.push(quote(n) + (gap ? ": " : ":") + r));
  1126. return r = 0 === a.length ? "{}" : gap ? "{\n" + gap + a.join(",\n" + gap) + "\n" + s + "}" : "{" + a.join(",") + "}",
  1127. gap = s,
  1128. r
  1129. }
  1130. }
  1131. "function" != typeof Date.prototype.toJSON && (Date.prototype.toJSON = function() {
  1132. return isFinite(this.valueOf()) ? this.getUTCFullYear() + "-" + f(this.getUTCMonth() + 1) + "-" + f(this.getUTCDate()) + "T" + f(this.getUTCHours()) + ":" + f(this.getUTCMinutes()) + ":" + f(this.getUTCSeconds()) + "Z" : null
  1133. }
  1134. ,
  1135. String.prototype.toJSON = Number.prototype.toJSON = Boolean.prototype.toJSON = function() {
  1136. return this.valueOf()
  1137. }
  1138. );
  1139. var cx = /[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g, escapable = /[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g, gap, indent, meta = {
  1140. "\b": "\\b",
  1141. "\t": "\\t",
  1142. "\n": "\\n",
  1143. "\f": "\\f",
  1144. "\r": "\\r",
  1145. '"': '\\"',
  1146. "\\": "\\\\"
  1147. }, rep;
  1148. "function" != typeof JSON.stringify && (JSON.stringify = function(e, t, i) {
  1149. var n;
  1150. if (indent = gap = "",
  1151. "number" == typeof i)
  1152. for (n = 0; n < i; n += 1)
  1153. indent += " ";
  1154. else
  1155. "string" == typeof i && (indent = i);
  1156. if ((rep = t) && "function" != typeof t && ("object" != typeof t || "number" != typeof t.length))
  1157. throw new Error("JSON.stringify");
  1158. return str("", {
  1159. "": e
  1160. })
  1161. }
  1162. ),
  1163. "function" != typeof JSON.parse && (JSON.parse = function(text, reviver) {
  1164. function walk(e, t) {
  1165. var i, n, r = e[t];
  1166. if (r && "object" == typeof r)
  1167. for (i in r)
  1168. Object.prototype.hasOwnProperty.call(r, i) && (void 0 !== (n = walk(r, i)) ? r[i] = n : delete r[i]);
  1169. return reviver.call(e, t, r)
  1170. }
  1171. var j;
  1172. if (text = String(text),
  1173. cx.lastIndex = 0,
  1174. cx.test(text) && (text = text.replace(cx, function(e) {
  1175. return "\\u" + ("0000" + e.charCodeAt(0).toString(16)).slice(-4)
  1176. })),
  1177. /^[\],:{}\s]*$/.test(text.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g, "@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g, "]").replace(/(?:^|:|,)(?:\s*\[)+/g, "")))
  1178. return j = eval("(" + text + ")"),
  1179. "function" == typeof reviver ? walk({
  1180. "": j
  1181. }, "") : j;
  1182. throw new SyntaxError("JSON.parse")
  1183. }
  1184. )
  1185. }(),
  1186. Hh = Keen.utils,
  1187. Ih = function(i) {
  1188. function e(e) {
  1189. for (u = 1; e = n.shift(); )
  1190. e()
  1191. }
  1192. var t, n = [], r = document, o = r.documentElement, a = o.doScroll, s = "DOMContentLoaded", l = "addEventListener", c = "onreadystatechange", h = "readyState", u = (a ? /^loaded|^c/ : /^loaded|c/).test(r[h]);
  1193. return r[l] && r[l](s, t = function() {
  1194. r.removeEventListener(s, t, !1),
  1195. e()
  1196. }
  1197. , !1),
  1198. a && r.attachEvent(c, t = function() {
  1199. /^c/.test(r[h]) && (r.detachEvent(c, t),
  1200. e())
  1201. }
  1202. ),
  1203. i = a ? function(t) {
  1204. self != top ? u ? t() : n.push(t) : function() {
  1205. try {
  1206. o.doScroll("left")
  1207. } catch (e) {
  1208. return setTimeout(function() {
  1209. i(t)
  1210. }, 50)
  1211. }
  1212. t()
  1213. }()
  1214. }
  1215. : function(e) {
  1216. u ? e() : n.push(e)
  1217. }
  1218. }
  1219. ,
  1220. "undefined" != typeof module && module.exports ? module.exports = Ih() : "function" == typeof define && define.amd ? define(Ih) : Hh.domready = Ih();
  1221. var loaded = window.Keen, cached = window._Keen || {}, clients, ready;
  1222. if (loaded && cached) {
  1223. for (var instance in clients = cached.clients || {},
  1224. ready = cached.ready || [],
  1225. clients)
  1226. if (clients.hasOwnProperty(instance)) {
  1227. var client = clients[instance];
  1228. for (var method in Keen.prototype)
  1229. Keen.prototype.hasOwnProperty(method) && (loaded.prototype[method] = Keen.prototype[method]);
  1230. if (loaded.Query = Keen.Query ? Keen.Query : function() {}
  1231. ,
  1232. loaded.Visualization = Keen.Visualization ? Keen.Visualization : function() {}
  1233. ,
  1234. client._config && (client.configure.call(client, client._config),
  1235. delete client._config),
  1236. client._setGlobalProperties) {
  1237. for (var globals = client._setGlobalProperties, i = 0; i < globals.length; i++)
  1238. client.setGlobalProperties.apply(client, globals[i]);
  1239. delete client._setGlobalProperties
  1240. }
  1241. if (client._addEvent) {
  1242. for (var queue = client._addEvent || [], i = 0; i < queue.length; i++)
  1243. client.addEvent.apply(client, queue[i]);
  1244. delete client._addEvent
  1245. }
  1246. var callback = client._on || [];
  1247. if (client._on) {
  1248. for (var i = 0; i < callback.length; i++)
  1249. client.on.apply(client, callback[i]);
  1250. client.trigger("ready"),
  1251. delete client._on
  1252. }
  1253. }
  1254. for (var i = 0; i < ready.length; i++) {
  1255. var callback = ready[i];
  1256. Keen.on("ready", function() {
  1257. callback()
  1258. })
  1259. }
  1260. }
  1261. return Keen.loaded && setTimeout(function() {
  1262. Keen.utils.domready(function() {
  1263. Keen.trigger("ready")
  1264. })
  1265. }, 0),
  1266. Keen
  1267. }),
  1268. function() {
  1269. var i = window.analytics = window.analytics || [];
  1270. if (!i.initialize) {
  1271. if (i.invoked)
  1272. return window.console && console.error && console.error("Segment snippet included twice.");
  1273. i.invoked = !0,
  1274. i.methods = ["trackSubmit", "trackClick", "trackLink", "trackForm", "pageview", "identify", "reset", "group", "track", "ready", "alias", "debug", "page", "once", "off", "on"],
  1275. i.factory = function(t) {
  1276. return function() {
  1277. var e = Array.prototype.slice.call(arguments);
  1278. return e.unshift(t),
  1279. i.push(e),
  1280. i
  1281. }
  1282. }
  1283. ;
  1284. for (var e = 0; e < i.methods.length; e++) {
  1285. var t = i.methods[e];
  1286. i[t] = i.factory(t)
  1287. }
  1288. i.load = function(e) {
  1289. var t = document.createElement("script");
  1290. t.type = "text/javascript",
  1291. t.async = !0,
  1292. t.src = ("https:" === document.location.protocol ? "https://" : "http://") + "cdn.segment.com/analytics.js/v1/" + e + "/analytics.min.js";
  1293. var i = document.getElementsByTagName("script")[0];
  1294. i.parentNode.insertBefore(t, i)
  1295. }
  1296. ,
  1297. i.SNIPPET_VERSION = "4.0.0"
  1298. }
  1299. }(),
  1300. function(i, u) {
  1301. "use strict";
  1302. var d = "function"
  1303. , p = "undefined"
  1304. , f = "object"
  1305. , e = "major"
  1306. , t = "model"
  1307. , n = "name"
  1308. , r = "type"
  1309. , o = "vendor"
  1310. , a = "version"
  1311. , s = "architecture"
  1312. , l = "console"
  1313. , c = "mobile"
  1314. , h = "tablet"
  1315. , g = {
  1316. has: function(e, t) {
  1317. return -1 !== t.toLowerCase().indexOf(e.toLowerCase())
  1318. },
  1319. lowerize: function(e) {
  1320. return e.toLowerCase()
  1321. }
  1322. }
  1323. , m = {
  1324. rgx: function() {
  1325. for (var e, t, i, n, r, o, a, s = 0, l = arguments; s < l.length; s += 2) {
  1326. var c = l[s]
  1327. , h = l[s + 1];
  1328. if (typeof e == p)
  1329. for (n in e = {},
  1330. h)
  1331. typeof (r = h[n]) == f ? e[r[0]] = u : e[r] = u;
  1332. for (t = i = 0; t < c.length; t++)
  1333. if (o = c[t].exec(this.getUA())) {
  1334. for (n = 0; n < h.length; n++)
  1335. a = o[++i],
  1336. typeof (r = h[n]) == f && 0 < r.length ? 2 == r.length ? typeof r[1] == d ? e[r[0]] = r[1].call(this, a) : e[r[0]] = r[1] : 3 == r.length ? typeof r[1] != d || r[1].exec && r[1].test ? e[r[0]] = a ? a.replace(r[1], r[2]) : u : e[r[0]] = a ? r[1].call(this, a, r[2]) : u : 4 == r.length && (e[r[0]] = a ? r[3].call(this, a.replace(r[1], r[2])) : u) : e[r] = a || u;
  1337. break
  1338. }
  1339. if (o)
  1340. break
  1341. }
  1342. return e
  1343. },
  1344. str: function(e, t) {
  1345. for (var i in t)
  1346. if (typeof t[i] == f && 0 < t[i].length) {
  1347. for (var n = 0; n < t[i].length; n++)
  1348. if (g.has(t[i][n], e))
  1349. return "?" === i ? u : i
  1350. } else if (g.has(t[i], e))
  1351. return "?" === i ? u : i;
  1352. return e
  1353. }
  1354. }
  1355. , v = {
  1356. browser: {
  1357. oldsafari: {
  1358. major: {
  1359. 1: ["/8", "/1", "/3"],
  1360. 2: "/4",
  1361. "?": "/"
  1362. },
  1363. version: {
  1364. "1.0": "/8",
  1365. 1.2: "/1",
  1366. 1.3: "/3",
  1367. "2.0": "/412",
  1368. "2.0.2": "/416",
  1369. "2.0.3": "/417",
  1370. "2.0.4": "/419",
  1371. "?": "/"
  1372. }
  1373. }
  1374. },
  1375. device: {
  1376. sprint: {
  1377. model: {
  1378. "Evo Shift 4G": "7373KT"
  1379. },
  1380. vendor: {
  1381. HTC: "APA",
  1382. Sprint: "Sprint"
  1383. }
  1384. }
  1385. },
  1386. os: {
  1387. windows: {
  1388. version: {
  1389. ME: "4.90",
  1390. "NT 3.11": "NT3.51",
  1391. "NT 4.0": "NT4.0",
  1392. 2e3: "NT 5.0",
  1393. XP: ["NT 5.1", "NT 5.2"],
  1394. Vista: "NT 6.0",
  1395. 7: "NT 6.1",
  1396. 8: "NT 6.2",
  1397. 8.1: "NT 6.3",
  1398. RT: "ARM"
  1399. }
  1400. }
  1401. }
  1402. }
  1403. , y = {
  1404. browser: [[/(opera\smini)\/((\d+)?[\w\.-]+)/i, /(opera\s[mobiletab]+).+version\/((\d+)?[\w\.-]+)/i, /(opera).+version\/((\d+)?[\w\.]+)/i, /(opera)[\/\s]+((\d+)?[\w\.]+)/i], [n, a, e], [/\s(opr)\/((\d+)?[\w\.]+)/i], [[n, "Opera"], a, e], [/(kindle)\/((\d+)?[\w\.]+)/i, /(lunascape|maxthon|netfront|jasmine|blazer)[\/\s]?((\d+)?[\w\.]+)*/i, /(avant\s|iemobile|slim|baidu)(?:browser)?[\/\s]?((\d+)?[\w\.]*)/i, /(?:ms|\()(ie)\s((\d+)?[\w\.]+)/i, /(rekonq)((?:\/)[\w\.]+)*/i, /(chromium|flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt|iron)\/((\d+)?[\w\.-]+)/i], [n, a, e], [/(trident).+rv[:\s]((\d+)?[\w\.]+).+like\sgecko/i], [[n, "IE"], a, e], [/(yabrowser)\/((\d+)?[\w\.]+)/i], [[n, "Yandex"], a, e], [/(comodo_dragon)\/((\d+)?[\w\.]+)/i], [[n, /_/g, " "], a, e], [/(chrome|omniweb|arora|[tizenoka]{5}\s?browser)\/v?((\d+)?[\w\.]+)/i], [n, a, e], [/(dolfin)\/((\d+)?[\w\.]+)/i], [[n, "Dolphin"], a, e], [/((?:android.+)crmo|crios)\/((\d+)?[\w\.]+)/i], [[n, "Chrome"], a, e], [/version\/((\d+)?[\w\.]+).+?mobile\/\w+\s(safari)/i], [a, e, [n, "Mobile Safari"]], [/version\/((\d+)?[\w\.]+).+?(mobile\s?safari|safari)/i], [a, e, n], [/webkit.+?(mobile\s?safari|safari)((\/[\w\.]+))/i], [n, [e, m.str, v.browser.oldsafari.major], [a, m.str, v.browser.oldsafari.version]], [/(konqueror)\/((\d+)?[\w\.]+)/i, /(webkit|khtml)\/((\d+)?[\w\.]+)/i], [n, a, e], [/(navigator|netscape)\/((\d+)?[\w\.-]+)/i], [[n, "Netscape"], a, e], [/(swiftfox)/i, /(icedragon|iceweasel|camino|chimera|fennec|maemo\sbrowser|minimo|conkeror)[\/\s]?((\d+)?[\w\.\+]+)/i, /(firefox|seamonkey|k-meleon|icecat|iceape|firebird|phoenix)\/((\d+)?[\w\.-]+)/i, /(mozilla)\/((\d+)?[\w\.]+).+rv\:.+gecko\/\d+/i, /(uc\s?browser|polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|qqbrowser)[\/\s]?((\d+)?[\w\.]+)/i, /(links)\s\(((\d+)?[\w\.]+)/i, /(gobrowser)\/?((\d+)?[\w\.]+)*/i, /(ice\s?browser)\/v?((\d+)?[\w\._]+)/i, /(mosaic)[\/\s]((\d+)?[\w\.]+)/i], [n, a, e], [/(apple(?:coremedia|))\/((\d+)[\w\._]+)/i, /(coremedia) v((\d+)[\w\._]+)/i], [n, a, e], [/(aqualung|lyssna|bsplayer)\/([\w\.-]+)/i], [n, a], [/(ares|ossproxy)\s((\d+)[\w\.-]+)/i], [n, a, e], [/(audacious|audimusicstream|amarok|bass|core|dalvik|gnomemplayer|music on console|nsplayer|psp-internetradioplayer|videos)\/((\d+)[\w\.-]+)/i, /(clementine|music player daemon)\s((\d+)[\w\.-]+)/i, /(lg player|nexplayer)\s((\d+)[\d\.]+)/i, /player\/(nexplayer|lg player)\s((\d+)[\w\.-]+)/i], [n, a, e], [/(nexplayer)\s((\d+)[\w\.-]+)/i], [n, a, e], [/(flrp)\/((\d+)[\w\.-]+)/i], [[n, "Flip Player"], a, e], [/(fstream|nativehost|queryseekspider|ia-archiver|facebookexternalhit)/i], [n], [/(gstreamer) souphttpsrc (?:\([^\)]+\)){0,1} libsoup\/((\d+)[\w\.-]+)/i], [n, a, e], [/(htc streaming player)\s[\w_]+\s\/\s((\d+)[\d\.]+)/i, /(java|python-urllib|python-requests|wget|libcurl)\/((\d+)[\w\.-_]+)/i, /(lavf)((\d+)[\d\.]+)/i], [n, a, e], [/(htc_one_s)\/((\d+)[\d\.]+)/i], [[n, /_/g, " "], a, e], [/(mplayer)(?:\s|\/)(?:(?:sherpya-){0,1}svn)(?:-|\s)(r\d+(?:-\d+[\w\.-]+){0,1})/i], [n, a], [/(mplayer)(?:\s|\/)((\d+)[\w\.-]+)/i, /(mplayer) unknown-((\d+)[\w\.\-]+)/i], [n, a, e], [/(mplayer)/i, /(yourmuze)/i, /(media player classic|nero showtime)/i], [n], [/(nero (?:home|scout))\/((\d+)[\w\.-]+)/i], [n, a, e], [/(nokia\d+)\/((\d+)[\w\.-]+)/i], [n, a, e], [/\s(songbird)\/((\d+)[\w\.-]+)/i], [n, a, e], [/(winamp)3 version ((\d+)[\w\.-]+)/i, /(winamp)\s((\d+)[\w\.-]+)/i, /(winamp)mpeg\/((\d+)[\w\.-]+)/i], [n, a, e], [/(ocms-bot|tapinradio|tunein radio|unknown|winamp|inlight radio)/i], [n], [/(quicktime|rma|radioapp|radioclientapplication|soundtap|totem|stagefright|streamium)\/((\d+)[\w\.-]+)/i], [n, a, e], [/(smp)((\d+)[\d\.]+)/i], [n, a, e], [/(vlc) media player - version ((\d+)[\w\.]+)/i, /(vlc)\/((\d+)[\w\.-]+)/i, /(xbmc|gvfs|xine|xmms|irapp)\/((\d+)[\w\.-]+)/i, /(foobar2000)\/((\d+)[\d\.]+)/i, /(itunes)\/((\d+)[\d\.]+)/i], [n, a, e], [/(wmplayer)\/((\d+)[\w\.-]+)/i, /(windows-media-player)\/((\d+)[\w\.-]+)/i], [[n, /-/g, " "], a, e], [/windows\/((\d+)[\w\.-]+) upnp\/[\d\.]+ dlnadoc\/[\d\.]+ (home media server)/i], [a, e, [n, "Windows"]], [/(com\.riseupradioalarm)\/((\d+)[\d\.]*)/i], [n, a, e], [/(rad.io)\s((\d+)[\d\.]+)/i, /(radio.(?:de|at|fr))\s((\d+)[\d\.]+)/i], [[n, "rad.io"], a, e]],
  1405. cpu: [[/(?:(amd|x(?:(?:86|64)[_-])?|wow|win)64)[;\)]/i], [[s, "amd64"]], [/(ia32(?=;))/i], [[s, g.lowerize]], [/((?:i[346]|x)86)[;\)]/i], [[s, "ia32"]], [/windows\s(ce|mobile);\sppc;/i], [[s, "arm"]], [/((?:ppc|powerpc)(?:64)?)(?:\smac|;|\))/i], [[s, /ower/, "", g.lowerize]], [/(sun4\w)[;\)]/i], [[s, "sparc"]], [/(ia64(?=;)|68k(?=\))|arm(?=v\d+;)|(?:irix|mips|sparc)(?:64)?(?=;)|pa-risc)/i], [s, g.lowerize]],
  1406. device: [[/\((ipad|playbook);[\w\s\);-]+(rim|apple)/i], [t, o, [r, h]], [/applecoremedia\/[\w\.]+ \((ipad)/], [t, [o, "Apple"], [r, h]], [/(apple\s{0,1}tv)/i], [[t, "Apple TV"], [o, "Apple"]], [/(hp).+(touchpad)/i, /(kindle)\/([\w\.]+)/i, /\s(nook)[\w\s]+build\/(\w+)/i, /(dell)\s(strea[kpr\s\d]*[\dko])/i], [o, t, [r, h]], [/\((ip[honed|\s\w*]+);.+(apple)/i], [t, o, [r, c]], [/\((ip[honed|\s\w*]+);/i], [t, [o, "Apple"], [r, c]], [/(blackberry)[\s-]?(\w+)/i, /(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus|dell|huawei|meizu|motorola)[\s_-]?([\w-]+)*/i, /(hp)\s([\w\s]+\w)/i, /(asus)-?(\w+)/i], [o, t, [r, c]], [/\((bb10);\s(\w+)/i], [[o, "BlackBerry"], t, [r, c]], [/android.+((transfo[prime\s]{4,10}\s\w+|eeepc|slider\s\w+))/i], [[o, "Asus"], t, [r, h]], [/(sony)\s(tablet\s[ps])/i], [o, t, [r, h]], [/(nintendo)\s([wids3u]+)/i], [o, t, [r, l]], [/((playstation)\s[3portablevi]+)/i], [[o, "Sony"], t, [r, l]], [/(sprint\s(\w+))/i], [[o, m.str, v.device.sprint.vendor], [t, m.str, v.device.sprint.model], [r, c]], [/(htc)[;_\s-]+([\w\s]+(?=\))|\w+)*/i, /(zte)-(\w+)*/i, /(alcatel|geeksphone|huawei|lenovo|nexian|panasonic|(?=;\s)sony)[_\s-]?([\w-]+)*/i], [o, [t, /_/g, " "], [r, c]], [/\s((milestone|droid(?:[2-4x]|\s(?:bionic|x2|pro|razr))?(:?\s4g)?))[\w\s]+build\//i, /(mot)[\s-]?(\w+)*/i], [[o, "Motorola"], t, [r, c]], [/android.+\s((mz60\d|xoom[\s2]{0,2}))\sbuild\//i], [[o, "Motorola"], t, [r, h]], [/android.+((sch-i[89]0\d|shw-m380s|gt-p\d{4}|gt-n8000|sgh-t8[56]9))/i], [[o, "Samsung"], t, [r, h]], [/((s[cgp]h-\w+|gt-\w+|galaxy\snexus))/i, /(sam[sung]*)[\s-]*(\w+-?[\w-]*)*/i, /sec-((sgh\w+))/i], [[o, "Samsung"], t, [r, c]], [/(sie)-(\w+)*/i], [[o, "Siemens"], t, [r, c]], [/(maemo|nokia).*(n900|lumia\s\d+)/i, /(nokia)[\s_-]?([\w-]+)*/i], [[o, "Nokia"], t, [r, c]], [/android\s3\.[\s\w-;]{10}((a\d{3}))/i], [[o, "Acer"], t, [r, h]], [/android\s3\.[\s\w-;]{10}(lg?)-([06cv9]{3,4})/i], [[o, "LG"], t, [r, h]], [/((nexus\s[45]))/i, /(lg)[e;\s-\/]+(\w+)*/i], [[o, "LG"], t, [r, c]], [/android.+((ideatab[a-z0-9\-\s]+))/i], [[o, "Lenovo"], t, [r, h]], [/(lg) netcast\.tv/i], [o, [r, "smarttv"]], [/(mobile|tablet);.+rv\:.+gecko\//i], [r, o, t]],
  1407. engine: [[/(presto)\/([\w\.]+)/i, /(webkit|trident|netfront|netsurf|amaya|lynx|w3m)\/([\w\.]+)/i, /(khtml|tasman|links)[\/\s]\(?([\w\.]+)/i, /(icab)[\/\s]([23]\.[\d\.]+)/i], [n, a], [/rv\:([\w\.]+).*(gecko)/i], [a, n]],
  1408. os: [[/microsoft\s(windows)\s(vista|xp)/i], [n, a], [/(windows)\snt\s6\.2;\s(arm)/i, /(windows\sphone(?:\sos)*|windows\smobile|windows)[\s\/]?([ntce\d\.\s]+\w)/i], [n, [a, m.str, v.os.windows.version]], [/(win(?=3|9|n)|win\s9x\s)([nt\d\.]+)/i], [[n, "Windows"], [a, m.str, v.os.windows.version]], [/\((bb)(10);/i], [[n, "BlackBerry"], a], [/(blackberry)\w*\/?([\w\.]+)*/i, /(tizen)\/([\w\.]+)/i, /(android|webos|palm\os|qnx|bada|rim\stablet\sos|meego)[\/\s-]?([\w\.]+)*/i], [n, a], [/(symbian\s?os|symbos|s60(?=;))[\/\s-]?([\w\.]+)*/i], [[n, "Symbian"], a], [/mozilla.+\(mobile;.+gecko.+firefox/i], [[n, "Firefox OS"], a], [/(nintendo|playstation)\s([wids3portablevu]+)/i, /(mint)[\/\s\(]?(\w+)*/i, /(joli|[kxln]?ubuntu|debian|[open]*suse|gentoo|arch|slackware|fedora|mandriva|centos|pclinuxos|redhat|zenwalk)[\/\s-]?([\w\.-]+)*/i, /(hurd|linux)\s?([\w\.]+)*/i, /(gnu)\s?([\w\.]+)*/i], [n, a], [/(cros)\s[\w]+\s([\w\.]+\w)/i], [[n, "Chromium OS"], a], [/(sunos)\s?([\w\.]+\d)*/i], [[n, "Solaris"], a], [/\s([frentopc-]{0,4}bsd|dragonfly)\s?([\w\.]+)*/i], [n, a], [/(ip[honead]+)(?:.*os\s*([\w]+)*\slike\smac|;\sopera)/i], [[n, "iOS"], [a, /_/g, "."]], [/(mac\sos\sx)\s?([\w\s\.]+\w)*/i], [n, [a, /_/g, "."]], [/(haiku)\s(\w+)/i, /(aix)\s((\d)(?=\.|\)|\s)[\w\.]*)*/i, /(macintosh|mac(?=_powerpc)|plan\s9|minix|beos|os\/2|amigaos|morphos|risc\sos)/i, /(unix)\s?([\w\.]+)*/i], [n, a]]
  1409. }
  1410. , A = function(e) {
  1411. var t = e || (i && i.navigator && i.navigator.userAgent ? i.navigator.userAgent : "");
  1412. return this instanceof A ? (this.getBrowser = function() {
  1413. return m.rgx.apply(this, y.browser)
  1414. }
  1415. ,
  1416. this.getCPU = function() {
  1417. return m.rgx.apply(this, y.cpu)
  1418. }
  1419. ,
  1420. this.getDevice = function() {
  1421. return m.rgx.apply(this, y.device)
  1422. }
  1423. ,
  1424. this.getEngine = function() {
  1425. return m.rgx.apply(this, y.engine)
  1426. }
  1427. ,
  1428. this.getOS = function() {
  1429. return m.rgx.apply(this, y.os)
  1430. }
  1431. ,
  1432. this.getResult = function() {
  1433. return {
  1434. ua: this.getUA(),
  1435. browser: this.getBrowser(),
  1436. engine: this.getEngine(),
  1437. os: this.getOS(),
  1438. device: this.getDevice(),
  1439. cpu: this.getCPU()
  1440. }
  1441. }
  1442. ,
  1443. this.getUA = function() {
  1444. return t
  1445. }
  1446. ,
  1447. this.setUA = function(e) {
  1448. return t = e,
  1449. this
  1450. }
  1451. ,
  1452. void this.setUA(t)) : new A(e).getResult()
  1453. };
  1454. if (typeof exports != p)
  1455. typeof module != p && module.exports && (exports = module.exports = A),
  1456. exports.UAParser = A;
  1457. else if (i.UAParser = A,
  1458. typeof define == d && define.amd && define(function() {
  1459. return A
  1460. }),
  1461. typeof i.jQuery != p) {
  1462. var C = i.jQuery
  1463. , I = new A;
  1464. C.ua = I.getResult(),
  1465. C.ua.get = function() {
  1466. return I.getUA()
  1467. }
  1468. ,
  1469. C.ua.set = function(e) {
  1470. I.setUA(e);
  1471. var t = I.getResult();
  1472. for (var i in t)
  1473. C.ua[i] = t[i]
  1474. }
  1475. }
  1476. }(this),
  1477. window.Modernizr = function(e, t) {
  1478. function i(e, t) {
  1479. return typeof e === t
  1480. }
  1481. var n, r, o, a = {}, s = t.documentElement, l = t.createElement("modernizr"), c = l.style, h = {}, u = [], d = u.slice, p = {}.hasOwnProperty;
  1482. for (var f in r = i(p, "undefined") || i(p.call, "undefined") ? function(e, t) {
  1483. return t in e && i(e.constructor.prototype[t], "undefined")
  1484. }
  1485. : function(e, t) {
  1486. return p.call(e, t)
  1487. }
  1488. ,
  1489. Function.prototype.bind || (Function.prototype.bind = function(n) {
  1490. var r = this;
  1491. if ("function" != typeof r)
  1492. throw new TypeError;
  1493. var o = d.call(arguments, 1)
  1494. , a = function() {
  1495. if (this instanceof a) {
  1496. function e() {}
  1497. e.prototype = r.prototype;
  1498. var t = new e
  1499. , i = r.apply(t, o.concat(d.call(arguments)));
  1500. return Object(i) === i ? i : t
  1501. }
  1502. return r.apply(n, o.concat(d.call(arguments)))
  1503. };
  1504. return a
  1505. }
  1506. ),
  1507. h.webgl = function() {
  1508. return !!e.WebGLRenderingContext
  1509. }
  1510. ,
  1511. h)
  1512. r(h, f) && (n = f.toLowerCase(),
  1513. a[n] = h[f](),
  1514. u.push((a[n] ? "" : "no-") + n));
  1515. return a.addTest = function(e, t) {
  1516. if ("object" == typeof e)
  1517. for (var i in e)
  1518. r(e, i) && a.addTest(i, e[i]);
  1519. else {
  1520. if (e = e.toLowerCase(),
  1521. void 0 !== a[e])
  1522. return a;
  1523. t = "function" == typeof t ? t() : t,
  1524. "undefined" != typeof enableClasses && enableClasses && (s.className += " " + (t ? "" : "no-") + e),
  1525. a[e] = t
  1526. }
  1527. return a
  1528. }
  1529. ,
  1530. o = "",
  1531. c.cssText = o,
  1532. l = null,
  1533. a._version = "2.8.2",
  1534. a
  1535. }(this, this.document),
  1536. function(xe, e, Se) {
  1537. "use strict";
  1538. function Me(s, e, n) {
  1539. function a(e) {
  1540. var t = Q.length;
  1541. if (G.old = xe.extend({}, G),
  1542. H = V ? 0 : k[F.horizontal ? "width" : "height"](),
  1543. Y = W[F.horizontal ? "width" : "height"](),
  1544. z = V ? s : U[F.horizontal ? "outerWidth" : "outerHeight"](),
  1545. Q.length = 0,
  1546. G.start = 0,
  1547. G.end = nt(z - H, 0),
  1548. le) {
  1549. $.length,
  1550. J = U.children(F.itemSelector),
  1551. $.length = 0;
  1552. var h, u = Ne(U, F.horizontal ? "paddingLeft" : "paddingTop"), d = Ne(U, F.horizontal ? "paddingRight" : "paddingBottom"), i = "border-box" === xe(J).css("boxSizing"), p = "none" !== J.css("float"), f = 0, g = J.length - 1;
  1553. z = 0,
  1554. J.each(function(e, t) {
  1555. var i = xe(t)
  1556. , n = t.getBoundingClientRect()
  1557. , r = it(F.horizontal ? n.width || n.right - n.left : n.height || n.bottom - n.top)
  1558. , o = Ne(i, F.horizontal ? "marginLeft" : "marginTop")
  1559. , a = Ne(i, F.horizontal ? "marginRight" : "marginBottom")
  1560. , s = r + o + a
  1561. , l = !o || !a
  1562. , c = {};
  1563. c.el = t,
  1564. c.size = l ? r : s,
  1565. c.half = c.size / 2,
  1566. c.start = z + (l ? o : 0),
  1567. c.center = c.start - it(H / 2 - c.size / 2),
  1568. c.end = c.start - H + c.size,
  1569. e || (z += u),
  1570. z += s,
  1571. F.horizontal || p || a && o && 0 < e && (z -= rt(o, a)),
  1572. e === g && (c.end += d,
  1573. z += d,
  1574. f = l ? a : 0),
  1575. $.push(c),
  1576. h = c
  1577. }),
  1578. U[0].style[F.horizontal ? "width" : "height"] = (i ? z : z - u - d) + "px",
  1579. z -= f,
  1580. $.length ? (G.start = $[0][ae ? "center" : "start"],
  1581. G.end = ae ? h.center : H < z ? h.end : G.start) : G.start = G.end = 0
  1582. }
  1583. if (G.center = it(G.end / 2 + G.start / 2),
  1584. v(),
  1585. j.length && 0 < Y && (F.dynamicHandle ? (q = Fe(q = G.start === G.end ? Y : it(Y * H / z), F.minHandleSize, Y),
  1586. j[0].style[F.horizontal ? "width" : "height"] = q + "px") : q = j[F.horizontal ? "outerWidth" : "outerHeight"](),
  1587. X.end = Y - q,
  1588. _e || c()),
  1589. !V && 0 < H) {
  1590. var n = G.start
  1591. , r = "";
  1592. if (le)
  1593. xe.each($, function(e, t) {
  1594. ae ? Q.push(t.center) : t.start + t.size > n && n <= G.end && (n = t.start,
  1595. Q.push(n),
  1596. (n += H) > G.end && n < G.end + H && Q.push(G.end))
  1597. });
  1598. else
  1599. for (; n - H < G.end; )
  1600. Q.push(n),
  1601. n += H;
  1602. if (Z[0] && t !== Q.length) {
  1603. for (var o = 0; o < Q.length; o++)
  1604. r += F.pageBuilder.call(B, o);
  1605. (K = Z.html(r).children()).eq(ee.activePage).addClass(F.activeClass)
  1606. }
  1607. }
  1608. if (ee.slideeSize = z,
  1609. ee.frameSize = H,
  1610. ee.sbSize = Y,
  1611. ee.handleSize = q,
  1612. le) {
  1613. e && null != F.startAt && (m(F.startAt),
  1614. B[se ? "toCenter" : "toStart"](F.startAt));
  1615. var a = $[ee.activeItem];
  1616. l(se && a ? a.center : Fe(G.dest, G.start, G.end))
  1617. } else
  1618. e ? null != F.startAt && l(F.startAt, 1) : l(Fe(G.dest, G.start, G.end));
  1619. L("load")
  1620. }
  1621. function l(e, t, i) {
  1622. if (le && Ie.released && !i) {
  1623. var n = d(e)
  1624. , r = e > G.start && e < G.end;
  1625. se ? (r && (e = $[n.centerItem].center),
  1626. ae && F.activateMiddle && m(n.centerItem)) : r && (e = $[n.firstItem].start)
  1627. }
  1628. Ie.init && Ie.slidee && F.elasticBounds ? e > G.end ? e = G.end + (e - G.end) / 6 : e < G.start && (e = G.start + (e - G.start) / 6) : e = Fe(e, G.start, G.end),
  1629. Ae.start = +new Date,
  1630. Ae.time = 0,
  1631. Ae.from = G.cur,
  1632. Ae.to = e,
  1633. Ae.delta = e - G.cur,
  1634. Ae.tweesing = Ie.tweese || Ie.init && !Ie.slidee,
  1635. Ae.immediate = !Ae.tweesing && (t || Ie.init && Ie.slidee || !F.speed),
  1636. Ie.tweese = 0,
  1637. e !== G.dest && (G.dest = e,
  1638. L("change"),
  1639. _e || o()),
  1640. g(),
  1641. v(),
  1642. p(),
  1643. K[0] && ye.page !== ee.activePage && (ye.page = ee.activePage,
  1644. K.removeClass(F.activeClass).eq(ee.activePage).addClass(F.activeClass),
  1645. L("activePage", ye.page))
  1646. }
  1647. function o() {
  1648. if (B.initialized) {
  1649. if (!_e)
  1650. return _e = Ge(o),
  1651. void (Ie.released && L("moveStart"));
  1652. Ae.immediate ? G.cur = Ae.to : Ae.tweesing ? (Ae.tweeseDelta = Ae.to - G.cur,
  1653. $e(Ae.tweeseDelta) < .1 ? G.cur = Ae.to : G.cur += Ae.tweeseDelta * (Ie.released ? F.swingSpeed : F.syncSpeed)) : (Ae.time = rt(+new Date - Ae.start, F.speed),
  1654. G.cur = Ae.from + Ae.delta * xe.easing[F.easing](Ae.time / F.speed, Ae.time, 0, 1, F.speed)),
  1655. Ae.to === G.cur ? (G.cur = Ae.to,
  1656. Ie.tweese = _e = 0) : _e = Ge(o),
  1657. L("move"),
  1658. V || (Ve ? U[0].style[Ve] = ke + (F.horizontal ? "translateX" : "translateY") + "(" + -G.cur + "px)" : U[0].style[F.horizontal ? "left" : "top"] = -it(G.cur) + "px"),
  1659. !_e && Ie.released && L("moveEnd"),
  1660. c()
  1661. }
  1662. }
  1663. function c() {
  1664. j.length && (X.cur = G.start === G.end ? 0 : ((Ie.init && !Ie.slidee ? G.dest : G.cur) - G.start) / (G.end - G.start) * X.end,
  1665. X.cur = Fe(it(X.cur), X.start, X.end),
  1666. ye.hPos !== X.cur && (ye.hPos = X.cur,
  1667. Ve ? j[0].style[Ve] = ke + (F.horizontal ? "translateX" : "translateY") + "(" + X.cur + "px)" : j[0].style[F.horizontal ? "left" : "top"] = X.cur + "px"))
  1668. }
  1669. function t() {
  1670. Ce.speed && G.cur !== (0 < Ce.speed ? G.end : G.start) || B.stop(),
  1671. Te = Ie.init ? Ge(t) : 0,
  1672. Ce.now = +new Date,
  1673. Ce.pos = G.cur + (Ce.now - Ce.lastTime) / 1e3 * Ce.speed,
  1674. l(Ie.init ? Ce.pos : it(Ce.pos)),
  1675. Ie.init || G.cur !== G.dest || L("moveEnd"),
  1676. Ce.lastTime = Ce.now
  1677. }
  1678. function i(e, t, i) {
  1679. if ("boolean" === Re(t) && (i = t,
  1680. t = Se),
  1681. t === Se)
  1682. l(G[e], i);
  1683. else {
  1684. if (se && "center" !== e)
  1685. return;
  1686. var n = B.getPos(t);
  1687. n && l(n[e], i, !se)
  1688. }
  1689. }
  1690. function h(e) {
  1691. return null != e ? De(e) ? 0 <= e && e < $.length ? e : -1 : J.index(e) : -1
  1692. }
  1693. function u(e) {
  1694. return h(De(e) && e < 0 ? e + $.length : e)
  1695. }
  1696. function m(e, t) {
  1697. var i = h(e);
  1698. return !(!le || i < 0) && (ye.active === i && !t || (J.eq(ee.activeItem).removeClass(F.activeClass),
  1699. J.eq(i).addClass(F.activeClass),
  1700. ye.active = ee.activeItem = i,
  1701. p(),
  1702. L("active", i)),
  1703. i)
  1704. }
  1705. function d(e) {
  1706. e = Fe(De(e) ? e : G.dest, G.start, G.end);
  1707. var t = {}
  1708. , i = ae ? 0 : H / 2;
  1709. if (!V)
  1710. for (var n = 0, r = Q.length; n < r; n++) {
  1711. if (e >= G.end || n === Q.length - 1) {
  1712. t.activePage = Q.length - 1;
  1713. break
  1714. }
  1715. if (e <= Q[n] + i) {
  1716. t.activePage = n;
  1717. break
  1718. }
  1719. }
  1720. if (le) {
  1721. for (var o = !1, a = !1, s = !1, l = 0, c = $.length; l < c; l++)
  1722. if (!1 === o && e <= $[l].start + $[l].half && (o = l),
  1723. !1 === s && e <= $[l].center + $[l].half && (s = l),
  1724. l === c - 1 || e <= $[l].end + $[l].half) {
  1725. a = l;
  1726. break
  1727. }
  1728. t.firstItem = De(o) ? o : 0,
  1729. t.centerItem = De(s) ? s : t.firstItem,
  1730. t.lastItem = De(a) ? a : t.centerItem
  1731. }
  1732. return t
  1733. }
  1734. function v(e) {
  1735. xe.extend(ee, d(e))
  1736. }
  1737. function p() {
  1738. var e = G.dest <= G.start
  1739. , t = G.dest >= G.end
  1740. , i = (e ? 1 : 0) | (t ? 2 : 0);
  1741. if (ye.slideePosState !== i && (ye.slideePosState = i,
  1742. ge.is("button,input") && ge.prop("disabled", e),
  1743. me.is("button,input") && me.prop("disabled", t),
  1744. ge.add(de)[e ? "addClass" : "removeClass"](F.disabledClass),
  1745. me.add(ue)[t ? "addClass" : "removeClass"](F.disabledClass)),
  1746. ye.fwdbwdState !== i && Ie.released && (ye.fwdbwdState = i,
  1747. de.is("button,input") && de.prop("disabled", e),
  1748. ue.is("button,input") && ue.prop("disabled", t)),
  1749. le && null != ee.activeItem) {
  1750. var n = 0 === ee.activeItem
  1751. , r = ee.activeItem >= $.length - 1
  1752. , o = (n ? 1 : 0) | (r ? 2 : 0);
  1753. ye.itemsButtonState !== o && (ye.itemsButtonState = o,
  1754. pe.is("button,input") && pe.prop("disabled", n),
  1755. fe.is("button,input") && fe.prop("disabled", r),
  1756. pe[n ? "addClass" : "removeClass"](F.disabledClass),
  1757. fe[r ? "addClass" : "removeClass"](F.disabledClass))
  1758. }
  1759. }
  1760. function r(e, t, i) {
  1761. if (e = u(e),
  1762. t = u(t),
  1763. -1 < e && -1 < t && e !== t && (!i || t !== e - 1) && (i || t !== e + 1)) {
  1764. J.eq(e)[i ? "insertAfter" : "insertBefore"]($[t].el);
  1765. var n = e < t ? e : i ? t : t - 1
  1766. , r = t < e ? e : i ? t + 1 : t
  1767. , o = t < e;
  1768. null != ee.activeItem && (e === ee.activeItem ? ye.active = ee.activeItem = i ? o ? t + 1 : t : o ? t : t - 1 : ee.activeItem > n && ee.activeItem < r && (ye.active = ee.activeItem += o ? 1 : -1)),
  1769. a()
  1770. }
  1771. }
  1772. function f(e, t) {
  1773. for (var i = 0, n = ve[e].length; i < n; i++)
  1774. if (ve[e][i] === t)
  1775. return i;
  1776. return -1
  1777. }
  1778. function g() {
  1779. Ie.released && !B.isPaused && B.resume()
  1780. }
  1781. function y(e) {
  1782. return it(Fe(e, X.start, X.end) / X.end * (G.end - G.start)) + G.start
  1783. }
  1784. function A() {
  1785. Ie.history[0] = Ie.history[1],
  1786. Ie.history[1] = Ie.history[2],
  1787. Ie.history[2] = Ie.history[3],
  1788. Ie.history[3] = Ie.delta
  1789. }
  1790. function C(e) {
  1791. Ie.released = 0,
  1792. Ie.source = e,
  1793. Ie.slidee = "slidee" === e
  1794. }
  1795. function I(e) {
  1796. var t = "touchstart" === e.type
  1797. , i = e.data.source
  1798. , n = "slidee" === i;
  1799. Ie.init || !t && b(e.target) || !("handle" !== i || F.dragHandle && X.start !== X.end) || n && !(t ? F.touchDragging : F.mouseDragging && e.which < 2) || (t || Pe(e),
  1800. C(i),
  1801. Ie.init = 0,
  1802. Ie.$source = xe(e.target),
  1803. Ie.touch = t,
  1804. Ie.pointer = t ? e.originalEvent.touches[0] : e,
  1805. Ie.initX = Ie.pointer.pageX,
  1806. Ie.initY = Ie.pointer.pageY,
  1807. Ie.initPos = n ? G.cur : X.cur,
  1808. Ie.start = +new Date,
  1809. Ie.time = 0,
  1810. Ie.path = 0,
  1811. Ie.delta = 0,
  1812. Ie.locked = 0,
  1813. Ie.history = [0, 0, 0, 0],
  1814. Ie.pathToLock = n ? t ? 30 : 10 : 0,
  1815. We.on(t ? qe : Ye, E),
  1816. B.pause(1),
  1817. (n ? U : j).addClass(F.draggedClass),
  1818. L("moveStart"),
  1819. n && (be = setInterval(A, 10)))
  1820. }
  1821. function E(e) {
  1822. if (Ie.released = "mouseup" === e.type || "touchend" === e.type,
  1823. Ie.pointer = Ie.touch ? e.originalEvent[Ie.released ? "changedTouches" : "touches"][0] : e,
  1824. Ie.pathX = Ie.pointer.pageX - Ie.initX,
  1825. Ie.pathY = Ie.pointer.pageY - Ie.initY,
  1826. Ie.path = et(tt(Ie.pathX, 2) + tt(Ie.pathY, 2)),
  1827. Ie.delta = F.horizontal ? Ie.pathX : Ie.pathY,
  1828. Ie.released || !(Ie.path < 1)) {
  1829. if (!Ie.init) {
  1830. if (!(F.horizontal ? $e(Ie.pathX) > $e(Ie.pathY) : $e(Ie.pathX) < $e(Ie.pathY)))
  1831. return _();
  1832. Ie.init = 1
  1833. }
  1834. Pe(e),
  1835. !Ie.locked && Ie.path > Ie.pathToLock && Ie.slidee && (Ie.locked = 1,
  1836. Ie.$source.on(Ze, Oe)),
  1837. Ie.released && (_(),
  1838. F.releaseSwing && Ie.slidee && (Ie.swing = (Ie.delta - Ie.history[0]) / 40 * 300,
  1839. Ie.delta += Ie.swing,
  1840. Ie.tweese = 10 < $e(Ie.swing))),
  1841. l(Ie.slidee ? it(Ie.initPos - Ie.delta) : y(Ie.initPos + Ie.delta))
  1842. }
  1843. }
  1844. function _() {
  1845. clearInterval(be),
  1846. Ie.released = !0,
  1847. We.off(Ie.touch ? qe : Ye, E),
  1848. (Ie.slidee ? U : j).removeClass(F.draggedClass),
  1849. setTimeout(function() {
  1850. Ie.$source.off(Ze, Oe)
  1851. }),
  1852. G.cur === G.dest && Ie.init && L("moveEnd"),
  1853. B.resume(1),
  1854. Ie.init = 0
  1855. }
  1856. function b(e) {
  1857. return ~xe.inArray(e.nodeName, Qe) || xe(e).is(F.interactive)
  1858. }
  1859. function w() {
  1860. B.stop(),
  1861. We.off("mouseup", w)
  1862. }
  1863. function T(e) {
  1864. switch (Pe(e),
  1865. this) {
  1866. case ue[0]:
  1867. case de[0]:
  1868. B.moveBy(ue.is(this) ? F.moveBy : -F.moveBy),
  1869. We.on("mouseup", w);
  1870. break;
  1871. case pe[0]:
  1872. B.prev();
  1873. break;
  1874. case fe[0]:
  1875. B.next();
  1876. break;
  1877. case ge[0]:
  1878. B.prevPage();
  1879. break;
  1880. case me[0]:
  1881. B.nextPage()
  1882. }
  1883. }
  1884. function x(e) {
  1885. e.originalEvent[He] = B;
  1886. var t = +new Date;
  1887. if (ot + F.scrollHijack > t && ce[0] !== document && ce[0] !== window)
  1888. ot = t;
  1889. else if (F.scrollBy && G.start !== G.end) {
  1890. var i = function(e) {
  1891. return Ee.curDelta = (F.horizontal ? e.deltaY || e.deltaX : e.deltaY) || -e.wheelDelta,
  1892. Ee.curDelta /= 1 === e.deltaMode ? 3 : 100,
  1893. le ? (Ue = +new Date,
  1894. Ee.last < Ue - Ee.resetTime && (Ee.delta = 0),
  1895. Ee.last = Ue,
  1896. Ee.delta += Ee.curDelta,
  1897. $e(Ee.delta) < 1 ? Ee.finalDelta = 0 : (Ee.finalDelta = it(Ee.delta / 1),
  1898. Ee.delta %= 1),
  1899. Ee.finalDelta) : Ee.curDelta
  1900. }(e.originalEvent);
  1901. (F.scrollTrap || 0 < i && G.dest < G.end || i < 0 && G.dest > G.start) && Pe(e, 1),
  1902. B.slideBy(F.scrollBy * i)
  1903. }
  1904. }
  1905. function S(e) {
  1906. F.clickBar && e.target === W[0] && (Pe(e),
  1907. l(y((F.horizontal ? e.pageX - W.offset().left : e.pageY - W.offset().top) - q / 2)))
  1908. }
  1909. function M(e) {
  1910. if (F.keyboardNavBy)
  1911. switch (e.which) {
  1912. case F.horizontal ? 37 : 38:
  1913. Pe(e),
  1914. B["pages" === F.keyboardNavBy ? "prevPage" : "prev"]();
  1915. break;
  1916. case F.horizontal ? 39 : 40:
  1917. Pe(e),
  1918. B["pages" === F.keyboardNavBy ? "nextPage" : "next"]()
  1919. }
  1920. }
  1921. function R(e) {
  1922. return b(this) ? void (e.originalEvent[He + "ignore"] = !0) : void (this.parentNode !== U[0] || e.originalEvent[He + "ignore"] || B.activate(this))
  1923. }
  1924. function P() {
  1925. this.parentNode === Z[0] && B.activatePage(K.index(this))
  1926. }
  1927. function O(e) {
  1928. F.pauseOnHover && B["mouseenter" === e.type ? "pause" : "resume"](2)
  1929. }
  1930. function L(e, t) {
  1931. if (ve[e]) {
  1932. for (N = ve[e].length,
  1933. Je.length = 0,
  1934. D = 0; D < N; D++)
  1935. Je.push(ve[e][D]);
  1936. for (D = 0; D < N; D++)
  1937. Je[D].call(B, e, t)
  1938. }
  1939. }
  1940. var D, N, F = xe.extend({}, Me.defaults, e), B = this, V = De(s), k = xe(s), U = F.slidee ? xe(F.slidee).eq(0) : k.children().eq(0), H = 0, z = 0, G = {
  1941. start: 0,
  1942. center: 0,
  1943. end: 0,
  1944. cur: 0,
  1945. dest: 0
  1946. }, W = xe(F.scrollBar).eq(0), j = W.children().eq(0), Y = 0, q = 0, X = {
  1947. start: 0,
  1948. end: 0,
  1949. cur: 0
  1950. }, Z = xe(F.pagesBar), K = 0, Q = [], J = 0, $ = [], ee = {
  1951. firstItem: 0,
  1952. lastItem: 0,
  1953. centerItem: 0,
  1954. activeItem: null,
  1955. activePage: 0
  1956. }, te = new Be(k[0]), ie = new Be(U[0]), ne = new Be(W[0]), re = new Be(j[0]), oe = "basic" === F.itemNav, ae = "forceCentered" === F.itemNav, se = "centered" === F.itemNav || ae, le = !V && (oe || se || ae), ce = F.scrollSource ? xe(F.scrollSource) : k, he = F.dragSource ? xe(F.dragSource) : k, ue = xe(F.forward), de = xe(F.backward), pe = xe(F.prev), fe = xe(F.next), ge = xe(F.prevPage), me = xe(F.nextPage), ve = {}, ye = {}, Ae = {}, Ce = {}, Ie = {
  1957. released: 1
  1958. }, Ee = {
  1959. last: 0,
  1960. delta: 0,
  1961. resetTime: 200
  1962. }, _e = 0, be = 0, we = 0, Te = 0;
  1963. V || (s = k[0]),
  1964. B.initialized = 0,
  1965. B.frame = s,
  1966. B.slidee = U[0],
  1967. B.pos = G,
  1968. B.rel = ee,
  1969. B.items = $,
  1970. B.pages = Q,
  1971. B.isPaused = 0,
  1972. B.options = F,
  1973. B.dragging = Ie,
  1974. B.reload = function() {
  1975. a()
  1976. }
  1977. ,
  1978. B.getPos = function(e) {
  1979. if (le) {
  1980. var t = h(e);
  1981. return -1 !== t && $[t]
  1982. }
  1983. var i = U.find(e).eq(0);
  1984. if (i[0]) {
  1985. var n = F.horizontal ? i.offset().left - U.offset().left : i.offset().top - U.offset().top
  1986. , r = i[F.horizontal ? "outerWidth" : "outerHeight"]();
  1987. return {
  1988. start: n,
  1989. center: n - H / 2 + r / 2,
  1990. end: n - H + r,
  1991. size: r
  1992. }
  1993. }
  1994. return !1
  1995. }
  1996. ,
  1997. B.moveBy = function(e) {
  1998. Ce.speed = e,
  1999. !Ie.init && Ce.speed && G.cur !== (0 < Ce.speed ? G.end : G.start) && (Ce.lastTime = +new Date,
  2000. Ce.startPos = G.cur,
  2001. C("button"),
  2002. Ie.init = 1,
  2003. L("moveStart"),
  2004. ze(Te),
  2005. t())
  2006. }
  2007. ,
  2008. B.stop = function() {
  2009. "button" === Ie.source && (Ie.init = 0,
  2010. Ie.released = 1)
  2011. }
  2012. ,
  2013. B.prev = function() {
  2014. B.activate(null == ee.activeItem ? 0 : ee.activeItem - 1)
  2015. }
  2016. ,
  2017. B.next = function() {
  2018. B.activate(null == ee.activeItem ? 0 : ee.activeItem + 1)
  2019. }
  2020. ,
  2021. B.prevPage = function() {
  2022. B.activatePage(ee.activePage - 1)
  2023. }
  2024. ,
  2025. B.nextPage = function() {
  2026. B.activatePage(ee.activePage + 1)
  2027. }
  2028. ,
  2029. B.slideBy = function(e, t) {
  2030. e && (le ? B[se ? "toCenter" : "toStart"](Fe((se ? ee.centerItem : ee.firstItem) + F.scrollBy * e, 0, $.length)) : l(G.dest + e, t))
  2031. }
  2032. ,
  2033. B.slideTo = function(e, t) {
  2034. l(e, t)
  2035. }
  2036. ,
  2037. B.toStart = function(e, t) {
  2038. i("start", e, t)
  2039. }
  2040. ,
  2041. B.toEnd = function(e, t) {
  2042. i("end", e, t)
  2043. }
  2044. ,
  2045. B.toCenter = function(e, t) {
  2046. i("center", e, t)
  2047. }
  2048. ,
  2049. B.getIndex = h,
  2050. B.activate = function(e, t) {
  2051. var i = m(e);
  2052. F.smart && !1 !== i && (se ? B.toCenter(i, t) : i >= ee.lastItem ? B.toStart(i, t) : i <= ee.firstItem ? B.toEnd(i, t) : g())
  2053. }
  2054. ,
  2055. B.activatePage = function(e, t) {
  2056. De(e) && l(Q[Fe(e, 0, Q.length - 1)], t)
  2057. }
  2058. ,
  2059. B.resume = function(e) {
  2060. F.cycleBy && F.cycleInterval && ("items" !== F.cycleBy || $[0] && null != ee.activeItem) && !(e < B.isPaused) && (B.isPaused = 0,
  2061. we ? we = clearTimeout(we) : L("resume"),
  2062. we = setTimeout(function() {
  2063. switch (L("cycle"),
  2064. F.cycleBy) {
  2065. case "items":
  2066. B.activate(ee.activeItem >= $.length - 1 ? 0 : ee.activeItem + 1);
  2067. break;
  2068. case "pages":
  2069. B.activatePage(ee.activePage >= Q.length - 1 ? 0 : ee.activePage + 1)
  2070. }
  2071. }, F.cycleInterval))
  2072. }
  2073. ,
  2074. B.pause = function(e) {
  2075. e < B.isPaused || (B.isPaused = e || 100,
  2076. we && (we = clearTimeout(we),
  2077. L("pause")))
  2078. }
  2079. ,
  2080. B.toggle = function() {
  2081. B[we ? "pause" : "resume"]()
  2082. }
  2083. ,
  2084. B.set = function(e, t) {
  2085. xe.isPlainObject(e) ? xe.extend(F, e) : F.hasOwnProperty(e) && (F[e] = t)
  2086. }
  2087. ,
  2088. B.add = function(e, t) {
  2089. var i = xe(e);
  2090. le ? (null == t || !$[0] || t >= $.length ? i.appendTo(U) : $.length && i.insertBefore($[t].el),
  2091. null != ee.activeItem && t <= ee.activeItem && (ye.active = ee.activeItem += i.length)) : U.append(i),
  2092. a()
  2093. }
  2094. ,
  2095. B.remove = function(e) {
  2096. if (le) {
  2097. var t = u(e);
  2098. if (-1 < t) {
  2099. J.eq(t).remove();
  2100. var i = t === ee.activeItem;
  2101. null != ee.activeItem && t < ee.activeItem && (ye.active = --ee.activeItem),
  2102. a(),
  2103. i && (ye.active = null,
  2104. B.activate(ee.activeItem))
  2105. }
  2106. } else
  2107. xe(e).remove(),
  2108. a()
  2109. }
  2110. ,
  2111. B.moveAfter = function(e, t) {
  2112. r(e, t, 1)
  2113. }
  2114. ,
  2115. B.moveBefore = function(e, t) {
  2116. r(e, t)
  2117. }
  2118. ,
  2119. B.on = function(e, t) {
  2120. if ("object" === Re(e))
  2121. for (var i in e)
  2122. e.hasOwnProperty(i) && B.on(i, e[i]);
  2123. else if ("function" === Re(t))
  2124. for (var n = e.split(" "), r = 0, o = n.length; r < o; r++)
  2125. ve[n[r]] = ve[n[r]] || [],
  2126. -1 === f(n[r], t) && ve[n[r]].push(t);
  2127. else if ("array" === Re(t))
  2128. for (var a = 0, s = t.length; a < s; a++)
  2129. B.on(e, t[a])
  2130. }
  2131. ,
  2132. B.one = function(t, i) {
  2133. B.on(t, function e() {
  2134. i.apply(B, arguments),
  2135. B.off(t, e)
  2136. })
  2137. }
  2138. ,
  2139. B.off = function(e, t) {
  2140. if (t instanceof Array)
  2141. for (var i = 0, n = t.length; i < n; i++)
  2142. B.off(e, t[i]);
  2143. else
  2144. for (var r = e.split(" "), o = 0, a = r.length; o < a; o++)
  2145. if (ve[r[o]] = ve[r[o]] || [],
  2146. null == t)
  2147. ve[r[o]].length = 0;
  2148. else {
  2149. var s = f(r[o], t);
  2150. -1 !== s && ve[r[o]].splice(s, 1)
  2151. }
  2152. }
  2153. ,
  2154. B.destroy = function() {
  2155. return ce.add(j).add(W).add(Z).add(ue).add(de).add(pe).add(fe).add(ge).add(me).off("." + He),
  2156. We.off("keydown", M),
  2157. pe.add(fe).add(ge).add(me).removeClass(F.disabledClass),
  2158. J && null != ee.activeItem && J.eq(ee.activeItem).removeClass(F.activeClass),
  2159. Z.empty(),
  2160. V || (k.off("." + He),
  2161. te.restore(),
  2162. ie.restore(),
  2163. ne.restore(),
  2164. re.restore(),
  2165. xe.removeData(s, He)),
  2166. $.length = Q.length = 0,
  2167. ye = {},
  2168. B.initialized = 0,
  2169. B
  2170. }
  2171. ,
  2172. B.init = function() {
  2173. if (!B.initialized) {
  2174. B.on(n);
  2175. var e = ["overflow", "position"]
  2176. , t = ["position", "webkitTransform", "msTransform", "transform", "left", "top", "width", "height"];
  2177. te.save.apply(te, e),
  2178. ne.save.apply(ne, e),
  2179. ie.save.apply(ie, t),
  2180. re.save.apply(re, t);
  2181. var i = j;
  2182. return V || (i = i.add(U),
  2183. k.css("overflow", "hidden"),
  2184. Ve || "static" !== k.css("position") || k.css("position", "relative")),
  2185. Ve ? ke && i.css(Ve, ke) : ("static" === W.css("position") && W.css("position", "relative"),
  2186. i.css({
  2187. position: "absolute"
  2188. })),
  2189. F.forward && ue.on(Ke, T),
  2190. F.backward && de.on(Ke, T),
  2191. F.prev && pe.on(Ze, T),
  2192. F.next && fe.on(Ze, T),
  2193. F.prevPage && ge.on(Ze, T),
  2194. F.nextPage && me.on(Ze, T),
  2195. ce.on(Xe, x),
  2196. W[0] && W.on(Ze, S),
  2197. le && F.activateOn && k.on(F.activateOn + "." + He, "*", R),
  2198. Z[0] && F.activatePageOn && Z.on(F.activatePageOn + "." + He, "*", P),
  2199. he.on(je, {
  2200. source: "slidee"
  2201. }, I),
  2202. j && j.on(je, {
  2203. source: "handle"
  2204. }, I),
  2205. We.on("keydown", M),
  2206. V || (k.on("mouseenter." + He + " mouseleave." + He, O),
  2207. k.on("scroll." + He, Le)),
  2208. B.initialized = 1,
  2209. a(!0),
  2210. F.cycleBy && !V && B[F.startPaused ? "pause" : "resume"](),
  2211. B
  2212. }
  2213. }
  2214. }
  2215. function Re(e) {
  2216. return null == e ? String(e) : "object" == typeof e || "function" == typeof e ? Object.prototype.toString.call(e).match(/\s([a-z]+)/i)[1].toLowerCase() || "object" : typeof e
  2217. }
  2218. function Pe(e, t) {
  2219. e.preventDefault(),
  2220. t && e.stopPropagation()
  2221. }
  2222. function Oe(e) {
  2223. Pe(e, 1),
  2224. xe(this).off(e.type, Oe)
  2225. }
  2226. function Le() {
  2227. this.scrollLeft = 0,
  2228. this.scrollTop = 0
  2229. }
  2230. function De(e) {
  2231. return !isNaN(parseFloat(e)) && isFinite(e)
  2232. }
  2233. function Ne(e, t) {
  2234. return 0 | it(String(e.css(t)).replace(/[^\-0-9.]/g, ""))
  2235. }
  2236. function Fe(e, t, i) {
  2237. return e < t ? t : i < e ? i : e
  2238. }
  2239. function Be(t) {
  2240. var i = {
  2241. style: {},
  2242. save: function() {
  2243. if (t && t.nodeType) {
  2244. for (var e = 0; e < arguments.length; e++)
  2245. i.style[arguments[e]] = t.style[arguments[e]];
  2246. return i
  2247. }
  2248. },
  2249. restore: function() {
  2250. if (t && t.nodeType) {
  2251. for (var e in i.style)
  2252. i.style.hasOwnProperty(e) && (t.style[e] = i.style[e]);
  2253. return i
  2254. }
  2255. }
  2256. };
  2257. return i
  2258. }
  2259. var Ve, ke, Ue, r, o, He = "sly", ze = e.cancelAnimationFrame || e.cancelRequestAnimationFrame, Ge = e.requestAnimationFrame, We = xe(document), je = "touchstart." + He + " mousedown." + He, Ye = "mousemove." + He + " mouseup." + He, qe = "touchmove." + He + " touchend." + He, Xe = (document.implementation.hasFeature("Event.wheel", "3.0") ? "wheel." : "mousewheel.") + He, Ze = "click." + He, Ke = "mousedown." + He, Qe = ["INPUT", "SELECT", "BUTTON", "TEXTAREA"], Je = [], $e = Math.abs, et = Math.sqrt, tt = Math.pow, it = Math.round, nt = Math.max, rt = Math.min, ot = 0;
  2260. function t(e) {
  2261. for (var t = 0, i = r.length; t < i; t++) {
  2262. var n = r[t] ? r[t] + e.charAt(0).toUpperCase() + e.slice(1) : e;
  2263. if (null != o.style[n])
  2264. return n
  2265. }
  2266. }
  2267. We.on(Xe, function(e) {
  2268. var t = e.originalEvent[He]
  2269. , i = +new Date;
  2270. (!t || t.options.scrollHijack < i - ot) && (ot = i)
  2271. }),
  2272. function(t) {
  2273. Ge = t.requestAnimationFrame || t.webkitRequestAnimationFrame || function(e) {
  2274. var t = (new Date).getTime()
  2275. , i = Math.max(0, 16 - (t - r))
  2276. , n = setTimeout(e, i);
  2277. return r = t,
  2278. n
  2279. }
  2280. ;
  2281. var r = (new Date).getTime()
  2282. , i = t.cancelAnimationFrame || t.webkitCancelAnimationFrame || t.clearTimeout;
  2283. ze = function(e) {
  2284. i.call(t, e)
  2285. }
  2286. }(window),
  2287. r = ["", "webkit", "moz", "ms", "o"],
  2288. o = document.createElement("div"),
  2289. Ve = t("transform"),
  2290. ke = t("perspective") ? "translateZ(0) " : "",
  2291. e.Sly = Me,
  2292. xe.fn.sly = function(n, r) {
  2293. var o, a;
  2294. return xe.isPlainObject(n) || ("string" !== Re(n) && !1 !== n || (o = !1 === n ? "destroy" : n,
  2295. a = Array.prototype.slice.call(arguments, 1)),
  2296. n = {}),
  2297. this.each(function(e, t) {
  2298. var i = xe.data(t, He);
  2299. i || o ? i && o && i[o] && i[o].apply(i, a) : i = xe.data(t, He, new Me(t,n,r).init())
  2300. })
  2301. }
  2302. ,
  2303. Me.defaults = {
  2304. slidee: null,
  2305. horizontal: !1,
  2306. itemNav: null,
  2307. itemSelector: null,
  2308. smart: !1,
  2309. activateOn: null,
  2310. activateMiddle: !1,
  2311. scrollSource: null,
  2312. scrollBy: 0,
  2313. scrollHijack: 300,
  2314. scrollTrap: !1,
  2315. dragSource: null,
  2316. mouseDragging: !1,
  2317. touchDragging: !1,
  2318. releaseSwing: !1,
  2319. swingSpeed: .2,
  2320. elasticBounds: !1,
  2321. interactive: null,
  2322. scrollBar: null,
  2323. dragHandle: !1,
  2324. dynamicHandle: !1,
  2325. minHandleSize: 50,
  2326. clickBar: !1,
  2327. syncSpeed: .5,
  2328. pagesBar: null,
  2329. activatePageOn: null,
  2330. pageBuilder: function(e) {
  2331. return "<li>" + (e + 1) + "</li>"
  2332. },
  2333. forward: null,
  2334. backward: null,
  2335. prev: null,
  2336. next: null,
  2337. prevPage: null,
  2338. nextPage: null,
  2339. cycleBy: null,
  2340. cycleInterval: 5e3,
  2341. pauseOnHover: !1,
  2342. startPaused: !1,
  2343. moveBy: 300,
  2344. speed: 0,
  2345. easing: "swing",
  2346. startAt: null,
  2347. keyboardNavBy: null,
  2348. draggedClass: "dragged",
  2349. activeClass: "active",
  2350. disabledClass: "disabled"
  2351. }
  2352. }(jQuery, window),
  2353. function o(a, s, l) {
  2354. function c(i, e) {
  2355. if (!s[i]) {
  2356. if (!a[i]) {
  2357. var t = "function" == typeof require && require;
  2358. if (!e && t)
  2359. return t(i, !0);
  2360. if (h)
  2361. return h(i, !0);
  2362. var n = new Error("Cannot find module '" + i + "'");
  2363. throw n.code = "MODULE_NOT_FOUND",
  2364. n
  2365. }
  2366. var r = s[i] = {
  2367. exports: {}
  2368. };
  2369. a[i][0].call(r.exports, function(e) {
  2370. var t = a[i][1][e];
  2371. return c(t || e)
  2372. }, r, r.exports, o, a, s, l)
  2373. }
  2374. return s[i].exports
  2375. }
  2376. for (var h = "function" == typeof require && require, e = 0; e < l.length; e++)
  2377. c(l[e]);
  2378. return c
  2379. }({
  2380. 1: [function(p, f, e) {
  2381. (function(e) {
  2382. "use strict";
  2383. function t(e) {
  2384. this.player = null,
  2385. this.director = null,
  2386. this.modelManager = null,
  2387. this.container = null,
  2388. this.tagManager = null,
  2389. this.fadeInSpeed = e,
  2390. null !== this.fadeInSpeed && void 0 !== this.fadeInSpeed || (this.fadeInSpeed = 0)
  2391. }
  2392. var r = p("three")
  2393. , i = p("./util/logger")
  2394. , n = (p("./util/common"),
  2395. p("./enum/PlayerEvents"))
  2396. , o = p("./enum/DirectorEvents")
  2397. , a = p("./settings")
  2398. , s = p("./enum/Viewmode")
  2399. , l = (p("./enum/WarpStyle"),
  2400. p("./enum/BlackoutStyle"),
  2401. p("./enum/ModelManagerEvents"))
  2402. , c = p("./enum/tagEvents")
  2403. , h = p("./util/transitions")
  2404. , u = p("./util/lerp")
  2405. , d = new i(e);
  2406. t.prototype.init = function(e, t, i, n, r) {
  2407. (window.app = this).player = t,
  2408. this.director = e,
  2409. this.modelManager = i,
  2410. this.tagManager = n,
  2411. this.container = r,
  2412. this.updateModel(),
  2413. this.bindEvents()
  2414. }
  2415. ,
  2416. t.prototype.bindEvents = function() {
  2417. this.modelManager.on(l.ActiveModelChanged, this.updateModel.bind(this)),
  2418. this.player.on(n.ModeChanging, this.handlePlayerModeChanging.bind(this)),
  2419. this.player.on(n.ModeChanged, this.handlePlayerModeChanged.bind(this)),
  2420. this.player.on(n.ClosestPanoChanging, this.handleClosestPanoChanging.bind(this)),
  2421. this.player.on(n.StartInside, this.handleStartInside.bind(this)),
  2422. this.player.on(n.StartOutside, this.handleStartOutside.bind(this)),
  2423. this.player.on(n.WarpStarted, this.handleWarpStarted.bind(this)),
  2424. this.director.on(o.ActionInterrupted, this.handleActionInterruption.bind(this)),
  2425. this.tagManager.on(c.TagActivated, this.ontagActivated.bind(this)),
  2426. this.tagManager.on(c.TagNavigation, this.onNavigationTotag.bind(this))
  2427. }
  2428. ,
  2429. t.prototype.updateModel = function() {
  2430. this.model = this.modelManager.getActiveModel()
  2431. }
  2432. ,
  2433. t.prototype.handleWarpStarted = function() {
  2434. this.hidePlayerReticule()
  2435. }
  2436. ,
  2437. t.prototype.ontagActivated = function() {
  2438. this.hidePlayerReticule()
  2439. }
  2440. ,
  2441. t.prototype.onNavigationTotag = function() {
  2442. this.hidePlayerReticule()
  2443. }
  2444. ,
  2445. t.prototype.handlePlayerModeChanging = function(e, t, i) {
  2446. var n = this.modelManager.getActiveModel()
  2447. , r = this.player.is360View(t, i) || this.director.tourIsPlaying ? 0 : a[t].markerOpacity;
  2448. n.fadePanoMarkers(r),
  2449. n.setMode(t)
  2450. }
  2451. ,
  2452. t.prototype.handlePlayerModeChanged = function(e, t) {
  2453. var i = this.modelManager.getActiveModel()
  2454. , n = t === s.PANORAMA ? r.DoubleSide : r.FrontSide;
  2455. i.setSide(n),
  2456. i.setMode(t)
  2457. }
  2458. ,
  2459. t.prototype.handleClosestPanoChanging = function(e, t, i) {
  2460. i !== s.TRANSITIONING && (e && !this.director.tourIsPlaying && e.hoverOff(i),
  2461. t && !this.director.tourIsPlaying && t.hoverOn(i))
  2462. }
  2463. ,
  2464. t.prototype.handleActionInterruption = function() {}
  2465. ,
  2466. t.prototype.handleStartInside = function(e) {
  2467. var t = a[this.player.mode]
  2468. , i = e ? 0 : t.transitionTime * t.skyboxOpacityLength;
  2469. this.fadeIn(this.fadeInSpeed),
  2470. this.model.alpha = 0,
  2471. this.model.skybox.material.uniforms.opacity.value = 1,
  2472. this.model.fadePanoMarkers(e ? 0 : t.markerOpacity);
  2473. var n = this.player.reticule;
  2474. h.start(u.property(n.material, "opacity", 0), i, null, 0, null, "retReOpac")
  2475. }
  2476. ,
  2477. t.prototype.handleStartOutside = function(e) {
  2478. this.fadeIn(e)
  2479. }
  2480. ,
  2481. t.prototype.fadeIn = function(e) {
  2482. null != e || (e = 2e3,
  2483. d.warn("DisplayController.fadeIn -> no transition time specified, defaulting to 2000 ms.")),
  2484. $(this.container).fadeIn(e)
  2485. }
  2486. ,
  2487. t.prototype.hidePlayerReticule = function() {
  2488. this.player.reticule.hide()
  2489. }
  2490. ,
  2491. f.exports = t
  2492. }
  2493. ).call(this, "/js/DisplayController.js")
  2494. }
  2495. , {
  2496. "./enum/BlackoutStyle": 18,
  2497. "./enum/DirectorEvents": 23,
  2498. "./enum/tagEvents": 32,
  2499. "./enum/ModelManagerEvents": 33,
  2500. "./enum/PlayerEvents": 40,
  2501. "./enum/Viewmode": 51,
  2502. "./enum/WarpStyle": 52,
  2503. "./settings": 166,
  2504. "./util/common": 185,
  2505. "./util/lerp": 188,
  2506. "./util/logger": 189,
  2507. "./util/transitions": 195,
  2508. three: 217
  2509. }],
  2510. 2: [function(e, t, i) {
  2511. "use strict";
  2512. function n() {
  2513. this.baseStartTime = performance.timing.navigationStart,
  2514. this.loadingStartTime = null,
  2515. this.waitingStartTime = null,
  2516. this.appReadyTime = null
  2517. }
  2518. n.prototype.setBaseStartTime = function(e) {
  2519. this.baseStartTime = e || Date.now()
  2520. }
  2521. ,
  2522. n.prototype.setWaitingStartTime = function(e) {
  2523. this.waitingStartTime = e || Date.now()
  2524. }
  2525. ,
  2526. n.prototype.setLoadingStartTime = function(e) {
  2527. this.loadingStartTime = e || Date.now()
  2528. }
  2529. ,
  2530. n.prototype.setAppReadyTime = function(e) {
  2531. this.appReadyTime = e || Date.now()
  2532. }
  2533. ,
  2534. n.prototype.calcFullLoadingTime = function() {
  2535. var e = this.appReadyTime - this.baseStartTime;
  2536. return this.waitingStartTime && (e -= this.loadingStartTime - this.waitingStartTime),
  2537. e
  2538. }
  2539. ,
  2540. t.exports = n
  2541. }
  2542. , {}],
  2543. 3: [function(i, n, e) {
  2544. (function(e) {
  2545. "use strict";
  2546. function a() {
  2547. return 100 * Math.random()
  2548. }
  2549. var t = i("./util/logger")
  2550. , s = i("./util/browser")
  2551. , l = new t(e)
  2552. , c = window.MP_AB_TESTS = window.MP_AB_TESTS || {
  2553. initialized: !1,
  2554. init: function(e, t) {
  2555. if (t = t || {},
  2556. !this.initialized) {
  2557. for (var i in this.initialized = !0,
  2558. s.valueFromHash("tilegen") && (t.tilegen = 1 === s.valueFromHash("tilegen", 0)),
  2559. s.valueFromHash("imgopt") && (t.imgopt = 1 === s.valueFromHash("imgopt", 0)),
  2560. e) {
  2561. var n = i.match("^sc_tilegen_([0-9]+)$");
  2562. n && (c.tilegen = a() < parseInt(n[1]));
  2563. var r = i.match("^sc_imgopt_([0-9]+)$");
  2564. r && (c.imgopt = a() < parseInt(r[1]))
  2565. }
  2566. for (var o in t)
  2567. c[o] = t[o],
  2568. l.debug("A/B override:", o, c[o])
  2569. }
  2570. },
  2571. changeIfTileGenerating: function(e) {
  2572. return c.tilegen && (e += -1 === e.indexOf("?") ? "?" : "&",
  2573. e += ""),
  2574. e
  2575. },
  2576. changeIfImageOptimzing: function(e) {
  2577. if(e.includes("blob:http"))return e;//add
  2578. return c.imgopt && -1 === e.indexOf("imgopt=1") && (e += -1 === e.indexOf("?") ? "?" : "&",
  2579. e += ""),
  2580. e
  2581. },
  2582. tilegen: !1,
  2583. imgopt: !1
  2584. };
  2585. n.exports = c
  2586. }
  2587. ).call(this, "/js/ab.js")
  2588. }
  2589. , {
  2590. "./util/browser": 182,
  2591. "./util/logger": 189
  2592. }],
  2593. 4: [function(u, d, e) {
  2594. (function(e) {
  2595. "use strict";
  2596. function r(n, e, t, i) {
  2597. function r(e) {
  2598. a[e.sid] = !0;
  2599. var t = e.billboard.media && e.billboard.media.type
  2600. , i = {
  2601. tag_id: e.sid,
  2602. tags_visited: Object.keys(a).length,
  2603. tag_count: Object.keys(n.tags).length,
  2604. tag_view_count: ++d,
  2605. has_media: !!t
  2606. };
  2607. t && (i.media_type = t),
  2608. g("tag_opened", i)
  2609. }
  2610. var o, a = {}, s = Date.now() - P, l = null;
  2611. i && (l = Date.now() - window.navigationStart);
  2612. try {
  2613. o = /* n.data.player_options.highlight_reel && */ 0 < n.heroLocations.length
  2614. } catch (n) {
  2615. o = !1
  2616. }
  2617. var c, h = n.supportsVR;
  2618. h || (c = "VR disabled at the model/account level",
  2619. y.valueFromHash("vr") === w.NONE ? c = "VR disabled, using &vr=0" : y.detectAndroid() ? _.isDeviceSupported(b.Android) || (c = "VR disabled, unsupported Android version") : y.detectIOS() && (_.isDeviceSupported(b.IOS) || (c = "VR disabled, unsupported iOS version"))),
  2620. g("model_loaded", {
  2621. duration: s,
  2622. duration_from_navigation_start: l,
  2623. has_hlr: o,
  2624. has_vr: h,
  2625. vr_reason: c
  2626. });
  2627. var u = 0;
  2628. n.panos.forEach(function(e) {
  2629. e.on("enter", function() {
  2630. f("pano_viewed", {
  2631. pano_id: e.id,
  2632. pano_view_count: ++u,
  2633. alignment_type: e.alignmentType,
  2634. interaction_source: R,
  2635. navigation_source: v
  2636. })
  2637. })
  2638. });
  2639. var d = 0;
  2640. for (var p in n.tags)
  2641. n.tags[p].billboard.on(M.OPENED, r.bind(this, n.tags[p]));
  2642. e.on("tour_auto", function(e) {
  2643. v = "tour_" + e
  2644. }),
  2645. e.on("tour_manual", function(e) {
  2646. R = "gui-" + e,
  2647. v = "tour_manual"
  2648. }),
  2649. t.on(C.InteractionKey, function() {
  2650. e.mode === A.TRANSITIONING || e.flying || m(C.InteractionKey)
  2651. }),
  2652. t.on(C.InteractionDirect, function() {
  2653. e.mode === A.TRANSITIONING || e.flying || m(C.InteractionDirect)
  2654. }),
  2655. function(t) {
  2656. I.on(T.OPENED, function() {
  2657. f("showcase_share_intent", {
  2658. pano_id: t.currentPano && t.currentPano.id
  2659. })
  2660. }),
  2661. I.on(T.LINK_CLICKED, function(e) {
  2662. f("showcase_share_action", {
  2663. channel: e.channel,
  2664. pano_id: t.currentPano && t.currentPano.id
  2665. })
  2666. }),
  2667. E.on(x.ORIGIN_LINK_CLICKED, function() {
  2668. f("showcase_share_origin_link_clicked")
  2669. })
  2670. }(e),
  2671. function() {
  2672. _.on(S.OPENED, f.bind(this, "showcase_gui", {
  2673. gui_action: "click_vr_button"
  2674. })),
  2675. _.on(S.LAUNCH, function(e) {
  2676. f("showcase_gui", {
  2677. gui_action: "launch_vr",
  2678. vr_platform: e.vr_platform,
  2679. vr_app: e.vr_app
  2680. })
  2681. }),
  2682. _.on(S.PREV, f.bind(this, "showcase_gui", {
  2683. gui_action: "vr_modal_prev"
  2684. })),
  2685. _.on(S.NEXT, function(e) {
  2686. f("showcase_gui", {
  2687. gui_action: e.nextAction
  2688. })
  2689. }),
  2690. _.on(S.CLOSED, f.bind(this, "showcase_gui", {
  2691. gui_action: "vr_modal_close"
  2692. })),
  2693. _.on(S.falseICECHOSEN, function(e) {
  2694. f("showcase_gui", {
  2695. gui_action: e.name + " "
  2696. })
  2697. }),
  2698. _.on(S.STORE, function(e) {
  2699. f("showcase_gui", {
  2700. gui_action: "launch_store",
  2701. store: e
  2702. })
  2703. })
  2704. }()
  2705. }
  2706. function f(e, t) {
  2707. if (t = t || {},
  2708. i)
  2709. try {
  2710. window.analytics.track(e, s.extendObject(t, c), {
  2711. context: {
  2712. app: {
  2713. name: "showcase",
  2714. version: "2.25.6-0-gd87e5b1"
  2715. },
  2716. screen: {
  2717. width: window.screen.width,
  2718. height: window.screen.height,
  2719. density: window.devicePixelRatio
  2720. }
  2721. }
  2722. })
  2723. } catch (t) {
  2724. console.warn("Failed to send data to segment for " + e)
  2725. }
  2726. }
  2727. function g(e, t) {
  2728. f(e, t = t || {})
  2729. }
  2730. function m(e, t) {
  2731. R = e === C.InteractionGui ? "gui-" + t : e,
  2732. v = "self_guided"
  2733. }
  2734. var v, o, a = (u("three"),
  2735. u("./util/ajax"),
  2736. u("./ab")), y = u("./util/browser"), s = u("./util/common"), t = u("./settings"), A = (u("./localization/localize"),
  2737. u("./enum/Viewmode")), C = u("./enum/ControlEvents"), I = u("./gui/sharing/modal"), E = u("./gui/title/titleBar"), _ = u("./gui/vr/vrModal"), b = u("./enum/VRPlatforms"), w = u("./enum/VROption"), T = u("./gui/sharing/ShareEvents"), x = u("./gui/title/TitleEvents"), S = u("./gui/vr/vrEvent"), M = u("./tag/Billboard/BillboardEvent"), l = new (u("./util/logger"))(e), R = (u("./enum/PlayerEvents"),
  2738. "direct"), i = null, n = !1, P = null, c = null, h = s.uuid4();
  2739. d.exports = {
  2740. report: function(e, t, i, n) {
  2741. !function(e, t) {
  2742. if (o)
  2743. try {
  2744. o.addEvent(e, s.extendObject({
  2745. host: window.location.host,
  2746. keen: {
  2747. addons: [{
  2748. name: "keen:ua_parser",
  2749. input: {
  2750. ua_string: "user_agent"
  2751. },
  2752. output: "parsed_user_agent"
  2753. }]
  2754. },
  2755. user_agent: "${keen.user_agent}",
  2756. referrer: {
  2757. url: s.normalizeUrl(document.referrer),
  2758. domain: s.domainFromUrl(document.referrer),
  2759. url_original: document.referrer
  2760. },
  2761. embedded: y.inIframe(),
  2762. is_mobile: y.isMobile(),
  2763. version: "2.25.6-0-gd87e5b1"
  2764. }, t))
  2765. } catch (e) {
  2766. l.warn("analytics.report -> client.addEvent() error (is there blocking software installed?). Error message: " + e)
  2767. }
  2768. }("Session starts", {
  2769. model: e,
  2770. status: t,
  2771. loadtime: Date.now() - (P || Date.now()),
  2772. loadtime_from_navigation_start: i ? Date.now() - window.navigationStart : null,
  2773. autoplay: i,
  2774. quickstart: n,
  2775. ab_tilegen: a.tilegen,
  2776. ab_imgopt: a.imgopt
  2777. })
  2778. },
  2779. impression: function(e) {
  2780. g("impression", {
  2781. visible: void 0 === (e = e || {}).isVisible || e.isVisible,
  2782. url_params: (void 0 !== e.immediate && e.immediate,
  2783. window.location.search.substr(1).split("&"))
  2784. })
  2785. },
  2786. initKeen: function(e) {
  2787. return e.token && e.appId ? void (o = new Keen({
  2788. projectId: e.appId,
  2789. writeKey: e.token,
  2790. readKey: "",
  2791. requestType: "xhr"
  2792. })) : void l.warn("no keen token/appId")
  2793. },
  2794. initSegment: function(e) {
  2795. return e.token ? (i = e.token,
  2796. window.analytics.load(e.token),
  2797. c = {
  2798. model_id: e.model,
  2799. start_source: e.startSource,
  2800. autoplay: e.autoplay,
  2801. quickstart: e.quickstart,
  2802. language_tag: t.languageTag,
  2803. is_mobile: y.isMobile(),
  2804. iframe: y.inIframe(),
  2805. aspect_ratio: y.aspectRatio(),
  2806. session_id: h,
  2807. window: {
  2808. width: $("#player").width(),
  2809. height: $("#player").height()
  2810. },
  2811. platform: {
  2812. browser: {
  2813. name: $.ua.browser.name,
  2814. major: $.ua.browser.major,
  2815. version: $.ua.browser.version
  2816. },
  2817. os: {
  2818. name: $.ua.os.name,
  2819. version: $.ua.os.version
  2820. },
  2821. device: {
  2822. vendor: $.ua.device.vendor,
  2823. model: $.ua.device.model,
  2824. type: $.ua.device.type
  2825. }
  2826. }
  2827. },
  2828. n = Math.random() < t.analytics.sessionTrackingRate,
  2829. l.debug("tracking sample rate = " + t.analytics.sessionTrackingRate),
  2830. void l.debug("tracking this session = " + n)) : void l.warn("no segment token")
  2831. },
  2832. sessionStart: function(e) {
  2833. l.debug("analytics user_session_start"),
  2834. f("session_started"),
  2835. P = Date.now(),
  2836. window.addEventListener("unload", function() {
  2837. !function(e, t) {
  2838. if (t = t || {},
  2839. navigator.sendBeacon && i)
  2840. try {
  2841. navigator.sendBeacon("https://api.segment.io/v1/t", JSON.stringify({
  2842. event: e,
  2843. anonymousId: window.analytics.user().anonymousId(),
  2844. properties: s.extendObject(t, c),
  2845. writeKey: i,
  2846. sentAt: Date.now(),
  2847. type: "track",
  2848. context: {
  2849. userAgent: y.userAgent(),
  2850. library: {
  2851. name: "showcase-beacon",
  2852. version: "2.25.6-0-gd87e5b1"
  2853. },
  2854. app: {
  2855. name: "showcase",
  2856. version: "2.25.6-0-gd87e5b1"
  2857. }
  2858. }
  2859. }))
  2860. } catch (e) {
  2861. console.warn("Failed to send async segment request")
  2862. }
  2863. }("session_ended", {
  2864. duration: Date.now() - P
  2865. })
  2866. })
  2867. },
  2868. modelLoaded: function(e, t, i, n) {
  2869. r(e, t, i, n)
  2870. },
  2871. loadComplete: function(e) {
  2872. f("load_times", {
  2873. time_to_app_start: e
  2874. })
  2875. },
  2876. track: function(e, t) {
  2877. n && (l.debug('analytics.track("' + e + '", ' + JSON.stringify(t) + " )"),
  2878. f(e, t))
  2879. },
  2880. trackAlways: function(e, t) {
  2881. l.debug('analytics.trackAlways("' + e + '", ' + JSON.stringify(t) + " )"),
  2882. f(e, t)
  2883. },
  2884. getSessionId: function() {
  2885. return h
  2886. },
  2887. updateInteraction: m
  2888. }
  2889. }
  2890. ).call(this, "/js/analytics.js")
  2891. }
  2892. , {
  2893. "./ab": 3,
  2894. "./enum/ControlEvents": 21,
  2895. "./enum/PlayerEvents": 40,
  2896. "./enum/VROption": 47,
  2897. "./enum/VRPlatforms": 49,
  2898. "./enum/Viewmode": 51,
  2899. "./gui/sharing/ShareEvents": 76,
  2900. "./gui/sharing/modal": 77,
  2901. "./gui/title/TitleEvents": 80,
  2902. "./gui/title/titleBar": 82,
  2903. "./gui/vr/vrEvent": 85,
  2904. "./gui/vr/vrModal": 87,
  2905. "./localization/localize": 108,
  2906. "./tag/Billboard/BillboardEvent": 120,
  2907. "./settings": 166,
  2908. "./util/ajax": 181,
  2909. "./util/browser": 182,
  2910. "./util/common": 185,
  2911. "./util/logger": 189,
  2912. three: 217
  2913. }],
  2914. 5: [function(e, t, i) {
  2915. "use strict";
  2916. function n() {
  2917. r.PerspectiveCamera.call(this, a.clampVFOV(o.dollhouseFOV), $("#player").width() / $("#player").height(), o.dollhouseNear, o.dollhouseFar),
  2918. this.controls = null
  2919. }
  2920. var r = e("three")
  2921. , o = e("../constants")
  2922. , a = e("../util/cameraLight");
  2923. (n.prototype = Object.create(r.PerspectiveCamera.prototype)).updateAspect = function(e) {
  2924. this.aspect = e,
  2925. this.updateProjectionMatrix()
  2926. }
  2927. ,
  2928. t.exports = n
  2929. }
  2930. , {
  2931. "../constants": 8,
  2932. "../util/cameraLight": 184,
  2933. three: 217
  2934. }],
  2935. 6: [function(e, t, i) {
  2936. "use strict";
  2937. function n() {
  2938. var e = $("#player").width() / $("#player").height();
  2939. r.OrthographicCamera.call(this, -o.orthoBase, o.orthoBase, o.orthoBase / e, -o.orthoBase / e, o.orthoNear, o.orthoFar),
  2940. this.controls = null,
  2941. this.updateAspect(e)
  2942. }
  2943. var r = e("three")
  2944. , o = e("../constants");
  2945. (n.prototype = Object.create(r.OrthographicCamera.prototype)).updateAspect = function(e) {
  2946. this.aspect = e,
  2947. this.top = o.orthoBase / e,
  2948. this.bottom = -o.orthoBase / e,
  2949. this.updateProjectionMatrix()
  2950. }
  2951. ,
  2952. t.exports = n
  2953. }
  2954. , {
  2955. "../constants": 8,
  2956. three: 217
  2957. }],
  2958. 7: [function(e, t, i) {
  2959. "use strict";
  2960. function n() {
  2961. r.PerspectiveCamera.call(this, a.clampVFOV(o.insideFOV), $("#player").width() / $("#player").height(), o.insideNear, o.insideFar),
  2962. this.controls = null
  2963. }
  2964. var r = e("three")
  2965. , o = e("../settings")
  2966. , a = e("../util/cameraLight");
  2967. (n.prototype = Object.create(r.PerspectiveCamera.prototype)).updateAspect = function(e) {
  2968. this.aspect = e,
  2969. this.updateProjectionMatrix()
  2970. }
  2971. ,
  2972. t.exports = n
  2973. }
  2974. , {
  2975. "../settings": 166,
  2976. "../util/cameraLight": 184,
  2977. three: 217
  2978. }],
  2979. 8: [function(e, t, i) {
  2980. "use strict";
  2981. t.exports = {
  2982. signedUrlDefaultExpireTime: 24e4,
  2983. signedUrlCheckInterval: 1e4,
  2984. signedUrlRefreshBuffer: 15e3,
  2985. dollhouseFOV: 70,
  2986. dollhouseNear: .1,//1,
  2987. dollhouseFar: 5e3,
  2988. insideFOV: 70,
  2989. insideFOVMax: 120,
  2990. insideNear: 0.01,//.1,
  2991. insideFar: 5e3,
  2992. insideLookSpeed: .12,
  2993. insideLookLimitUp: 40,
  2994. insideLookLimitDown: -40,
  2995. orthoNear: 1,
  2996. orthoFar: 5e3,
  2997. orthoBase: 10,
  2998. narrowLandscapeHeight: 290,
  2999. reallyNarrowLandscapeHeight: 250,
  3000. visionTilingStartDate: new Date("8/26/2016"),
  3001. visionTilingStartVersion: "1.1.407.13667",
  3002. windowHeightHighQualityThreshold: 900,
  3003. tourStepDelayDefault: 3500,
  3004. tourStepDelaySlideShow: 5e3,
  3005. workshopApsect: 9 / 16,
  3006. highQualityMaxZoom: 2,
  3007. ultraHighQualityMaxZoom: 3
  3008. }
  3009. }
  3010. , {}],
  3011. 9: [function(e, t, i) {
  3012. "use strict";
  3013. function n() {
  3014. this.activeControl = null,
  3015. this.controls = {},
  3016. this.cameras = {}
  3017. }
  3018. var a = e("./PanoramaControls")
  3019. , s = e("./DollhouseControls")
  3020. , l = e("./FloorplanControls")
  3021. , c = e("../cameras/PanoramaCamera")
  3022. , h = e("../cameras/DollhouseCamera")
  3023. , u = e("../cameras/FloorplanCamera")
  3024. , r = e("events").EventEmitter
  3025. , d = e("../enum/ControlEvents")
  3026. , o = e("../enum/ModelManagerEvents")
  3027. , p = e("../enum/Viewmode")
  3028. , f = e("../settings");
  3029. (n.prototype = Object.create(r.prototype)).init = function(e, t) {
  3030. this.setUpControls(),
  3031. this.bindEvents(e, t)
  3032. }
  3033. ,
  3034. n.prototype.activateControls = function(e) {
  3035. this.activeControl && (this.activeControl.reset(),
  3036. this.activeControl.enabled = !1),
  3037. this.controls[e] && (this.controls[e].enabled = !0),
  3038. this.activeControl = this.controls[e]
  3039. }
  3040. ,
  3041. n.prototype.setUpControls = function() {
  3042. var i = {}
  3043. , n = {}
  3044. , e = [p.PANORAMA, p.DOLLHOUSE, p.FLOORPLAN]
  3045. , r = [c, h, u]
  3046. , o = [a, s, l];
  3047. e.forEach(function(e, t) {
  3048. i[e] = new r[t],
  3049. n[e] = new o[t](i[e]),
  3050. n[e].on(d.Move, this.emit.bind(this, d.Move)),
  3051. n[e].on(d.InputStart, this.emit.bind(this, d.InputStart)),
  3052. n[e].on(d.InteractionDirect, this.emit.bind(this, d.InteractionDirect)),
  3053. n[e].on(d.InteractionKey, this.emit.bind(this, d.InteractionKey)),
  3054. n[e].on(d.Pinch, this.emit.bind(this, d.Pinch)),
  3055. n[e].on(d.Scroll, this.emit.bind(this, d.Scroll))
  3056. }
  3057. .bind(this)),
  3058. this.controls = n,
  3059. this.cameras = i
  3060. }
  3061. ,
  3062. n.prototype.bindEvents = function(e, t) {
  3063. e.addEventListener("mousemove", this.onMouseMove.bind(this)),
  3064. e.addEventListener("mousedown", this.onMouseDown.bind(this)),
  3065. e.addEventListener("mouseup", this.onMouseUp.bind(this)),
  3066. e.addEventListener("mouseover", this.onMouseOver.bind(this)),
  3067. f.useWheel && (e.addEventListener("mousewheel", this.onMouseWheel.bind(this), {
  3068. passive: !1
  3069. }),
  3070. e.addEventListener("DOMMouseScroll", this.onMouseWheel.bind(this))),
  3071. e.addEventListener("touchstart", this.onTouchStart.bind(this)),
  3072. e.addEventListener("touchmove", this.onTouchMove.bind(this)),
  3073. e.addEventListener("touchend", this.onTouchEnd.bind(this)),
  3074. e.addEventListener("contextmenu", function(e) {
  3075. e.preventDefault()
  3076. }),
  3077. e.addEventListener("pointerdown", this.onPointerDown.bind(this)),
  3078. e.addEventListener("pointermove", this.onPointerMove.bind(this)),
  3079. e.addEventListener("pointerup", this.onPointerUp.bind(this)),
  3080. e.addEventListener("pointerout", this.onPointerCancel.bind(this)),
  3081. e.addEventListener("pointercancel", this.onPointerCancel.bind(this)),
  3082. document.addEventListener("keydown", this.onKeyDown.bind(this)),
  3083. document.addEventListener("keyup", this.onKeyUp.bind(this)),
  3084. t.on(o.ActiveModelChanged, function(e) {
  3085. this.setModelForControls(e.model)
  3086. }
  3087. .bind(this))
  3088. }
  3089. ,
  3090. n.prototype.setModelForControls = function(e) {
  3091. this.controls[p.DOLLHOUSE].setZoomBounds(e.boundingBox);
  3092. var t = e.boundingBox.clone().expandByScalar(f.modelBoundsPadding);
  3093. [p.DOLLHOUSE, p.FLOORPLAN].forEach(function(e) {
  3094. this.controls[e].setBounds(t)
  3095. }
  3096. .bind(this))
  3097. }
  3098. ,
  3099. n.prototype.onMouseDown = function(e) {
  3100. e.preventDefault(),
  3101. this.activeControl && this.activeControl.onMouseDown(e)
  3102. }
  3103. ,
  3104. n.prototype.onMouseMove = function(e) {
  3105. e.preventDefault(),
  3106. this.activeControl && this.activeControl.onMouseMove(e)
  3107. }
  3108. ,
  3109. n.prototype.onMouseUp = function(e) {
  3110. e.preventDefault(),
  3111. this.activeControl && this.activeControl.onMouseUp(e)
  3112. }
  3113. ,
  3114. n.prototype.onMouseOver = function(e) {
  3115. e.preventDefault(),
  3116. this.activeControl && this.activeControl.onMouseOver(e)
  3117. }
  3118. ,
  3119. n.prototype.onMouseWheel = function(e) {
  3120. e.preventDefault(),
  3121. this.activeControl && this.activeControl.onMouseWheel(e)
  3122. }
  3123. ,
  3124. n.prototype.onTouchStart = function(e) {
  3125. e.preventDefault(),
  3126. this.activeControl && this.activeControl.onTouchStart(e),
  3127. $("#hotListWrap")[0].classList.remove("hotListActive"),
  3128. $("#hotListContent ul .active").removeClass("active"),
  3129. $("#hotList")[0].classList.remove("active")
  3130. }
  3131. ,
  3132. n.prototype.onTouchMove = function(e) {
  3133. e.preventDefault(),
  3134. this.activeControl && this.activeControl.onTouchMove(e)
  3135. }
  3136. ,
  3137. n.prototype.onTouchEnd = function(e) {
  3138. e.preventDefault(),
  3139. this.activeControl && this.activeControl.onTouchEnd(e)
  3140. }
  3141. ,
  3142. n.prototype.onPointerDown = function(e) {
  3143. if (e.preventDefault(),
  3144. this.activeControl)
  3145. switch (e.pointerType) {
  3146. case "mouse":
  3147. this.activeControl.onMouseDown(e);
  3148. break;
  3149. default:
  3150. this.activeControl.onPointerDown(e)
  3151. }
  3152. }
  3153. ,
  3154. n.prototype.onPointerMove = function(e) {
  3155. if (e.preventDefault(),
  3156. this.activeControl)
  3157. switch (e.pointerType) {
  3158. case "mouse":
  3159. this.activeControl.onMouseMove(e);
  3160. break;
  3161. default:
  3162. this.activeControl.onPointerMove(e)
  3163. }
  3164. }
  3165. ,
  3166. n.prototype.onPointerUp = function(e) {
  3167. if (e.preventDefault(),
  3168. this.activeControl)
  3169. switch (e.pointerType) {
  3170. case "mouse":
  3171. this.activeControl.onMouseUp(e);
  3172. break;
  3173. default:
  3174. this.activeControl.onPointerUp(e)
  3175. }
  3176. }
  3177. ,
  3178. n.prototype.onPointerCancel = function(e) {
  3179. e.preventDefault(),
  3180. this.activeControl && "mouse" !== e.pointerType && this.activeControl.onPointerUp(e)
  3181. }
  3182. ,
  3183. n.prototype.onKeyDown = function(e) {
  3184. e.metaKey || e.ctrlKey || (e.preventDefault(),
  3185. this.activeControl && this.activeControl.onKeyDown(e))
  3186. }
  3187. ,
  3188. n.prototype.onKeyUp = function(e) {
  3189. e.preventDefault(),
  3190. this.activeControl && this.activeControl.onKeyUp(e)
  3191. }
  3192. ,
  3193. t.exports = n
  3194. }
  3195. , {
  3196. "../cameras/DollhouseCamera": 5,
  3197. "../cameras/FloorplanCamera": 6,
  3198. "../cameras/PanoramaCamera": 7,
  3199. "../enum/ControlEvents": 21,
  3200. "../enum/ModelManagerEvents": 33,
  3201. "../enum/Viewmode": 51,
  3202. "../settings": 166,
  3203. "./DollhouseControls": 10,
  3204. "./FloorplanControls": 11,
  3205. "./PanoramaControls": 13,
  3206. events: 202
  3207. }],
  3208. 10: [function(e, t, i) {
  3209. "use strict";
  3210. function n(e) {
  3211. a.call(this, e),
  3212. this.minPolarAngle = o.dollhouseDefault.minPolarAngle,
  3213. this.maxPolarAngle = o.dollhouseDefault.maxPolarAngle,
  3214. this.minDistance = o.dollhouseDefault.minDistance,
  3215. this.maxDistance = o.dollhouseDefault.maxDistance,
  3216. this.adjustedMinDistance = this.minDistance,
  3217. this.adjustedMaxDistance = this.maxDistance
  3218. }
  3219. var r = e("three")
  3220. , o = e("../settings")
  3221. , a = e("./OutsideControls");
  3222. (n.prototype = Object.create(a.prototype)).pan = function(e, t) {
  3223. this.camera.updateMatrix();
  3224. var i = this.camera.position.clone().sub(this.target).length();
  3225. i *= Math.tan(this.camera.fov / 2 * Math.PI / 180),
  3226. this.panLeft(2 * e * i / $("#player").height()),
  3227. this.panUp(-2 * t * i / $("#player").height())
  3228. }
  3229. ,
  3230. n.prototype.updateZoom = function() {
  3231. return this.offset.length() * this.scale
  3232. }
  3233. ,
  3234. n.prototype.setZoomBounds = function(e) {
  3235. var t = e.min.distanceTo(e.max);
  3236. this.adjustedMinDistance = Math.max(Math.min(t / 2, o.dollhouseDefault.minDistance), 0),
  3237. this.adjustedMaxDistance = Math.min(Math.max(t, o.dollhouseDefault.maxDistance), o.skyboxRadius),
  3238. this.minDistance = this.adjustedMinDistance,
  3239. this.maxDistance = this.adjustedMaxDistance
  3240. }
  3241. ,
  3242. n.prototype.resetRanges = function(e, t) {
  3243. e ? (this.minDistance = Math.min(e, this.minDistance),
  3244. this.maxDistance = Math.max(e, this.maxDistance)) : (this.minDistance = this.adjustedMinDistance,
  3245. this.maxDistance = this.adjustedMaxDistance),
  3246. t ? (this.minPolarAngle = r.Math.degToRad(-15),
  3247. this.maxPolarAngle = r.Math.degToRad(89.9)) : (this.minPolarAngle = o.dollhouseDefault.minPolarAngle,
  3248. this.maxPolarAngle = o.dollhouseDefault.maxPolarAngle)
  3249. }
  3250. ,
  3251. n.prototype.toJSON = function() {
  3252. return a.prototype.toJSON.call(this)
  3253. }
  3254. ,
  3255. t.exports = n
  3256. }
  3257. , {
  3258. "../settings": 166,
  3259. "./OutsideControls": 12,
  3260. three: 217
  3261. }],
  3262. 11: [function(e, t, i) {
  3263. "use strict";
  3264. function n(e) {
  3265. c.call(this, e),
  3266. this.minDistance = 15,
  3267. this.maxDistance = 50,
  3268. this.noRotateUpDown = !0,
  3269. this.minPolarAngle = 0,
  3270. this.maxPolarAngle = 0,
  3271. this.mouseActions[u.LEFT] = h.PAN,
  3272. this.mouseActions[u.MIDDLE] = h.DOLLY,
  3273. this.mouseActions[u.RIGHT] = h.ROTATE,
  3274. this.touchActions[1] = h.PAN,
  3275. this.touchActions[2] = h.ROTATE_DOLLY,
  3276. this.absoluteScale = 1,
  3277. this.currentScale = 1
  3278. }
  3279. var r, o, a, s = e("three"), l = e("../settings"), c = e("./OutsideControls"), h = e("../enum/ControlActions"), u = e("../enum/MouseButton"), d = e("../util/math"), p = e("../util/browser");
  3280. (n.prototype = Object.create(c.prototype)).zoomToContain = function(e) {
  3281. this.absoluteScale = this.getDefaultAbsoluteScale(e);
  3282. this.currentScale = this.absoluteScale
  3283. }
  3284. ,
  3285. /* n.prototype.getDefaultAbsoluteScale = function(modelSize) {
  3286. var t = Math.max(modelSize.x, modelSize.z)
  3287. , i = Math.min(modelSize.x, modelSize.z)
  3288. , n = Math.max(t, i * this.camera.aspect)
  3289. , r = Math.max(i, t * this.camera.aspect);
  3290. var absoluteScale = (p.aspectRatio() < 1 ? r : n) / 2 / l.orthoBase * 1.2
  3291. return absoluteScale
  3292. }, */
  3293. n.prototype.getDefaultAbsoluteScale = function(modelSize, ratio) {
  3294. let defaultRatio = 1.2 , absoluteScale
  3295. if(_settings.floorPlanAngle){//指定了角度的话,就和browser.aspectRatio()无关,总使用纵向
  3296. var angle = parseFloat(_settings.floorPlanAngle)
  3297. modelSize = modelSize.clone().applyEuler(new THREE.Euler(0, angle, 0))
  3298. var n = Math.max(Math.abs(modelSize.x), Math.abs(modelSize.z) * this.camera.aspect) //视口宽高比 >= 1 情况下,模型所占最大视口尺寸
  3299. var screenSize = Math.min($("#player").width(), $("#player").height())
  3300. var maxSize = 800;//模型最大占据像素
  3301. ratio = ratio != void 0 ? ratio : Math.max(screenSize * defaultRatio / maxSize, defaultRatio) ;
  3302. absoluteScale = n / 2 / l.orthoBase * ratio; //根据模型所占最大视口尺寸调整缩放
  3303. }else{
  3304. var t = Math.max(modelSize.x, modelSize.z)
  3305. , i = Math.min(modelSize.x, modelSize.z)
  3306. , n = Math.max(t, i * this.camera.aspect)
  3307. , r = Math.max(i, t * this.camera.aspect);
  3308. absoluteScale = (p.aspectRatio() < 1 ? r : n) / 2 / l.orthoBase * defaultRatio
  3309. }
  3310. return absoluteScale
  3311. },
  3312. n.prototype.rotateToView = function(modelSize, direction) {
  3313. let i = 0, n = p.aspectRatio() < 1 //是否模型尺寸显“细长”
  3314. if(_settings.floorPlanAngle ){//规定了cadImage旋转值的话 (0是无效的,将不设置)
  3315. i = parseFloat(_settings.floorPlanAngle)
  3316. }else{
  3317. let r = modelSize.x < modelSize.z; //是否视口为“窄屏”
  3318. if(n === r) //“细长” 且 “窄屏”,说明模型尺寸比例与视口比例匹配,相机坐标只需要调转“前”“后”
  3319. {
  3320. if(direction.z > 0) //(第一种情况)相机是否位于背面。 注:在默认情况下webgl的相机朝向-z, direction.z > 0 说明相机视野已经偏向+z,说明相机位于模型“背面”
  3321. {
  3322. i = Math.PI; //经度上做180度轨道角位移,使相机移到静止模型的“前面”
  3323. }
  3324. //(第二种情况) 不做处理
  3325. }
  3326. else if(direction.x > 0)
  3327. {
  3328. i = Math.PI / 2;
  3329. }
  3330. else
  3331. {
  3332. i = -Math.PI / 2;
  3333. }
  3334. }
  3335. this.rotateLeft(i);
  3336. this.update(0);
  3337. }
  3338. ,
  3339. n.prototype.rotateToAngle = function(angle){//add 旋转到特定角度
  3340. this.rotateLeft(angle + this.lon);
  3341. this.update(0);
  3342. }
  3343. ,
  3344. n.prototype.pan = function(e, t) {
  3345. this.camera.updateMatrix(),
  3346. this.panLeft(e * (this.camera.right - this.camera.left) / $("#player").width()),
  3347. this.panUp(-t * (this.camera.top - this.camera.bottom) / $("#player").height())
  3348. }
  3349. ,
  3350. n.prototype.updateZoom = function() {
  3351. return this.absoluteScale *= this.scale - .03 * this.keyboardZoomSpeed,
  3352. this.absoluteScale = Math.max(l.zoomNearLimit, Math.min(this.absoluteScale, l.zoomFarLimit)),
  3353. this.currentScale = .8 * this.currentScale + .2 * this.absoluteScale,
  3354. this.camera.left = -l.orthoBase * this.currentScale,
  3355. this.camera.right = l.orthoBase * this.currentScale,
  3356. this.camera.top = l.orthoBase * this.currentScale / this.camera.aspect,
  3357. this.camera.bottom = -l.orthoBase * this.currentScale / this.camera.aspect,
  3358. this.camera.updateProjectionMatrix(),
  3359. this.offset.length()
  3360. }
  3361. ,
  3362. n.prototype.toJSON = (r = new s.Quaternion,
  3363. o = (new s.Quaternion).setFromAxisAngle(new s.Vector3(0,1,0), s.Math.degToRad(90)),
  3364. a = new s.Quaternion,
  3365. function() {
  3366. var e = c.prototype.toJSON.call(this);
  3367. return r.copy(e.camera_quaternion),
  3368. a.copy(o),
  3369. a.multiply(r),
  3370. e.camera_quaternion.x = d.toPrecision(a.x, 4),
  3371. e.camera_quaternion.y = d.toPrecision(a.y, 4),
  3372. e.camera_quaternion.z = d.toPrecision(a.z, 4),
  3373. e.camera_quaternion.w = d.toPrecision(a.w, 4),
  3374. e.ortho_zoom = d.toPrecision(this.currentScale * this.camera.aspect, 4),
  3375. e
  3376. }
  3377. ),
  3378. t.exports = n
  3379. }
  3380. , {
  3381. "../enum/ControlActions": 20,
  3382. "../enum/MouseButton": 34,
  3383. "../settings": 166,
  3384. "../util/browser": 182,
  3385. "../util/math": 190,
  3386. "./OutsideControls": 12,
  3387. three: 217
  3388. }],
  3389. 12: [function(e, t, i) {
  3390. "use strict";
  3391. function n(e) {
  3392. this.camera = e,
  3393. (this.camera.controls = this).enabled = !1,
  3394. this.target = new a.Vector3,
  3395. this.targetBounds = new a.Box3,
  3396. this.zoomSpeed = 2,//编辑时缩放快一些
  3397. this.minDistance = 0,
  3398. this.maxDistance = 1 / 0,
  3399. this.noRotateUpDown = !1,
  3400. this.rotateSpeed = 1,
  3401. this.keyboardZoomSpeed = 0,
  3402. this.keyPanSpeed = 7,
  3403. this.autoRotate = !1,
  3404. this.autoRotateSpeed = 2,
  3405. this.autoPan = !1,
  3406. this.autoPanPosition = new a.Vector3,
  3407. this.minPolarAngle = a.Math.degToRad(25),
  3408. this.maxPolarAngle = a.Math.degToRad(65),
  3409. this.rotationAcceleration = new a.Vector2,
  3410. this.rotationSpeed = new a.Vector2,
  3411. this.panAcceleration = new a.Vector2,
  3412. this.panSpeed = new a.Vector2,
  3413. this.rotateStart = new a.Vector2,
  3414. this.rotateEnd = new a.Vector2,
  3415. this.rotateDelta = new a.Vector2,
  3416. this.panStart = new a.Vector2,
  3417. this.panEnd = new a.Vector2,
  3418. this.panDelta = new a.Vector2,
  3419. this.panOffset = new a.Vector3,
  3420. this.offset = new a.Vector3,
  3421. this.dollyStart = new a.Vector2,
  3422. this.dollyEnd = new a.Vector2,
  3423. this.dollyDelta = new a.Vector2,
  3424. this.phiDelta = 0,
  3425. this.thetaDelta = 0,
  3426. this.scale = 1,
  3427. this.panVector = new a.Vector3,
  3428. this.lastPosition = new a.Vector3,
  3429. this.state = u.NONE,
  3430. this.mouseActions = {},
  3431. this.mouseActions[d.LEFT] = u.ROTATE,
  3432. this.mouseActions[d.MIDDLE] = u.DOLLY,
  3433. this.mouseActions[d.RIGHT] = u.PAN,
  3434. this.touchActions = {},
  3435. this.touchActions[1] = u.ROTATE,
  3436. this.touchActions[2] = u.PAN_DOLLY,
  3437. this.lastMoveTime = 0,
  3438. this.pointersLimit = 2,
  3439. this.pointers = []
  3440. }
  3441. 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;
  3442. (n.prototype = Object.create(g.prototype)).setBounds = function(e) {
  3443. this.targetBounds = e
  3444. }
  3445. ,
  3446. n.prototype.isEngaged = function() {
  3447. return this.state !== u.NONE
  3448. }
  3449. ,
  3450. n.prototype.rotateLeft = function(e) {
  3451. void 0 === e && (e = this.getAutoRotationAngle()),
  3452. this.thetaDelta -= e
  3453. }
  3454. ,
  3455. n.prototype.rotateUp = function(e) {
  3456. this.noRotateUpDown || (void 0 === e && (e = this.getAutoRotationAngle()),
  3457. this.phiDelta -= e)
  3458. }
  3459. ,
  3460. n.prototype.panLeft = function(e) {
  3461. var t = this.camera.matrix.elements;
  3462. this.panOffset.set(t[0], 0, t[2]).normalize(),
  3463. this.panOffset.multiplyScalar(-e),
  3464. this.panVector.add(this.panOffset)
  3465. }
  3466. ,
  3467. n.prototype.panUp = function(e) {
  3468. var t = this.camera.matrix.elements;
  3469. this.panOffset.set(t[4], 0, t[6]).normalize(),
  3470. this.panOffset.multiplyScalar(-e),
  3471. this.panVector.add(this.panOffset)
  3472. }
  3473. ,
  3474. n.prototype.startRotating = function(e, t) {
  3475. e && this.navRotationAcc("x", e),
  3476. t && this.navRotationAcc("y", t)
  3477. }
  3478. ,
  3479. n.prototype.stopRotating = function(e) {
  3480. e && (this.rotationSpeed.x = this.rotationSpeed.y = 0),
  3481. this.navRotationAcc("x", 0),
  3482. this.navRotationAcc("y", 0)
  3483. }
  3484. ,
  3485. n.prototype.setAutoPanPosition = (r = new a.Vector3,
  3486. o = new a.Vector3,
  3487. function(e, t) {
  3488. r.copy(this.camera.position),
  3489. void 0 === e && null === e || r.setX(e),
  3490. void 0 === t && null === t || r.setZ(t);
  3491. var i = this.camera.position.distanceTo(this.target)
  3492. , n = l.FORWARD.clone().applyQuaternion(this.camera.quaternion);
  3493. this.targetClamped = !1,
  3494. o.copy(r).addScaledVector(n, i),
  3495. this.targetBounds.containsPoint(o) || (this.targetBounds.clampPoint(o, o),
  3496. r.copy(o).addScaledVector(n, -i),
  3497. this.targetClamped = !0),
  3498. this.autoPanPosition.x = r.x,
  3499. this.autoPanPosition.z = r.z,
  3500. this.autoPan && this.stopAutoPanning()
  3501. }
  3502. ),
  3503. n.prototype.stopAutoPanning = function() {
  3504. var e = this.autoPan;
  3505. this.autoPan = !1,
  3506. this.emit(this.targetClamped ? f.AutoPanClamped : e ? f.AutoPanInterrupt : f.AutoPanComplete)
  3507. }
  3508. ,
  3509. n.prototype.dollyIn = function(e) {
  3510. void 0 === e && (e = this.getZoomScale()),
  3511. this.scale /= e
  3512. }
  3513. ,
  3514. n.prototype.dollyOut = function(e) {
  3515. void 0 === e && (e = this.getZoomScale()),
  3516. this.scale *= e
  3517. }
  3518. ,
  3519. n.prototype.updatePan = function(e) {
  3520. if (this.panSpeed.multiplyScalar(1 - c.panFriction).addScaledVector(this.panAcceleration, c.panAccelerationOutside * e),
  3521. this.pan(-this.panSpeed.x, this.panSpeed.y),
  3522. this.autoPan) {
  3523. var t = (new a.Vector3).copy(this.autoPanPosition).sub(this.camera.position);
  3524. t.setY(0).clampLength(0, 50 * e),
  3525. this.target.add(t),
  3526. this.camera.position.add(t),
  3527. this.autoPanPosition.x === this.camera.position.x && this.autoPanPosition.z === this.camera.position.z && (this.autoPan = !1,
  3528. this.stopAutoPanning())
  3529. }
  3530. }
  3531. ,
  3532. n.prototype.update = function(e) {
  3533. e = e || 1 / 60,
  3534. this.rotationSpeed.multiplyScalar(1 - c.rotationFriction).addScaledVector(this.rotationAcceleration, c.rotationAccelerationOutside * e),
  3535. this.rotateLeft(-this.rotationSpeed.x),
  3536. this.noRotateUpDown || this.rotateUp(this.rotationSpeed.y),
  3537. this.updatePan(e);
  3538. var t = this.camera.position;
  3539. this.offset.copy(t).sub(this.target);
  3540. var i = Math.atan2(this.offset.x, this.offset.z)
  3541. , n = Math.atan2(Math.sqrt(this.offset.x * this.offset.x + this.offset.z * this.offset.z), this.offset.y);
  3542. this.autoRotate && this.rotateLeft(this.getAutoRotationAngle()),
  3543. i += this.thetaDelta,
  3544. n += this.phiDelta,
  3545. n = Math.max(this.minPolarAngle, Math.min(this.maxPolarAngle, n)),
  3546. n = Math.max(1e-6, Math.min(Math.PI - 1e-6, n));
  3547. this.lon = i, this.lat = n//add
  3548. var r = this.updateZoom();
  3549. r = Math.max(this.minDistance, Math.min(this.maxDistance, r)),
  3550. this.target.add(this.panVector),
  3551. this.targetBounds.clampPoint(this.target, this.target),
  3552. this.offset.x = r * Math.sin(n) * Math.sin(i),
  3553. this.offset.y = r * Math.cos(n),
  3554. this.offset.z = r * Math.sin(n) * Math.cos(i),
  3555. t.copy(this.target).add(this.offset),
  3556. this.camera.lookAt(this.target),
  3557. this.thetaDelta = 0,
  3558. this.phiDelta = 0,
  3559. this.scale = 1,
  3560. this.panVector.set(0, 0, 0),
  3561. 0 < this.lastPosition.distanceTo(this.camera.position) && this.lastPosition.copy(this.camera.position)
  3562. }
  3563. ,
  3564. n.prototype.getAutoRotationAngle = function() {
  3565. return 2 * Math.PI / 60 / 60 * this.autoRotateSpeed
  3566. }
  3567. ,
  3568. n.prototype.getZoomScale = function() {
  3569. return Math.pow(.95, this.zoomSpeed)
  3570. }
  3571. ,
  3572. n.prototype.onMouseDown = function(e) {
  3573. if (this.enabled) {
  3574. switch (e.preventDefault(),
  3575. this.stopAutoPanning(),
  3576. this.mouseDown = !0,
  3577. this.state = this.mouseActions[e.button],
  3578. this.state) {
  3579. case u.ROTATE:
  3580. this.rotateStart.set(e.clientX, this.noRotateUpDown ? 0 : e.clientY),
  3581. this.rotationSpeed.set(0, 0);
  3582. break;
  3583. case u.DOLLY:
  3584. this.dollyStart.set(e.clientX, e.clientY);
  3585. break;
  3586. case u.PAN:
  3587. this.panStart.set(e.clientX, e.clientY)
  3588. }
  3589. this.emit(f.InputStart, "mouse")
  3590. }
  3591. }
  3592. ,
  3593. n.prototype.onMouseMove = function(e) {
  3594. if (this.enabled && this.mouseDown && 0 !== e.buttons) {
  3595. switch (e.preventDefault(),
  3596. this.state) {
  3597. case u.ROTATE:
  3598. this.rotateEnd.set(e.clientX, this.noRotateUpDown ? 0 : e.clientY),
  3599. this.rotateDelta.subVectors(this.rotateEnd, this.rotateStart),
  3600. this.rotateLeft(2 * Math.PI * this.rotateDelta.x / $("#player").width() * this.rotateSpeed),
  3601. this.rotateUp(2 * Math.PI * this.rotateDelta.y / $("#player").height() * this.rotateSpeed),
  3602. this.rotateStart.copy(this.rotateEnd);
  3603. break;
  3604. case u.DOLLY:
  3605. this.dollyEnd.set(e.clientX, e.clientY),
  3606. this.dollyDelta.subVectors(this.dollyEnd, this.dollyStart),
  3607. (0 < this.dollyDelta.y ? this.dollyIn : this.dollyOut).call(this),
  3608. this.dollyStart.copy(this.dollyEnd);
  3609. break;
  3610. case u.PAN:
  3611. this.panEnd.set(e.clientX, e.clientY),
  3612. this.panDelta.subVectors(this.panEnd, this.panStart),
  3613. this.pan(this.panDelta.x, this.panDelta.y),
  3614. this.panStart.copy(this.panEnd)
  3615. }
  3616. this.emit(f.Move, "mouse"),
  3617. this.lastMoveTime = e.timeStamp,
  3618. this.update()
  3619. }
  3620. }
  3621. ,
  3622. n.prototype.onMouseUp = function(e) {
  3623. this.enabled && (this.mouseDown = !1,
  3624. this.state = u.NONE,
  3625. "mouseover" !== e.type && (e.timeStamp > this.lastMoveTime + 100 ? (this.rotationSpeed.set(0, 0),
  3626. this.rotationAcceleration.set(0, 0)) : this.rotationAcceleration.set(-this.rotateDelta.x, this.rotateDelta.y),
  3627. this.update(),
  3628. this.rotationAcceleration.set(0, 0),
  3629. this.rotateDelta.set(0, 0)))
  3630. }
  3631. ,
  3632. n.prototype.onMouseOver = function(e) {
  3633. 0 !== e.which && 0 !== e.buttons || this.onMouseUp(e)
  3634. }
  3635. ,
  3636. n.prototype.onMouseWheel = function(e) {
  3637. this.enabled && c.useWheel && (this.emit(f.Move, "wheel"),
  3638. (0 < (e.wheelDelta || -e.detail) ? this.dollyOut : this.dollyIn).call(this),
  3639. this.update())
  3640. }
  3641. ,
  3642. n.prototype.onKeyDown = function(e) {
  3643. this.enabled && (e.metaKey || e.ctrlKey || (e.preventDefault(),
  3644. this.handleKeyDown(e.which)))
  3645. }
  3646. ,
  3647. n.prototype.navRotationAcc = function(e, t) {
  3648. "y" === e ? this.noRotateUpDown ? this.keyboardZoomSpeed = t : this.rotationAcceleration.y = t : this.rotationAcceleration.x = t
  3649. }
  3650. ,
  3651. n.prototype.navPanAcc = function(e, t) {
  3652. this.stopAutoPanning(),
  3653. this.panAcceleration[e] = t
  3654. }
  3655. ,
  3656. n.prototype.handleKeyDown = function(e) {
  3657. var t = !0;
  3658. switch (e) {
  3659. case p.UPARROW:
  3660. case p.I:
  3661. this.navRotationAcc("y", 1);
  3662. break;
  3663. case p.DOWNARROW:
  3664. case p.K:
  3665. this.navRotationAcc("y", -1);
  3666. break;
  3667. case p.LEFTARROW:
  3668. case p.J:
  3669. this.navRotationAcc("x", -1);
  3670. break;
  3671. case p.RIGHTARROW:
  3672. case p.L:
  3673. this.navRotationAcc("x", 1);
  3674. break;
  3675. case p.W:
  3676. this.navPanAcc("y", 1);
  3677. break;
  3678. case p.S:
  3679. this.navPanAcc("y", -1);
  3680. break;
  3681. case p.A:
  3682. this.navPanAcc("x", -1);
  3683. break;
  3684. case p.D:
  3685. this.navPanAcc("x", 1);
  3686. break;
  3687. default:
  3688. t = !1
  3689. }
  3690. t && this.emit(f.Move, "key")
  3691. }
  3692. ,
  3693. n.prototype.onKeyUp = function(e) {
  3694. this.enabled && (e.preventDefault(),
  3695. e.stopPropagation(),
  3696. this.handleKeyUp(e.which))
  3697. }
  3698. ,
  3699. n.prototype.handleKeyUp = function(e) {
  3700. switch (e) {
  3701. case p.I:
  3702. case p.K:
  3703. case p.UPARROW:
  3704. case p.DOWNARROW:
  3705. this.keyboardZoomSpeed = 0,
  3706. this.rotationAcceleration.y = 0;
  3707. break;
  3708. case p.J:
  3709. case p.L:
  3710. case p.LEFTARROW:
  3711. case p.RIGHTARROW:
  3712. this.rotationAcceleration.x = 0;
  3713. break;
  3714. case p.S:
  3715. case p.W:
  3716. this.panAcceleration.y = 0;
  3717. break;
  3718. case p.A:
  3719. case p.D:
  3720. this.panAcceleration.x = 0
  3721. }
  3722. }
  3723. ,
  3724. n.prototype.onTouchStart = function(i) {
  3725. if (this.enabled || this.state === u.NONE) {
  3726. i.preventDefault(),
  3727. i.stopPropagation(),
  3728. this.stopAutoPanning();
  3729. var e = function() {
  3730. if (2 === i.touches.length) {
  3731. var e = i.touches[0].pageX - i.touches[1].pageX
  3732. , t = i.touches[0].pageY - i.touches[1].pageY;
  3733. this.dollyStart.set(e, t)
  3734. }
  3735. }
  3736. .bind(this)
  3737. , t = function() {
  3738. this.panStart.set(h.average(i.touches, "pageX"), h.average(i.touches, "pageY"))
  3739. }
  3740. .bind(this)
  3741. , n = function() {
  3742. this.rotateStart.set(h.average(i.touches, "pageX"), h.average(i.touches, "pageY"))
  3743. }
  3744. .bind(this);
  3745. switch (this.state = this.touchActions[i.touches.length],
  3746. this.state) {
  3747. case u.PAN_DOLLY:
  3748. e();
  3749. case u.PAN:
  3750. t();
  3751. break;
  3752. case u.ROTATE_DOLLY:
  3753. e();
  3754. case u.ROTATE:
  3755. n()
  3756. }
  3757. this.rotationSpeed.set(0, 0),
  3758. this.emit(f.InputStart, "touch")
  3759. }
  3760. }
  3761. ,
  3762. n.prototype.onTouchMove = function(a) {
  3763. if (this.enabled && this.state !== u.NONE) {
  3764. a.preventDefault(),
  3765. a.stopPropagation();
  3766. var s = function() {
  3767. var e = a.touches[0].pageX - a.touches[1].pageX
  3768. , t = a.touches[0].pageY - a.touches[1].pageY;
  3769. this.dollyEnd.set(e, t);
  3770. var i = this.dollyStart.length() - this.dollyEnd.length();
  3771. 0 < i ? this.dollyOut(1 + i / 500) : this.dollyIn(1 - i / 500),
  3772. this.dollyStart.copy(this.dollyEnd)
  3773. }
  3774. .bind(this)
  3775. , e = function() {
  3776. this.panEnd.set(h.average(a.touches, "pageX"), h.average(a.touches, "pageY")),
  3777. this.panDelta.subVectors(this.panEnd, this.panStart),
  3778. this.pan(this.panDelta.x, this.panDelta.y),
  3779. this.panStart.copy(this.panEnd),
  3780. this.rotateDelta.set(0, 0)
  3781. }
  3782. .bind(this)
  3783. , l = function() {
  3784. this.rotateEnd.set(h.average(a.touches, "pageX"), h.average(a.touches, "pageY")),
  3785. this.rotateDelta.subVectors(this.rotateEnd, this.rotateStart),
  3786. this.rotateLeft(2 * Math.PI * this.rotateDelta.x / $("#player").width() * this.rotateSpeed),
  3787. this.rotateUp(2 * Math.PI * this.rotateDelta.y / $("#player").height() * this.rotateSpeed),
  3788. this.rotateStart.copy(this.rotateEnd)
  3789. }
  3790. .bind(this)
  3791. , t = function() {
  3792. if (2 === a.touches.length) {
  3793. var e = window.devicePixelRatio || 1
  3794. , t = a.touches[1].pageX - a.touches[0].pageX
  3795. , i = a.touches[1].pageY - a.touches[0].pageY
  3796. , n = Math.sqrt(t * t + i * i);
  3797. if (Math.abs(this.dollyStart.length() - n) > c.input.touchMoveThreshold * e)
  3798. this.state = u.DOLLY,
  3799. s();
  3800. else {
  3801. var r = h.average(a.touches, "pageX")
  3802. , o = h.average(a.touches, "pageY");
  3803. this.rotateDelta.set(r, o).sub(this.rotateStart).length() > c.input.touchMoveThreshold && (this.state = u.ROTATE,
  3804. this.rotateStart.set(r, o),
  3805. l())
  3806. }
  3807. }
  3808. }
  3809. .bind(this);
  3810. switch (this.state) {
  3811. case u.PAN_DOLLY:
  3812. s();
  3813. case u.PAN:
  3814. e();
  3815. break;
  3816. case u.ROTATE_DOLLY:
  3817. t();
  3818. break;
  3819. case u.DOLLY:
  3820. s();
  3821. break;
  3822. case u.ROTATE:
  3823. l();
  3824. break;
  3825. default:
  3826. this.state = u.NONE
  3827. }
  3828. this.lastMoveTime = a.timeStamp,
  3829. this.emit(f.Move, "touch")
  3830. }
  3831. }
  3832. ,
  3833. n.prototype.onTouchEnd = function(e) {
  3834. this.enabled && (this.state === u.ROTATE && (e.timeStamp > this.lastMoveTime + 100 ? (this.rotationSpeed.set(0, 0),
  3835. this.rotationAcceleration.set(0, 0)) : this.rotationAcceleration.set(-this.rotateDelta.x, this.rotateDelta.y)),
  3836. this.state = u.NONE,
  3837. this.update(),
  3838. this.rotationAcceleration.set(0, 0),
  3839. this.rotateDelta.set(0, 0))
  3840. }
  3841. ,
  3842. n.prototype.onPointerDown = function(e) {
  3843. this.enabled && ("touch" === e.pointerType && (this.pointers.length < this.pointersLimit && this.pointers.push({
  3844. id: e.pointerId,
  3845. pageX: e.pageX,
  3846. pageY: e.pageY
  3847. }),
  3848. e.touches = this.pointers,
  3849. this.onTouchStart(e)),
  3850. this.emit(f.InputStart, "pointer"))
  3851. }
  3852. ,
  3853. n.prototype.onPointerMove = function(t) {
  3854. this.enabled && "touch" === t.pointerType && (this.pointers.forEach(function(e) {
  3855. t.pointerId === e.id && (e.pageX = t.pageX,
  3856. e.pageY = t.pageY)
  3857. }),
  3858. t.touches = this.pointers,
  3859. this.onTouchMove(t))
  3860. }
  3861. ,
  3862. n.prototype.onPointerUp = function(i) {
  3863. this.enabled && "touch" === i.pointerType && (this.pointers.forEach(function(e, t) {
  3864. i.pointerId === e.id && this.pointers.splice(t, 1)
  3865. }
  3866. .bind(this)),
  3867. i.touches = this.pointers,
  3868. this.onTouchEnd(i))
  3869. }
  3870. ,
  3871. n.prototype.reset = function() {
  3872. this.state = u.NONE,
  3873. this.stopAutoPanning(),
  3874. this.rotationSpeed.set(0, 0),
  3875. this.rotationAcceleration.set(0, 0),
  3876. this.panSpeed.set(0, 0),
  3877. this.panAcceleration.set(0, 0)
  3878. }
  3879. ,
  3880. n.prototype.toJSON = function() {
  3881. return {
  3882. camera_position: {
  3883. x: s.toPrecision(this.camera.position.x, 4),
  3884. y: s.toPrecision(this.camera.position.y, 4),
  3885. z: s.toPrecision(this.camera.position.z, 4)
  3886. },
  3887. camera_quaternion: {
  3888. x: s.toPrecision(this.camera.quaternion.x, 4),
  3889. y: s.toPrecision(this.camera.quaternion.y, 4),
  3890. z: s.toPrecision(this.camera.quaternion.z, 4),
  3891. w: s.toPrecision(this.camera.quaternion.w, 4)
  3892. }
  3893. }
  3894. }
  3895. ,
  3896. t.exports = n
  3897. }
  3898. , {
  3899. "../enum/ControlActions": 20,
  3900. "../enum/ControlEvents": 21,
  3901. "../enum/Keys": 30,
  3902. "../enum/MouseButton": 34,
  3903. "../enum/Vectors": 50,
  3904. "../settings": 166,
  3905. "../util/common": 185,
  3906. "../util/math": 190,
  3907. events: 202,
  3908. three: 217
  3909. }],
  3910. 13: [function(u, d, e) {
  3911. (function(e) {
  3912. "use strict";
  3913. function t(e) {
  3914. this.camera = e,
  3915. (this.camera.controls = this).target = new s.Vector3(0,0,0),
  3916. this.lookVector = new s.Vector3,
  3917. this.lookSpeed = .05,
  3918. this.rotationAcc = new s.Vector2,
  3919. this.rotationSpeed = new s.Vector2,
  3920. this.lat = 0,
  3921. this.lon = 0,
  3922. this.phi = 0,
  3923. this.theta = 0,
  3924. this.enabled = !1,
  3925. this.locked = !1,
  3926. this.pointer = new s.Vector2(0,0),
  3927. this.rotationHistory = [],
  3928. this.rotationDifference = new s.Vector2,
  3929. this.pointerDragOn = !1,
  3930. this.pointerDragStart = new s.Vector2(0,0),
  3931. this.pinchDistance = 0,
  3932. this.moveStart = new s.Vector2,
  3933. this.moveTolerance = .01,
  3934. this.pointersLimit = 2,
  3935. this.pointers = []
  3936. //watch(this, 'enabled', this.enabled)
  3937. }
  3938. var s = u("three")
  3939. , i = u("../util/logger")
  3940. , n = u("../settings")
  3941. , r = u("../util/common")
  3942. , o = u("../util/math")
  3943. , a = (u("../enum/Vectors"),
  3944. u("../enum/MouseButton"))
  3945. , l = u("../enum/Keys")
  3946. , c = u("../enum/ControlEvents")
  3947. , h = u("events").EventEmitter;
  3948. new i(e),
  3949. (t.prototype = Object.create(h.prototype)).usable = function() {
  3950. return this.enabled && !this.locked
  3951. }
  3952. ,
  3953. /* t.prototype.lookAt = function(e) {
  3954. var t = this.camera.position.clone().sub(e)
  3955. , i = Math.atan(t.z / t.x);
  3956. i += t.x < 0 ? Math.PI : 0,
  3957. i += 0 < t.x && t.z < 0 ? 2 * Math.PI : 0,
  3958. this.lon = s.Math.radToDeg(i) + 180;
  3959. var n = Math.sqrt(t.x * t.x + t.z * t.z)
  3960. , r = Math.atan(t.y / n);
  3961. this.lat = -s.Math.radToDeg(r)
  3962. } */
  3963. t.prototype.lookAt = function(aim, dir) {
  3964. var t = dir || this.camera.position.clone().sub(aim); //aim所指点的笛卡尔坐标系
  3965. var i = Math.atan(t.z / t.x);
  3966. i += t.x < 0 ? Math.PI : 0;
  3967. i += t.x > 0 && t.z < 0 ? 2 * Math.PI : 0;
  3968. this.lon = s.Math.radToDeg(i) + 180;
  3969. var n = Math.sqrt(t.x * t.x + t.z * t.z),
  3970. o = Math.atan(t.y / n);
  3971. this.lat = -s.Math.radToDeg(o);
  3972. }
  3973. ,
  3974. t.prototype.startRotationFrom = function(e, t) {
  3975. o.convertScreenPositionToNDC(e, t, this.pointer),
  3976. this.pointerDragOn = !0,
  3977. this.pointerDragStart.copy(this.pointer),
  3978. this.moveStart.copy(this.pointer),
  3979. this.rotationHistory = [],
  3980. this.rotationSpeed.set(0, 0)
  3981. }
  3982. ,
  3983. t.prototype.onMouseOver = function(e) {
  3984. !this.pointerDragOn || 0 !== e.which && 0 !== e.buttons || this.onMouseUp(e)
  3985. }
  3986. ,
  3987. t.prototype.onTouchStart = function(e) {
  3988. if (this.usable()) {
  3989. switch (e.preventDefault(),
  3990. e.stopPropagation(),
  3991. e.touches.length) {
  3992. case 1:
  3993. this.startRotationFrom(e.touches[0].clientX, e.touches[0].clientY);
  3994. break;
  3995. case 2:
  3996. var t = (e.touches[0].clientX - e.touches[1].clientX) / $("#player").width()
  3997. , i = (e.touches[0].clientY - e.touches[1].clientY) / $("#player").height();
  3998. this.pinchDistance = Math.sqrt(t * t + i * i)
  3999. }
  4000. this.emit(c.InputStart, "touch")
  4001. }
  4002. }
  4003. ,
  4004. t.prototype.onPointerDown = function(e) {
  4005. this.usable() && "touch" === e.pointerType && (this.pointers.length < this.pointersLimit && this.pointers.push({
  4006. id: e.pointerId,
  4007. clientX: e.clientX,
  4008. clientY: e.clientY
  4009. }),
  4010. e.touches = this.pointers,
  4011. this.onTouchStart(e),
  4012. this.emit(c.InputStart, "pointer"))
  4013. }
  4014. ,
  4015. t.prototype.onMouseDown = function(e) {
  4016. if (this.usable()) {
  4017. switch (e.preventDefault(),
  4018. e.stopPropagation(),
  4019. e.button) {
  4020. case a.LEFT:
  4021. this.startRotationFrom(e.clientX, e.clientY)
  4022. }
  4023. this.emit(c.InputStart, "mouse")
  4024. }
  4025. }
  4026. ,
  4027. t.prototype.updateRotation = function() {
  4028. if (this.usable() && this.pointerDragOn) {
  4029. var e = new s.Vector3(this.pointerDragStart.x,this.pointerDragStart.y,-1).unproject(this.camera)
  4030. , t = new s.Vector3(this.pointer.x,this.pointer.y,-1).unproject(this.camera)
  4031. , i = Math.sqrt(e.x * e.x + e.z * e.z)
  4032. , n = Math.sqrt(t.x * t.x + t.z * t.z)
  4033. , r = Math.atan2(e.y, i)
  4034. , o = Math.atan2(t.y, n);
  4035. this.rotationDifference.y = s.Math.radToDeg(r - o),
  4036. e.y = 0,
  4037. t.y = 0;
  4038. var a = Math.acos(e.dot(t) / e.length() / t.length());
  4039. isNaN(a) || (this.rotationDifference.x = s.Math.radToDeg(a),
  4040. this.pointerDragStart.x < this.pointer.x && (this.rotationDifference.x *= -1)),
  4041. this.pointerDragStart.copy(this.pointer)
  4042. }
  4043. }
  4044. ,
  4045. t.prototype.onMouseMove = function(e) {
  4046. this.usable() && (o.convertScreenPositionToNDC(e.clientX, e.clientY, this.pointer),
  4047. 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"))
  4048. }
  4049. ,
  4050. t.prototype.onTouchMove = function(e) {
  4051. if (this.usable())
  4052. switch (this.emit(c.Move, "touch"),
  4053. e.touches.length) {
  4054. case 1:
  4055. o.convertScreenPositionToNDC(e.touches[0].clientX, e.touches[0].clientY, this.pointer);
  4056. break;
  4057. case 2:
  4058. var t = (e.touches[0].clientX - e.touches[1].clientX) / $("#player").width()
  4059. , i = (e.touches[0].clientY - e.touches[1].clientY) / $("#player").height()
  4060. , n = this.pinchDistance - Math.sqrt(t * t + i * i);
  4061. .01 < Math.abs(n) && (this.emit(c.InteractionDirect),
  4062. this.emit(c.Pinch, n),
  4063. this.pinchDistance -= n)
  4064. }
  4065. }
  4066. ,
  4067. t.prototype.onPointerMove = function(t) {
  4068. this.usable() && "touch" === t.pointerType && (this.pointers.forEach(function(e) {
  4069. t.pointerId === e.id && (e.clientX = t.clientX,
  4070. e.clientY = t.clientY)
  4071. }),
  4072. t.touches = this.pointers,
  4073. this.onTouchMove(t))
  4074. }
  4075. ,
  4076. t.prototype.endRotation = function() {
  4077. this.pointerDragOn = !1;
  4078. var e = r.averageVectors(this.rotationHistory);
  4079. this.rotationSpeed.set(e.x * n.rotationAfterMoveMultiplier, e.y * n.rotationAfterMoveMultiplier)
  4080. }
  4081. ,
  4082. t.prototype.onTouchEnd = function(e) {
  4083. this.usable() && (e.preventDefault(),
  4084. e.stopPropagation(),
  4085. this.endRotation())
  4086. }
  4087. ,
  4088. t.prototype.onMouseUp = function(e) {
  4089. this.usable() && (e.preventDefault(),
  4090. e.stopPropagation(),
  4091. this.endRotation())
  4092. }
  4093. ,
  4094. t.prototype.onPointerUp = function(i) {
  4095. this.usable() && "touch" === i.pointerType && (this.pointers.forEach(function(e, t) {
  4096. i.pointerId === e.id && this.pointers.splice(t, 1)
  4097. }
  4098. .bind(this)),
  4099. i.touches = this.pointers,
  4100. this.onTouchEnd(i))
  4101. }
  4102. ,
  4103. t.prototype.update = function(e) {
  4104. for (this.lon,
  4105. this.lat,
  4106. this.updateRotation(),
  4107. this.rotationHistory.push(this.rotationDifference.clone()); this.rotationHistory.length > n.rotationAfterMoveHistoryCount; )
  4108. this.rotationHistory.shift();
  4109. this.lon += this.rotationDifference.x,
  4110. this.lat += this.rotationDifference.y,
  4111. this.rotationDifference.set(0, 0),
  4112. this.rotationSpeed.x = this.rotationSpeed.x * (1 - n.rotationFriction) + this.rotationAcc.x * n.rotationAccelerationInside,
  4113. this.rotationSpeed.y = this.rotationSpeed.y * (1 - n.rotationFriction) + this.rotationAcc.y * n.rotationAccelerationInside,
  4114. this.lon += this.rotationSpeed.x * e,
  4115. this.lat += this.rotationSpeed.y * e
  4116. let insideLookLimitDown = this.insideLookLimitDown != void 0 ? this.insideLookLimitDown : n.insideLookLimitDown
  4117. let insideLookLimitUp = this.insideLookLimitUp != void 0 ? this.insideLookLimitUp : n.insideLookLimitUp
  4118. insideLookLimitDown = insideLookLimitDown - n.insideFOV/2 + this.camera.fov / 2
  4119. insideLookLimitUp = insideLookLimitUp + n.insideFOV/2 - this.camera.fov / 2
  4120. 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 );
  4121. //this.lat = Math.max(n.insideLookLimitDown, Math.min(n.insideLookLimitUp, this.lat)),
  4122. this.phi = s.Math.degToRad(90 - this.lat),
  4123. this.theta = s.Math.degToRad(this.lon),
  4124. this.lookVector.x = Math.sin(this.phi) * Math.cos(this.theta),
  4125. this.lookVector.y = Math.cos(this.phi),
  4126. this.lookVector.z = Math.sin(this.phi) * Math.sin(this.theta),
  4127. this.target.copy(this.lookVector).add(this.camera.position),
  4128. this.camera.lookAt(this.target)
  4129. }
  4130. ,
  4131. t.prototype.onMouseWheel = function(e) {
  4132. if (this.usable()) {
  4133. var t = e.wheelDelta || -e.detail;
  4134. this.emit(c.InteractionDirect),
  4135. this.emit(c.Scroll, t)
  4136. }
  4137. }
  4138. ,
  4139. t.prototype.onKeyDown = function(e) {
  4140. this.usable() && (e.metaKey || e.ctrlKey || (e.preventDefault(),
  4141. this.handleKeyDown(e.which)))
  4142. }
  4143. ,
  4144. t.prototype.handleKeyDown = function(e) {
  4145. var t = function(e, t) {
  4146. this.rotationAcc[e] = t
  4147. }
  4148. .bind(this);
  4149. this.emit(c.InteractionKey);
  4150. var i = !0;
  4151. switch (e) {
  4152. case l.LEFTARROW:
  4153. case l.J:
  4154. t("x", -1);
  4155. break;
  4156. case l.RIGHTARROW:
  4157. case l.L:
  4158. t("x", 1);
  4159. break;
  4160. case l.I:
  4161. t("y", 1);
  4162. break;
  4163. case l.K:
  4164. t("y", -1);
  4165. break;
  4166. default:
  4167. i = !1
  4168. }
  4169. i && this.emit(c.Move, "key")
  4170. }
  4171. ,
  4172. t.prototype.onKeyUp = function(e) {
  4173. this.usable() && (e.preventDefault(),
  4174. e.stopPropagation(),
  4175. this.handleKeyUp(e.which))
  4176. }
  4177. ,
  4178. t.prototype.handleKeyUp = function(e) {
  4179. switch (e) {
  4180. case l.LEFTARROW:
  4181. case l.J:
  4182. case l.RIGHTARROW:
  4183. case l.L:
  4184. this.rotationAcc.x = 0;
  4185. break;
  4186. case l.I:
  4187. case l.K:
  4188. this.rotationAcc.y = 0
  4189. }
  4190. }
  4191. ,
  4192. t.prototype.startRotating = function(e, t) {
  4193. e && (this.rotationAcc.x = e),
  4194. t && (this.rotationAcc.y = t)
  4195. }
  4196. ,
  4197. t.prototype.stopRotating = function(e) {
  4198. e && (this.rotationSpeed.x = this.rotationSpeed.y = 0),
  4199. this.rotationAcc.set(0, 0)
  4200. }
  4201. ,
  4202. t.prototype.reset = function() {
  4203. this.pointerDragOn = !1,
  4204. this.rotationAcc.set(0, 0),
  4205. this.rotationSpeed.set(0, 0),
  4206. this.pointers = []
  4207. }
  4208. ,
  4209. t.prototype.toJSON = function() {
  4210. return {
  4211. camera_position: {
  4212. x: o.toPrecision(this.camera.position.x, 4),
  4213. y: o.toPrecision(this.camera.position.y, 4),
  4214. z: o.toPrecision(this.camera.position.z, 4)
  4215. },
  4216. camera_quaternion: {
  4217. x: o.toPrecision(this.camera.quaternion.x, 4),
  4218. y: o.toPrecision(this.camera.quaternion.y, 4),
  4219. z: o.toPrecision(this.camera.quaternion.z, 4),
  4220. w: o.toPrecision(this.camera.quaternion.w, 4)
  4221. }
  4222. }
  4223. }
  4224. ,
  4225. t.prototype.setStateFromJSON = function(e) {
  4226. this.camera.position.copy(e.camera_position),
  4227. this.camera.quaternion.copy(e.camera_quaternion)
  4228. }
  4229. ,
  4230. d.exports = t
  4231. }
  4232. ).call(this, "/js/controls/PanoramaControls.js")
  4233. }
  4234. , {
  4235. "../enum/ControlEvents": 21,
  4236. "../enum/Keys": 30,
  4237. "../enum/MouseButton": 34,
  4238. "../enum/Vectors": 50,
  4239. "../settings": 166,
  4240. "../util/common": 185,
  4241. "../util/logger": 189,
  4242. "../util/math": 190,
  4243. events: 202,
  4244. three: 217
  4245. }],
  4246. 14: [function(t, i, e) {
  4247. (function(e) {
  4248. "use strict";
  4249. var c = t("three")
  4250. , h = t("../enum/Viewmode")
  4251. , u = new (t("../util/logger"))(e);
  4252. i.exports = {
  4253. serialize: function(e) {
  4254. return encodeURI(JSON.stringify(e))
  4255. },
  4256. deserialize: function(e) {
  4257. function t(e) {
  4258. return e.reduce(function(e, t) {
  4259. return e && "number" == typeof t && !isNaN(t)
  4260. }, !0)
  4261. }
  4262. try {
  4263. var i = JSON.parse(decodeURI(e))
  4264. , n = {
  4265. mode: h.fromInt(i.camera_mode),
  4266. panoId: i.scan_id,
  4267. position: (new c.Vector3).copy(i.camera_position),
  4268. quaternion: (new c.Quaternion).copy(i.camera_quaternion),
  4269. zoom: i.ortho_zoom,
  4270. floorVisibility: i.floor_visibility
  4271. }
  4272. , r = n.position;
  4273. t([r.x, r.y, r.z]) || n.position.set(0, 0, 0);
  4274. var o = n.quaternion;
  4275. return t([o.x, o.y, o.z, o.w]) || n.quaternion.set(0, 0, 0, 1),
  4276. n
  4277. } catch (i) {
  4278. u.debug("Not able to parse start location as JSON; falling back to old array style parsing");
  4279. try {
  4280. var a = e.split(",")
  4281. , s = {
  4282. x: parseFloat(a[2]),
  4283. y: parseFloat(a[3]),
  4284. z: parseFloat(a[4])
  4285. }
  4286. , l = {
  4287. x: parseFloat(a[5]),
  4288. y: parseFloat(a[6]),
  4289. z: parseFloat(a[7]),
  4290. w: parseFloat(a[8])
  4291. };
  4292. return t([s.x, s.y, s.z]) || (s.x = 0,
  4293. s.y = 0,
  4294. s.z = 0),
  4295. t([l.x, l.y, l.z, l.w]) || (l.x = 0,
  4296. l.y = 0,
  4297. l.z = 0,
  4298. l.w = 1),
  4299. {
  4300. mode: h.fromInt(a[0]),
  4301. panoId: a[1],
  4302. position: (new c.Vector3).copy(s),
  4303. quaternion: (new c.Quaternion).copy(l)
  4304. }
  4305. } catch (t) {
  4306. u.warn('Invalid start override, ignoring: "' + e + '"', t.message)
  4307. }
  4308. }
  4309. return null
  4310. }
  4311. }
  4312. }
  4313. ).call(this, "/js/controls/serializer.js")
  4314. }
  4315. , {
  4316. "../enum/Viewmode": 51,
  4317. "../util/logger": 189,
  4318. three: 217
  4319. }],
  4320. 15: [function(C, I, e) {
  4321. (function(e) {
  4322. "use strict";
  4323. function t() {
  4324. this.endlessLoop = r.warp.loop,
  4325. this.clock = new i.Clock(!0),
  4326. this.model = null,
  4327. this.player = null,
  4328. this.currentItem = null,
  4329. this.destinationItem = null,
  4330. this.tourIsPlaying = !1,
  4331. this.transitionStage = v.None,
  4332. this.nextFunc = null,
  4333. this.onTheBus = !1,
  4334. this.tourInProgress = !1,
  4335. this.reachSource = null,
  4336. this.interrupted = !1,
  4337. this.nItems = 0,
  4338. this.walkingSectionPaused = !1
  4339. }
  4340. var i = C("three")
  4341. , n = C("./util/logger")
  4342. , r = C("./settings")
  4343. , o = C("./util/transitions")
  4344. , a = C("events").EventEmitter
  4345. , s = C("./enum/Viewmode")
  4346. , l = C("./analytics")
  4347. , c = C("./enum/WarpStyle")
  4348. , h = (o = C("./util/transitions"),
  4349. C("./model/ModelManager"),
  4350. C("./enum/ModelManagerEvents"))
  4351. , u = C("./enum/DirectorEvents")
  4352. , d = C("./enum/PlayerEvents")
  4353. , p = (C("./enum/ControlEvents"),
  4354. C("./enum/BlackoutStyle"))
  4355. , f = C("./enum/PathDiscardMode")
  4356. , g = C("./enum/PathDisplayMode")
  4357. , m = (C("./player"),
  4358. new n(e))
  4359. , v = Object.freeze({
  4360. None: 0,
  4361. Moving: 1,
  4362. Aiming: 2,
  4363. Interlude: 3
  4364. })
  4365. , y = Object.freeze({
  4366. Forward: 1,
  4367. NoChange: 0,
  4368. Backwards: -1
  4369. })
  4370. , A = o.getUniqueId();
  4371. (t.prototype = Object.create(a.prototype)).init = function(e, t) {
  4372. this.player = e,
  4373. this.modelManager = t,
  4374. this.updateModel(),
  4375. this.resetAll(),
  4376. this.bindEvents()
  4377. }
  4378. ,
  4379. t.prototype.resetAll = function() {
  4380. if (this.currentItem = null,
  4381. this.destinationItem = null,
  4382. this.tourIsPlaying = !1,
  4383. //this.bgmReplay(),
  4384. this.transitionStage = v.None,
  4385. this.nextFunc = null,
  4386. this.onTheBus = !1,
  4387. this.reachSource = null,
  4388. this.interrupted = !1,
  4389. this.model) {
  4390. var e = r.path.typ === c.WALK ? c.WALK : c.STD;
  4391. this.defaultWarpStyle = this.model.data.hasOwnProperty("player_options") && this.model.data.player_options && !1 === this.model.data.player_options.fast_transitions ? e : c.BLACK
  4392. } else
  4393. this.defaultWarpStyle = c.BLACK,
  4394. m.warn('No model yet, choosing "' + this.defaultWarpStyle + '" transitions');
  4395. this.resetSpecialTransition()
  4396. }
  4397. ,
  4398. t.prototype.updateModel = function() {
  4399. this.model = this.modelManager.getActiveModel(),
  4400. this.nItems = this.model.heroLocations.length
  4401. }
  4402. ,
  4403. t.prototype.bindEvents = function() {
  4404. this.modelManager.on(h.ActiveModelChanged, this.updateModel.bind(this)),
  4405. this.player.on(d.WarpInterruptedWithFlyTo, this.checkAndHandleWalkingtourInterruption.bind(this)),
  4406. this.player.on(d.Move, this.handlePlayerMove.bind(this)),
  4407. this.player.on(d.PanoChosen, this.handlePlayerPanoChosen.bind(this)),
  4408. this.player.on(d.ModeChanged, this.handlePlayerModeChanged.bind(this)),
  4409. this.player.on(d.InputStart, this.handlePlayerInputStart.bind(this)),
  4410. this.player.on(d.FlyingStarted, this.handlePlayerFlyingStarted.bind(this)),
  4411. this.player.once(d.Move, function() {
  4412. o.cancelById(A)
  4413. })
  4414. }
  4415. ,
  4416. t.prototype.checkAndHandleWalkingtourInterruption = function(e) {//快速停止。 改:去掉判断nextWarpStyle,因为这个属性改乱了,导致点击停止按钮不执行
  4417. return /* e === c.WALK && ( */this.interrupt(p.NONE),
  4418. this.pauseWalkingSection(),
  4419. this.player.fastForwardActivePanoFlight(),
  4420. !0/* ) */
  4421. }
  4422. ,
  4423. t.prototype.handlePlayerMove = function(e) {
  4424. this.transitionStage === v.Interlude && this.interrupt(p.NONE),
  4425. this.emit("update.controls")
  4426. }
  4427. ,
  4428. t.prototype.handlePlayerPanoChosen = function(e, t) {
  4429. this.intermediateState() || e.id === t.id || (this.onTheBus = !1,
  4430. this.emit("update.controls"))
  4431. }
  4432. ,
  4433. t.prototype.handlePlayerModeChanged = function(e, t) {
  4434. this.intermediateState() || e === t || (this.onTheBus = !1,
  4435. this.emit("update.controls"))
  4436. }
  4437. ,
  4438. t.prototype.handlePlayerInputStart = function(e) {
  4439. this.transitionStage === v.Interlude && this.interrupt(p.NONE)
  4440. }
  4441. ,
  4442. t.prototype.handlePlayerFlyingStarted = function() {
  4443. this.clearWalkingSectionPaused()
  4444. }
  4445. ,
  4446. t.prototype.describe = function() {
  4447. return {
  4448. nItems: this.nItems,
  4449. currentItem: this.currentItem,
  4450. destinationItem: this.destinationItem,
  4451. tourIsPlaying: this.tourIsPlaying,
  4452. onTheBus: this.onTheBus,
  4453. endlessLoop: this.endlessLoop,
  4454. viewMode: this.player.mode,
  4455. inTransition: this._inTransition(),
  4456. transitionStage: this.transitionStage,
  4457. tourInProgress: this.tourInProgress
  4458. }
  4459. }
  4460. ,
  4461. t.prototype._inTransition = function() {
  4462. return this.player.flying || this.player.isWarping() || this.player.isWaitingToWarp() || this.player.mode === s.TRANSITIONING || this.tourIsPlaying
  4463. }
  4464. ,
  4465. t.prototype.bounceable = function() {
  4466. var e = this.clock.getDelta();
  4467. return this.isInterrupted() || e < .9 && .01 < e || this.player.flying && !this.player.isWarping()
  4468. }
  4469. ,
  4470. t.prototype.itemCompare = function(item1, item2, type){//add
  4471. if(type == 'equal'){//==
  4472. return item1 && item2 && item1[0] == item2[0] && item1[1] == item2[1]
  4473. }else if(type == 'less'){//<
  4474. return item1 && item2 && (item1[0] < item2[0]) || (item1[0] == item2[0] && item1[1] < item2[1])
  4475. }
  4476. }
  4477. t.prototype.currentMoveDirection = function() {
  4478. //return null === this.currentItem || void 0 === this.currentItem ? y.Forward : this.destinationItem === this.currentItem ? y.NoChange : this.destinationItem > this.currentItem ? y.Forward : y.Backwards
  4479. 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
  4480. }
  4481. ,
  4482. t.prototype.clearPath = function() {
  4483. this._inTransition() || this.player.path.discardPathObject()
  4484. }
  4485. ,
  4486. t.prototype.allFloors = function() {
  4487. this.model.toggleAllFloors()
  4488. }
  4489. ,
  4490. t.prototype.actionComplete = function(e) {
  4491. if (this.interrupted = !1,
  4492. this.transitionStage = v.None,
  4493. this.resetSpecialTransition(),
  4494. null !== this.destinationItem && this.setCurrentItem(this.destinationItem),
  4495. this.tourIsPlaying || (this.player.disablePreRendering(),
  4496. this.player.mode === s.PANORAMA && this.player.currentPano.isAligned() && this.model.fadePanoMarkers()),
  4497. this.emit("update.controls"),
  4498. this.nextFunc) {
  4499. var t = this.nextFunc;
  4500. this.nextFunc = null,
  4501. t()
  4502. }
  4503. }
  4504. ,
  4505. t.prototype.awaitCompletion = function(e, t) {
  4506. this.nextFunc = t,
  4507. e()
  4508. }
  4509. ,
  4510. t.prototype.updateSuccessFunction = function(e) {
  4511. this.nextFunc = e
  4512. }
  4513. ,
  4514. t.prototype.interrupt = function(e, t) {
  4515. return !!this.wouldInterrupt() && (this.tourIsPlaying && (this.player.zoomEnabled = this.wasZoomEnabled),
  4516. this.tourIsPlaying = !1,
  4517. //this.bgmReplay(),
  4518. this.interrupted = !0,
  4519. this.nextFunc = null,
  4520. this.emit(u.ActionInterrupted),
  4521. null != e || (e = p.BEGINNING),
  4522. this.player.interruptAndFastForward(e, t),
  4523. !0)
  4524. }
  4525. ,
  4526. t.prototype.wouldInterrupt = function() {
  4527. return this.transitionStage !== v.None
  4528. }
  4529. ,
  4530. t.prototype.intermediateState = function() {
  4531. return this.transitionStage !== v.None
  4532. }
  4533. ,
  4534. t.prototype.isInterrupted = function() {
  4535. return this.interrupted
  4536. }
  4537. ,
  4538. t.prototype.pauseWalkingSection = function() {
  4539. this.walkingSectionPaused = !0
  4540. }
  4541. ,
  4542. t.prototype.clearWalkingSectionPaused = function() {
  4543. this.walkingSectionPaused = !1
  4544. }
  4545. ,
  4546. t.prototype.autoTour = function() {
  4547. var i = Date.now();
  4548. this.model.auxDataPromise.then(function() {
  4549. i = Date.now() - i;
  4550. var e = r.warp.auto
  4551. , t = this.model.data && this.model.data.player_options/* && this.model.data.player_options.highlight_reel */;
  4552. 0 <= e && 1 < this.model.heroCount() && t && o.trigger({
  4553. duration: Math.max(1e3 * Math.min(300, e) - i, 0),
  4554. done: function() {
  4555. this.playTour()
  4556. }
  4557. .bind(this),
  4558. name: "_atr",
  4559. id: A
  4560. })
  4561. }
  4562. .bind(this))
  4563. }
  4564. ,
  4565. t.prototype.atDestinationPano = function() {
  4566. if (!this.player.currentPano || null === this.destinationItem)
  4567. return !1;
  4568. var e = this.player.currentPano.id;
  4569. if (void 0 === e)
  4570. return !1;
  4571. var t = this.model.heroLocations;
  4572. //return null !== this.destinationItem && void 0 !== t[this.destinationItem] && e === t[this.destinationItem].panoId
  4573. var destination = this.destinationItem && this.model.getHeroDescriptorByIndex(this.destinationItem)
  4574. return destination && destination.panoId == e
  4575. }
  4576. ,
  4577. t.prototype.redirectToItem = function(e, t) {
  4578. if (null != e)
  4579. if (this.wouldInterrupt())
  4580. if (this.player.mode !== s.TRANSITIONING) {
  4581. m.debug("Director.redirectToItem() -> Redirecting to " + e + " via " + t);
  4582. var i = function() {
  4583. o.setTimeout(function() {
  4584. this.setDestinationItem(e),
  4585. this.goToDestination(!0, p.BEGINNING, r.warp.warpInterruptionRedirectTime, !1)
  4586. }
  4587. .bind(this), 0)
  4588. }
  4589. .bind(this);
  4590. this.interrupt(p.END, 0),
  4591. this.updateSuccessFunction(i)
  4592. } else
  4593. m.debug("Director.redirectToItem() -> Cannot redirect while transitioning.");
  4594. else
  4595. m.warn("Director.redirectToItem() -> Director cannot redirect if there is nothing to interrupt.");
  4596. else
  4597. m.warn("Director.redirectToItem() -> Redirecting to null item.")
  4598. }
  4599. ,
  4600. t.prototype.useSpecialTransition = function(e) {
  4601. void 0 !== e && this.defaultWarpStyle !== c.BLACK && m.debug("useSpecialTransition(): " + e),
  4602. this.nextWarpStyle = c.BLACK
  4603. }
  4604. ,
  4605. t.prototype.resetSpecialTransition = function() {
  4606. this.nextWarpStyle = this.defaultWarpStyle
  4607. }
  4608. ,
  4609. t.prototype.arrivedAtDestination = function(e) {
  4610. if (this.player.flying || this.player.isWarping())
  4611. m.warn("Cannot advance to interlude or aiming while player is flying or warping.");
  4612. else {
  4613. this.transitionStage = v.Aiming;
  4614. var t = this.tourIsPlaying ? this.tourInterlude.bind(this, this.nextItem(this.currentItem)) : null;
  4615. this.player.model.fadePanoMarkers(0),
  4616. this.awaitCompletion(function() {
  4617. this.resetSpecialTransition(),
  4618. e ? this.player.aimTourCamera(this.destinationItem, g.Retain, g.Slow, this.actionComplete.bind(this)) : this.actionComplete()
  4619. }
  4620. .bind(this), t)
  4621. }
  4622. }
  4623. ,
  4624. t.prototype.goToDestination = function(e, t, i, n) {
  4625. //音频
  4626. var musicInfo = this.model.heroLocations[this.destinationItem[0]].musicInfo //只有外层有音乐
  4627. if(musicInfo && musicInfo.music){
  4628. let src = musicInfo.music.includes(g_Prefix.slice(-10)) ? musicInfo.music : g_Prefix + musicInfo.music;
  4629. let audioObj = SoundManager.list.find(e=>e.name == 'tour')
  4630. let audioSrc1 = common.getFileNameFromUrl(audioObj.src);
  4631. let audioSrc2 = common.getFileNameFromUrl(src)
  4632. if(audioSrc1 == audioSrc2){//应该是继续播放该folder
  4633. if(this.destinationItem[1] == 0){//从头开始播放 因为可能暂停后然后再点该缩略图播
  4634. SoundManager.play('tour',null,0) // currentTime = 0;
  4635. }else if( audioObj.audio.paused && audioObj.audio.currentTime < audioObj.audio.duration ){//未播完
  4636. SoundManager.play('tour')//继续播。 如果不是< 说明播完了,item[1]不为0应该是继续播放就不需要从头
  4637. }
  4638. }else{//很可能是该folder的起始
  4639. SoundManager.play('tour', manage.dealURL(src))
  4640. }
  4641. }
  4642. if (this.onTheBus = !0,
  4643. this.emit("update.controls"),
  4644. this.player.updateLastView(),
  4645. n || !this.atDestinationPano()){
  4646. if (this.player.flying || this.player.isWarping())
  4647. m.warn("Cannot go to new destination while player is flying or warping.");
  4648. else {
  4649. var a = this.model.getHeroDescriptorByIndex(this.destinationItem)
  4650. , s = null
  4651. , l = null;
  4652. if (a.isPano()) {
  4653. var o1 = e ? 'black' : this.getMomentTour(this.destinationItem) //window.DATA.momentTour || "walk";
  4654. l = this.player.warpToPanoByHeroIndex.bind(this.player, this.destinationItem, g.Show, f.Slow, o1, !0, i, this.actionComplete.bind(this)),
  4655. s = this.arrivedAtDestination.bind(this, !0)
  4656. //add
  4657. if(o1=='black' && a.zoom && a.zoom != this.player.zoomLevel){
  4658. this.player.smoothZoomFovTo(null, a.zoom, r.warp.teleportTime) //瞬间过渡的时间
  4659. }
  4660. } else{
  4661. l = this.player.warpToNonPanoByHeroIndex.bind(this.player, this.destinationItem, this.actionComplete.bind(this)),
  4662. s = this.arrivedAtDestination.bind(this, !1);
  4663. }
  4664. this.transitionStage = v.Moving,
  4665. this.model.fadePanoMarkers(0),
  4666. this.awaitCompletion(function() {
  4667. l()
  4668. }
  4669. .bind(this), s),
  4670. this.emit("update.controls")
  4671. }
  4672. }else{
  4673. //add 原地旋转时, 写到_warpCameraAim里,因那有时间
  4674. /* var a = this.model.getHeroDescriptorByIndex(this.destinationItem)
  4675. if(a.zoom && a.zoom != this.player.zoomLevel){
  4676. this.player.smoothZoomFovTo(null, a.zoom, r.warp.teleportTime) //瞬间过渡的时间
  4677. } */
  4678. this.arrivedAtDestination(!0)
  4679. }
  4680. }
  4681. ,
  4682. t.prototype.tourInterlude = function() {
  4683. if (l.trackAlways("reach_highlight", {
  4684. reach_source: this.reachSource
  4685. }),
  4686. this.model.fadePanoMarkers(0),
  4687. this.emit("update.controls"),
  4688. this.tourIsPlaying)
  4689. return this.atEndOfTour() && !this.endlessLoop ? (this.tourInProgress = !1,
  4690. this.stopTour(),
  4691. this.emit(u.TourEnd),
  4692. void (this.player.mode === s.PANORAMA && this.model.fadePanoMarkers(r.panorama.markerOpacity))) : void this.awaitCompletion(function() {
  4693. this.transitionStage = v.Interlude,
  4694. this.player.tourInterlude(this.nextItem(this.currentItem), this.actionComplete.bind(this))
  4695. }
  4696. .bind(this), this.goNext.bind(this))
  4697. }
  4698. ,
  4699. t.prototype.playTour = function() {
  4700. if (!this.bounceable())
  4701. return this.tourIsPlaying ? void m.info("tour is already playing") : void (this.wouldInterrupt() || (this.player.emit("tour_auto", this.defaultWarpStyle),
  4702. this.tourInProgress = !0,
  4703. this.reachSource = "play",
  4704. this.tourIsPlaying = !0,
  4705. this.wasZoomEnabled = this.player.zoomEnabled,
  4706. this.player.zoomEnabled = !1,
  4707. this.resetSpecialTransition(),
  4708. this.emit("update.controls"),
  4709. this.emit(u.TourStart),
  4710. this.player.enablePreRendering(),
  4711. this.walkingSectionPaused ? (this.clearWalkingSectionPaused(),
  4712. this.goToDestination()) : /* this.goNext() */(
  4713. this.atEndOfTour() ? this.goNext() : ( this.tourAdvance(0) , this.goToDestination())) )
  4714. ) //xzw: 不要直接跳到下一个点开始,从当前点开始,否则当一段区域内只有一个导览时播放会立刻跳到下一个缩略图进行。
  4715. }
  4716. ,
  4717. t.prototype.stopTour = function(isAutoStop) {//停止导览 isAutoStop 希望仅在飞完结束自动停止时的stopTour不停止tourSound, 这样才能完整播放tourSound. 不过似乎会在倒数第二个片段点击按钮停止导览时也视作自动结束的(执行this.interrupt() )。
  4718. this.isInterrupted() || this.transitionStage === v.Moving && this.checkAndHandleWalkingtourInterruption(this.nextWarpStyle) || (this.tourIsPlaying && (this.player.zoomEnabled = this.wasZoomEnabled),
  4719. this.tourIsPlaying = !1,
  4720. //(!isAutoStop || g_tourAudio && g_tourAudio.paused )&&this.bgmReplay(),//xzw
  4721. this.interrupt(),
  4722. this.clearWalkingSectionPaused(),
  4723. this.resetSpecialTransition(),
  4724. this.emit("update.controls"))
  4725. }
  4726. ,
  4727. t.prototype.endTourProgress = function() {
  4728. this.tourInProgress = !1,
  4729. this.emit("update.controls"),
  4730. this.emit(u.TourEnd)
  4731. }
  4732. ,
  4733. t.prototype.goToHighlight = function(e) {
  4734. if (this.wouldInterrupt())
  4735. this.itemCompare(this.destinationItem,e,'equal') ? this.interrupt() : this.redirectToItem(e, "goToHighlight");
  4736. else {
  4737. if (m.debug("<tour.goto " + e + ">"),
  4738. this.isInterrupted())
  4739. return;
  4740. this.clearWalkingSectionPaused(),
  4741. this.setDestinationItem(e),
  4742. this.useSpecialTransition("Hilight"),
  4743. this.goToDestination(true),//add true
  4744. l.trackAlways("reach_highlight", {
  4745. reach_source: "thumb"
  4746. })
  4747. }
  4748. }
  4749. ,
  4750. t.prototype.prevHighlight = function() {
  4751. this.bounceable() || (this.player.emit("tour_manual", "prev"),
  4752. this.interrupt(p.BEGINNING) || this.isInterrupted() || (this.clearWalkingSectionPaused(),
  4753. this.reachSource = "prev",
  4754. this.goPrev()))
  4755. }
  4756. ,
  4757. t.prototype.nextHighlight = function() {
  4758. this.bounceable() || (this.player.emit("tour_manual", "next"),
  4759. this.interrupt(p.BEGINNING) || this.isInterrupted() || (this.clearWalkingSectionPaused(),
  4760. this.reachSource = "next",
  4761. this.goNext()))
  4762. }
  4763. ,
  4764. t.prototype.changeMode = function(e) {
  4765. var t = $.Deferred()
  4766. , i = t.resolve.bind(t)
  4767. , n = t.reject.bind(t);
  4768. if (this.emit(u.StartModeChange),
  4769. !function() {
  4770. return this.clearWalkingSectionPaused(),
  4771. !!this.wouldInterrupt() && (this.interrupt(),
  4772. !0)
  4773. }
  4774. .bind(this)()) {
  4775. switch (e) {
  4776. case s.PANORAMA:
  4777. 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);
  4778. break;
  4779. case s.DOLLHOUSE:
  4780. case s.FLOORPLAN:
  4781. this.player.flyToNewMode({
  4782. mode: e
  4783. }).done(i).fail(n);
  4784. break;
  4785. case s.OUTDOOR:
  4786. 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)
  4787. }
  4788. return t.promise()
  4789. }
  4790. }
  4791. ,
  4792. t.prototype.atEndOfTour = function(item) {
  4793. //return this.currentItem >= this.nItems - 1
  4794. var end = this.currentItem && this.currentItem[0] >= this.nItems - 1;
  4795. if(end){
  4796. var heroLocations = this.model.heroLocations[this.nItems-1].heroLocations
  4797. if(heroLocations){
  4798. end = this.currentItem[1] >= heroLocations.length - 1
  4799. }
  4800. }
  4801. return end;
  4802. }
  4803. ,
  4804. t.prototype.firstDestination = function() {
  4805. //return 0 < this.nItems ? 0 : null
  4806. return 0 < this.nItems ? [0,0]: null
  4807. }
  4808. ,
  4809. t.prototype.finalDestination = function() {
  4810. //return 0 < this.nItems ? this.nItems - 1 : null
  4811. return 0 < this.nItems ? [this.nItems - 1,0]: null
  4812. }
  4813. ,
  4814. t.prototype.goPrev = function() {
  4815. this.tourAdvance(-1)
  4816. }
  4817. ,
  4818. t.prototype.goNext = function() {
  4819. this.tourAdvance(1)
  4820. }
  4821. ,
  4822. t.prototype.setDestinationItem = function(e) {
  4823. this.destinationItem = e,
  4824. this.emit("update.controls")
  4825. }
  4826. ,
  4827. t.prototype.setCurrentItem = function(e) {
  4828. this.currentItem = e,
  4829. this.emit("update.controls")
  4830. }
  4831. ,
  4832. t.prototype.nextItem = function(currentItem) {
  4833. //return null === e ? this.firstDestination() : e >= this.nItems - 1 ? this.endlessLoop ? this.firstDestination() : null : e + 1
  4834. if(currentItem == void 0)return this.firstDestination()
  4835. var currentLocation = this.model.heroLocations[currentItem[0]];
  4836. var currentChildNum = currentLocation.heroLocations ? currentLocation.heroLocations.length : 1
  4837. var item;
  4838. if(this.currentItem[1] >= currentChildNum - 1){//子目录中最后一个
  4839. item = [currentItem[0] + 1, 0] //结果可能超出nItems
  4840. }else{
  4841. item = [currentItem[0] , currentItem[1]+1]
  4842. }
  4843. if(item[0] >= this.nItems ){
  4844. item = this.firstDestination()
  4845. }
  4846. return item;
  4847. //暂时不理会endlessLoop,默认为false
  4848. }
  4849. ,
  4850. t.prototype.prevItem = function(currentItem) {
  4851. //return null === e ? this.firstDestination() : e < 0 ? this.endlessLoop ? this.lastDestination() : null : e - 1
  4852. if(currentItem == void 0)return this.firstDestination()//finalDestination?
  4853. var item;
  4854. var lastLocation = this.model.heroLocations[currentItem[0]-1];
  4855. if(!lastLocation) return this.finalDestination()//[-1, 0]//this.setDestinationItem([-1, 0]) //结果小于0
  4856. else{
  4857. var lastChildNum = lastLocation.heroLocations ? lastLocation.heroLocations.length : 1
  4858. if(this.currentItem[1] == 0){//子目录中第一个
  4859. return [currentItem[0] - 1, lastChildNum-1]
  4860. }else{
  4861. return [currentItem[0], currentItem[1]-1]
  4862. }
  4863. }
  4864. }
  4865. ,
  4866. t.prototype.tourAdvance = function(e) {//e是1或-1或0
  4867. m.debug("tourAdvance(" + e + ")")
  4868. if(null === this.currentItem || void 0 === this.currentItem){
  4869. this.setDestinationItem(this.firstDestination())
  4870. }else{
  4871. var item = this.currentItem
  4872. if(e == 1){
  4873. item = this.nextItem(this.currentItem)
  4874. }else if(e == -1){
  4875. item = this.prevItem(this.currentItem)
  4876. }
  4877. this.setDestinationItem(item)
  4878. }
  4879. if(this.itemCompare(this.destinationItem, this.finalDestination(), 'equal')[0] < 0 ){
  4880. this.useSpecialTransition("reverse-looping to end")
  4881. }else if(this.itemCompare(this.destinationItem, this.firstDestination(), 'equal')){
  4882. this.useSpecialTransition("looping back to start")
  4883. }
  4884. /* if(this.destinationItem[0] < 0 ){
  4885. this.setDestinationItem(this.finalDestination())
  4886. this.useSpecialTransition("reverse-looping to end")
  4887. }else{
  4888. this.destinationItem[0] >= this.nItems && (this.setDestinationItem(this.firstDestination()),
  4889. this.useSpecialTransition("looping back to start"))
  4890. } */
  4891. /* var momentTour = this.getMomentTour(this.destinationItem);
  4892. if ( "black" === momentTour) { // 方奕卓 瞬间过渡, 相机缩放至1
  4893. var i = this.player.zoomLevel;
  4894. this.player.zoomEnabled = !0;
  4895. var t = function(e, t) {
  4896. this.player.zoomTo((1 - e) * i, !0)
  4897. }
  4898. .bind(this);
  4899. o.start(t, 1500, function() {}, 0, h.easeOutQuad, "zoom")
  4900. } */
  4901. this.goToDestination()
  4902. }
  4903. ,
  4904. t.prototype.getMomentTour = function(destinationItem) {//add
  4905. var wholeMomentTour = window.DATA.momentTour || "walk"; //最外层
  4906. if(!destinationItem) return wholeMomentTour
  4907. else{
  4908. var currentLocation = this.model.getHeroDescriptorByIndex(destinationItem)//最内层。 如果有使用最内层
  4909. if(currentLocation.momentTour)return currentLocation.momentTour;
  4910. var currentLocation_ = this.model.heroLocations[destinationItem[0]];
  4911. return currentLocation_.momentTour || wholeMomentTour; //若中间层或最内层有就使用,否则使用最外层
  4912. }
  4913. }
  4914. ,
  4915. I.exports = t
  4916. }
  4917. ).call(this, "/js/director.js")
  4918. }
  4919. , {
  4920. "./analytics": 4,
  4921. "./enum/BlackoutStyle": 18,
  4922. "./enum/ControlEvents": 21,
  4923. "./enum/DirectorEvents": 23,
  4924. "./enum/ModelManagerEvents": 33,
  4925. "./enum/PathDiscardMode": 38,
  4926. "./enum/PathDisplayMode": 39,
  4927. "./enum/PlayerEvents": 40,
  4928. "./enum/Viewmode": 51,
  4929. "./enum/WarpStyle": 52,
  4930. "./model/ModelManager": 140,
  4931. "./player": 155,
  4932. "./settings": 166,
  4933. "./util/logger": 189,
  4934. "./util/transitions": 195,
  4935. events: 202,
  4936. three: 217
  4937. }],
  4938. 16: [function(e, t, i) {
  4939. "use strict";
  4940. var n = e("three")
  4941. , r = e("./enum/Viewmode")
  4942. , o = (e("./settings"),
  4943. e("./util/transitions"))
  4944. , a = e("./enum/PlayerEvents")
  4945. , s = new n.ShaderPass(n.HorizontalBlurShader)
  4946. , l = new n.ShaderPass(n.VerticalBlurShader);
  4947. l.renderToScreen = !0;
  4948. var c = $("#player").width() / $("#player").height();
  4949. isNaN(c) && (c = 1);
  4950. //initTransitionPass(n)
  4951. var h = {
  4952. currentBlur: 0,
  4953. aspect: c,
  4954. blurStrength: 1,
  4955. hblurPass: s,
  4956. vblurPass: l,
  4957. fastTranMaskPass : new n.TransitionPass(),
  4958. bindEvents: function(e) {
  4959. e.on(a.ModeChanged, function(e, t) {
  4960. e === r.PANORAMA && (o.cancel(h.blur),
  4961. o.cancel(h.addBlur),
  4962. o.start(h.removeBlur, 500, null, 0, null, "deblur"))
  4963. })
  4964. },
  4965. blur: function(e) {
  4966. var t = (h.currentBlur = e) * h.blurStrength;
  4967. l.uniforms.v.value = t / 512 * h.aspect,
  4968. s.uniforms.h.value = t / 512
  4969. },
  4970. addBlur: function(e) {
  4971. e = Math.max(e, h.currentBlur),
  4972. h.blur(e)
  4973. },
  4974. removeBlur: function(e) {
  4975. e = Math.min(1 - e, h.currentBlur),
  4976. h.blur(e)
  4977. }
  4978. };
  4979. h.blur(0),
  4980. t.exports = h
  4981. }
  4982. , {
  4983. "./enum/PlayerEvents": 40,
  4984. "./enum/Viewmode": 51,
  4985. "./settings": 166,
  4986. "./util/transitions": 195,
  4987. three: 217
  4988. }],
  4989. 17: [function(e, t, i) {
  4990. "use strict";
  4991. t.exports = {
  4992. UNKNOWN: 0,
  4993. ALIGNED: 1,
  4994. UNALIGNED: 2,
  4995. PLACED: 3
  4996. }
  4997. }
  4998. , {}],
  4999. 18: [function(e, t, i) {
  5000. "use strict";
  5001. t.exports = {
  5002. NONE: 0,
  5003. MIDDLE: 1,
  5004. END: 2,
  5005. BEGINNING: 3,
  5006. FADEIN: 4
  5007. }
  5008. }
  5009. , {}],
  5010. 19: [function(e, t, i) {
  5011. "use strict";
  5012. var r = e("three");
  5013. t.exports = {
  5014. newBlue: new r.Color(4967932),
  5015. altBlue: new r.Color(47355),
  5016. tagDefault: new r.Color(223357),
  5017. classicBlue: new r.Color(53759),
  5018. mpYellow: new r.Color(16502016),
  5019. mpOrange: new r.Color(16428055),
  5020. mpBlue: new r.Color(12096),
  5021. mpLtGrey: new r.Color(13751252),
  5022. mpDkGrey: new r.Color(10000019),
  5023. mpRed: new r.Color(12525854),
  5024. mpOrangeDesat: new r.Color(16764529),
  5025. mpBlueDesat: new r.Color(4034734),
  5026. mpRedDesat: new r.Color(14705505),
  5027. white: new r.Color(16777215),
  5028. black: new r.Color(0),
  5029. _desat: function(e, t) {
  5030. var i = t || .3
  5031. , n = (new r.Color).copy(e).getHSL();
  5032. return (new r.Color).setHSL(n.h, n.s * (1 - i), n.l)
  5033. },
  5034. _darken: function(e, t) {
  5035. var i = t || .2
  5036. , n = e.getHSL();
  5037. return (new r.Color).setHSL(n.h, n.s, n.l * (1 - i))
  5038. }
  5039. }
  5040. }
  5041. , {
  5042. three: 217
  5043. }],
  5044. 20: [function(e, t, i) {
  5045. "use strict";
  5046. t.exports = {
  5047. NONE: -1,
  5048. ROTATE: 0,
  5049. DOLLY: 1,
  5050. PAN: 2,
  5051. ROTATE_DOLLY: 3,
  5052. PAN_DOLLY: 4
  5053. }
  5054. }
  5055. , {}],
  5056. 21: [function(e, t, i) {
  5057. "use strict";
  5058. t.exports = {
  5059. Move: "move",
  5060. InteractionDirect: "interaction.direct",
  5061. InteractionKey: "interaction.key",
  5062. InteractionGui: "interaction.gui",
  5063. FlyInDirection: "fly.direction",
  5064. InputStart: "input.start",
  5065. Pinch: "input.pinch",
  5066. Scroll: "input.scroll",
  5067. AutoPanInterrupt: "autopan.interrupt",
  5068. AutoPanComplete: "autopan.complete",
  5069. AutoPanClamped: "autopan.clamped",
  5070. LongTap: "longtap"
  5071. }
  5072. }
  5073. , {}],
  5074. 22: [function(e, t, i) {
  5075. "use strict";
  5076. t.exports = Object.freeze({
  5077. FORWARD: "FORWARD",
  5078. LEFT: "LEFT",
  5079. RIGHT: "RIGHT",
  5080. BACK: "BACK",
  5081. UP: "UP",
  5082. DOWN: "DOWN"
  5083. })
  5084. }
  5085. , {}],
  5086. 23: [function(e, t, i) {
  5087. "use strict";
  5088. t.exports = {
  5089. ActionInterrupted: "action.interrupted",
  5090. TourStart: "tour.start",
  5091. TourEnd: "tour.end",
  5092. StartModeChange: "mode.startChange"
  5093. }
  5094. }
  5095. , {}],
  5096. 24: [function(e, t, i) {
  5097. "use strict";
  5098. t.exports = Object.freeze({
  5099. None: 0,
  5100. Queued: 1,
  5101. ForceQueued: 2,
  5102. Downloading: 3,
  5103. Downloaded: 4,
  5104. DownloadFailed: 5
  5105. })
  5106. }
  5107. , {}],
  5108. 25: [function(e, t, i) {
  5109. "use strict";
  5110. t.exports = {
  5111. GL_TEXTURE_CUBE_MAP_POSITIVE_X: 0,
  5112. GL_TEXTURE_CUBE_MAP_NEGATIVE_X: 1,
  5113. GL_TEXTURE_CUBE_MAP_POSITIVE_Y: 2,
  5114. GL_TEXTURE_CUBE_MAP_NEGATIVE_Y: 3,
  5115. GL_TEXTURE_CUBE_MAP_POSITIVE_Z: 4,
  5116. GL_TEXTURE_CUBE_MAP_NEGATIVE_Z: 5
  5117. }
  5118. }
  5119. , {}],
  5120. 26: [function(e, t, i) {
  5121. "use strict";
  5122. t.exports = {
  5123. Texture2D: 0,
  5124. TextureCube: 1
  5125. }
  5126. }
  5127. , {}],
  5128. 27: [function(e, t, i) {
  5129. "use strict";
  5130. t.exports = {
  5131. SMALL: "small",
  5132. LARGE: "large"
  5133. }
  5134. }
  5135. , {}],
  5136. 28: [function(e, t, i) {
  5137. "use strict";
  5138. var n = e("./Viewmode")
  5139. , r = {
  5140. LANDING: {},
  5141. NAVIGATION: "navigation",
  5142. MORE_HELP: "moreHelp",
  5143. TOUR_INTERACTION: {}
  5144. };
  5145. r.LANDING[n.PANORAMA] = "panorama.landing",
  5146. r.LANDING[n.OUTDOOR] = "outdoor.landing",
  5147. r.LANDING[n.DOLLHOUSE] = "dollhouse.landing",
  5148. r.LANDING[n.FLOORPLAN] = "floorplan.landing",
  5149. r.TOUR_INTERACTION.standard = "standard.tour",
  5150. r.TOUR_INTERACTION[n.OUTDOOR] = "outdoor.tour",
  5151. r.TOUR_INTERACTION[n.FLOORPLAN] = "floorplan.tour",
  5152. t.exports = r
  5153. }
  5154. , {
  5155. "./Viewmode": 51
  5156. }],
  5157. 29: [function(e, t, i) {
  5158. "use strict";
  5159. var n = {
  5160. UP: 1,
  5161. DOWN: -1,
  5162. LEFT: "L",
  5163. RIGHT: "R",
  5164. FORWARD: "F",
  5165. BACK: "B",
  5166. reverse: {},
  5167. opposite: function(e) {
  5168. return this.reverse[e.toString()]
  5169. }
  5170. };
  5171. n.reverse[n.UP] = n.DOWN,
  5172. n.reverse[n.DOWN] = n.UP,
  5173. n.reverse[n.LEFT] = n.RIGHT,
  5174. n.reverse[n.RIGHT] = n.LEFT,
  5175. n.reverse[n.FORWARD] = n.BACK,
  5176. n.reverse[n.BACK] = n.FORWARD,
  5177. t.exports = n
  5178. }
  5179. , {}],
  5180. 30: [function(e, t, i) {
  5181. "use strict";
  5182. var n = {
  5183. ZERO: 48,
  5184. ONE: 49,
  5185. TWO: 50,
  5186. THREE: 51,
  5187. FOUR: 52,
  5188. FIVE: 53,
  5189. SIX: 54,
  5190. SEVEN: 55,
  5191. EIGHT: 56,
  5192. NINE: 57,
  5193. LEFTARROW: 37,
  5194. UPARROW: 38,
  5195. RIGHTARROW: 39,
  5196. DOWNARROW: 40,
  5197. A: 65,
  5198. B: 66,
  5199. C: 67,
  5200. D: 68,
  5201. E: 69,
  5202. F: 70,
  5203. G: 71,
  5204. H: 72,
  5205. I: 73,
  5206. J: 74,
  5207. K: 75,
  5208. L: 76,
  5209. M: 77,
  5210. N: 78,
  5211. O: 79,
  5212. P: 80,
  5213. Q: 81,
  5214. R: 82,
  5215. S: 83,
  5216. T: 84,
  5217. U: 85,
  5218. V: 86,
  5219. W: 87,
  5220. X: 88,
  5221. Y: 89,
  5222. Z: 90,
  5223. SPACE: 32,
  5224. RETURN: 13,
  5225. SEMICOLON: 186,
  5226. PLUSEQUALS: 187,
  5227. DASHUNDERSCORE: 189,
  5228. OPENBRACKET: 219
  5229. };
  5230. e("../util/browser").detectFirefox() && (n.SEMICOLON = 59,
  5231. n.PLUSEQUALS = 61,
  5232. n.DASHUNDERSCORE = 173),
  5233. t.exports = n
  5234. }
  5235. , {
  5236. "../util/browser": 182
  5237. }],
  5238. 31: [function(e, t, i) {
  5239. "use strict";
  5240. t.exports = {
  5241. EN_US: "en-US",
  5242. ES_MX: "es-MX",
  5243. FR_FR: "fr-FR",
  5244. DE_DE: "de-DE",
  5245. RU_RU: "ru-RU",
  5246. CN_CN: "cn-CN",
  5247. JP_JP: "jp-JP"
  5248. }
  5249. }
  5250. , {}],
  5251. 32: [function(e, t, i) {
  5252. "use strict";
  5253. t.exports = {
  5254. TagActivated: "tag.activated",
  5255. TagDismissed: "tag.dismissed",
  5256. TagNavigation: "tag.navigation"
  5257. }
  5258. }
  5259. , {}],
  5260. 33: [function(e, t, i) {
  5261. "use strict";
  5262. t.exports = {
  5263. ModelAdded: "model-added",
  5264. ActiveModelChanged: "active-model-changed"
  5265. }
  5266. }
  5267. , {}],
  5268. 34: [function(e, t, i) {
  5269. "use strict";
  5270. t.exports = {
  5271. LEFT: 0,
  5272. MIDDLE: 1,
  5273. RIGHT: 2
  5274. }
  5275. }
  5276. , {}],
  5277. 35: [function(e, t, i) {
  5278. "use strict";
  5279. t.exports = {
  5280. PanoRenderComplete: "panorama.render.complete",
  5281. TileRenderFailure: "panorama.tile.render.failed",
  5282. TileRenderSuccess: "panorama.tile.render.success",
  5283. TileUploadAttempted: "panorama.tile.upload.attempted",
  5284. UploadAttemptedForAllTiles: "panorama.upload.attempted.all.tiles",
  5285. ZoomLevelRenderStarted: "panorama.zoom.render.started"
  5286. }
  5287. }
  5288. , {}],
  5289. 36: [function(e, t, i) {
  5290. "use strict";
  5291. t.exports = {
  5292. BASE: 1,
  5293. STANDARD: 2,
  5294. HIGH: 3,
  5295. ULTRAHIGH: 4
  5296. }
  5297. }
  5298. , {}],
  5299. 37: [function(e, t, i) {
  5300. "use strict";
  5301. t.exports = {
  5302. LoadComplete: "panorama.load.complete",
  5303. LoadFailed: "panorama.load.failed",
  5304. TileLoaded: "panorama.tile.loaded"
  5305. }
  5306. }
  5307. , {}],
  5308. 38: [function(e, t, i) {
  5309. "use strict";
  5310. t.exports = Object.freeze({
  5311. Standard: 0,
  5312. Slow: 1,
  5313. Retain: 2
  5314. })
  5315. }
  5316. , {}],
  5317. 39: [function(e, t, i) {
  5318. "use strict";
  5319. t.exports = Object.freeze({
  5320. Show: 0,
  5321. Hide: 1,
  5322. Retain: 2
  5323. })
  5324. }
  5325. , {}],
  5326. 40: [function(e, t, i) {
  5327. "use strict";
  5328. t.exports = {
  5329. Move: "move",
  5330. MoveComplete: "move.complete",
  5331. ModeChanged: "mode.changed",
  5332. ModeChanging: "mode.changing",
  5333. PanoChosen: "pano.chosen",
  5334. ClosestPanoChanging: "closest.pano.changing",
  5335. WarpStarted: "warp.started",
  5336. WarpInterrupted: "warp.interrupted",
  5337. WarpEnded: "warp.ended",
  5338. FlyinFinished: "flyin.finished",
  5339. FlyingStarted: "flying.started",
  5340. FlyingInterrupted: "flying.interrupted",
  5341. FlyingEnded: "flying.ended",
  5342. Ready: "ready",
  5343. StartInside: "start.inside",
  5344. StartOutside: "start.outside",
  5345. ViewChanged: "view.changed",
  5346. WarpInterruptedWithFlyTo: "warp.interrupted.flyto",
  5347. InputStart: "input.start"
  5348. }
  5349. }
  5350. , {}],
  5351. 41: [function(e, t, i) {
  5352. "use strict";
  5353. t.exports = Object.freeze({
  5354. DEFAULT: 0,
  5355. PANOMARKERS: 1,
  5356. RETICULE: 2,
  5357. TAG: 3
  5358. })
  5359. }
  5360. , {}],
  5361. 42: [function(e, t, i) {
  5362. "use strict";
  5363. t.exports = {
  5364. visibleFloor: 1,
  5365. ghostFloor: 3,
  5366. boundingSkybox: 1,
  5367. panoMarker: 2,
  5368. reticule: 3,
  5369. tagStem: 4,
  5370. tagDisc: 5,
  5371. ribbon: 100
  5372. }
  5373. }
  5374. , {}],
  5375. 43: [function(e, t, i) {
  5376. "use strict";
  5377. t.exports = {
  5378. ContextCreated: "scene-renderer-context-created",
  5379. AfterRender: "after-render",
  5380. MemoryUsageUpdated: "scene-renderer-memory-usage-updated"
  5381. }
  5382. }
  5383. , {}],
  5384. 44: [function(e, t, i) {
  5385. "use strict";
  5386. t.exports = {
  5387. IDLE: "idle",
  5388. BROWSE: "browse",
  5389. EXAMINE: "examine"
  5390. }
  5391. }
  5392. , {}],
  5393. 45: [function(e, t, i) {
  5394. "use strict";
  5395. t.exports = {
  5396. TileDownloadSuccess: "tiledownloader.download.success",
  5397. TileDownloadFailure: "tiledownloader.download.failure",
  5398. PanoDownloadComplete: "tiledownloader.pano.download.complete"
  5399. }
  5400. }
  5401. , {}],
  5402. 46: [function(e, t, i) {
  5403. "use strict";
  5404. t.exports = {
  5405. CardboardAndroid: "googlevr",
  5406. GearVR: "gearvr",
  5407. CardboardIOS: "googlevrios",
  5408. Cardboard: "googlevr"
  5409. }
  5410. }
  5411. , {}],
  5412. 47: [function(e, t, i) {
  5413. "use strict";
  5414. t.exports = {
  5415. NONE: 0,
  5416. CONTEXTUAL: 1,
  5417. ANDROID: 2
  5418. }
  5419. }
  5420. , {}],
  5421. 48: [function(e, t, i) {
  5422. "use strict";
  5423. var n = {
  5424. Title: 0,
  5425. Cardboard: 1
  5426. }
  5427. , r = {
  5428. Title: 0,
  5429. Cardboard: 1,
  5430. Gear: 2
  5431. };
  5432. [n, r].forEach(function(e) {
  5433. e.pageCount = Object.keys(e).length
  5434. }),
  5435. t.exports.ios = n,
  5436. t.exports.standard = r
  5437. }
  5438. , {}],
  5439. 49: [function(e, t, i) {
  5440. "use strict";
  5441. t.exports = {
  5442. Android: "android",
  5443. IOS: "ios",
  5444. Desktop: "desktop",
  5445. UnsupportedAndroid: "android-unsupported"
  5446. }
  5447. }
  5448. , {}],
  5449. 50: [function(e, t, i) {
  5450. "use strict";
  5451. var n = e("three");
  5452. t.exports = {
  5453. UP: new n.Vector3(0,1,0),
  5454. DOWN: new n.Vector3(0,-1,0),
  5455. LEFT: new n.Vector3(-1,0,0),
  5456. RIGHT: new n.Vector3(1,0,0),
  5457. FORWARD: new n.Vector3(0,0,-1),
  5458. BACK: new n.Vector3(0,0,1)
  5459. }
  5460. }
  5461. , {
  5462. three: 217
  5463. }],
  5464. 51: [function(e, t, i) {
  5465. "use strict";
  5466. var n = e("../exception/ViewmodeConvertException")
  5467. , r = e("./coreViewmodes")
  5468. , o = {
  5469. MESH: "mesh",
  5470. OUTDOOR: "outdoor",
  5471. TRANSITIONING: "transitioning",
  5472. toInt: function(e) {
  5473. switch (e) {
  5474. case this.PANORAMA:
  5475. return 1;
  5476. case this.DOLLHOUSE:
  5477. return 2;
  5478. case this.FLOORPLAN:
  5479. return 3;
  5480. case this.OUTDOOR:
  5481. return 4;
  5482. case this.TRANSITIONING:
  5483. return -1
  5484. }
  5485. throw new n("No known conversion for Viewmode to int for mode: " + e)
  5486. },
  5487. fromInt: function(e) {
  5488. switch (e) {
  5489. case "1":
  5490. case 1:
  5491. return this.PANORAMA;
  5492. case "2":
  5493. case 2:
  5494. return this.DOLLHOUSE;
  5495. case "3":
  5496. case 3:
  5497. return this.FLOORPLAN;
  5498. case "4":
  5499. case 4:
  5500. return this.OUTDOOR
  5501. }
  5502. throw new n("No known conversion for int to viewmode for int: " + e)
  5503. },
  5504. convertWorkshopModeInt: function(e) {
  5505. switch (e) {
  5506. case "0":
  5507. case 0:
  5508. case void 0:
  5509. return this.PANORAMA;
  5510. case "1":
  5511. case 1:
  5512. return this.FLOORPLAN;
  5513. case "2":
  5514. case 2:
  5515. return this.DOLLHOUSE;
  5516. case "3":
  5517. case 3:
  5518. return this.MESH
  5519. }
  5520. throw new n("No known conversion for Workshop int to viewmode for int: " + e)
  5521. }
  5522. };
  5523. e("../util/common").extendObject(o, r),
  5524. t.exports = o
  5525. }
  5526. , {
  5527. "../exception/ViewmodeConvertException": 58,
  5528. "../util/common": 185,
  5529. "./coreViewmodes": 54
  5530. }],
  5531. 52: [function(e, t, i) {
  5532. "use strict";
  5533. t.exports = {
  5534. BLACK: "black",
  5535. STD: "std",
  5536. WALK: "walk"
  5537. }
  5538. }
  5539. , {}],
  5540. 53: [function(e, t, i) {
  5541. "use strict";
  5542. t.exports = {
  5543. ZoomIn: "zoom.in",
  5544. ZoomOut: "zoom.out",
  5545. ZoomMax: "zoom.max",
  5546. ZoomMin: "zoom.min"
  5547. }
  5548. }
  5549. , {}],
  5550. 54: [function(e, t, i) {
  5551. "use strict";
  5552. t.exports = {
  5553. PANORAMA: "panorama",
  5554. DOLLHOUSE: "dollhouse",
  5555. FLOORPLAN: "floorplan"
  5556. }
  5557. }
  5558. , {}],
  5559. 55: [function(e, t, i) {
  5560. "use strict";
  5561. t.exports = function(e) {
  5562. this.message = e
  5563. }
  5564. }
  5565. , {}],
  5566. 56: [function(e, t, i) {
  5567. "use strict";
  5568. function n(e) {
  5569. r.call(this, e)
  5570. }
  5571. var r = e("./BasicException");
  5572. n.prototype = Object.create(r.prototype),
  5573. t.exports = n
  5574. }
  5575. , {
  5576. "./BasicException": 55
  5577. }],
  5578. 57: [function(e, t, i) {
  5579. "use strict";
  5580. function n(e) {
  5581. r.call(this, e)
  5582. }
  5583. var r = e("./BasicException");
  5584. n.prototype = Object.create(r.prototype),
  5585. t.exports = n
  5586. }
  5587. , {
  5588. "./BasicException": 55
  5589. }],
  5590. 58: [function(e, t, i) {
  5591. "use strict";
  5592. function n(e) {
  5593. r.call(this, e)
  5594. }
  5595. var r = e("./BasicException");
  5596. n.prototype = Object.create(r.prototype),
  5597. t.exports = n
  5598. }
  5599. , {
  5600. "./BasicException": 55
  5601. }],
  5602. 59: [function(a, s, e) {
  5603. (function(e) {
  5604. "use strict";
  5605. var i = a("./util/ajax")
  5606. , n = a("./util/showcase")
  5607. , t = a("./util/logger")
  5608. , r = new t(e)
  5609. , o = {};
  5610. s.exports = {
  5611. loadFeatureFlags: function(e) {
  5612. var t = $.Deferred();
  5613. return i.get(e.urlBase + "", {
  5614. responseType: "json",
  5615. prefetchFrom: "user",
  5616. auth: n.getAuthorizationHeader()
  5617. }).done(function(e) {
  5618. (o = function(e) {
  5619. var t = {};
  5620. if (e) {
  5621. var i = e.flags;
  5622. if (i)
  5623. for (var n in i)
  5624. i.hasOwnProperty(n) && (t[i[n]] = !0);
  5625. return t
  5626. }
  5627. return r.debug("Feature flags -> parseFeatureFlags: rawData is null."),
  5628. null
  5629. }(e)) ? t.resolve(o) : t.reject("loading-failed")
  5630. }).fail(function() {
  5631. r.debug("Retrieval of feature flags failed."),
  5632. t.reject("loading-failed")
  5633. }),
  5634. t.promise()
  5635. },
  5636. getFlags: function() {
  5637. return o
  5638. },
  5639. updateDependentSettings: function(e, t) {
  5640. (e = e || o).labels && (t.labels.enabled = !0),
  5641. e.zooming && !t.zoom.forceOff && (t.zoom.enabled = !0),
  5642. e.showcase_sdk && (t.sdkInit = !0),
  5643. e.mobile_highq_override && (t.tiling.mobileHighQualityOverride = !0),
  5644. e.showcase_webvr && (t.vr.allowWebVR = !0),
  5645. e.uhql && (t.tiling.allowUltraHighResolution = !0),
  5646. e.hide_sc_sharing && (t.share.enabled = !1)
  5647. }
  5648. }
  5649. }
  5650. ).call(this, "/js/featureflags.js")
  5651. }
  5652. , {
  5653. "./util/ajax": 181,
  5654. "./util/logger": 189,
  5655. "./util/showcase": 193
  5656. }],
  5657. 60: [function(e, t, i) {
  5658. "use strict";
  5659. var n = (e("../util/common"),
  5660. {
  5661. status: 0,
  5662. set: function(e) {
  5663. if (isNaN(e))
  5664. return !1;
  5665. var t = $(".progressbar");
  5666. e < 0 && (e = 0),
  5667. 100 < e && (e = 100);
  5668. var i = e * (parseInt(t.css("width").replace("px", "")) / 100)
  5669. , n = Math.round(e)
  5670. , r = parseInt(i) - 15;
  5671. t.find(".bar").css("width", i),
  5672. t.find(".label").css("left", r),
  5673. t.find(".perc").text(n + "%"),
  5674. this.status = e
  5675. },
  5676. done: function(e) {
  5677. return e || this.status ? (this.status = null,
  5678. this.set(100)) : this
  5679. }
  5680. });
  5681. t.exports.circleLoader = n
  5682. }
  5683. , {
  5684. "../util/common": 185
  5685. }],
  5686. 61: [function(e, t, i) {
  5687. "use strict";
  5688. t.exports = Object.freeze({
  5689. CLOSE: "modal.closer.close"
  5690. })
  5691. }
  5692. , {}],
  5693. 62: [function(e, t, i) {
  5694. "use strict";
  5695. function n(t, e) {
  5696. function i() {
  5697. var e = t.offsetHeight >= $("#player").height() && t.offsetWidth >= $("#player").width();
  5698. e !== p && ((p = e) ? (t.classList.add("closeByFooter"),
  5699. c.classList.add("closeByFooter")) : (t.classList.remove("closeByFooter"),
  5700. c.classList.remove("closeByFooter")))
  5701. }
  5702. e ? setTimeout(i, r.guiAnimationSpeed) : i()
  5703. }
  5704. var r = e("../../settings")
  5705. , o = (e("../../tag/Media/MediaEvent"),
  5706. e("../../util/browser"))
  5707. , a = e("../../util/common")
  5708. , s = e("./ModalCloserEvent")
  5709. , l = e("events").EventEmitter
  5710. , c = document.getElementsByClassName("footer")[0]
  5711. , h = c.querySelectorAll(".close")[0]
  5712. , u = null
  5713. , d = null
  5714. , p = null
  5715. , f = (o.isMobile(),
  5716. {
  5717. open: function(e) {
  5718. e && (n(e),
  5719. u && h.removeEventListener("click", u, !0),
  5720. u = function(e, t) {
  5721. t && (t.stopPropagation(),
  5722. t.preventDefault()),
  5723. e && this.emit(s.CLOSE, e),
  5724. f.reset()
  5725. }
  5726. .bind(this, e.id),
  5727. h.addEventListener("click", u, !0),
  5728. d && window.removeEventListener("resize", d, !0),
  5729. d = n.bind(this, e),
  5730. window.addEventListener("resize", d, !0))
  5731. },
  5732. reset: function() {
  5733. c.classList.remove("closeByFooter"),
  5734. h.removeEventListener("click", u, !0),
  5735. window.removeEventListener("resize", d, !0),
  5736. u = d = p = null
  5737. }
  5738. });
  5739. a.extendObject(f, l.prototype),
  5740. t.exports = f
  5741. }
  5742. , {
  5743. "../../tag/Media/MediaEvent": 131,
  5744. "../../settings": 166,
  5745. "../../util/browser": 182,
  5746. "../../util/common": 185,
  5747. "./ModalCloserEvent": 61,
  5748. events: 202
  5749. }],
  5750. 63: [function(e, t, i) {
  5751. "use strict";
  5752. var A = e("../lib/dat.gui")
  5753. , C = e("three")
  5754. , I = e("../util/easing")
  5755. , E = e("../enum/Viewmode")
  5756. , _ = e("../enum/Colors")
  5757. , b = e("../enum/WarpStyle")
  5758. , w = e("../settings");
  5759. e("../tag/tag"),
  5760. A.GUI.prototype.removeFolder = function(e) {
  5761. var t = this.__folders[e];
  5762. t && (t.close(),
  5763. this.__ul.removeChild(t.domElement.parentNode),
  5764. delete this.__folders[e],
  5765. this.onResize())
  5766. }
  5767. ,
  5768. t.exports.toggle = function(t, e, i) {
  5769. var n = new A.GUI({
  5770. width: 400
  5771. })
  5772. , r = n.addFolder("Flydown from Dollhouse");
  5773. r.add(w.flydown, "movementEasing", Object.keys(I)),
  5774. r.add(w.flydown, "movementDelay", 0, 1).step(.01),
  5775. r.add(w.flydown, "rotationEasing", Object.keys(I)),
  5776. r.add(w.flydown, "rotationDelay", 0, 1).step(.01),
  5777. r.add(w.flydown, "modelTextureDelay", 0, 1).step(.01),
  5778. r.add(w.flydown, "skyboxDelay", 0, 1).step(.01),
  5779. r.add(w.dollhouseDefault, "minPolarAngle", 0, C.Math.degToRad(50)),
  5780. r.add(w.dollhouseDefault, "maxPolarAngle", C.Math.degToRad(50), C.Math.degToRad(170));
  5781. var o = n.addFolder("Transition between panos");
  5782. o.add(w.transition, "blur", 0, 10).onFinishChange(function() {}),
  5783. o.add(w.transition, "flySpeed", 0, 10).step(.01).onFinishChange(function() {
  5784. w.transition.flyTime = 0,
  5785. o.__controllers.forEach(function(e) {
  5786. e.updateDisplay()
  5787. })
  5788. }),
  5789. o.add(w.transition, "flyTime", 0, 5e3).onFinishChange(function() {
  5790. w.transition.flySpeed = 0,
  5791. o.__controllers.forEach(function(e) {
  5792. e.updateDisplay()
  5793. })
  5794. }),
  5795. o.add(w.transition, "aimTime", 500, 2500).step(50),
  5796. o.add(w.transition, "aimSlowFactor", 1, 3).step(.1),
  5797. o.add(w.transition, "movementEasing", Object.keys(I));
  5798. var a = n.addFolder("Path Display");
  5799. a.add(w.path, "opacity", 0, 1).step(.01).onFinishChange(function() {}),
  5800. a.add(w.path, "height", 0, .2).step(.01).onFinishChange(function() {}),
  5801. a.add(w.path, "outsideHeight", 0, 2).step(.01).onFinishChange(function() {}),
  5802. a.add(w.path, "ribbonWidth", .01, .35).step(.01).onFinishChange(function() {}),
  5803. a.add(w.path, "waypointRadius", .01, 1.2).step(.01).onFinishChange(function() {}),
  5804. a.add(w.path, "waypointPulse", 0, 3600).step(20).onFinishChange(function() {}),
  5805. a.add(w.path, "waypointIndoorRadius", .01, 1.2).step(.01).onFinishChange(function() {}),
  5806. a.add(w.path, "fadeInTime", 0, 1200).step(10).onFinishChange(function() {}),
  5807. a.add(w.path, "fadeOutTime", 0, 1200).step(10).onFinishChange(function() {}),
  5808. a.add(w.path, "color", Object.keys(_)).onFinishChange(function() {
  5809. w.path.color = _[w.path.color],
  5810. w.path.colorUp = _._desat(w.path.color),
  5811. w.path.colorDown = _.darken(w.path.color)
  5812. }),
  5813. a.add(w, "reticuleColor", Object.keys(_)).onFinishChange(function() {
  5814. w.reticuleColor = _[w.reticuleColor]
  5815. });
  5816. var s = n.addFolder("Warping")
  5817. , l = s.addFolder("Warp/Teleport");
  5818. l.add(w.warp, "softPushDist", 0, 2).onFinishChange(function() {}),
  5819. l.add(w.warp, "softPushEnd", 0, 1).step(.01).onFinishChange(function() {}),
  5820. l.add(w.warp, "softBendAngle", 0, 45).onFinishChange(function() {}),
  5821. l.add(w.warp, "softBendTilt", 0, 45).onFinishChange(function() {}),
  5822. l.add(w.warp, "softBendEnd", 0, 1).step(.01).onFinishChange(function() {}),
  5823. l.add(w.warp, "burnsAngle", 0, 30).onFinishChange(function() {}),
  5824. l.add(w.warp, "minBurnsAngle", 0, 10).onFinishChange(function() {}),
  5825. l.add(w.warp, "brakeStrength", 1, 8).onFinishChange(function() {}),
  5826. l.add(w.warp, "minBrakeAngle", 0, 5).step(.01).onFinishChange(function() {}),
  5827. l.add(w.warp, "maxBrakeAngle", 0, 5).step(.01).onFinishChange(function() {}),
  5828. l.add(w.path, "mapGuides").onFinishChange(function() {}),
  5829. l.add(w.warp, "teleportTime", 0, 5e3).step(10).onFinishChange(function() {}),
  5830. l.add(w.warp, "outsideTime", 0, 5e3).step(10).onFinishChange(function() {}),
  5831. l.add(w.path, "typ", Object.keys(b)).onFinishChange(function() {
  5832. w.path.typ = b[w.path.typ]
  5833. }),
  5834. l.add(w.warp, "loop").onChange(function() {}).onFinishChange(function() {
  5835. e.endlessLoop = w.warp.loop
  5836. }),
  5837. l.add(w.warp, "walkSlideShowThreshhold", 1, 1e4).step(1).onFinishChange(function() {}),
  5838. l.add(w.warp, "walkExtraPanosDistance", 0, 3).step(.1).onFinishChange(function() {}),
  5839. l.add(w.transition, "fastForwardFactor", 1, 10).step(1).onFinishChange(function() {});
  5840. var c = s.addFolder("Long Warp Only");
  5841. c.add(w.warp, "minWarpTime", 0, 5e3).step(10).onFinishChange(function() {
  5842. w.warp.flySpeed = 0,
  5843. c.__controllers.forEach(function(e) {
  5844. e.updateDisplay()
  5845. })
  5846. }),
  5847. c.add(w.warp, "timePerMeter", 0, 5e3).step(10).onFinishChange(function() {}),
  5848. c.add(w.warp, "lookAheadMax", .01, 1).step(.01).onFinishChange(function() {}),
  5849. c.add(w.warp, "lookAheadDist", .01, 4).step(.01).onFinishChange(function() {}),
  5850. c.add(w.warp, "maxTurnPerSec", 0, 720).step(1).onFinishChange(function() {}),
  5851. c.add(w.warp, "maxAimPerSec", 0, 720).step(1).onFinishChange(function() {}),
  5852. c.add(w.warp, "turnFriction", 0, 1).step(.01).onFinishChange(function() {}),
  5853. c.add(w.warp, "walkDelay", 0, 2e3).step(10).onFinishChange(function() {}),
  5854. c.add(w.transition, "flytimeMaxDistanceThreshold", 0, 25).step(10).onFinishChange(function() {}),
  5855. c.add(w.warp, "walkMaxDist", 0, 100).step(1).onFinishChange(function() {});
  5856. var h = n.addFolder("Warp Esoterica");
  5857. h.add(w.warp, "nearPanoDist", .01, 12).step(0).onFinishChange(function() {}),
  5858. h.add(w.warp, "blur", .01, 1).onFinishChange(function() {}),
  5859. h.add(w.warp, "flySpeed", 0, 10).step(.01).onFinishChange(function() {
  5860. w.warp.minWarpTime = 0,
  5861. h.__controllers.forEach(function(e) {
  5862. e.updateDisplay()
  5863. })
  5864. }),
  5865. h.add(w.warp, "showBunny").onFinishChange(function() {}),
  5866. h.add(w.warp, "fastTime", 0, 2500).step(10).onFinishChange(function() {}),
  5867. h.add(w.warp, "movementEasing", Object.keys(I));
  5868. var u = n.addFolder("Misc");
  5869. u.add(w, "dollhouseFOV", 10, 180).onChange(function() {
  5870. i.cameras[E.DOLLHOUSE].fov = w.dollhouseFOV
  5871. }),
  5872. u.add(w, "insideFOV", 10, 180).onChange(function() {
  5873. i.cameras[E.PANORAMA].fov = w.insideFOV
  5874. }),
  5875. u.add(w, "insideLookSpeed", .01, .3).step(.01).onChange(function() {}),
  5876. u.add(w, "rotationAccelerationInside", .1, 10).step(.1).onChange(function() {}),
  5877. u.add(w, "rotationAccelerationOutside", .1, 10).step(.1).onChange(function() {});
  5878. var d = n.addFolder("Navigation");
  5879. d.add(w.navigation, "panoScores").onFinishChange(function() {
  5880. w.navigation.panoScores || t.panos.forEach(function(e) {
  5881. e.floor.remove(e.text3d),
  5882. e.text3d = null
  5883. })
  5884. }),
  5885. d.add(w.navigation, "mouseDirection"),
  5886. d.add(w.navigation, "filterStrictness", 0, 1),
  5887. d.add(w.navigation, "angleFactor", -60, 0),
  5888. d.add(w.navigation, "directionFactor", 1, 20),
  5889. d.add(w.navigation, "distanceFactor", -5, 5),
  5890. d.add(w.navigation, "optionalityFactor", .1, 10);
  5891. var p = n.addFolder("tags")
  5892. , f = p.addFolder("Tag Creation");
  5893. f.add(w.tags.pole, "enabled").name("poleEnabled"),
  5894. f.add(w.tags.pole, "height", 0, 2.5).step(.01).name("poleHeight"),
  5895. f.add(w.tags.pole, "width", 1, 10).step(1).name("poleWidth"),
  5896. f.add(w.tags.pole, "opacity", .1, 1).step(.1).name("poleOpacity");
  5897. var g = p.addFolder("Visibility");
  5898. g.add(w.tags.visibility, "anyDistance"),
  5899. g.add(w.tags.visibility, "visibleDistance", .1, 30).step(.1),
  5900. g.add(w.tags.visibility, "cameraClearance", 0, 1).step(.01),
  5901. g.add(w.tags.visibility, "hideViaFloor"),
  5902. g.add(w.tags.visibility, "hideOffScreenDisc").name("hideEdgeDisc"),
  5903. g.add(w.tags.visibility, "hideOffScreenObject").name("hideEdgeObject");
  5904. var m = p.addFolder("Disc Parameters");
  5905. m.add(w.tags.disc.scale, "nearBound", .1, 10).step(.1),
  5906. m.add(w.tags.disc.scale, "farBound", .1, 20).step(.1).listen(),
  5907. m.add(w.tags.disc.scale, "linkFarBound").onChange(function(e) {
  5908. e && (w.tags.disc.scale.farBound = w.tags.visibility.visibleDistance * (1 - w.tags.disc.scale.linkPercent / 100))
  5909. }),
  5910. m.add(w.tags.disc.scale, "linkPercent", 0, 100).step(1).onChange(function(e) {
  5911. w.tags.disc.scale.linkFarBound && (w.tags.disc.scale.farBound = w.tags.visibility.visibleDistance * (1 - e / 100))
  5912. }),
  5913. m.add(w.tags.disc.scale, "maxSize", 40, 200).step(1),
  5914. m.add(w.tags.disc.scale, "minSize", 20, 100).step(1),
  5915. m.add(w.tags.disc.scale, "responsiveness", 0, 100).step(1);
  5916. var v = p.addFolder("Navigate");
  5917. v.add(w.tags.navigate, "nearestPano").name("nearestPano"),
  5918. v.add(w.tags.navigate, "lineOfSight").name("lineOfSight"),
  5919. v.add(w.tags.navigate, "reactivate").name("reactivate"),
  5920. v.add(w.tags.navigate, "aimAt", ["disc", "object", "pole", "nothing"]).name("aim at"),
  5921. v.add(w.tags.navigate, "tiltTolerance", 0, 50).step(1),
  5922. v.add(w.tags.navigate, "rotateSpeedFactor", 0, 5).step(.1);
  5923. var y = n.addFolder("Debug");
  5924. y.add(w, "wireframe").onFinishChange(function() {
  5925. t.chunks.forEach(function(e) {
  5926. e.material && (e.wireframeTwin || (e.wireframeTwin = new C.WireframeHelper(e),
  5927. e.wireframeTwin.material.depthWrite = !1,
  5928. e.wireframeTwin.material.depthTest = !1,
  5929. e.wireframeTwin.material.opacity = .5,
  5930. e.wireframeTwin.material.transparent = !0),
  5931. w.wireframe ? t.add(e.wireframeTwin) : t.remove(e.wireframeTwin))
  5932. })
  5933. }),
  5934. y.add(w, "skyboxWireframe").onFinishChange(function() {
  5935. w.skyboxWireframe ? (t.skybox.wireframe = new C.WireframeHelper(t.skybox),
  5936. t.add(t.skybox.wireframe)) : (t.remove(t.skybox.wireframe),
  5937. t.skybox.wireframe = null)
  5938. }),
  5939. y.add(w, "showSweeps").onFinishChange(function() {
  5940. t.setSweepVisibility(w.showSweeps)
  5941. }),
  5942. y.add(w, "showMesh").onFinishChange(function() {
  5943. t.chunks.forEach(function(e) {
  5944. e.visible = w.showMesh
  5945. })
  5946. }),
  5947. y.add(w, "showFloors").onFinishChange(function() {
  5948. t.floors.forEach(function(e) {
  5949. e.collider.children.forEach(function(e) {
  5950. e.material.visible = w.showFloors
  5951. })
  5952. })
  5953. }),
  5954. y.add(w, "showSkyboxes").onFinishChange(function() {
  5955. t.panos.forEach(function(e) {
  5956. e.skyboxMesh.visible = w.showSkyboxes
  5957. })
  5958. }),
  5959. y.add(w, "showNeighbors").onChange(function() {}),
  5960. y.add(t, "alpha", 0, 1)
  5961. }
  5962. }
  5963. , {
  5964. "../enum/Colors": 19,
  5965. "../enum/Viewmode": 51,
  5966. "../enum/WarpStyle": 52,
  5967. "../lib/dat.gui": 93,
  5968. "../tag/tag": 123,
  5969. "../settings": 166,
  5970. "../util/easing": 186,
  5971. three: 217
  5972. }],
  5973. 64: [function(c, h, e) {
  5974. (function(e) {
  5975. "use strict";
  5976. function i(e, t, i, n) {
  5977. $(".gui-error .error-problem-text").text(e),
  5978. $(".gui-error .error-solution-text").text(t),
  5979. $(".gui-error .error-explanation").text(i),
  5980. $(".gui-error .error-actions").html(n),
  5981. $(window).resize(),
  5982. $(".gui-error").fadeIn(),
  5983. $("#bottom-logo").fadeIn()
  5984. }
  5985. function n(e) {
  5986. 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("");
  5987. i(e, s.ERROR_BROWSER_SOLUTION, s.ERROR_BROWSER_EXPLANATION, t),
  5988. r.isMobile() || $("[rel=tiletip]").tooltip({
  5989. placement: "bottom",
  5990. delay: {
  5991. show: 50,
  5992. hide: 0
  5993. },
  5994. trigger: "hover",
  5995. viewport: {
  5996. selector: "body",
  5997. padding: 10
  5998. }
  5999. })
  6000. }
  6001. function t() {
  6002. var e = r.isMobile() ? "" : '<span class="link install-browser">' + s.ERROR_GENERIC_ACTIONS_2 + "</span>" + s.ERROR_GENERIC_ACTIONS_3
  6003. , t = [s.ERROR_GENERIC_ACTIONS_1, e].join("");
  6004. i(s.ERROR_GENERIC_PROBLEM, s.ERROR_GENERIC_SOLUTION, "", t),
  6005. r.isMobile() || $(".install-browser").on("click touchstart", function(e) {
  6006. e.preventDefault(),
  6007. e.stopPropagation(),
  6008. n(" ")
  6009. })
  6010. }
  6011. var r = c("./../util/browser")
  6012. , o = c("./../analytics")
  6013. , a = c("./../settings")
  6014. , s = c("../localization/localize")
  6015. , l = new (c("./../util/logger"))(e);
  6016. h.exports.error = function(e) {
  6017. if ($("head title").text(a.pageTitle),
  6018. $("#gui-message, #gui-loading, #nprogress, #gui-thumb, #bottom-logo").hide(),
  6019. $("#gui-loading").fadeOut(250),
  6020. $("#quick-blackout").hide(),
  6021. o.track("showcase_error", {
  6022. error_key: e
  6023. }),
  6024. s.locale || s.init(),
  6025. "webgl-unsupported" === e)
  6026. r.isMobile() ? t() : n(s.ERROR_WEBGL_UNSUPPORTED_PROBLEM);
  6027. else if ("webgl-ios" === e)
  6028. 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>.");
  6029. else if ("webgl-safari" === e)
  6030. 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>.");
  6031. else if ("webgl-generic" === e)
  6032. t();
  6033. else if ("missing-urls" === e)
  6034. i(s.ERROR_MISSING_URLS_PROBLEM, "", s.ERROR_MISSING_URLS_EXPLANATION);
  6035. else if ("loading-failed" === e)
  6036. 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>.");
  6037. else {
  6038. if ("loading-failed-maintenance" !== e)
  6039. return void l.error("Unhandled error: " + e);
  6040. i(s.ERROR_MAINTENANCE_PROBLEM, s.ERROR_MAINTENANCE_SOLUTION)
  6041. }
  6042. }
  6043. }
  6044. ).call(this, "/js/gui/error.js")
  6045. }
  6046. , {
  6047. "../localization/localize": 108,
  6048. "./../analytics": 4,
  6049. "./../settings": 166,
  6050. "./../util/browser": 182,
  6051. "./../util/logger": 189
  6052. }],
  6053. 65: [function(Oe, Le, e) {
  6054. (function(e) {
  6055. "use strict";
  6056. function c() {
  6057. for (var e in Ce)
  6058. if (Ce.hasOwnProperty(e)) {
  6059. var t = Ce[e];
  6060. if (!t.visible)
  6061. for (var i = 0; i < t.elements.length; i++)
  6062. $(t.elements[i]).hide()
  6063. }
  6064. Ce.highlight.visible && $(".pinBottom").addClass("highlightExists"),
  6065. !1 === Ce.tourControls.visible && $("#drawer").addClass("fullWidth"),
  6066. ge = [],
  6067. Ce.floors.visible && ge.push(".gui-floor", ".gui-floor-title"),
  6068. ge.push(".hideTarget", ".pinTop.right")
  6069. }
  6070. function v(e, t) {
  6071. var i = !S.isMobile() && M.zoom.enabled && t.mode === ie.PANORAMA && !e.tourIsPlaying;
  6072. $("#gui-zoomin").toggle(i),
  6073. $("#gui-zoomout").toggle(i)
  6074. }
  6075. function l() {
  6076. n(),
  6077. $(".pinBottom").toggleClass("open"),
  6078. $("#drawer").toggleClass("open"),
  6079. $(".footer").toggleClass("open"),
  6080. $("#drawer").hasClass("open") ? ($("#pullTab .icon").attr("data-original-title", se.CLOSE_HIGHLIGHTS),
  6081. _e("highlights")) : ($("#pullTab .icon").attr("data-original-title", se.OPEN_HIGHLIGHTS),
  6082. O.resetDrawer()),
  6083. setTimeout(function() {
  6084. $("#pullTab").toggleClass("opened")
  6085. }, $("#drawer").hasClass("open") ? 0 : M.highlightAnimationDuration),
  6086. $(".pinBottom").hasClass("open") && t($(".vr-popup")) && $(".vr-popup").is(":visible") && X.dismiss()
  6087. }
  6088. function t(e) {
  6089. var t;
  6090. return "none" !== e.css("display") ? t = e.position().top + e.outerHeight() : (e.attr("style", "visibility: hidden"),
  6091. t = e.position().top + e.outerHeight(),
  6092. e.attr("style", "display: none")),
  6093. $("#player").outerHeight() - 130 < t + 25
  6094. }
  6095. function y(e) {
  6096. "touchstart" === e.type && e.preventDefault(),
  6097. e.stopPropagation()
  6098. }
  6099. function n() {
  6100. w && (w.reload(),
  6101. w.init())
  6102. }
  6103. function r() {
  6104. $("#gui-spinner").stop(!0, !0),
  6105. $("#gui-spinner").fadeOut(1e3),
  6106. !(Ae = !0)
  6107. }
  6108. function A(e, t) {
  6109. var i = e.mode
  6110. , n = t || e.currentPano;
  6111. $("#gui-modes-dollhouse").toggleClass("active", i === ie.DOLLHOUSE),
  6112. $("#gui-modes-floorplan").toggleClass("active", i === ie.FLOORPLAN),
  6113. $("#gui-modes-inside").toggleClass("active", i === ie.PANORAMA),
  6114. i === ie.PANORAMA ? ($("#view-controllers").slideUp(500),
  6115. M.show360Views.enabled && !n.isAligned() ? ($(".gui-floor").addClass("hidden"),
  6116. $("#gui-modes-outside").addClass("desktop-only")) : ($(".gui-floor").removeClass("hidden"),
  6117. $("#gui-modes-outside").removeClass("desktop-only")),
  6118. $("#gui-modes-outside").removeClass("hidden")) : i !== ie.TRANSITIONING && (r(),
  6119. pe = i,
  6120. $("#gui-modes-outside").addClass("hidden"),
  6121. e.model.has360Views && $(".gui-floor").removeClass("hidden"),
  6122. $("#view-controllers").is(":visible") || $("#view-controllers").slideDown(M.guiAnimationSpeed))
  6123. }
  6124. function C(t, i) {
  6125. function e() {
  6126. document.getElementById("vr").classList.remove("hidden"),
  6127. M.vr.allowWebVR ? S.getVRDisplay().then(function(e) {
  6128. S.supportsFullscreen() ? function(e) {
  6129. ue.info(e.displayName + " detected, VR button activates WebVR experience"),
  6130. Q.init(t.data, i, e, x),
  6131. Q.on(J.OPENED, _e.bind(gui, "vr")),
  6132. Q.on(J.SHOW_TERMS, W.show.bind(W))
  6133. }(e) : (ue.warn("Unable to use WebVR when full screen is not supported"),
  6134. $(".improper-embed").toggleClass("hidden", !1),
  6135. n())
  6136. }, function(e) {
  6137. n()
  6138. }) : n()
  6139. }
  6140. function n() {
  6141. var e;
  6142. ue.info("WebVR support not found, VR button activates native app VR modal"),
  6143. X.init(t.data, x),
  6144. X.on(Z.OPENED, (e = document.getElementById("vr-modal"),
  6145. function() {
  6146. _e("vr"),
  6147. V.open(e)
  6148. }
  6149. )),
  6150. X.on(Z.CLOSED, V.reset)
  6151. }
  6152. if (M.vr.enabled && t.supportsVR && !S.valueFromHash("mls", 0))
  6153. switch (M.vr.option) {
  6154. case le.CONTEXTUAL:
  6155. e();
  6156. break;
  6157. case le.ANDROID:
  6158. S.detectAndroid() && e();
  6159. break;
  6160. case le.NONE:
  6161. }
  6162. }
  6163. function h(e, i) {
  6164. for (var n = $(".gui-floor"), t = 0; t < e.floors.length; t++)
  6165. if ("372" !== getQueryVariable("m")) {
  6166. var r = $('<div class="floorChoice" data-index="' + t + '"></div>').text(e.floors.get(t).name);
  6167. $(".gui-floor").find(".container").prepend(r)
  6168. }
  6169. n.find(".container").prepend('<div class="floorChoice darkGlass allFloorBtn" data-index="all" style="display:none">' + se.FLOOR_ALL + "</div>"),
  6170. n.on("click", function(e) {
  6171. y(e),
  6172. _e("floor"),
  6173. n.toggleClass("open")
  6174. }),
  6175. $(".floorChoice").on("click", function(e) {
  6176. y(e);
  6177. var t = $(this).data("index");
  6178. "all" !== t ? (R.updateInteraction(oe.InteractionGui, "floor-control"),
  6179. i.player.gotoFloor(t),
  6180. R.track("showcase_gui", {
  6181. gui_action: "click_floor_select_button",
  6182. interaction_source: "gui"
  6183. })) : (R.updateInteraction(oe.InteractionGui, "floor-control"),
  6184. _e("move"),
  6185. i.allFloors(),
  6186. R.track("showcase_gui", {
  6187. gui_action: "click_toggle_all_floors_button",
  6188. interaction_source: "gui"
  6189. })),
  6190. n.removeClass("open")
  6191. })
  6192. }
  6193. function I(e, t) {
  6194. e && (t === ie.DOLLHOUSE || t === ie.FLOORPLAN ? ($(".allFloorBtn").show(),
  6195. $(".gui-floor-icon").hide(),
  6196. $(".gui-floor-title").show()) : ($(".allFloorBtn").hide(),
  6197. $(".gui-floor-icon").show(),
  6198. $(".gui-floor-title").hide()),
  6199. e.model.allFloorsVisible ? ($(".gui-floor-title").text(se.FLOOR_ALL),
  6200. $(".gui-floor-number").text(se.FLOOR_ALL),
  6201. $(".floorChoice").removeClass("active"),
  6202. $('.floorChoice[data-index="all"]').addClass("active")) : ($(".gui-floor-title").text(e.name),
  6203. $(".gui-floor-number").text(" " + (e.floorIndex + 1)),
  6204. $(".floorChoice").removeClass("active"),
  6205. $(".floorChoice[data-index=" + e.floorIndex + "]").addClass("active")))
  6206. }
  6207. function E() {
  6208. var e = $("#player").width() - 20
  6209. , t = $("#scroller")
  6210. , i = $("#drawer")
  6211. , n = $(".pinBottom");
  6212. $("#player").width() < 488 || $("#player").height() < 488 ? (t.addClass("hidden"),
  6213. i.addClass("noScroll"),
  6214. n.addClass("noScroll")) : e < T != !i.hasClass("noScroll") && (t.toggleClass("hidden"),
  6215. i.toggleClass("noScroll"),
  6216. n.toggleClass("noScroll"))
  6217. }
  6218. function _(e) {
  6219. e.waitQueue.length <= 0 ? r() : ye || function(e) {
  6220. e = e || 0,
  6221. Ae = !1,
  6222. window.setTimeout(function() {
  6223. Ae || (!0,
  6224. $("#gui-spinner").stop(!0, !0).show())
  6225. }
  6226. .bind(this), e)
  6227. }(M.modelComponentLoadSpinnerDelay)
  6228. }
  6229. function b(e, t) {
  6230. for (var i = []; e; )
  6231. i.push(e),
  6232. e = e.parentNode;
  6233. for (; t && -1 === i.indexOf(t); )
  6234. t = t.parentNode;
  6235. return t
  6236. }
  6237. var w, T, o, a, x, i, s, u, d, p, f, g, S = (Oe("three"),
  6238. Oe("../util/ajax"),
  6239. Oe("../util/browser")), M = Oe("../settings"), R = Oe("../analytics"), m = (Oe("../util/transitions"),
  6240. Oe("../util/camera"),
  6241. Oe("../util/logger")), P = (Oe("../objects/Snapshot"),
  6242. 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"),
  6243. Oe("../tag/Media/MediaEvent")), re = (Oe("../enum/PathDiscardMode"),
  6244. Oe("../enum/PathDisplayMode"),
  6245. Oe("../enum/DirectorEvents"),
  6246. Oe("../enum/PlayerEvents")), oe = Oe("../enum/ControlEvents"), ae = Oe("./sharing/ShareEvents"), se = Oe("../localization/localize"), le = (Oe("../enum/Vectors"),
  6247. Oe("../enum/WarpStyle"),
  6248. Oe("../enum/AlignmentType"),
  6249. Oe("../enum/VROption")), ce = Oe("./konami"), he = Oe("../lib/dat.gui"), ue = new m(e), de = (Oe("../util/showcase"),
  6250. Oe("../enum/ZoomEvents")), pe = ie.DOLLHOUSE, fe = 0, ge = [".hideTarget"], me = null, ve = null, ye = !1, Ae = !1, Ce = {
  6251. coBrand: {
  6252. visible: !0,
  6253. elements: [".co-brand", "#loaderCoBrand"]
  6254. },
  6255. help: {
  6256. visible: !0,
  6257. elements: [".nav-help", "#nav-help"]
  6258. },
  6259. tourControls: {
  6260. visible: !0,
  6261. elements: [".next", ".previous", "#play"]
  6262. },
  6263. highlight: {
  6264. visible: !0,
  6265. elements: ["#drawer", "#pullTab"]
  6266. },
  6267. share: {
  6268. visible: !0,
  6269. elements: [".socialButton", "#share"]
  6270. },
  6271. fullScreen: {
  6272. visible: !0,
  6273. elements: ["#gui-fullscreen"]
  6274. },
  6275. floors: {
  6276. visible: !0,
  6277. elements: [".gui-floor"]
  6278. }
  6279. }, Ie = (g = document.getElementById("drawer"),
  6280. function() {
  6281. $("#player").height() < 400 && g.classList.contains("open") && l()
  6282. }
  6283. ), Ee = (f = document.getElementById("meta-info"),
  6284. function() {
  6285. $("#player").height() < 400 && f.classList.contains("expand") && z.toggleMeta(!0)
  6286. }
  6287. ), _e = (i = document.getElementById("meta-info"),
  6288. s = document.getElementById("interaction-modal"),
  6289. u = $("#drawer").eq(0),
  6290. d = $(".gui-floor").eq(0),
  6291. p = $(".vr-popup").eq(0),
  6292. function(e) {
  6293. switch (e) {
  6294. case "info":
  6295. we(),
  6296. Te(),
  6297. Ie(),
  6298. Me(),
  6299. Re(),
  6300. xe(),
  6301. Pe();
  6302. break;
  6303. case "terms":
  6304. be(),
  6305. Te(),
  6306. Se(),
  6307. Me(),
  6308. Re(),
  6309. xe(),
  6310. Pe();
  6311. break;
  6312. case "help":
  6313. be(),
  6314. we(),
  6315. Me(),
  6316. Re(),
  6317. xe(),
  6318. Pe();
  6319. break;
  6320. case "vr":
  6321. be(),
  6322. we(),
  6323. Me(),
  6324. Re(),
  6325. Te(),
  6326. Pe(),
  6327. t(p) && Se();
  6328. break;
  6329. case "highlights":
  6330. Ee(),
  6331. we(),
  6332. Me(),
  6333. Re();
  6334. break;
  6335. case "share":
  6336. be(),
  6337. we(),
  6338. Te(),
  6339. Re(),
  6340. xe(),
  6341. Pe();
  6342. break;
  6343. case "floor":
  6344. we(),
  6345. Me(),
  6346. xe();
  6347. break;
  6348. case "view":
  6349. Re(),
  6350. Me(),
  6351. we(),
  6352. xe();
  6353. break;
  6354. case "tour":
  6355. case "move":
  6356. we(),
  6357. Me(),
  6358. Re(),
  6359. xe();
  6360. break;
  6361. case "resize":
  6362. be(),
  6363. Ie(),
  6364. Re();
  6365. break;
  6366. case "tag":
  6367. we(),
  6368. Te(),
  6369. Me(),
  6370. Re(),
  6371. xe()
  6372. }
  6373. }
  6374. );
  6375. function be() {
  6376. i.classList.contains("expand") && z.toggleMeta(!0)
  6377. }
  6378. function we() {
  6379. W.hide()
  6380. }
  6381. function Te() {
  6382. U.close()
  6383. }
  6384. function xe() {
  6385. X.dismiss()
  6386. }
  6387. function Se() {
  6388. u.hasClass("open") && l()
  6389. }
  6390. function Me() {
  6391. K.hide()
  6392. }
  6393. function Re() {
  6394. d.hasClass("open") && d.removeClass("open")
  6395. }
  6396. function Pe() {
  6397. s.classList.contains("fadeIn") && (s.classList.contains("landing") ? D.dismissModal() : s.classList.contains("tour") && q.dismissModal())
  6398. }
  6399. $(document).on("fullscreenchange webkitfullscreenchange mozfullscreenchange MSFullscreenChange", function(e) {
  6400. $("#gui-fullscreen").toggle(!S.isFullscreen()),
  6401. $("#gui-fullscreen-exit").toggle(!!S.isFullscreen()),
  6402. setTimeout(function() {
  6403. $(".icon:visible").hide().show(0)
  6404. }, 100)
  6405. }),
  6406. $("#gui-fullscreen").find("a").on("click", function(e) {
  6407. y(e),
  6408. S.requestFullscreen($("body")[0]),
  6409. R.track("showcase_gui", {
  6410. gui_action: "click_enter_fullscreen",
  6411. interaction_source: "gui"
  6412. })
  6413. }),
  6414. $("#gui-fullscreen-exit").find("a").on("click", function(e) {
  6415. y(e),
  6416. S.exitFullscreen(),
  6417. R.track("showcase_gui", {
  6418. gui_action: "click_exit_fullscreen",
  6419. interaction_source: "gui"
  6420. })
  6421. }),
  6422. $(window).on("resize", function(e) {
  6423. var t = e.target.innerHeight
  6424. , i = e.target.innerWidth;
  6425. t === o && i === a || (Ce.highlight.visible && E(),
  6426. _e("resize"),
  6427. $(".pinTop.right").removeClass("hideUnderMeta"),
  6428. n(),
  6429. o = t,
  6430. a = i)
  6431. }).resize(),
  6432. S.supportsFullscreen() || $("#gui-fullscreen").hide(),
  6433. $("#pullTab").on("click", function(e) {
  6434. y(e),
  6435. $("#drawer").hasClass("open") ? (R.trackAlways("showcase_gui", {
  6436. gui_action: "hide_highlight_reel"
  6437. }),
  6438. $(this).addClass("open").children("img").attr("src", "images/auto.png")) : (R.trackAlways("showcase_gui", {
  6439. gui_action: "show_highlight_reel"
  6440. }),
  6441. $(this).removeClass("open").children("img").attr("src", "images/auto-suspend.png")),
  6442. l()
  6443. }),
  6444. window.DATA.showHotListSta && ($("#hotList").css("display", ""),
  6445. $("#hotList").on("click", function(e) {
  6446. y(e);
  6447. var t = $("#hotListWrap")[0];
  6448. t.classList.contains("hotListActive") ? (t.classList.remove("hotListActive"),
  6449. this.classList.remove("active")) : (t.classList.add("hotListActive"),
  6450. this.classList.add("active"))
  6451. }),
  6452. $("#hotListContent ul").on("mouseover", function(e) {
  6453. y(e);
  6454. var t = e.target
  6455. , i = document.getElementById("hotListWrap");
  6456. if ("SPAN" === t.tagName) {
  6457. var n = t.parentElement.parentElement;
  6458. t.offsetWidth + 116 >= n.clientWidth ? i.style.width = t.offsetWidth + 116 + "px" : i.style.width = ""
  6459. } else if ("LI" === t.tagName) {
  6460. n = t.parentElement;
  6461. t.children[0].offsetWidth + 116 >= n.clientWidth ? i.style.width = t.children[0].offsetWidth + 116 + "px" : i.style.width = ""
  6462. } else
  6463. i.style.width = ""
  6464. }),
  6465. $("#hotListContent ul").on("click", function(e) {
  6466. y(e),
  6467. this.preElem && this.preElem.classList.remove("active"),
  6468. "SPAN" === e.target.tagName ? (e.target.parentElement.classList.add("active"),
  6469. e.target.parentElement.hot && e.target.parentElement.hot.examine(!0),
  6470. this.preElem = e.target.parentElement) : (e.target.classList.add("active"),
  6471. e.target.hot && e.target.hot.examine(!0),
  6472. this.preElem = e.target)
  6473. }),
  6474. $("#hotListClose").on("click", function(e) {
  6475. y(e),
  6476. $("#hotListWrap")[0].classList.remove("hotListActive"),
  6477. $("#hotListContent ul .active").removeClass("active"),
  6478. $("#hotList")[0].classList.remove("active")
  6479. })),
  6480. "true" === window.DATA.supportsVR && $("#vr").css("display", ""),
  6481. $("#more-menu-button").on("click", function(e) {
  6482. y(e),
  6483. $("#more-menu").toggleClass("open")
  6484. }),
  6485. Le.exports.init = function(s, l, c, e, t, i, n) {
  6486. var r;
  6487. x = n,
  6488. s.outsideAllowed() || $("#gui-modes-outside").addClass("invisible"),
  6489. s.supportedModes[ie.PANORAMA] || $("#gui-modes-inside").addClass("invisible"),
  6490. F.init(),
  6491. D.init(s, i),
  6492. ce.init(s, l, e),
  6493. $(".icon").on("mouseover", function() {
  6494. l.player && l.player.reticule.hide()
  6495. }),
  6496. function(e, t) {
  6497. var i = t.player;
  6498. $("#gui-modes-inside").on("mousedown touchstart", function(e) {
  6499. y(e),
  6500. R.updateInteraction(oe.InteractionGui, "inside-button"),
  6501. R.track("USER", {
  6502. event_type: "showcase_gui",
  6503. gui_action: "click_inside_mode_button"
  6504. }),
  6505. t.changeMode(ie.PANORAMA)
  6506. }),
  6507. $("#gui-modes-outside").find("a").on("click", function(e) {
  6508. y(e),
  6509. R.track("showcase_gui", {
  6510. gui_action: "click_outside_mode_button"
  6511. }),
  6512. t.changeMode(pe)
  6513. }),
  6514. $("#gui-modes-floorplan").on("click", function(e) {
  6515. y(e),
  6516. i.mode !== ie.FLOORPLAN && (R.track("showcase_gui", {
  6517. gui_action: "click_floorplan_mode_button"
  6518. }),
  6519. t.changeMode(ie.FLOORPLAN))
  6520. }),
  6521. $("#gui-modes-dollhouse").on("click", function(e) {
  6522. y(e),
  6523. i.mode !== ie.DOLLHOUSE && (R.track("showcase_gui", {
  6524. gui_action: "click_dollhouse_mode_button"
  6525. }),
  6526. t.changeMode(ie.DOLLHOUSE))
  6527. })
  6528. }(0, l),
  6529. function(e, t) {
  6530. $("#play").on("mousedown touchstart", function(e) {
  6531. y(e),
  6532. _e("tour"),
  6533. q.play(),
  6534. R.trackAlways("showcase_gui", {
  6535. gui_action: "play_highlights"
  6536. })
  6537. }),
  6538. window.startAndPlay = function(e) {
  6539. _e("tour"),
  6540. q.play(),
  6541. R.trackAlways("showcase_gui", {
  6542. gui_action: "play_highlights"
  6543. })
  6544. }
  6545. ,
  6546. $("#pause").on("mousedown touchstart", function(e) {
  6547. y(e),
  6548. q.pause(),
  6549. R.trackAlways("showcase_gui", {
  6550. gui_action: "pause_highlights"
  6551. })
  6552. }),
  6553. $("#gui-zoomin").find("a").on("click", function(e) {
  6554. y(e),
  6555. t.player.zoomInIncrementally()
  6556. }),
  6557. $("#gui-zoomout").find("a").on("click", function(e) {
  6558. y(e),
  6559. t.player.zoomOutIncrementally()
  6560. })
  6561. }(0, l),
  6562. s.data.enable_social_sharing && s.data.is_public && M.share.enabled && (K.init(DATA.name/* s.data.name */),
  6563. K.on(ae.OPENED, (r = document.getElementById("share-modal"),
  6564. function() {
  6565. _e("share"),
  6566. V.open(r)
  6567. }
  6568. )),
  6569. K.on(ae.CLOSED, V.reset)),
  6570. 0 < s.heroLocations.length ? function(e, i, t) {
  6571. var n = 100 / (fe = e.heroLocations.length) + "%"
  6572. , r = $("#thumb-container")
  6573. , o = $("#progressBar");
  6574. $("#status").find(".totalSteps").text(fe);
  6575. for (var a = 0; a < fe; a++) {
  6576. var s = e.heroLocations[a]
  6577. , l = $('<li class="thumbImg" data-index=""><img src=""></li>');
  6578. if(s.heroLocations){//有子项,选第一张截图
  6579. var tmp = s.heroLocations[0].thumbUrl.replace('https://','').replace('http://','')
  6580. }else{
  6581. var tmp = s.thumbUrl.replace('https://','').replace('http://','')
  6582. }
  6583. if (l.attr("data-index", a),
  6584. //Ce.highlight.visible && l.find("img").attr("src",'https://'+tmp),
  6585. Ce.highlight.visible && l.find("img").attr("src", 'http://'+tmp),// xzw改 导览图片 https在某些服务器打不开
  6586. s.name) {
  6587. var c = $('<div class="overlay"></div>').text(s.name);
  6588. l.prepend(c)
  6589. }
  6590. if (e.has360Views && s.cameraMode === ie.PANORAMA) {
  6591. var h = e.panos.get(s.panoId)
  6592. , 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>';
  6593. l.prepend(u)
  6594. }
  6595. r.append(l),
  6596. o.append('<div class="step" data-idx="' + a + '" style="width:' + n + '"></div>')
  6597. }
  6598. T = 144 * fe,
  6599. 111 * fe,
  6600. $(".thumbImg").on("mouseover", function() {
  6601. !function(e) {
  6602. return e.describe().inTransition
  6603. }(i) && t.showPathToHeroLocation([$(this).data("index"),0])//改
  6604. }),
  6605. $(".thumbImg").on("mouseout", function() {
  6606. i.clearPath()
  6607. }),
  6608. $(".thumbImg").on("click", function(e) {
  6609. y(e);
  6610. var t = $(this);
  6611. R.updateInteraction(oe.InteractionGui, "thumbnail"),
  6612. R.trackAlways("showcase_gui", {
  6613. gui_action: "click_highlight"
  6614. }),
  6615. i.goToHighlight([t.data("index"),0])//改
  6616. }),
  6617. $(".previous").find("a").on("click", function(e) {
  6618. y(e),
  6619. R.trackAlways("showcase_gui", {
  6620. gui_action: "prev_highlight"
  6621. }),
  6622. i.prevHighlight()
  6623. }),
  6624. $(".next").find("a").on("click", function(e) {
  6625. y(e),
  6626. R.trackAlways("showcase_gui", {
  6627. gui_action: "next_highlight"
  6628. }),
  6629. i.nextHighlight()
  6630. }),
  6631. $("#drawer").on("mouseleave", function(t) {
  6632. var i;
  6633. y(t);
  6634. try {
  6635. i = new MouseEvent("mouseup",{
  6636. clientX: t.clientX,
  6637. clientY: t.clientY,
  6638. screenX: t.screenX,
  6639. screenY: t.screenY
  6640. })
  6641. } catch (e) {
  6642. (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)
  6643. }
  6644. document.dispatchEvent(i)
  6645. }),
  6646. (w = new Sly($("#scrollFrame"),{
  6647. horizontal: !0,
  6648. itemNav: "centered",
  6649. smart: !0,
  6650. scrollTrap: !0,
  6651. scrollBy: 1,
  6652. mouseDragging: !0,
  6653. touchDragging: !0,
  6654. speed: 300,
  6655. dragHandle: !0,
  6656. dynamicHandle: !0,
  6657. clickBar: !0,
  6658. scrollBar: $("#scroller"),
  6659. activateOn: null
  6660. }).init()).on("active", function(e, t) {
  6661. t,
  6662. _e("tour"),
  6663. $(".step").removeClass("active"),
  6664. $("#status").find(".curIdx").text(t + 1);
  6665. for (var i = 0; i <= t; i++)
  6666. $("#progressBar").find("[data-idx='" + i + "']").addClass("active")
  6667. }),
  6668. E()
  6669. //add :
  6670. let scrollFrame = $(w.frame)
  6671. scrollFrame.on("wheel.sly", function() {
  6672. lastMoveScrollTime = Date.now()
  6673. })
  6674. let dragstart
  6675. /* scrollFrame.on("pointerdown", function() {
  6676. dragstart = true
  6677. })
  6678. scrollFrame.on("pointerup", function() {
  6679. dragstart = false
  6680. }) */
  6681. scrollFrame.on("pointermove", function() {
  6682. //if(dragstart){
  6683. lastMoveScrollTime = Date.now()
  6684. //}
  6685. })
  6686. }(s, l, c) : (Ce.highlight.visible = !1,
  6687. Ce.tourControls.visible = !1),
  6688. z.on(G.OPEN_INFO, _e.bind(this, "info")),
  6689. function() {
  6690. var n;
  6691. document.body.addEventListener("mousedown", function(e) {
  6692. n = 0 === e.button || 1 === e.which ? e.target : null
  6693. }, !0),
  6694. document.body.addEventListener("mouseup", function(t) {
  6695. n !== t.target && (n = b(n, t.target));
  6696. var e = document.getElementById("gui-parent");
  6697. if (b(e, n) !== e && (n = null),
  6698. n) {
  6699. var i;
  6700. try {
  6701. i = new MouseEvent("click",t)
  6702. } catch (e) {
  6703. (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)
  6704. }
  6705. i.syntheticClick = !0,
  6706. n.dispatchEvent(i),
  6707. n = null
  6708. }
  6709. }, !0),
  6710. document.getElementById("gui-parent").addEventListener("click", function(e) {
  6711. e.syntheticClick || (e.stopPropagation(),
  6712. "A" === e.target.nodeName && e.preventDefault())
  6713. }, !0)
  6714. }(),
  6715. A(c),
  6716. C(s, t),
  6717. s.on("floor.changed", I),
  6718. s.on("waiting", function(e) {
  6719. _(e)
  6720. }
  6721. .bind(this, s)),
  6722. s.on("waiting-done", function(e) {
  6723. _(e)
  6724. }
  6725. .bind(this, s)),
  6726. c.on(re.ModeChanged, function(e, t) {
  6727. A(c),
  6728. v(l, c),
  6729. t === ie.PANORAMA && c.currentPano && !c.currentPano.isAligned() && (t = ie.OUTDOOR),
  6730. U.updateMode(t)
  6731. }),
  6732. e.on(oe.Move, _e.bind(this, "move")),
  6733. c.on(re.Ready, function() {
  6734. O.init(e, c, c.tagManager, l),
  6735. c.on(re.ModeChanged, function(e, t) {
  6736. e !== t && $(".vr-popup").is(":visible") && X.dismiss()
  6737. })
  6738. }),
  6739. c.on(re.PanoChosen, function(e, t) {
  6740. A(c, t),
  6741. U.updateMode(t && !t.isAligned() ? ie.OUTDOOR : ie.PANORAMA)
  6742. }),
  6743. V.on(k.CLOSE, function(e) {
  6744. switch (e) {
  6745. case "vr-modal":
  6746. X.dismiss();
  6747. break;
  6748. case "share-modal":
  6749. K.hide();
  6750. break;
  6751. case "terms-modal":
  6752. W.hide()
  6753. }
  6754. });
  6755. var lastMoveScrollTime = 0;//add
  6756. 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();
  6757. l.on("update.controls", function() {
  6758. var e, t, i, n = l.describe();
  6759. if (n.tourIsPlaying || c.isWarping() ? (Ce.tourControls.visible && (h.hide(),
  6760. u.show()),
  6761. n.tourInProgress && (d.forEach(function(e) {
  6762. e.classList.add("playing")
  6763. }),
  6764. p.addClass("playing"),
  6765. f.addClass("playing"))) : (Ce.tourControls.visible && (h.show(),
  6766. u.hide()),
  6767. n.tourInProgress || (q.stopTour(),
  6768. d.forEach(function(e) {
  6769. e.classList.remove("playing")
  6770. }),
  6771. p.removeClass("playing"),
  6772. f.removeClass("playing"))),
  6773. null !== n.currentItem) {
  6774. var r, o;
  6775. $("#status").find(".curIdx").text(n.currentItem[0] + 1),
  6776. n.onTheBus ? (r = "active",
  6777. o = "recent") : (o = "active",
  6778. r = "recent");
  6779. var a = null === n.destinationItem || n.currentItem[0] === n.destinationItem[0];
  6780. for (e = 0; e < s.heroLocations.length; e += 1)
  6781. i = g.eq(e),
  6782. t = m.eq(e),
  6783. i.removeClass(o),
  6784. t.removeClass(o),
  6785. n.onTheBus && e === n.destinationItem[0] ? (i.addClass(r),
  6786. t.addClass(r),
  6787. // 如果一段时间内用户不拖拽滚动scroll,才focus回这个item
  6788. (Date.now() - lastMoveScrollTime > 2000) && w.activate(e)
  6789. ): n.onTheBus && a && e === n.currentItem[0] ? (i.addClass(r),
  6790. t.addClass(r)) : (i.removeClass(r),
  6791. t.removeClass(r))
  6792. } else
  6793. for (e = 0; e < s.heroLocations.length; e += 1)
  6794. i = g.eq(e),
  6795. t = m.eq(e),
  6796. i.removeClass("active recent"),
  6797. t.removeClass("active recent");
  6798. v(l, c)
  6799. }),
  6800. document.addEventListener("keydown", function(e) {
  6801. switch (R.updateInteraction(oe.InteractionKey),
  6802. e.which) {
  6803. case te.ZERO:
  6804. M.debug && s.toggleAlpha();
  6805. break;
  6806. case te.NINE:
  6807. M.debug && B.toggle();
  6808. break;
  6809. case te.ONE:
  6810. c.isInMode(ie.TRANSITIONING) || l.changeMode(ie.PANORAMA);
  6811. break;
  6812. case te.TWO:
  6813. s.outsideAllowed() && !c.isInMode(ie.DOLLHOUSE, ie.TRANSITIONING) && l.changeMode(ie.DOLLHOUSE);
  6814. break;
  6815. case te.THREE:
  6816. s.outsideAllowed() && !c.isInMode(ie.FLOORPLAN, ie.TRANSITIONING) && l.changeMode(ie.FLOORPLAN);
  6817. break;
  6818. case te.FOUR:
  6819. c.isInMode(ie.TRANSITIONING) || l.changeMode(ie.OUTDOOR);
  6820. break;
  6821. case te.SPACE:
  6822. Ce.tourControls.visible && ($("#playHead").hasClass("playing") || _e("tour"));
  6823. break;
  6824. case te.RETURN:
  6825. M.debug && s.toggleExplodeUp();
  6826. break;
  6827. case te.P:
  6828. !function(e) {
  6829. me.gui || (me.gui = function(e) {
  6830. var t = new he.GUI;
  6831. return t.add(M, "showSweeps").name("Show sweeps").onFinishChange(function() {
  6832. e.setSweepVisibility(M.showSweeps)
  6833. }),
  6834. t.add(M, "rotationAccelerationInside", .1, 10).name("Rotation speed").step(.1),
  6835. t.add(M.transition, "flyTime", 0, 5e3).name("Transition time").onFinishChange(function() {
  6836. M.transition.flySpeed = 0,
  6837. t.__controllers.forEach(function(e) {
  6838. e.updateDisplay()
  6839. })
  6840. }),
  6841. t.add(M.path, "opacity", 0, 1).name("Path opacity"),
  6842. $(t.__closeButton).hide(),
  6843. t
  6844. }(me.model)),
  6845. (me.visible = e) ? $(me.gui.domElement).show() : $(me.gui.domElement).hide()
  6846. }(!me.visible);
  6847. break;
  6848. case te.U:
  6849. !function(e) {
  6850. ve.gui || (ve.gui = function(t, i) {
  6851. function e() {
  6852. var e = i.toJSON();
  6853. n.linkToLocation = window.location.protocol + "//" + window.location.host + window.location.pathname + "?m=" + t.sid + "&start=" + ee.serialize(e),
  6854. i.tagManager.activeTag && (n.linkToLocation += "&tag=" + i.tagManager.activeTag.sid)
  6855. }
  6856. var n = {}
  6857. , r = new he.GUI({
  6858. autoPlace: !0,
  6859. width: "60%"
  6860. });
  6861. return e(),
  6862. i.on(re.ViewChanged, e),
  6863. r.add(n, "linkToLocation").name(se.LINK_TO_LOCATION).listen(),
  6864. r.domElement.id = "datLinks",
  6865. [].slice.call(r.domElement.querySelectorAll(".property-name")).forEach(function(e) {
  6866. if (!S.detectSafari()) {
  6867. var t = document.createElement("button");
  6868. t.classList.add("btn-deep-link"),
  6869. t.innerText = se.MENU_COPY,
  6870. e.nextSibling.appendChild(t);
  6871. var n = function() {
  6872. alert(se.LINK_ALERT_COPY),
  6873. t.hide()
  6874. };
  6875. t.addEventListener("click", function(e) {
  6876. try {
  6877. var t = e.target.parentNode.childNodes[0];
  6878. t.select();
  6879. var i = document.execCommand("copy");
  6880. t.blur(),
  6881. i || n()
  6882. } catch (e) {
  6883. n()
  6884. }
  6885. })
  6886. }
  6887. }),
  6888. $(r.__closeButton).hide(),
  6889. r
  6890. }(ve.model, ve.player)),
  6891. (ve.visible = e) ? $(ve.gui.domElement).show() : $(ve.gui.domElement).hide()
  6892. }(!ve.visible);
  6893. break;
  6894. case te.X:
  6895. M.debug && s.toggleExplode();
  6896. break;
  6897. case te.PLUSEQUALS:
  6898. l.player.activatePersistentZooming(!0),
  6899. O.hideUi();
  6900. break;
  6901. case te.DASHUNDERSCORE:
  6902. l.player.activatePersistentZooming(!1),
  6903. O.hideUi();
  6904. break;
  6905. case te.SEVEN:
  6906. ue.info("Zoom level: " + l.player.zoomLevel + ", FOV: " + l.player.zoomFov);
  6907. break;
  6908. case te.EIGHT:
  6909. l.player.decreaseZoomSpeed();
  6910. break;
  6911. case te.NINE:
  6912. l.player.increaseZoomSpeed()
  6913. }
  6914. return c && c.reticule.hide(),
  6915. !0
  6916. }
  6917. .bind(this)),
  6918. document.addEventListener("keyup", function(e) {
  6919. switch (e.which) {
  6920. case te.PLUSEQUALS:
  6921. l.player.deactivatePersistentZooming();
  6922. break;
  6923. case te.DASHUNDERSCORE:
  6924. l.player.deactivatePersistentZooming()
  6925. }
  6926. }
  6927. .bind(this)),
  6928. function(e) {
  6929. me = {
  6930. gui: null,
  6931. visible: !1,
  6932. model: e
  6933. }
  6934. }(s),
  6935. function(e, t) {
  6936. ve = {
  6937. gui: null,
  6938. visible: !1,
  6939. model: e,
  6940. player: t
  6941. }
  6942. }(s, l.player),
  6943. function(e) {
  6944. function t(e, i) {
  6945. $(e).find("a").each(function(e, t) {
  6946. i ? $(t).removeClass("buttonZoomDisabled").addClass("buttonZoomEnabled") : $(t).addClass("buttonZoomDisabled").removeClass("buttonZoomEnabled"),
  6947. t.style.pointerEvents = i ? "auto" : "none"
  6948. })
  6949. }
  6950. e.on(de.ZoomMax, function() {
  6951. t("#gui-zoomin", !1),
  6952. t("#gui-zoomout", !0)
  6953. }),
  6954. e.on(de.ZoomMin, function() {
  6955. t("#gui-zoomin", !0),
  6956. t("#gui-zoomout", !1)
  6957. }),
  6958. e.on(de.ZoomIn, function() {
  6959. t("#gui-zoomout", !0)
  6960. }),
  6961. e.on(de.ZoomOut, function() {
  6962. t("#gui-zoomin", !0)
  6963. }),
  6964. e.zoomLevel >= M.zoom.max ? t("#gui-zoomin", !1) : t("#gui-zoomin", !0),
  6965. e.zoomLevel <= M.zoom.min ? t("#gui-zoomout", !1) : t("#gui-zoomout", !0)
  6966. }(c),
  6967. P.setAutoPlay(s.heroCount()),
  6968. U.init(c, i.mode),
  6969. U.on(H.OPENED, _e.bind(this, "help")),
  6970. W.init(),
  6971. W.on(j.OPENED, (o = document.getElementById("terms-modal"),
  6972. function() {
  6973. _e("terms"),
  6974. V.open(o)
  6975. }
  6976. )),
  6977. W.on(j.CLOSED, V.reset),
  6978. M.quickstart.enabled || D.delayLanding(i.mode).then(D.showMessage.bind(this, c, l, Ce.coBrand.visible)),
  6979. (M.quickstart.enabled || c.model.outsideAllowed()) && O.init(e, c, c.tagManager, l),
  6980. M.profiling.enabled && B.show(),
  6981. q.init(l)
  6982. }
  6983. ,
  6984. Le.exports.startLoading = function(e, t, i, n, r, o) {
  6985. function a() {
  6986. o.setLoadingStartTime(),
  6987. function() {
  6988. function e(e) {
  6989. e.target === t || $.contains(t, e.target) || e.target === i || $.contains(i, e.target) || e.target === n || $.contains(n, e.target)
  6990. }
  6991. $("body").css("touch-action", "none"),
  6992. $("#gui-parent").find("*:not(#tag-billboards)").on("touchmove", function(e) {});
  6993. var t = document.getElementById("terms-text")
  6994. , i = document.getElementById("more-help-wrapper")
  6995. , n = (document.getElementById("navigation-help-wrapper"),
  6996. document.getElementById("help-dialog"),
  6997. document.getElementById("tag-billboards"));
  6998. M.useWheel && (document.body.addEventListener("mousewheel", e, {
  6999. passive: !1
  7000. }),
  7001. document.body.addEventListener("DOMMouseScroll", e)),
  7002. $("#terms-text, #more-help-wrapper, #navigation-help-wrapper").off("touchmove").on("touchmove", function(e) {
  7003. e.stopPropagation()
  7004. })
  7005. }(),
  7006. r ? (D.showMessage(t, i, Ce.coBrand.visible),
  7007. l()) : function(e) {
  7008. L.show(e),
  7009. c()
  7010. }(l)
  7011. }
  7012. var s = $.Deferred()
  7013. , l = s.resolve.bind(s);
  7014. ye = !0,
  7015. _(e);
  7016. e.data.player_options && function(e) {
  7017. Ce.tourControls.visible = true//e.tour_buttons && S.valueFromHash("gt", 1),
  7018. Ce.coBrand.visible = e.presented_by && 1 !== M.specialEdition && M.brand && !S.valueFromHash("mls", !1),
  7019. Ce.highlight.visible = /* e.highlight_reel && */ 1 !== M.specialEdition && M.showHighlights
  7020. }(e.data.player_options),
  7021. 1 === M.specialEdition && $("body").addClass("specialEdition");
  7022. se.localizeGUI();
  7023. !function(i) {
  7024. function e(e, t) {
  7025. return !!i.player_options[e] && i[t || e]
  7026. }
  7027. $(".model-title").text(i.name);
  7028. var t = M.pageTitle;
  7029. 2 !== S.valueFromHash("mls", 0) && i.name && (t = i.name),
  7030. document.title = t,
  7031. S.isMobile() ? $("#gui-fullscreen").css("display", "none") : ($("[rel=tooltip]").tooltip({
  7032. delay: {
  7033. show: 50,
  7034. hide: 0
  7035. },
  7036. trigger: "hover",
  7037. html: !1,
  7038. viewport: {
  7039. selector: "body",
  7040. padding: 10
  7041. }
  7042. }),
  7043. S.inIframe() && document.getElementsByClassName("pinBottom-container")[0].classList.add("embed")),
  7044. z.populate({
  7045. name: e("model_name", "name"),
  7046. coBrand: e("presented_by"),
  7047. description: e("model_summary", "summary") || "暂无内容",
  7048. contactName: e("contact_name"),
  7049. address: e("address"),
  7050. phone: e("contact_phone"),
  7051. formattedPhone: i.formatted_contact_phone,
  7052. email: e("contact_email"),
  7053. url: e("external_url"),
  7054. socialSharing: i.enable_social_sharing && i.is_public
  7055. })
  7056. }(e.data);
  7057. r || $(".quick").addClass("hidden");
  7058. n ? (R.impression(),
  7059. a()) : (o.setWaitingStartTime(),
  7060. N.show(r, a))
  7061. return s
  7062. }
  7063. ,
  7064. Le.exports.endLoading = function(e, t, i) {
  7065. var n = t.player;
  7066. function r() {
  7067. i.dismissExaminedTag(),
  7068. i.disableHovering()
  7069. }
  7070. $("#gui-thumb").fadeOut(2500),
  7071. L.hide(function() {
  7072. ye = !1
  7073. }),
  7074. Y.init(e, i),
  7075. z.finishSetup(Object.keys(e.tags).length),
  7076. i.on(ne.IMAGE_OPENED, _e.bind(this, "tag")),
  7077. X.on(Z.OPENED, r),
  7078. K.on(ae.OPENED, r),
  7079. U.on(H.OPENED, r),
  7080. W.on(j.OPENED, r);
  7081. var o = i.enableHovering.bind(i);
  7082. if (X.on(Z.CLOSED, o),
  7083. K.on(ae.CLOSED, o),
  7084. U.on(H.CLOSED, o),
  7085. W.on(j.CLOSED, o),
  7086. M.labels.enabled && Object.keys(e.labels).length,
  7087. e.floors.length <= 1 || !Ce.floors.visible ? Ce.floors.visible = !1 : (h(e, t),
  7088. I(e.currentFloor, n.mode)),
  7089. "372" === getQueryVariable("m") && (Ce.floors.visible = 1,
  7090. h(e, t)),
  7091. c(),
  7092. v(t, t.player),
  7093. $("#gui").fadeIn(1500),
  7094. Ce.highlight.visible && (2 !== M.startHighlights || e.has360Views) && setTimeout(function() {
  7095. l(),
  7096. (!e.has360Views && 1 !== M.startHighlights || e.has360Views && 0 === M.startHighlights) && setTimeout(l, 2e3)
  7097. }, 2e3),
  7098. !S.isMobile())
  7099. for (var a = ["a", "#title-toggle", ".next-button", ".prev-button", ".gui-floor", ".meta-toggle", ".thumbImg", "logo-button"], s = 0; s < a.length; s++)
  7100. $(a[s]).addClass("hasHover");
  7101. _(e),
  7102. z.setupToggling(),
  7103. window.editHotPanel && editHotPanel(),
  7104. function() {
  7105. var i = $("#pullTab")
  7106. , e = {
  7107. bottom: {
  7108. "border-bottom-left-radius": "10px",
  7109. "border-bottom-right-radius": "10px"
  7110. },
  7111. top: {
  7112. "border-top-left-radius": "10px",
  7113. "border-top-right-radius": "10px"
  7114. }
  7115. }
  7116. , t = {
  7117. bottom: {
  7118. "border-top-right-radius": "10px",
  7119. "border-bottom-right-radius": "10px"
  7120. },
  7121. top: {
  7122. "border-bottom-left-radius": "10px",
  7123. "border-top-left-radius": "10px"
  7124. }
  7125. };
  7126. function n(e, t) {
  7127. $("#gui-modes-map > div:visible:last").css(e),
  7128. i.is(":visible") ? $(".viewContainer > div:visible:first").css(t) : $("#gui-modes-map > div:visible:first").css(t)
  7129. }
  7130. /Android|webOS|iPhone|iPod|BlackBerry/i.test(navigator.userAgent) ? n(e.bottom, e.top) : n(t.bottom, t.top);
  7131. (window.DATA.model.special || "true" === window.DATA.special) && window.specialScene && specialScene.special().afterImplement()
  7132. }()
  7133. $(".toolRight a").removeClass('hasHover')
  7134. }
  7135. ,
  7136. Le.exports.onProgress = function(e) {
  7137. L.progress(e)
  7138. }
  7139. }
  7140. ).call(this, "/js/gui/gui.js")
  7141. }
  7142. , {
  7143. "../analytics": 4,
  7144. "../controls/serializer": 14,
  7145. "../enum/AlignmentType": 17,
  7146. "../enum/BlackoutStyle": 18,
  7147. "../enum/ControlEvents": 21,
  7148. "../enum/DirectorEvents": 23,
  7149. "../enum/Keys": 30,
  7150. "../enum/PathDiscardMode": 38,
  7151. "../enum/PathDisplayMode": 39,
  7152. "../enum/PlayerEvents": 40,
  7153. "../enum/VROption": 47,
  7154. "../enum/Vectors": 50,
  7155. "../enum/Viewmode": 51,
  7156. "../enum/WarpStyle": 52,
  7157. "../enum/ZoomEvents": 53,
  7158. "../lib/dat.gui": 93,
  7159. "../localization/localize": 108,
  7160. "../tag/Media/MediaEvent": 131,
  7161. "../objects/Snapshot": 153,
  7162. "../settings": 166,
  7163. "../util/ajax": 181,
  7164. "../util/browser": 182,
  7165. "../util/camera": 183,
  7166. "../util/logger": 189,
  7167. "../util/showcase": 193,
  7168. "../util/transitions": 195,
  7169. "./closer/ModalCloserEvent": 61,
  7170. "./closer/modalCloser": 62,
  7171. "./help/HelpEvent": 66,
  7172. "./help/help": 67,
  7173. "./helpManager": 68,
  7174. "./immersiveMode": 69,
  7175. "./konami": 70,
  7176. "./landingScreen": 71,
  7177. "./loadingScreen": 72,
  7178. "./memoryUsage": 73,
  7179. "./playButton": 74,
  7180. "./populateModal": 75,
  7181. "./sharing/ShareEvents": 76,
  7182. "./sharing/modal": 77,
  7183. "./terms/TermsEvent": 78,
  7184. "./terms/terms": 79,
  7185. "./title/TitleEvents": 80,
  7186. "./title/tagToggle": 81,
  7187. "./title/titleBar": 82,
  7188. "./tourInteraction": 84,
  7189. "./vr/vrEvent": 85,
  7190. "./vr/vrModal": 87,
  7191. "./webvr/WebVrEvent": 88,
  7192. "./webvr/webVRgui": 89,
  7193. three: 217
  7194. }],
  7195. 66: [function(e, t, i) {
  7196. "use strict";
  7197. t.exports = Object.freeze({
  7198. OPENED: "help.opened",
  7199. CLOSED: "help.closed"
  7200. })
  7201. }
  7202. , {}],
  7203. 67: [function(e, t, i) {
  7204. "use strict";
  7205. function n() {
  7206. p.on("click", function(e) {
  7207. T && T !== a.TRANSITIONING && (0 < window.getComputedStyle(v).getPropertyValue("opacity") && !x ? S.close() : T && T !== a.TRANSITIONING && (x = !0,
  7208. setTimeout(function() {
  7209. x = !1
  7210. }, h.help.modalStayDuration),
  7211. S.emit(l.OPENED),
  7212. f.addClass("open " + T),
  7213. p.addClass("open"),
  7214. o(),
  7215. r(),
  7216. v.style.removeProperty ? v.style.removeProperty("display") : v.style.removeAttribute("display"),
  7217. v.classList.add("fadeIn")))
  7218. }),
  7219. E.on("click", function(e) {
  7220. S.close()
  7221. }),
  7222. C.on("click", function(e) {
  7223. T && T !== a.TRANSITIONING && (o(),
  7224. r())
  7225. }),
  7226. I.on("click", function(e) {
  7227. o(),
  7228. I.addClass("underline-tab"),
  7229. c.fill(b, s.MORE_HELP),
  7230. f.addClass("more-help")
  7231. })
  7232. }
  7233. function r() {
  7234. C.addClass("underline-tab"),
  7235. c.fill(_, s.NAVIGATION, T),
  7236. f.addClass(T)
  7237. }
  7238. function o() {
  7239. f.removeClass("more-help " + a.PANORAMA + " " + a.DOLLHOUSE + " " + a.FLOORPLAN + " " + a.OUTDOOR),
  7240. A.forEach(function(e) {
  7241. e.classList.remove("underline-tab")
  7242. })
  7243. }
  7244. var a = e("../../enum/Viewmode")
  7245. , s = e("../../enum/HelpModalType")
  7246. , l = e("./HelpEvent")
  7247. , c = (e("../helpManager"),
  7248. e("./../populateModal"))
  7249. , h = e("../../settings")
  7250. , u = e("../../util/common")
  7251. , d = e("events").EventEmitter
  7252. , p = $(".footer-help").eq(0)
  7253. , f = $("#help-dialog").eq(0)
  7254. , g = document.querySelector("#quick-logo")
  7255. , m = document.querySelector("#loaderCoBrand")
  7256. , v = document.querySelector("#help-dialog")
  7257. , y = document.querySelector(".footer")
  7258. , A = $(".help-tabs").children().toArray()
  7259. , C = $(".navigation-tab").eq(0)
  7260. , I = $(".more-help-tab").eq(0)
  7261. , E = ($("#interaction-modal").eq(0).find(".interaction").toArray(),
  7262. f.find(".close").eq(0))
  7263. , _ = f.find(".interactions").toArray()
  7264. , b = f.find(".ui-instructions").toArray()
  7265. , w = a.PANORAMA
  7266. , T = a.PANORAMA
  7267. , x = !1
  7268. , S = {
  7269. init: function(e, t) {
  7270. w = T = t,
  7271. [v, m, g, y].forEach(function(e) {
  7272. e.classList.add(c.deviceType)
  7273. }),
  7274. n()
  7275. },
  7276. close: function() {
  7277. if (f.hasClass("open") && (this.emit(l.CLOSED),
  7278. p.removeClass("open"),
  7279. f.removeClass("open"),
  7280. v.classList.contains("fadeIn"))) {
  7281. v.classList.remove("fadeIn");
  7282. var e = T === a.TRANSITIONING ? w : T;
  7283. c.clear(_, s.NAVIGATION, e)
  7284. }
  7285. },
  7286. updateMode: function(e) {
  7287. w = T,
  7288. T = e
  7289. }
  7290. };
  7291. u.extendObject(S, d.prototype),
  7292. t.exports = S
  7293. }
  7294. , {
  7295. "../../enum/HelpModalType": 28,
  7296. "../../enum/Viewmode": 51,
  7297. "../../settings": 166,
  7298. "../../util/common": 185,
  7299. "../helpManager": 68,
  7300. "./../populateModal": 75,
  7301. "./HelpEvent": 66,
  7302. events: 202
  7303. }],
  7304. 68: [function(s, l, e) {
  7305. (function(e) {
  7306. "use strict";
  7307. var t = s("../util/browser")
  7308. , i = s("./../util/logger")
  7309. , n = s("./../settings")
  7310. , r = new i(e)
  7311. , o = function() {
  7312. var t;
  7313. try {
  7314. return t = window.localStorage.getItem("visitCount") || "0",
  7315. t = (parseFloat(t) + 1).toString(),
  7316. window.localStorage.setItem("visitCount", t),
  7317. r.debug("visitCount = " + t),
  7318. t
  7319. } catch (e) {
  7320. t = "1",
  7321. r.debug("couldn't set local storage")
  7322. }
  7323. }()
  7324. , a = !1;
  7325. l.exports = {
  7326. isHelpDisabled: function() {
  7327. return "0" === t.valueFromHash("help", null) || a
  7328. },
  7329. isLargeHelpEnabled: function() {
  7330. return ("1" === o || "1" === t.valueFromHash("help", null)) && !this.isHelpDisabled()
  7331. },
  7332. isSmallHelpEnabled: function() {
  7333. return "2" === t.valueFromHash("help", null) && !this.isHelpDisabled()
  7334. },
  7335. isHelpEnabled: function() {
  7336. return this.isLargeHelpEnabled() || this.isSmallHelpEnabled()
  7337. },
  7338. setAutoPlay: function(e) {
  7339. a = 0 <= n.warp.auto && 1 < e
  7340. }
  7341. }
  7342. }
  7343. ).call(this, "/js/gui/helpManager.js")
  7344. }
  7345. , {
  7346. "../util/browser": 182,
  7347. "./../settings": 166,
  7348. "./../util/logger": 189
  7349. }],
  7350. 69: [function(e, t, i) {
  7351. "use strict";
  7352. function r(e) {
  7353. M || n(e) && C.hasClass("playing") || (clearTimeout(x),
  7354. T = !0,
  7355. h.close(),
  7356. function(e) {
  7357. !n(e) && S ? v.forEach(function(e) {
  7358. e.classList.remove("drawerOpen"),
  7359. e.classList.add("duringTour")
  7360. }) : C.hasClass("open") ? v.forEach(function(e) {
  7361. e.classList.remove("duringTour"),
  7362. e.classList.add("drawerOpen")
  7363. }) : P || R === g.FLOORPLAN || R === g.DOLLHOUSE || v.forEach(function(e) {
  7364. e.classList.add("fadeOut")
  7365. })
  7366. }(e),
  7367. R !== g.DOLLHOUSE && R !== g.FLOORPLAN && (E.hasClass("expand") && !_.hasClass("closed") || l.valueFromHash("title", 1),
  7368. C.hasClass("playing") || (y.forEach(function(e) {
  7369. e.classList.add("detectHover")
  7370. }),
  7371. x = setTimeout(a, c.immersive.timeToShowAgain))))
  7372. }
  7373. function o() {
  7374. C.hasClass("playing") || (clearTimeout(x),
  7375. x = setTimeout(a, c.immersive.timeToShowAgain))
  7376. }
  7377. function a() {
  7378. clearTimeout(x),
  7379. T = !1,
  7380. m.forEach(function(e) {
  7381. e.classList.remove("drawerOpen")
  7382. }),
  7383. S || v.forEach(function(e) {
  7384. e.classList.remove("duringTour")
  7385. }),
  7386. y.forEach(function(e) {
  7387. e.classList.remove("detectHover")
  7388. })
  7389. }
  7390. function s() {
  7391. T ? a() : r(),
  7392. M = !0,
  7393. setTimeout(function() {
  7394. M = !1
  7395. }, c.immersive.uiStayDuration)
  7396. }
  7397. function n(e) {
  7398. return "mouse" === e || "touch" === e || "key" === e || "gui" === e
  7399. }
  7400. var l = e("../util/browser")
  7401. , c = e("../settings")
  7402. , h = e("./help/help")
  7403. , u = e("../enum/tagEvents")
  7404. , d = e("../enum/ControlEvents")
  7405. , p = e("../enum/PlayerEvents")
  7406. , f = e("../enum/DirectorEvents")
  7407. , g = (p = e("../enum/PlayerEvents"),
  7408. e("../enum/Viewmode"))
  7409. , m = $(".pinTop.left, .pinBottom-container, #drawer-container, #drawer, .footer").toArray()
  7410. , v = $(".pinBottom-container, #drawer-container, .footer").toArray()
  7411. , y = $("#hover-bottom, #hover-top").toArray()
  7412. , A = ($("#pullTab").eq(0),
  7413. $("#playHead").eq(0),
  7414. $(".pinBottom-container").eq(0))
  7415. , C = $("#drawer").eq(0)
  7416. , I = $("#drawer-container").eq(0)
  7417. , E = $("#meta-info").eq(0)
  7418. , _ = $(".pinTop.left").eq(0)
  7419. , b = $("#player").eq(0)
  7420. , w = document.getElementById("pullTab")
  7421. , T = !1
  7422. , x = null
  7423. , S = !1
  7424. , M = !1
  7425. , R = null
  7426. , P = !1;
  7427. t.exports.init = function(e, t, i, n) {
  7428. (function(t, i, e, n) {
  7429. [g.PANORAMA, g.DOLLHOUSE, g.FLOORPLAN].forEach(function(e) {
  7430. t.controls[e].on(d.Move, r),
  7431. t.controls[e].on(d.LongTap, s)
  7432. }),
  7433. b.on("mousewheel DOMMouseScroll", r),
  7434. e.on(u.TagActivated, r),
  7435. e.on(u.TagNavigation, r),
  7436. i.on(p.FlyingEnded, o),
  7437. i.on(p.ModeChanging, function(e, t) {
  7438. P = t !== g.PANORAMA && e !== g.PANORAMA
  7439. }),
  7440. i.on(p.ModeChanged, function(e, t) {
  7441. R = i.mode,
  7442. t !== g.TRANSITIONING ? a() : r("modeChange")
  7443. }),
  7444. n.on(f.TourStart, function() {
  7445. S = !0,
  7446. r()
  7447. }),
  7448. n.on(f.TourEnd, function() {
  7449. S = !1,
  7450. a()
  7451. }),
  7452. n.on(f.ActionInterrupted, function() {
  7453. S = !1
  7454. }),
  7455. w.addEventListener("touchend", function() {
  7456. $("#pullTab").hasClass("opened") && !S && a()
  7457. }, !0)
  7458. }
  7459. )(e, t, i, n),
  7460. l.isMobile() ? (y.forEach(function(e) {
  7461. e.classList.add("mobile")
  7462. }),
  7463. A.click(a)) : (y.forEach(function(e) {
  7464. e.addEventListener("mouseleave", function() {
  7465. !b.is(":hover") && y[0].classList.contains("detectHover") && a()
  7466. }, !0)
  7467. }),
  7468. b.mouseleave(function() {
  7469. y[0].classList.contains("detectHover") && a()
  7470. })),
  7471. R = t.mode
  7472. }
  7473. ,
  7474. t.exports.hideUi = r,
  7475. t.exports.resetDrawer = function() {
  7476. I.hasClass("duringTour") || (S = !1,
  7477. r("gui"),
  7478. a())
  7479. }
  7480. }
  7481. , {
  7482. "../enum/ControlEvents": 21,
  7483. "../enum/DirectorEvents": 23,
  7484. "../enum/tagEvents": 32,
  7485. "../enum/PlayerEvents": 40,
  7486. "../enum/Viewmode": 51,
  7487. "../settings": 166,
  7488. "../util/browser": 182,
  7489. "./help/help": 67
  7490. }],
  7491. 70: [function(i, n, e) {
  7492. (function(e) {
  7493. "use strict";
  7494. var t = i("./../util/logger")
  7495. , o = i("./../settings")
  7496. , a = i("./debug")
  7497. , s = i("./../util/common")
  7498. , l = (i("./gui"),
  7499. new t(e));
  7500. o.console && $("body").append('<div id="debug-console"></div>'),
  7501. n.exports.init = function(i, n, r) {
  7502. l.debug("konami has the modelInstance");
  7503. var t = [];
  7504. $(window).on("keydown", function(e) {
  7505. t.push(e.which),
  7506. t.length > o.secretPanelWord.length && t.shift(),
  7507. s.equalLists(t, o.secretPanelWord) && (l.debug("Developer mode active."),
  7508. o.debug = !0)
  7509. }),
  7510. $(window).on("keydown", function e(t) {
  7511. o.debug && 72 === t.which && (i && r ? (a.toggle(i, n, r),
  7512. $(window).off("keydown", e)) : console.warn("sorry we're not ready yet"))
  7513. })
  7514. }
  7515. }
  7516. ).call(this, "/js/gui/konami.js")
  7517. }
  7518. , {
  7519. "./../settings": 166,
  7520. "./../util/common": 185,
  7521. "./../util/logger": 189,
  7522. "./debug": 63,
  7523. "./gui": 65
  7524. }],
  7525. 71: [function(e, t, i) {
  7526. "use strict";
  7527. function r() {
  7528. s.clear(m, l.LANDING[v]),
  7529. g.removeClass("fadeIn")
  7530. }
  7531. var o = e("../settings")
  7532. , a = (e("./help/help"),
  7533. e("./helpManager"))
  7534. , s = e("./populateModal")
  7535. , l = e("../enum/HelpModalType")
  7536. , n = e("../enum/Viewmode")
  7537. , c = e("../enum/DirectorEvents")
  7538. , h = e("../enum/PlayerEvents")
  7539. , u = $("#quick-blackout").eq(0)
  7540. , d = $("#quick-logo").eq(0)
  7541. , p = $(".quick-brand").toArray()
  7542. , f = $("#loaderCoBrand").eq(0)
  7543. , g = $("#interaction-modal").eq(0)
  7544. , m = g.find(".interaction").toArray()
  7545. , v = ($("#model-title, .pinBottom-container, #drawer-container, #drawer, .footer").toArray(),
  7546. "");
  7547. t.exports.delayLanding = function(e) {
  7548. var t = $.Deferred();
  7549. e || t.resolve();
  7550. var i = o.startupFlyinDelay;
  7551. return e === n.PANORAMA && (i += o.dollhouse.transitionTime),
  7552. setTimeout(t.resolve.bind(t), i),
  7553. t
  7554. }
  7555. ,
  7556. t.exports.showMessage = function(e, t, i) {
  7557. var n = 0;
  7558. o.quickstart.enabled && (function(e) {
  7559. /* e && (f.addClass("quick-brand"), //quick-brand样式有问题 会遮住屏幕
  7560. d.before(f),
  7561. p = $(".quick-brand").toArray()), */
  7562. u.addClass("fadeOut")
  7563. /* setTimeout(function() {
  7564. p.forEach(function(e) {
  7565. e.classList.add("fadeIn")
  7566. })
  7567. }, o.quickstart.showTextDelay),
  7568. setTimeout(function() {
  7569. p.forEach(function(e) {
  7570. e.classList.add("fadeOut")
  7571. })
  7572. }, o.quickstart.fadeOutDelay) */
  7573. }(i),
  7574. n = o.quickstart.showTextDelay + o.quickstart.fadeOutDelay),
  7575. function(e, t) {
  7576. setTimeout(function() {
  7577. if (a.isHelpEnabled()) {
  7578. if (t(),
  7579. s.init(),
  7580. g.addClass("fadeIn landing " + s.deviceType),
  7581. a.isSmallHelpEnabled())
  7582. return void g.addClass("small");
  7583. s.fill(m, l.LANDING[v]),
  7584. g.addClass(v)
  7585. }
  7586. }, e);
  7587. var i = {
  7588. pc: ["images/pc_step1.png", "images/pc_step2.png", "images/pc_step3.png"],
  7589. mobile: ["images/phone_step1.png", "images/phone_step2.png", "images/phone_step3.png"]
  7590. }
  7591. , n = $(".nav-icon .icon");
  7592. /Android|webOS|iPhone|iPod|BlackBerry/i.test(navigator.userAgent) && n.attr("src", i.mobile[0]);
  7593. function r(e) {
  7594. e.on("click", function() {
  7595. var e = null;
  7596. if (e = "plus" == $(this).attr("data-id") ? +n.attr("data-page") + 1 : +n.attr("data-page") - 1,
  7597. i.length < e || e < 1)
  7598. return !1;
  7599. /Android|webOS|iPhone|iPod|BlackBerry/i.test(navigator.userAgent) ? n.attr({
  7600. "data-page": e,
  7601. src: i.mobile[e - 1]
  7602. }) : n.attr({
  7603. "data-page": e,
  7604. src: i.pc[e - 1]
  7605. })
  7606. })
  7607. }
  7608. r($(".next-button")),
  7609. r($(".prev-button"))
  7610. }(n, function() {
  7611. e.once(h.Move, r),
  7612. t.once(c.TourStart, r)
  7613. })
  7614. }
  7615. ,
  7616. t.exports.init = function(e, t) {
  7617. v = t.mode === n.PANORAMA && t.pano && !t.pano.isAligned() ? n.OUTDOOR : t.mode
  7618. }
  7619. ,
  7620. t.exports.dismissModal = r
  7621. }
  7622. , {
  7623. "../enum/DirectorEvents": 23,
  7624. "../enum/HelpModalType": 28,
  7625. "../enum/PlayerEvents": 40,
  7626. "../enum/Viewmode": 51,
  7627. "../settings": 166,
  7628. "./help/help": 67,
  7629. "./helpManager": 68,
  7630. "./populateModal": 75
  7631. }],
  7632. 72: [function(e, t, i) {
  7633. "use strict";
  7634. var n = e("./circleLoader").circleLoader;
  7635. t.exports = {
  7636. element: $("#gui-loading"),
  7637. hide: function(e) {
  7638. n.done(),
  7639. this.element.fadeOut(1500, e)
  7640. },
  7641. show: function(e) {
  7642. this.element.fadeIn(500, function() {
  7643. this.element.css("display", "table"),
  7644. e && e()
  7645. }
  7646. .bind(this))
  7647. },
  7648. progress: function(e) {
  7649. n.set(e)
  7650. }
  7651. }
  7652. }
  7653. , {
  7654. "./circleLoader": 60
  7655. }],
  7656. 73: [function(e, t, i) {
  7657. "use strict";
  7658. var n = e("../settings")
  7659. , r = $("#memory-info")
  7660. , o = r.find("#memory-gpu")
  7661. , a = !1;
  7662. t.exports = {
  7663. show: function() {
  7664. n.profiling.enabled && (r.show(),
  7665. a = !0)
  7666. },
  7667. hide: function() {
  7668. r.hide(),
  7669. a = !1
  7670. },
  7671. toggle: function() {
  7672. a ? this.hide() : this.show()
  7673. },
  7674. update: function(e) {
  7675. n.profiling.enabled && o.text(Math.floor(e / 1e6) + "MB")
  7676. }
  7677. }
  7678. }
  7679. , {
  7680. "../settings": 166
  7681. }],
  7682. 74: [function(e, t, i) {
  7683. "use strict";
  7684. e("../util/browser"),
  7685. e("../analytics");
  7686. e("../settings"),
  7687. t.exports = {
  7688. show: function(e, t) {
  7689. $("#gui-message").fadeOut(500, function() {
  7690. t()
  7691. })
  7692. }
  7693. }
  7694. }
  7695. , {
  7696. "../analytics": 4,
  7697. "../settings": 166,
  7698. "../util/browser": 182
  7699. }],
  7700. 75: [function(e, t, i) {
  7701. "use strict";
  7702. function n(e, t, i, n) {
  7703. i ? this.assets[t][i][this.deviceType] : this.assets[t][this.deviceType]
  7704. }
  7705. var r = e("../util/browser")
  7706. , o = e("../localization/localize")
  7707. , a = e("../enum/HelpModalType")
  7708. , s = (e("../enum/HelpModalSize"),
  7709. e("../enum/Viewmode"));
  7710. t.exports = {
  7711. init: function() {
  7712. if (!this.hasInitialized) {
  7713. this.hasInitialized = !0,
  7714. this.deviceType = r.isMobile() ? "mobile" : "desktop",
  7715. this.assets = {},
  7716. this.assets[a.LANDING[s.PANORAMA]] = {
  7717. desktop: {
  7718. left: {
  7719. "top-info": o.ROTATE,
  7720. "big-image": "images/nav_help_mouse_drag_left.png",
  7721. keyboard: "images/nav_help_keyboard_left_right.png"
  7722. },
  7723. middle: {
  7724. "top-info": o.MOVE,
  7725. "big-image": "images/nav_help_mouse_click.png",
  7726. keyboard: "images/nav_help_keyboard_up_down.png"
  7727. },
  7728. right: {
  7729. "top-info": o.ZOOM,
  7730. "big-image": "images/nav_help_mouse_zoom.png",
  7731. keyboard: "images/nav_help_zoom_keys.png"
  7732. }
  7733. },
  7734. mobile: {
  7735. left: {
  7736. "top-info": o.ROTATE,
  7737. "big-image": "images/nav_help_gesture_drag.png"
  7738. },
  7739. middle: {
  7740. "top-info": o.MOVE,
  7741. "big-image": "images/nav_help_gesture_tap.png"
  7742. },
  7743. right: {
  7744. "top-info": o.ZOOM,
  7745. "big-image": "images/nav_help_gesture_pinch.png"
  7746. }
  7747. }
  7748. },
  7749. this.assets[a.LANDING[s.OUTDOOR]] = JSON.parse(JSON.stringify(this.assets[a.LANDING[s.PANORAMA]])),
  7750. this.assets[a.LANDING[s.DOLLHOUSE]] = {
  7751. desktop: {
  7752. left: {
  7753. "top-info": o.ROTATE,
  7754. "big-image": "images/nav_help_mouse_drag_left.png",
  7755. keyboard: "images/nav_help_keyboard_left_right.png"
  7756. },
  7757. middle: {
  7758. "top-info": o.MOVE,
  7759. "big-image": "images/nav_help_mouse_position_right.png"
  7760. }
  7761. },
  7762. mobile: {
  7763. left: {
  7764. "top-info": o.ROTATE,
  7765. "big-image": "images/nav_help_gesture_drag.png"
  7766. },
  7767. middle: {
  7768. "top-info": o.MOVE,
  7769. "big-image": "images/nav_help_gesture_position_two_finger.png"
  7770. }
  7771. }
  7772. },
  7773. this.assets[a.LANDING[s.FLOORPLAN]] = {
  7774. desktop: {
  7775. left: {
  7776. "top-info": o.MOVE,
  7777. "big-image": "images/nav_help_mouse_position_left.png"
  7778. },
  7779. middle: {
  7780. "top-info": o.ROTATE,
  7781. "big-image": "images/nav_help_mouse_drag_right.png",
  7782. keyboard: "images/nav_help_keyboard_left_right.png"
  7783. }
  7784. },
  7785. mobile: {
  7786. left: {
  7787. "top-info": o.MOVE,
  7788. "big-image": "images/nav_help_gesture_position.png"
  7789. },
  7790. middle: {
  7791. "top-info": o.ROTATE,
  7792. "big-image": "images/nav_help_gesture_drag_two_finger.png"
  7793. }
  7794. }
  7795. };
  7796. var e = {
  7797. "top-info": o.INSIDE,
  7798. "big-image": "images/nav_help_click_inside.png",
  7799. keyboard: "images/nav_help_inside_key.png"
  7800. };
  7801. this.assets[a.LANDING[s.OUTDOOR]].desktop.middle = e,
  7802. this.assets[a.LANDING[s.DOLLHOUSE]].desktop.right = e,
  7803. this.assets[a.LANDING[s.FLOORPLAN]].desktop.right = e;
  7804. var t = {
  7805. "top-info": o.INSIDE,
  7806. "big-image": "images/nav_help_tap_inside.png"
  7807. };
  7808. this.assets[a.LANDING[s.OUTDOOR]].mobile.middle = t,
  7809. this.assets[a.LANDING[s.DOLLHOUSE]].mobile.right = t,
  7810. this.assets[a.LANDING[s.FLOORPLAN]].mobile.right = t,
  7811. this.assets[a.NAVIGATION] = {},
  7812. this.assets[a.NAVIGATION][s.PANORAMA] = {
  7813. desktop: {
  7814. left: {
  7815. "top-info": o.HELP_DESKTOP_PANORAMA_1A,
  7816. "bottom-info": o.HELP_DESKTOP_PANORAMA_1B,
  7817. "big-image": "images/nav_help_mouse_drag_left.png",
  7818. keyboard: "images/nav_help_keyboard_left_right.png"
  7819. },
  7820. middle: {
  7821. "top-info": o.HELP_DESKTOP_PANORAMA_2A,
  7822. "bottom-info": o.HELP_DESKTOP_PANORAMA_2B,
  7823. "big-image": "images/nav_help_mouse_click.png",
  7824. keyboard: "images/nav_help_keyboard_up_down.png"
  7825. },
  7826. right: {
  7827. "top-info": o.HELP_DESKTOP_PANORAMA_3A,
  7828. "bottom-info": o.HELP_DESKTOP_PANORAMA_3B,
  7829. "big-image": "images/nav_help_mouse_zoom.png",
  7830. keyboard: "images/nav_help_zoom_keys.png"
  7831. }
  7832. },
  7833. mobile: {
  7834. left: {
  7835. "top-info": o.HELP_MOBILE_PANORAMA_1,
  7836. "big-image": "images/nav_help_gesture_drag.png"
  7837. },
  7838. middle: {
  7839. "top-info": o.HELP_MOBILE_PANORAMA_2,
  7840. "big-image": "images/nav_help_gesture_tap.png"
  7841. },
  7842. right: {
  7843. "top-info": o.HELP_MOBILE_3,
  7844. "big-image": "images/nav_help_gesture_pinch.png"
  7845. }
  7846. }
  7847. },
  7848. this.assets[a.NAVIGATION][s.DOLLHOUSE] = {
  7849. desktop: {
  7850. left: {
  7851. "top-info": o.HELP_DESKTOP_DOLLHOUSE_1A,
  7852. "bottom-info": o.HELP_DESKTOP_DOLLHOUSE_1B,
  7853. "big-image": "images/nav_help_mouse_drag_left.png",
  7854. keyboard: "images/nav_help_keyboard_all.png"
  7855. },
  7856. middle: {
  7857. "top-info": o.HELP_DESKTOP_DOLLHOUSE_2A,
  7858. "big-image": "images/nav_help_mouse_position_right.png"
  7859. },
  7860. right: {
  7861. "top-info": o.HELP_DESKTOP_DOLLHOUSE_3A,
  7862. "big-image": "images/nav_help_mouse_zoom.png"
  7863. }
  7864. },
  7865. mobile: {
  7866. left: {
  7867. "top-info": o.HELP_MOBILE_DOLLHOUSE_1,
  7868. "big-image": "images/nav_help_gesture_drag.png"
  7869. },
  7870. middle: {
  7871. "top-info": o.HELP_MOBILE_DOLLHOUSE_2,
  7872. "big-image": "images/nav_help_gesture_position_two_finger.png"
  7873. },
  7874. right: {
  7875. "top-info": o.HELP_MOBILE_3,
  7876. "big-image": "images/nav_help_gesture_pinch.png"
  7877. }
  7878. }
  7879. },
  7880. this.assets[a.NAVIGATION][s.FLOORPLAN] = {
  7881. desktop: {
  7882. left: {
  7883. "top-info": o.HELP_DESKTOP_FLOORPLAN_1A,
  7884. "big-image": "images/nav_help_mouse_position_left.png"
  7885. },
  7886. middle: {
  7887. "top-info": o.HELP_DESKTOP_FLOORPLAN_2A,
  7888. "bottom-info": o.HELP_DESKTOP_FLOORPLAN_2B,
  7889. "big-image": "images/nav_help_mouse_drag_right.png",
  7890. keyboard: "images/nav_help_keyboard_left_right.png"
  7891. },
  7892. right: {
  7893. "top-info": o.HELP_DESKTOP_FLOORPLAN_3A,
  7894. "bottom-info": o.HELP_DESKTOP_FLOORPLAN_3B,
  7895. "big-image": "images/nav_help_mouse_zoom.png",
  7896. keyboard: "images/nav_help_keyboard_up_down.png"
  7897. }
  7898. },
  7899. mobile: {
  7900. left: {
  7901. "top-info": o.HELP_MOBILE_FLOORPLAN_1,
  7902. "big-image": "images/nav_help_gesture_position.png"
  7903. },
  7904. middle: {
  7905. "top-info": o.HELP_MOBILE_FLOORPLAN_2,
  7906. "big-image": "images/nav_help_gesture_drag_two_finger.png"
  7907. },
  7908. right: {
  7909. "top-info": o.HELP_MOBILE_3,
  7910. "big-image": "images/nav_help_gesture_pinch.png"
  7911. }
  7912. }
  7913. },
  7914. this.assets[a.NAVIGATION][s.OUTDOOR] = JSON.parse(JSON.stringify(this.assets[a.NAVIGATION][s.PANORAMA])),
  7915. this.assets[a.NAVIGATION][s.OUTDOOR].desktop.middle = {
  7916. "top-info": o.HELP_DESKTOP_360_2A,
  7917. "bottom-info": o.HELP_DESKTOP_360_2B,
  7918. "big-image": "images/nav_help_click_inside.png",
  7919. keyboard: "images/nav_help_inside_key.png"
  7920. },
  7921. this.assets[a.NAVIGATION][s.OUTDOOR].mobile.middle = {
  7922. "top-info": o.HELP_MOBILE_360_2,
  7923. "big-image": "images/nav_help_tap_inside.png"
  7924. },
  7925. this.assets[a.MORE_HELP] = {
  7926. desktop: {
  7927. "more-help-hlr": {
  7928. "top-info": o.HELP_MORE_HLR_A,
  7929. "big-image": "images/nav_help_expand.svg",
  7930. "bottom-info": o.HELP_DESKTOP_MORE_HLR_B
  7931. },
  7932. "more-help-dollhouse": {
  7933. "top-info": o.HELP_MORE_DOLLHOUSE_A,
  7934. "big-image": "images/nav_help_dollhouse.svg",
  7935. "bottom-info": o.HELP_DESKTOP_MORE_DOLLHOUSE_B
  7936. },
  7937. "more-help-floors": {
  7938. "top-info": o.HELP_MORE_FLOORS_A,
  7939. "big-image": "images/nav_help_floor picker.svg",
  7940. "bottom-info": o.HELP_DESKTOP_MORE_FLOORS_B
  7941. },
  7942. "more-help-tag": {
  7943. "top-info": o.HELP_MORE_TAG_A,
  7944. "big-image": "images/nav_help_tag.svg",
  7945. "bottom-info": o.HELP_DESKTOP_MORE_TAG_B
  7946. },
  7947. "more-help-zoom": {
  7948. "top-info": o.HELP_MORE_ZOOM_A,
  7949. "big-image": "images/nav_help_zoom.svg",
  7950. "bottom-info": o.HELP_DESKTOP_MORE_ZOOM_B
  7951. },
  7952. "more-help-tour": {
  7953. "top-info": o.HELP_MORE_TOUR_A,
  7954. "big-image": "images/nav_help_play.png",
  7955. "bottom-info": o.HELP_DESKTOP_MORE_TOUR_B
  7956. },
  7957. "more-help-inside": {
  7958. "top-info": o.HELP_MORE_INSIDE_A,
  7959. "big-image": "images/nav_help_inside.svg",
  7960. "bottom-info": o.HELP_DESKTOP_MORE_INSIDE_B
  7961. },
  7962. "more-help-vr": {
  7963. "top-info": o.HELP_MORE_VR_A,
  7964. "big-image": "images/nav_help_vr.svg",
  7965. "bottom-info": o.HELP_DESKTOP_MORE_VR_B
  7966. },
  7967. "more-help-360": {
  7968. "top-info": o.HELP_MORE_360_A,
  7969. "big-image": "images/nav_help_360.svg",
  7970. "bottom-info": o.HELP_DESKTOP_MORE_360_B
  7971. },
  7972. "more-help-fullscreen": {
  7973. "top-info": o.HELP_MORE_FULLSCREEN_A,
  7974. "big-image": "images/nav_help_fullscreen.svg",
  7975. "bottom-info": o.HELP_DESKTOP_MORE_FULLSCREEN_B
  7976. }
  7977. },
  7978. mobile: {
  7979. "more-help-hlr": {
  7980. "top-info": o.HELP_MORE_HLR_A,
  7981. "big-image": "images/nav_help_expand.svg",
  7982. "bottom-info": o.HELP_DESKTOP_MORE_HLR_B
  7983. },
  7984. "more-help-dollhouse": {
  7985. "top-info": o.HELP_MORE_DOLLHOUSE_A,
  7986. "big-image": "images/nav_help_dollhouse.svg",
  7987. "bottom-info": o.HELP_MOBILE_MORE_DOLLHOUSE_B
  7988. },
  7989. "more-help-floors": {
  7990. "top-info": o.HELP_MORE_FLOORS_A,
  7991. "big-image": "images/nav_help_floor picker.svg",
  7992. "bottom-info": o.HELP_DESKTOP_MORE_FLOORS_B
  7993. },
  7994. "more-help-tag": {
  7995. "top-info": o.HELP_MORE_TAG_A,
  7996. "big-image": "images/nav_help_tag.svg",
  7997. "bottom-info": o.HELP_MOBILE_MORE_TAG_B
  7998. },
  7999. "more-help-tour": {
  8000. "top-info": o.HELP_MORE_TOUR_A,
  8001. "big-image": "images/nav_help_play.png",
  8002. "bottom-info": o.HELP_DESKTOP_MORE_TOUR_B
  8003. },
  8004. "more-help-inside": {
  8005. "top-info": o.HELP_MORE_INSIDE_A,
  8006. "big-image": "images/nav_help_inside.svg",
  8007. "bottom-info": o.HELP_MOBILE_MORE_INSIDE_B
  8008. },
  8009. "more-help-vr": {
  8010. "top-info": o.HELP_MORE_VR_A,
  8011. "big-image": "images/webvr.svg",
  8012. "bottom-info": o.HELP_MOBILE_MORE_VR_B
  8013. },
  8014. "more-help-360": {
  8015. "top-info": o.HELP_MORE_360_A,
  8016. "big-image": "images/nav_help_360.svg",
  8017. "bottom-info": o.HELP_MOBILE_MORE_360_B
  8018. }
  8019. }
  8020. },
  8021. this.assets[a.TOUR_INTERACTION[s.PANORAMA]] = {
  8022. desktop: {
  8023. left: {
  8024. "top-info": o.ROTATE,
  8025. "big-image": "images/nav_help_mouse_drag_left.png",
  8026. keyboard: "images/nav_help_keyboard_left_right.png"
  8027. },
  8028. middle: {
  8029. "top-info": o.MOVE,
  8030. "big-image": "images/nav_help_mouse_click.png",
  8031. keyboard: "images/nav_help_keyboard_up_down.png"
  8032. },
  8033. right: {
  8034. "top-info": o.PLAY,
  8035. "big-image": "images/Desktop-help-play-button.svg",
  8036. keyboard: "images/Desktop-help-spacebar-2.svg"
  8037. }
  8038. },
  8039. mobile: {
  8040. left: {
  8041. "top-info": o.ROTATE,
  8042. "big-image": "images/nav_help_gesture_drag.png"
  8043. },
  8044. middle: {
  8045. "top-info": o.MOVE,
  8046. "big-image": "images/nav_help_gesture_tap.png"
  8047. },
  8048. right: {
  8049. "top-info": o.PLAY,
  8050. "big-image": "images/mobile-help-play-button.svg"
  8051. }
  8052. }
  8053. },
  8054. this.assets[a.TOUR_INTERACTION[s.OUTDOOR]] = JSON.parse(JSON.stringify(this.assets[a.TOUR_INTERACTION[s.PANORAMA]])),
  8055. this.assets[a.TOUR_INTERACTION[s.OUTDOOR]].desktop.middle = this.assets[a.LANDING[s.OUTDOOR]].desktop.middle,
  8056. this.assets[a.TOUR_INTERACTION[s.OUTDOOR]].mobile.middle = this.assets[a.LANDING[s.OUTDOOR]].mobile.middle,
  8057. this.assets[a.TOUR_INTERACTION[s.FLOORPLAN]] = JSON.parse(JSON.stringify(this.assets[a.TOUR_INTERACTION[s.OUTDOOR]])),
  8058. this.assets[a.TOUR_INTERACTION[s.FLOORPLAN]].desktop.left = this.assets[a.LANDING[s.FLOORPLAN]].desktop.left,
  8059. this.assets[a.TOUR_INTERACTION[s.FLOORPLAN]].mobile.left = this.assets[a.LANDING[s.FLOORPLAN]].mobile.left
  8060. }
  8061. },
  8062. fill: function(e, t, i) {
  8063. n.call(this, e, t, i, !0)
  8064. },
  8065. clear: function(e, t, i) {
  8066. n.call(this, e, t, i, !1)
  8067. }
  8068. }
  8069. }
  8070. , {
  8071. "../enum/HelpModalSize": 27,
  8072. "../enum/HelpModalType": 28,
  8073. "../enum/Viewmode": 51,
  8074. "../localization/localize": 108,
  8075. "../util/browser": 182
  8076. }],
  8077. 76: [function(e, t, i) {
  8078. "use strict";
  8079. t.exports = Object.freeze({
  8080. OPENED: "share.open",
  8081. CLOSED: "share.closed",
  8082. LINK_CLICKED: "share.linked"
  8083. })
  8084. }
  8085. , {}],
  8086. 77: [function(e, t, i) {
  8087. "use strict";
  8088. function n(n) {
  8089. function e(e, t) {
  8090. var i = "top=" + (window.screenY + ($("#player").height() - t) / 2) + ",left=" + (window.screenX + ($("#player").width() - e) / 2) + ",width=" + e + ",height=" + t;
  8091. I.emit(l.LINK_CLICKED, {
  8092. channel: n
  8093. }),
  8094. window.open(C[n], "shareWindow", i)
  8095. }
  8096. switch (n) {
  8097. case A.FACEBOOK:
  8098. e(580, 420);
  8099. break;
  8100. case A.TWITTER:
  8101. e(550, 440);
  8102. break;
  8103. case A.MAIL:
  8104. I.emit(l.LINK_CLICKED, {
  8105. channel: "email"
  8106. }),
  8107. window.open(C[n], "_blank");
  8108. break;
  8109. case A.LINKEDIN:
  8110. }
  8111. }
  8112. function r(e) {
  8113. I.emit(l.LINK_CLICKED, {
  8114. channel: "copylink"
  8115. });
  8116. var t = document.createRange();
  8117. t.selectNodeContents(v);
  8118. var i = window.getSelection();
  8119. i.removeAllRanges(),
  8120. i.addRange(t),
  8121. document.execCommand("copy"),
  8122. y.classList.remove("hidden"),
  8123. v.classList.add("highlighted")
  8124. }
  8125. function o(e) {
  8126. e && (e.stopPropagation(),
  8127. e.target === v) || (window.getSelection().removeAllRanges(),
  8128. v.classList.remove("highlighted"),
  8129. y.classList.add("hidden"))
  8130. }
  8131. var a = e("../../util/browser")
  8132. , s = e("../../localization/localize")
  8133. , l = e("./ShareEvents")
  8134. , c = e("../../util/common")
  8135. , h = e("events").EventEmitter
  8136. , u = document.getElementById("sharing")
  8137. , d = document.getElementById("share-modal")
  8138. , p = document.getElementById("share-close")
  8139. , f = document.getElementById("facebook-share")
  8140. , g = document.getElementById("twitter-share")
  8141. , m = document.getElementById("mail-share")
  8142. , v = document.getElementById("share-url-text")
  8143. , y = document.getElementById("copy-success")
  8144. , A = Object.freeze({
  8145. FACEBOOK: "facebook",
  8146. TWITTER: "twitter",
  8147. MAIL: "mail",
  8148. LINKEDIN: "linkedin"
  8149. })
  8150. , C = {};
  8151. C[A.FACEBOOK] = "http://www.facebook.com/sharer.php?u=" + encodeURIComponent(window.location.href + "&utm_source=1") + "&t=",
  8152. C[A.TWITTER] = "http://twitter.com/intent/tweet?text=",
  8153. C[A.MAIL] = "mailto:?subject=";
  8154. var I = {
  8155. init: function(e) {
  8156. var t = encodeURIComponent(s.SHARE_EXPLORE + e + " " + s.SHARE_AT + " ");
  8157. C[A.FACEBOOK] += t + encodeURIComponent(window.location.href + "&utm_source=1"),
  8158. C[A.TWITTER] += t + encodeURIComponent(window.location.href + "&utm_source=2 " + s.SHARE_WITH + " #port"),
  8159. C[A.MAIL] += encodeURIComponent(s.SHARE_EXPLORE + e + s.SHARE_3D) + "&body=" + t + encodeURIComponent(window.location.href + "&utm_source=3"),
  8160. u.addEventListener("click", this.toggle.bind(this)),
  8161. p.addEventListener("click", this.hide.bind(this)),
  8162. v.addEventListener("click", r),
  8163. d.addEventListener("click", o),
  8164. f.addEventListener("click", n.bind(this, A.FACEBOOK)),
  8165. g.addEventListener("click", n.bind(this, A.TWITTER)),
  8166. m.addEventListener("click", n.bind(this, A.MAIL)),
  8167. v.textContent = window.location.href + "&utm_source=4",
  8168. d.classList.add(a.isMobile() ? "mobile" : "desktop"),
  8169. u.classList.remove("hidden")
  8170. },
  8171. show: function() {
  8172. this.emit(l.OPENED),
  8173. d.classList.add("fadeIn")
  8174. },
  8175. hide: function() {
  8176. d.classList.contains("fadeIn") && (this.emit(l.CLOSED),
  8177. document.selection && document.selection.empty(),
  8178. window.getSelection().removeAllRanges(),
  8179. o(),
  8180. d.classList.remove("fadeIn"))
  8181. },
  8182. toggle: function() {
  8183. d.classList.contains("fadeIn") ? this.hide() : this.show()
  8184. }
  8185. };
  8186. c.extendObject(I, h.prototype),
  8187. t.exports = I
  8188. }
  8189. , {
  8190. "../../localization/localize": 108,
  8191. "../../util/browser": 182,
  8192. "../../util/common": 185,
  8193. "./ShareEvents": 76,
  8194. events: 202
  8195. }],
  8196. 78: [function(e, t, i) {
  8197. "use strict";
  8198. t.exports = Object.freeze({
  8199. OPENED: "terms.opened",
  8200. CLOSED: "terms.closed"
  8201. })
  8202. }
  8203. , {}],
  8204. 79: [function(e, t, i) {
  8205. "use strict";
  8206. var n = e("./TermsEvent")
  8207. , r = e("../../localization/localize")
  8208. , o = e("../../analytics")
  8209. , a = e("../../util/ajax")
  8210. , s = e("../../util/common")
  8211. , l = e("events").EventEmitter
  8212. , c = document.getElementById("terms-modal")
  8213. , h = {
  8214. init: function() {
  8215. $(".footer-terms").on("click", function(e) {
  8216. e.preventDefault(),
  8217. this.show()
  8218. }
  8219. .bind(this)),
  8220. $("#terms-modal .close").on("click", this.hide.bind(this))
  8221. },
  8222. show: function() {
  8223. this.emit(n.OPENED),
  8224. a.get("static/" + r.TERMS_TEXT_FILE).done(function(e) {
  8225. var t = $("#terms-text").html(e);
  8226. o.track("showcase_gui", {
  8227. gui_action: "click_terms_button",
  8228. interaction_source: "gui"
  8229. }),
  8230. t.find("a").attr("target", "_blank")
  8231. }).fail(function() {
  8232. $("#terms-text").html("<h1>" + r.TERMS_OF_USE + "</h1><p>" + r.TERMS_FAIL)
  8233. }),
  8234. c.classList.add("fadeIn")
  8235. },
  8236. hide: function(e) {
  8237. e && e.preventDefault(),
  8238. c.classList.contains("fadeIn") && this.emit(n.CLOSED),
  8239. c.classList.remove("fadeIn")
  8240. }
  8241. };
  8242. s.extendObject(h, l.prototype),
  8243. t.exports = h
  8244. }
  8245. , {
  8246. "../../analytics": 4,
  8247. "../../localization/localize": 108,
  8248. "../../util/ajax": 181,
  8249. "../../util/common": 185,
  8250. "./TermsEvent": 78,
  8251. events: 202
  8252. }],
  8253. 80: [function(e, t, i) {
  8254. "use strict";
  8255. t.exports = Object.freeze({
  8256. OPEN_INFO: "title.open.info",
  8257. CLOSE_INFO: "title.close.info",
  8258. SHOW_INFO: "title.show.info",
  8259. HIDE_INFO: "title.hide.info",
  8260. LINK_CLICKED: "title.link.click",
  8261. CONTACT_LINK_CLICKED: "title.contact.click",
  8262. ORIGIN_LINK_CLICKED: "title.origin.click"
  8263. })
  8264. }
  8265. , {}],
  8266. 81: [function(e, t, i) {
  8267. "use strict";
  8268. var o = e("../../settings");
  8269. t.exports.init = function(e, t) {
  8270. o.tags.enabled && 0 !== Object.keys(e.tags).length && function(t, i) {
  8271. function e(e) {
  8272. t.shouldShowtags = "show" === this.value,
  8273. t.shouldShowtags ? i.showAlltags(o.tags.startup.fadeInDuration) : i.hideAlltags(o.tags.startup.fadeInDuration)
  8274. }
  8275. document.getElementById("tag-toggles").classList.remove("hidden"),
  8276. document.getElementById("radio-tag-show").checked = !0;
  8277. for (var n = document.getElementById("tag-inputs").querySelectorAll("input"), r = 0; r < n.length; r++)
  8278. n[r].addEventListener("change", e)
  8279. }(e, t)
  8280. }
  8281. }
  8282. , {
  8283. "../../settings": 166
  8284. }],
  8285. 82: [function(S, M, e) {
  8286. (function(e) {
  8287. "use strict";
  8288. function i(e) {
  8289. return !(!e || l.inIframe() && document.referrer === e || (E.classList.remove("hidden"),
  8290. _.innerHTML = r.WEBVR_LEARN_MORE + ": ",
  8291. _.appendChild(function(e) {
  8292. var t = document.createElement("a");
  8293. return t.id = "url",
  8294. t.target = "_blank",
  8295. t.href = e,
  8296. t.innerText = e,
  8297. t.addEventListener("click", x.emit.bind(x, a.ORIGIN_LINK_CLICKED)),
  8298. t
  8299. }(e)),
  8300. b.forEach(function(e) {
  8301. e.classList.add("share-link")
  8302. }),
  8303. 0))
  8304. }
  8305. function s(e, t) {
  8306. var i = e
  8307. , n = t;
  8308. return function(e, t) {
  8309. i.push(t || n, e)
  8310. }
  8311. }
  8312. var l = S("../../util/browser")
  8313. , t = S("../../util/common")
  8314. , n = S("../../util/logger")
  8315. , r = S("../../localization/localize")
  8316. , o = S("./titleBarSettings")
  8317. , c = S("../../settings")
  8318. , a = S("./TitleEvents")
  8319. , h = S("events").EventEmitter
  8320. , u = new n(e)
  8321. , d = document.querySelector(".pinTop.left")
  8322. , p = document.getElementsByClassName("title-container")[0]
  8323. , f = document.getElementById("title-toggle").querySelector("i")
  8324. , g = document.getElementById("meta-info-wrapper")
  8325. , m = document.getElementById("meta-info")
  8326. , v = document.getElementById("meta-description")
  8327. , y = document.getElementsByClassName("contact-info")[0]
  8328. , A = document.getElementById("contact-data")
  8329. , C = document.getElementById("addressTxt")
  8330. , I = document.getElementById("tag-toggles")
  8331. , E = document.getElementById("share-origin")
  8332. , _ = document.getElementById("share-link-wrapper")
  8333. , b = [m, g, p]
  8334. , w = !1
  8335. , T = !1
  8336. , x = {
  8337. populate: function(e) {
  8338. if (function(e, t) {
  8339. return e && l.valueFromHash("title", 1) && 2 !== l.valueFromHash("mls", 0) ? (document.getElementsByClassName("titleText")[0].innerText = e,
  8340. (g_weixinObj.title = e).length > o.minTooltipCharacters && p.parentElement.setAttribute("data-original-title", e),
  8341. t && 1 !== c.specialEdition && c.brand && !c.mls ? document.getElementById("cobrandTitle").innerText = t : (document.getElementsByClassName("co-brand")[0].classList.add("hidden"),
  8342. document.getElementById("gui-name").classList.add("noCoBrand"),
  8343. document.getElementById("cobrandTitle").classList.add("hidden")),
  8344. !0) : (document.getElementById("model-title").classList.add("hidden"),
  8345. !1)
  8346. }(DATA.name, e.coBrand)) {
  8347. if (function(e) {
  8348. e ? (w = !0,
  8349. v.innerHTML = e) : v.classList.add("hidden")
  8350. }(e.description),
  8351. function(e, t, i, n) {
  8352. if ((e || t || i) && c.brand && !l.valueFromHash("mls", !1)) {
  8353. w = !0;
  8354. var r = []
  8355. , o = s(r, "<br>");
  8356. if (e && o('<span id="contactName">' + e + "</span>"),
  8357. t) {
  8358. var a = n || t;
  8359. o(l.isMobile() ? '<a id="phone" href="callto:' + t + '">' + a + "</a>" : "<span>" + a + "</span>")
  8360. }
  8361. i && o('<a id="email" href="mailTo:' + i + '">' + i + "</a>"),
  8362. r[0] = "",
  8363. A.innerHTML = r.join("")
  8364. } else
  8365. y.classList.add("hidden")
  8366. }(e.contactName, e.phone, e.email, e.formatted_contact_phone),
  8367. function(e) {
  8368. if ("string" == typeof e)
  8369. try {
  8370. e = JSON.parse(e)
  8371. } catch (e) {
  8372. return u.warn("Unable to parse address data"),
  8373. C.parentElement.classList.add("hidden")
  8374. }
  8375. if (e && (e.address_1 || e.address_2 || e.city || e.state || e.zip)) {
  8376. w = !0;
  8377. var t = []
  8378. , i = s(t, " ");
  8379. e.address_1 && i(e.address_1),
  8380. e.address_2 && i(e.address_2),
  8381. e.city && i(e.city, ", "),
  8382. e.state && i(e.state, ", "),
  8383. e.zip && i(e.zip, e.state ? " " : ", "),
  8384. t[0] = "",
  8385. C.innerText = t.join("")
  8386. } else
  8387. C.parentElement.classList.add("hidden")
  8388. }(e.address),
  8389. w) {
  8390. var t = document.createElement("br");
  8391. I.insertBefore(t, I.firstElementChild)
  8392. }
  8393. e.socialSharing && c.share.enabled && (T = i(e.url))
  8394. }
  8395. },
  8396. finishSetup: function(e) {
  8397. w = w || !!e,
  8398. document.getElementById("title-toggle").addEventListener("click", x.toggleTitle.bind(x)),
  8399. w && p.addEventListener("click", x.toggleMeta.bind(x, !1)),
  8400. [].slice.call(v.querySelectorAll("a")).forEach(function(e) {
  8401. e.addEventListener("click", x.emit.bind(x, a.LINK_CLICKED))
  8402. }),
  8403. [].slice.call(y.querySelectorAll("a")).forEach(function(e) {
  8404. e.addEventListener("click", x.emit.bind(x, a.CONTACT_LINK_CLICKED, {
  8405. contact_type: e.getAttribute("id")
  8406. }))
  8407. }),
  8408. w || (T ? p.classList.add("share-only") : p.classList.add("no-meta"))
  8409. },
  8410. toggleMeta: function(e, t) {
  8411. var i = document.getElementById("model-title");
  8412. t && t.preventDefault();
  8413. var n = m.classList.contains("expand");
  8414. e && !n || (n ? (b.forEach(function(e) {
  8415. e.classList.remove("expand")
  8416. }),
  8417. this.emit(a.CLOSE_INFO),
  8418. i.classList.remove("expand")) : (b.forEach(function(e) {
  8419. e.classList.add("expand")
  8420. }),
  8421. i.classList.add("expand"),
  8422. this.emit(a.OPEN_INFO)))
  8423. },
  8424. setupToggling: function() {
  8425. g.style.height = m.offsetHeight + "px",
  8426. m.addEventListener("transitionend", function() {
  8427. g.style.height = m.offsetHeight + "px"
  8428. })
  8429. },
  8430. toggleTitle: function(e) {
  8431. e && e.preventDefault(),
  8432. d.classList.contains("closed") ? (d.classList.add("open"),
  8433. f.classList.remove("icon-dpad-right"),
  8434. f.classList.add("icon-dpad-left"),
  8435. this.emit(a.SHOW_INFO),
  8436. setTimeout(function() {
  8437. d.classList.remove("closed"),
  8438. d.classList.remove("open")
  8439. }, o.removeAnimationClasses)) : (d.classList.add("closed"),
  8440. f.classList.remove("icon-dpad-left"),
  8441. f.classList.add("icon-dpad-right"),
  8442. this.emit(a.HIDE_INFO))
  8443. }
  8444. };
  8445. t.extendObject(x, h.prototype),
  8446. M.exports = x
  8447. }
  8448. ).call(this, "/js/gui/title/titleBar.js")
  8449. }
  8450. , {
  8451. "../../localization/localize": 108,
  8452. "../../settings": 166,
  8453. "../../util/browser": 182,
  8454. "../../util/common": 185,
  8455. "../../util/logger": 189,
  8456. "./TitleEvents": 80,
  8457. "./titleBarSettings": 83,
  8458. events: 202
  8459. }],
  8460. 83: [function(e, t, i) {
  8461. "use strict";
  8462. t.exports = Object.freeze({
  8463. minTooltipCharacters: 19,
  8464. removeAnimationClasses: 500
  8465. })
  8466. }
  8467. , {}],
  8468. 84: [function(e, t, i) {
  8469. "use strict";
  8470. function n() {
  8471. //v.playTourNearBy(),
  8472. v.playTour(),
  8473. y && clearTimeout(y),
  8474. c(),
  8475. E.removeClass("fadeIn")
  8476. }
  8477. function r() {
  8478. A.classList.contains("playing") && (v.stopTour(),
  8479. E.addClass("fadeIn"),
  8480. setTimeout(function() {
  8481. E.removeClass("fadeIn")
  8482. }, h.tourInteraction.showPauseButton),
  8483. M || (clearTimeout(y),
  8484. y = setTimeout(s, h.tourInteraction.showModal)),
  8485. setTimeout(function() {
  8486. A.classList.remove("playing")
  8487. }, h.tourInteraction.allowNextClick))
  8488. }
  8489. function o() {
  8490. v.tourInProgress && (v.stopTour(),
  8491. v.endTourProgress(),
  8492. A.classList.remove("playing"))
  8493. }
  8494. function a() {
  8495. _.is(":visible") ? n() : r()
  8496. }
  8497. function s() {//去掉导览结束时的提示
  8498. /* if (!h.tourInteraction.disabled) {
  8499. T.removeClass("small landing " + d.FLOORPLAN + " " + d.OUTDOOR + " " + d.PANORAMA),
  8500. T.addClass("fadeIn tour " + p.deviceType);
  8501. var e, t = h.tourInteraction.smallModal ? m.SMALL : m.LARGE;
  8502. if (!h.tourInteraction.smallModal)
  8503. 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,
  8504. p.fill(x, g.TOUR_INTERACTION[e]),
  8505. T.addClass(e);
  8506. T.addClass(t)
  8507. } */
  8508. }
  8509. function l(e, t) {
  8510. if (t) {
  8511. if($.contains($('.toolRight')[0],t.target))return //add 防止编辑时input 空格开始导览
  8512. var i = "keydown" === t.type
  8513. , n = t.which === u.SPACE || v.tourIsPlaying;
  8514. i && n || e || (M = !0),
  8515. v.atEndOfTour() && c(),
  8516. !v.tourIsPlaying && v.tourInProgress && (E.removeClass("fadeIn"),
  8517. c(),
  8518. t.which !== u.SPACE && o()),
  8519. i && n && a()
  8520. }
  8521. }
  8522. function c() {
  8523. T.removeClass("fadeIn")
  8524. }
  8525. var h = (e("../util/browser"),
  8526. e("../settings"))
  8527. , u = e("../enum/Keys")
  8528. , d = e("../enum/Viewmode")
  8529. , p = (e("./helpManager"),
  8530. e("./populateModal"))
  8531. , f = e("../enum/DirectorEvents")
  8532. , g = e("../enum/HelpModalType")
  8533. , m = e("../enum/HelpModalSize")
  8534. , v = null
  8535. , y = null
  8536. , A = document.getElementById("pause-overlay")
  8537. , C = document.getElementById("player")
  8538. , I = document.getElementById("gui")
  8539. , E = $("#pause-icon").eq(0)
  8540. , _ = $("#play").eq(0)
  8541. , b = $("#playHead").eq(0)
  8542. , w = $(".rightViewContainer, #previous, #next, #gui-modes-inside, #gui-modes-outside, #gui-modes-dollhouse, #gui-modes-floorplan").toArray()
  8543. , T = $("#interaction-modal").eq(0)
  8544. , x = $("#interaction-modal .interaction").toArray()
  8545. , S = ["touchstart", "mousedown", "pointerdown"]
  8546. , M = !1;
  8547. t.exports.init = function(e) {
  8548. v = e,
  8549. S.forEach(function(t) {
  8550. C.addEventListener(t, l.bind(this, !1), !0),
  8551. I.addEventListener(t, l.bind(this, !0), !0),
  8552. A.addEventListener(t, r, !0),
  8553. w.forEach(function(e) {
  8554. e.addEventListener(t, o, !0)
  8555. }),
  8556. $("#drawer img").on(t, o)
  8557. }),
  8558. document.addEventListener("keydown", l.bind(this, !1), !0),
  8559. v.on(f.TourStart, function() {
  8560. A.classList.add("playing")
  8561. })
  8562. }
  8563. ,
  8564. t.exports.play = n,
  8565. t.exports.pause = r,
  8566. t.exports.pauseWithoutCTA = o,
  8567. t.exports.togglePlay = a,
  8568. t.exports.stopTour = function() {
  8569. b.hasClass("playing") && (clearTimeout(y),
  8570. v.atEndOfTour() ? (A.classList.remove("playing"),
  8571. s()) : E.removeClass("fadeIn"))
  8572. }
  8573. ,
  8574. t.exports.dismissModal = c
  8575. }
  8576. , {
  8577. "../enum/DirectorEvents": 23,
  8578. "../enum/HelpModalSize": 27,
  8579. "../enum/HelpModalType": 28,
  8580. "../enum/Keys": 30,
  8581. "../enum/Viewmode": 51,
  8582. "../settings": 166,
  8583. "../util/browser": 182,
  8584. "./helpManager": 68,
  8585. "./populateModal": 75
  8586. }],
  8587. 85: [function(e, t, i) {
  8588. "use strict";
  8589. t.exports = Object.freeze({
  8590. OPENED: "vr.modal.opened",
  8591. LAUNCH: "vr.modal.launch",
  8592. CLOSED: "vr.modal.closed",
  8593. NEXT: "vr.modal.next",
  8594. PREV: "vr.modal.prev",
  8595. STORE: "vr.modal.store",
  8596. falseICECHOSEN: "vr.modal.device"
  8597. })
  8598. }
  8599. , {}],
  8600. 86: [function(e, t, i) {
  8601. "use strict";
  8602. var h = e("../../util/browser")
  8603. , u = e("../../enum/VRApps")
  8604. , n = e("../../enum/VRPlatforms")
  8605. , d = e("../../util/ajax")
  8606. , p = e("../../settings")
  8607. , r = {};
  8608. for (var o in r[u.CardboardAndroid] = "https://play.google.com/store/apps/details?id=com.port.mpvrcardboard&redirect_uri=",
  8609. r[u.CardboardIOS] = "https://itunes.apple.com/us/app/port-vr/id1168808473&redirect_uri=",
  8610. r[u.GearVR] = "https://www.oculus.com/experiences/gear-vr/811670972252145/?redirect_uri=",
  8611. u) {
  8612. var a = u[o];
  8613. r[a] += encodeURIComponent(document.referrer + "&display=" + a)
  8614. }
  8615. var s, f = {}, g = (-1 === (s = window.location.host).indexOf(".port.com") && -1 === s.indexOf("localhost") && (s = "my.port.com"),
  8616. "https://" + s);
  8617. t.exports.init = function(e, t, o) {
  8618. function a(e, t, i, n) {
  8619. function r() {
  8620. return "&utm_medium=" + (h.inIframe() ? "embed" : "direct") + ("&utm_source=" + s) + ("&utm_showcase_session_id=" + o)
  8621. }
  8622. 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()
  8623. }
  8624. var s = h.inIframe() ? encodeURIComponent(document.referrer) : encodeURIComponent(window.location.href)
  8625. , l = g + "/vr/dlist/?ret=" + s
  8626. , c = g + "/vr/show/?ret=" + s;
  8627. switch (e) {
  8628. case n.IOS:
  8629. !function(t, e, i, n) {
  8630. var r = a(t, e, i, n)
  8631. , o = {
  8632. responseType: "json",
  8633. data: {
  8634. branch_key: p.appConfig.branch_key,
  8635. data: {
  8636. m: e,
  8637. full_url: r,
  8638. $desktop_url: "",
  8639. $og_app_id: "331853976762864119",
  8640. $og_title: i,
  8641. $og_description: n,
  8642. $og_image_url: location.origin + "/api/v1/player/models/" + e + "/thumb",
  8643. $canonical_url: window.location.href
  8644. }
  8645. }
  8646. };
  8647. d.post("https://api.branch.io/v1/url", o).done(function(e) {
  8648. f[t] = e.url
  8649. }).fail(function(e) {
  8650. f[t] = e
  8651. }
  8652. .bind(this, r))
  8653. }(u.CardboardIOS, t.sid, t.name, t.summary);
  8654. break;
  8655. default:
  8656. !function(e, t, i) {
  8657. for (var n in u) {
  8658. var r = u[n]
  8659. , o = a(r, e, t, i);
  8660. f[r] = o
  8661. }
  8662. }(t.sid, t.name, t.summary)
  8663. }
  8664. }
  8665. ,
  8666. t.exports.launch = function(e) {
  8667. var t = f[e];
  8668. window.open(t, "_blank")
  8669. }
  8670. ,
  8671. t.exports.launchStore = function(e) {
  8672. var t = r[e];
  8673. window.open(t, "_blank")
  8674. }
  8675. }
  8676. , {
  8677. "../../enum/VRApps": 46,
  8678. "../../enum/VRPlatforms": 49,
  8679. "../../settings": 166,
  8680. "../../util/ajax": 181,
  8681. "../../util/browser": 182
  8682. }],
  8683. 87: [function(e, t, i) {
  8684. "use strict";
  8685. function c(e) {
  8686. var t;
  8687. switch (e) {
  8688. case y.IOS:
  8689. return 9 < (t = g.iosVersion()).major || 9 === t.major && 1 <= t.minor;
  8690. case y.Android:
  8691. return 4 < (t = g.androidVersion()).major || 4 === t.major && 4 < t.minor || 4 === t.major && 4 === t.minor && 4 <= t.patch
  8692. }
  8693. return !1
  8694. }
  8695. function h(e) {
  8696. switch (e) {
  8697. case y.Android:
  8698. x.filter(".cardboard").off().on("click", q.cardboardAndroid),
  8699. x.filter(".gearvr").off().on("click", q.gear),
  8700. n(k, U, "logo-button", "same-line");
  8701. break;
  8702. case y.UnsupportedAndroid:
  8703. n("", H, "", "");
  8704. break;
  8705. case y.IOS:
  8706. x.filter(".cardboard").off().on("click", q.cardboardIOS),
  8707. n(k, "", "logo-button", "");
  8708. break;
  8709. case y.Desktop:
  8710. x.filter(".cardboard").off().on("click", r.bind(this, null, N, B)),
  8711. x.filter(".gearvr").off().on("click", r.bind(this, U, F, null)),
  8712. n(k, U, "logo-button", "same-line"),
  8713. Q.cardboard()
  8714. }
  8715. }
  8716. function u(e) {
  8717. $(".p1, .p2, .p3").hide(),
  8718. l.insertAfter(T),
  8719. w.removeClass("front-page"),
  8720. w.removeClass("details-page"),
  8721. w.removeClass("lastPage"),
  8722. x.removeClass("logo-button"),
  8723. x.removeClass("same-line"),
  8724. T.removeClass("headsetOptions"),
  8725. S.attr("src", ""),
  8726. S.filter(".second").removeClass("gear"),
  8727. S.css("display", "inline-block"),
  8728. S.off(),
  8729. M.filter(".second").css("display", ""),
  8730. O.css("display", "none"),
  8731. $(".p" + (e + 1) + _).show(),
  8732. S.filter(".third").insertBefore(M.filter(".third"))
  8733. }
  8734. function n(e, t, i, n) {
  8735. w.addClass("front-page"),
  8736. S.filter(".first").attr("src", e),
  8737. S.filter(".second").attr("src", t),
  8738. x.filter(".first").addClass(i),
  8739. x.filter(".second").addClass(i),
  8740. x.addClass(n),
  8741. ".show-desktop" === _ && T.insertAfter(l)
  8742. }
  8743. function r(e, t, i) {
  8744. T.addClass("headsetOptions"),
  8745. x.off(),
  8746. S.filter(".second").attr("src", t),
  8747. O.css("display", "block"),
  8748. M.filter(".second").css("display", "none"),
  8749. O.on("click", function() {
  8750. u(b.Title),
  8751. h(y.Desktop)
  8752. }),
  8753. e && (X.emit(C.falseICECHOSEN, {
  8754. name: v.GearVR
  8755. }),
  8756. S.filter(".first").attr("src", e),
  8757. S.filter(".second").addClass("gear"),
  8758. S.filter(".second").on("click", m.launchStore.bind(this, v.GearVR)),
  8759. Q.gearvr()),
  8760. i && (X.emit(C.falseICECHOSEN, {
  8761. name: v.Cardboard
  8762. }),
  8763. S.filter(".third").attr("src", i),
  8764. S.filter(".third").show(),
  8765. S.filter(".third").insertAfter(S.filter(".second")),
  8766. S.filter(".third").addClass("link"),
  8767. S.filter(".second").addClass("link"),
  8768. S.filter(".second").on("click", m.launchStore.bind(this, v.CardboardIOS)),
  8769. S.filter(".third").on("click", m.launchStore.bind(this, v.CardboardAndroid)),
  8770. Q.cardboard())
  8771. }
  8772. function d(e, t) {
  8773. switch (t) {
  8774. case y.IOS:
  8775. j = W,
  8776. Y = G;
  8777. break;
  8778. case y.Desktop:
  8779. e === b.Cardboard ? (j = N,
  8780. Y = B,
  8781. S.filter(".second").on("click", m.launchStore.bind(this, v.CardboardIOS)),
  8782. S.filter(".third").on("click", m.launchStore.bind(this, v.CardboardAndroid))) : (j = F,
  8783. S.filter(".second").on("click", m.launchStore.bind(this, v.GearVR)),
  8784. Y = "");
  8785. break;
  8786. default:
  8787. Y = e === b.Cardboard ? (j = H,
  8788. G) : (j = V,
  8789. z)
  8790. }
  8791. }
  8792. function p(e, t, i) {
  8793. w.find(".inner").addClass("details-page"),
  8794. w.addClass("details-page"),
  8795. S.filter(".first").attr("src", e),
  8796. S.filter(".second").attr("src", t),
  8797. S.filter(".third").attr("src", i)
  8798. }
  8799. function f() {
  8800. var e = 1 < g.aspectRatio() && g.isMobile();
  8801. w.toggleClass("landscape", e).toggleClass("portrait", !e),
  8802. w.toggleClass("tiny", $("#player").height() <= o.narrowLandscapeHeight),
  8803. w.toggleClass("tinier", $("#player").height() <= o.reallyNarrowLandscapeHeight)
  8804. }
  8805. var g = e("../../util/browser")
  8806. , m = e("./vrLink")
  8807. , v = e("../../enum/VRApps")
  8808. , y = e("../../enum/VRPlatforms")
  8809. , A = e("../../enum/VRPages")
  8810. , C = e("./vrEvent")
  8811. , o = (e("../../settings"),
  8812. e("../../constants"))
  8813. , I = e("../../localization/localize")
  8814. , a = e("../../util/common")
  8815. , s = e("events").EventEmitter
  8816. , E = 0
  8817. , _ = null
  8818. , b = A.standard
  8819. , w = $(".vr-popup")
  8820. , l = w.find(".vr-popup-body")
  8821. , T = w.find(".vr-images")
  8822. , x = w.find(".img-container")
  8823. , S = w.find(".vr-sm-image")
  8824. , M = x.find(".vr-img-caption")
  8825. , R = $(".vr-buttons").find(".prev-button")
  8826. , P = $(".vr-buttons").find(".next-button")
  8827. , O = T.find(".front-close")
  8828. , L = $(".vr-page")
  8829. , D = w.find("img")
  8830. , N = "images/apple-store.png"
  8831. , F = "images/badge-oculus.png"
  8832. , B = "images/badge-cardboard.png"
  8833. , V = "images/logo-samsung.png"
  8834. , k = "images/headset-cardboard.png"
  8835. , U = "images/headset-gearvr.png"
  8836. , H = "images/ico-android-robot.png"
  8837. , z = "images/ico-gearvr.png"
  8838. , G = "images/ico-vr.png"
  8839. , W = "images/apple-logo-white.svg"
  8840. , j = null
  8841. , Y = null
  8842. , q = {}
  8843. , X = {
  8844. init: function(e, t) {
  8845. function i(e) {
  8846. X.emit(C.STORE, {
  8847. type: e
  8848. }),
  8849. m.launchStore(e)
  8850. }
  8851. function n(e) {
  8852. switch (e !== b.pageCount && (u(e),
  8853. L.text(e + 1 + " / " + b.pageCount)),
  8854. e) {
  8855. case b.Title:
  8856. R.css("display", "none"),
  8857. P.text(a[e]),
  8858. h(r);
  8859. break;
  8860. case b.Cardboard:
  8861. R.css("display", "block"),
  8862. P.text(a[e]),
  8863. x.filter(".cardboard").off(),
  8864. x.filter(".gearvr").off(),
  8865. d(e, r),
  8866. p(k, j, Y);
  8867. break;
  8868. case b.Gear:
  8869. P.text(a[e]),
  8870. d(e, r),
  8871. w.addClass("lastPage"),
  8872. p(U, j, Y);
  8873. break;
  8874. case b.pageCount:
  8875. w.removeClass("fadeIn"),
  8876. X.emit(C.CLOSED)
  8877. }
  8878. D.filter("[src='']").hide()
  8879. }
  8880. var r = g.detectAndroid() ? g.detectAndroidMobile() && c(y.Android) ? (w.addClass("supported"),
  8881. _ = ".show-supported",
  8882. y.Android) : (w.addClass("unsupported"),
  8883. _ = ".show-unsupported",
  8884. y.UnsupportedAndroid) : g.detectIPhone() || g.detectIPod() ? (w.addClass("ios"),
  8885. _ = ".show-ios",
  8886. b = A.ios,
  8887. y.IOS) : (w.addClass("desktop"),
  8888. _ = ".show-desktop",
  8889. y.Desktop);
  8890. function o(e) {
  8891. X.emit(C.LAUNCH, {
  8892. vr_platform: r,
  8893. vr_app: e
  8894. }),
  8895. m.launch(e)
  8896. }
  8897. m.init(r, e, t),
  8898. r !== y.Desktop && w.addClass("mobile"),
  8899. q.cardboardAndroid = o.bind(this, v.CardboardAndroid),
  8900. q.gear = o.bind(this, v.GearVR),
  8901. q.cardboardIOS = o.bind(this, v.CardboardIOS),
  8902. f(),
  8903. $(".show-supported, .show-unsupported, .show-ios, .show-desktop").hide(),
  8904. $(_).show();
  8905. var a = [I.VR_LEARN_MORE_CAPS, I.VR_NEXT_CAPS, I.VR_GOT_IT_CAPS]
  8906. , s = ["vr_modal_learn_more", "vr_modal_next", "vr_modal_done"];
  8907. r === y.IOS && (a.splice(1, 1),
  8908. s.splice(1, 1)),
  8909. $("#vr").on("click", function(e) {
  8910. e.preventDefault(),
  8911. window.vrEnabled || (window.vrEnabled = !0,
  8912. this.classList.add("active"),
  8913. $("#gui div").not("#vrOff").addClass("vrHide"),
  8914. $("#vrOffImg").css({
  8915. display: "inline-block"
  8916. }))
  8917. }),
  8918. $("#vrOff").on("click", function() {
  8919. window.vrEnabled = !1,
  8920. $("#gui div").not("#vrOff").removeClass("vrHide"),
  8921. $("#vrOffImg").css({
  8922. display: "none"
  8923. }),
  8924. $("#player canvas").css({
  8925. width: "",
  8926. height: ""
  8927. }),
  8928. $("#vr").removeClass("active")
  8929. });
  8930. var l = "https://my.port.com/vr/show/?m=" + e.sid;
  8931. r === y.IOS ? $(".cardboardLink").on("click", i.bind(this, v.CardboardIOS)) : $(".cardboardLink").on("click", i.bind(this, v.CardboardAndroid)),
  8932. $(".gearLink").on("click", i.bind(this, v.GearVR)),
  8933. $("span.modelLink").text(l),
  8934. R.on("click", function(e) {
  8935. X.emit(C.PREV),
  8936. n(--E)
  8937. }),
  8938. P.on("click", function(e) {
  8939. P.text(),
  8940. X.emit(C.NEXT, {
  8941. nextAction: s[E]
  8942. }),
  8943. n(++E)
  8944. }),
  8945. w.find(".close").on("click", X.dismiss)
  8946. },
  8947. dismiss: function() {
  8948. w.hasClass("fadeIn") && (w.removeClass("fadeIn"),
  8949. X.emit(C.CLOSED))
  8950. },
  8951. isDeviceSupported: c
  8952. };
  8953. a.extendObject(X, s.prototype),
  8954. $(window).resize(f);
  8955. var Z, K, Q = (Z = M.filter(".first").find(".cardboard"),
  8956. K = M.filter(".first").find(".gearvr"),
  8957. {
  8958. cardboard: function() {
  8959. K.addClass("hidden"),
  8960. Z.removeClass("hidden")
  8961. },
  8962. gearvr: function() {
  8963. Z.addClass("hidden"),
  8964. K.removeClass("hidden")
  8965. }
  8966. });
  8967. t.exports = X
  8968. }
  8969. , {
  8970. "../../constants": 8,
  8971. "../../enum/VRApps": 46,
  8972. "../../enum/VRPages": 48,
  8973. "../../enum/VRPlatforms": 49,
  8974. "../../localization/localize": 108,
  8975. "../../settings": 166,
  8976. "../../util/browser": 182,
  8977. "../../util/common": 185,
  8978. "./vrEvent": 85,
  8979. "./vrLink": 86,
  8980. events: 202
  8981. }],
  8982. 88: [function(e, t, i) {
  8983. "use strict";
  8984. t.exports = Object.freeze({
  8985. OPENED: "webvr.modal.opened",
  8986. SHOW_TERMS: "webvr.footer.show.terms"
  8987. })
  8988. }
  8989. , {}],
  8990. 89: [function(B, V, e) {
  8991. (function(e) {
  8992. "use strict";
  8993. function a() {
  8994. function t() {
  8995. p.isPresenting || (r.info("exiting webVR"),
  8996. c("webvr_exit_app"),
  8997. -1 === window.location.search.indexOf("&qs=1") ? window.location = window.location + "&qs=1" : window.location = window.location,
  8998. window.removeEventListener("vrdisplaypresentchange", t))
  8999. }
  9000. r.info("Headset mounted"),
  9001. u.suspend();
  9002. var e = document.createElement("canvas");
  9003. for (e.getContext("webgl"),
  9004. e.className = "webvr-canvas",
  9005. document.bgColor = "#000",
  9006. document.body.style.backgroundColor = "#000"; document.body.firstChild; )
  9007. document.body.removeChild(document.body.firstChild);
  9008. document.body.appendChild(e),
  9009. c("webvr_enter_app"),
  9010. p.requestPresent([{
  9011. source: e,
  9012. predistorted: !0
  9013. }]).catch(function(e) {
  9014. r.error("Failed to present: " + e),
  9015. c("webvr_exit_calibrate"),
  9016. t()
  9017. }),
  9018. d.then(function() {
  9019. window.dispatchEvent(new Event("vrapp-start"))
  9020. }),
  9021. window.addEventListener("vrdisplaypresentchange", t)
  9022. }
  9023. function s() {
  9024. c("webvr_modal_close"),
  9025. _.find(".enter-button").off("click", a),
  9026. E.fadeOut(g.guiAnimationSpeed, function() {
  9027. _.toggleClass("hidden", !1),
  9028. b.toggleClass("hidden", !0),
  9029. f.exitFullscreen()
  9030. }),
  9031. I.fadeIn(g.guiAnimationSpeed)
  9032. }
  9033. function t() {
  9034. M.toggleClass("hidden", !0),
  9035. S.toggleClass("hidden", !1)
  9036. }
  9037. function l() {
  9038. _.toggleClass("hidden"),
  9039. b.toggleClass("hidden")
  9040. }
  9041. function c(e) {
  9042. var t = f.isLandscape() ? "landscape" : "portrait";
  9043. i.trackAlways("showcase_gui", {
  9044. gui_action: e,
  9045. orientation: t
  9046. })
  9047. }
  9048. function h() {
  9049. var e = f.isLandscape();
  9050. E.toggleClass("landscape", e).toggleClass("portrait", !e)
  9051. }
  9052. var u, d, p, f = B("../../util/browser"), g = B("../../settings"), m = (B("./../gui"),
  9053. B("../../enum/VRPlatforms")), v = B("../../enum/VRApps"), y = B("./../vr/vrLink"), A = B("./WebVrEvent"), i = B("../../analytics"), C = (B("../../constants"),
  9054. 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 = {
  9055. init: function(e, t, i, n) {
  9056. function r(e) {
  9057. e.preventDefault(),
  9058. o(e.currentTarget.id)
  9059. }
  9060. function o(i) {
  9061. F[i](),
  9062. Object.keys(F).map(function(e, t) {
  9063. $("#" + e).toggleClass("tabs-underlined", e === i)
  9064. })
  9065. }
  9066. p = i,
  9067. u = t,
  9068. y.init(m.Android, e, n),
  9069. h(),
  9070. new RegExp("daydream","i").test(p.displayName) ? (o("tabdaydream"),
  9071. w.filter(".device-headset-side").attr("src", "images/device-daydream-side.png"),
  9072. _.find(".title").text(C.localizeText("WEBVR_FOR_DAYDREAM"))) : (o("tabcardboard"),
  9073. w.filter(".device-headset-side").attr("src", R),
  9074. _.find(".title").text(C.localizeText("WEBVR_FOR_CARDBOARD"))),
  9075. $("#vr").on("click", function(e) {
  9076. e.preventDefault(),
  9077. c("click_webvr_button"),
  9078. E.is(":hidden") && (N.emit(A.OPENED),
  9079. I.fadeOut(g.guiAnimationSpeed),
  9080. E.fadeIn(g.guiAnimationSpeed),
  9081. function() {
  9082. if (!d) {
  9083. var n = "https://static.port.com/webvr/" + (f.valueFromHash("webvr") || g.appConfig.webvr_version) + "/js/main.js";
  9084. d = new Promise(function(e, t) {
  9085. var i = document.createElement("script");
  9086. i.type = "text/javascript",
  9087. i.src = n,
  9088. i.onload = e,
  9089. document.head.appendChild(i)
  9090. }
  9091. )
  9092. }
  9093. _.find(".enter-button").on("click", a)
  9094. }())
  9095. }),
  9096. $(".webvr-popup .close").on("click", function(e) {
  9097. e.preventDefault(),
  9098. _.hasClass("hidden") ? (c("webvr_help_close"),
  9099. l()) : s()
  9100. }),
  9101. $("#tabcardboard").on("click", r),
  9102. $("#tabdaydream").on("click", r),
  9103. $("#tabnative").on("click", r),
  9104. $(".webvr-popup .open-with-app").on("click", function(e) {
  9105. e.preventDefault(),
  9106. c("webvr_learn_more"),
  9107. o("tabnative"),
  9108. l()
  9109. }),
  9110. $(".webvr-popup .help").on("click", function(e) {
  9111. e.preventDefault(),
  9112. c(_.hasClass("hidden") ? "webvr_help_close" : "webvr_help_show"),
  9113. l()
  9114. }),
  9115. $(".webvr-popup .terms").on("click", function(e) {
  9116. e.preventDefault(),
  9117. c("webvr_click_terms"),
  9118. s(),
  9119. N.emit(A.SHOW_TERMS)
  9120. }),
  9121. T.on("click", function(e) {
  9122. e.preventDefault(),
  9123. c(D),
  9124. window.open(L, "_blank")
  9125. }),
  9126. x.on("click", function(e) {
  9127. e.preventDefault(),
  9128. c("webvr_phone_link"),
  9129. window.open("https://vr.google.com/daydream/phones/", "_blank")
  9130. }),
  9131. $(".webvr-popup .badge-cardboard").on("click", function(e) {
  9132. e.preventDefault(),
  9133. c("webvr_cardboard_link"),
  9134. y.launch(v.CardboardAndroid)
  9135. }),
  9136. $(".webvr-popup .badge-oculus").on("click", function(e) {
  9137. e.preventDefault(),
  9138. c("webvr_oculus_link"),
  9139. y.launch(v.GearVR)
  9140. })
  9141. }
  9142. }, F = {
  9143. tabcardboard: function() {
  9144. w.filter(".device-headset").attr("src", R),
  9145. w.filter(".device-phone").attr("src", "images/ico-android-robot.png"),
  9146. L = "https://vr.google.com/cardboard/get-cardboard/",
  9147. D = "webvr_cardboard_link",
  9148. T.text(C.localizeText("VR_GOOGLE_CARDBOARD")),
  9149. x.text(C.localizeText("VR_COMPATIBLE_ANDROID_LONG")),
  9150. $(".webvr-popup .detail.daydream-label").toggleClass("hidden", !0),
  9151. t()
  9152. },
  9153. tabdaydream: function() {
  9154. w.filter(".device-headset").attr("src", "images/device-daydream.png"),
  9155. w.filter(".device-phone").attr("src", "images/device-pixel.png"),
  9156. L = P,
  9157. D = O,
  9158. T.text(C.localizeText("WEBVR_DAYDREAM_VIEW")),
  9159. x.text(C.localizeText("VR_NEED_DAYDREAM_PHONE")),
  9160. $(".webvr-popup .detail.daydream-label").toggleClass("hidden", !1),
  9161. t()
  9162. },
  9163. tabnative: function() {
  9164. w.filter(".badge-cardboard").attr("src", "images/badge-cardboard.png"),
  9165. w.filter(".badge-oculus").attr("src", "images/badge-oculus.png"),
  9166. M.toggleClass("hidden", !1),
  9167. S.toggleClass("hidden", !0)
  9168. }
  9169. };
  9170. n.extendObject(N, o.prototype),
  9171. $(window).resize(h),
  9172. V.exports = N
  9173. }
  9174. ).call(this, "/js/gui/webvr/webVRgui.js")
  9175. }
  9176. , {
  9177. "../../analytics": 4,
  9178. "../../constants": 8,
  9179. "../../enum/VRApps": 46,
  9180. "../../enum/VRPlatforms": 49,
  9181. "../../localization/localize": 108,
  9182. "../../settings": 166,
  9183. "../../util/browser": 182,
  9184. "../../util/common": 185,
  9185. "../../util/logger": 189,
  9186. "./../gui": 65,
  9187. "./../vr/vrLink": 86,
  9188. "./WebVrEvent": 88,
  9189. events: 202
  9190. }],
  9191. 90: [function(e, t, i) {
  9192. "use strict";
  9193. function n(e, t, i, n, r) {
  9194. this.floorId = n || 0 === n ? n : -1,
  9195. this.roomId = r || "",
  9196. this.labelId = e,
  9197. this.position = (new o.Vector3).copy(t),
  9198. this.text = i
  9199. }
  9200. var o = e("three")
  9201. , r = e("../util/browser");
  9202. n.prototype.build = function() {
  9203. var e = window.document.createElement("div");
  9204. r.isMobile() ? e.setAttribute("class", "gui-floorplan-label gui-floorplan-label-mobile") : e.setAttribute("class", "gui-floorplan-label");
  9205. var t = window.document.createElement("div");
  9206. t.setAttribute("class", "gui-floorplan-label-text");
  9207. var i = window.document.createTextNode(this.text);
  9208. t.appendChild(i),
  9209. e.appendChild(t),
  9210. window.document.body.appendChild(e),
  9211. this.labelGui = e,
  9212. this.textBlock = t,
  9213. $(this.labelGui).hide();
  9214. var n = window.getComputedStyle(this.labelGui);
  9215. this.initialTransform = n.transform || n.webkitTransform
  9216. }
  9217. ,
  9218. t.exports = n
  9219. }
  9220. , {
  9221. "../util/browser": 182,
  9222. three: 217
  9223. }],
  9224. 91: [function(e, t, i) {
  9225. "use strict";
  9226. function n() {
  9227. this.player = null,
  9228. this.modelManager = null,
  9229. this.container = null
  9230. }
  9231. var c, o, r = e("three"), a = (e("../util/common"),
  9232. e("../enum/PlayerEvents")), s = (e("../enum/DirectorEvents"),
  9233. e("../enum/ModelManagerEvents")), l = e("../settings"), h = e("../enum/Viewmode"), u = (e("../enum/WarpStyle"),
  9234. e("../util/transitions"),
  9235. e("../util/lerp"),
  9236. e("../util/browser"));
  9237. n.prototype.init = function(e, t, i) {
  9238. this.player = e,
  9239. this.modelManager = t,
  9240. this.container = i,
  9241. this.updateModel(),
  9242. this.bindEvents()
  9243. }
  9244. ,
  9245. n.prototype.bindEvents = function() {
  9246. this.modelManager.on(s.ActiveModelChanged, this.updateModel.bind(this)),
  9247. this.player.on(a.ViewChanged, this.handlePlayerViewChanged.bind(this)),
  9248. this.player.on(a.ModeChanged, this.handlePlayerViewChanged.bind(this)),
  9249. this.player.on(a.StartInside, this.handleStartInside.bind(this)),
  9250. this.player.on(a.StartOutside, this.handleStartOutside.bind(this))
  9251. }
  9252. ,
  9253. n.prototype.updateModel = function() {
  9254. this.model = this.modelManager.getActiveModel()
  9255. }
  9256. ,
  9257. n.prototype.handlePlayerViewChanged = function() {
  9258. this.updateLabelVisibility(),
  9259. this.updateLabelDisplay()
  9260. }
  9261. ,
  9262. n.prototype.getLabelsForFloor = function(t, i) {
  9263. return (i = i || []).length = 0,
  9264. this.model.labels.forEach(function(e) {
  9265. this.labelVisibleForFloor(e, t) && i.push(e)
  9266. }
  9267. .bind(this)),
  9268. i
  9269. }
  9270. ,
  9271. n.prototype.getLabelsForCurrentFloor = function(e) {
  9272. return this.getLabelsForFloor(this.model.currentFloor.floorIndex, e)
  9273. }
  9274. ,
  9275. n.prototype.labelVisibleForFloor = function(e, t) {
  9276. var i = u.isMobile() && this.player.getLabelScaleFactor() < l.labels.zoomHideThreshhold.mobile || !u.isMobile() && this.player.getLabelScaleFactor() < l.labels.zoomHideThreshhold.desktop;
  9277. if (!this.model.showingLabels || !e.labelGui || !i)
  9278. return !1;
  9279. var n = e.floorId === this.model.floors.size() - 1;
  9280. return this.model.allFloorsVisible ? n : e.floorId === t
  9281. }
  9282. ,
  9283. n.prototype.updateLabelVisibility = function(e) {
  9284. this.model.labels.forEach(function(e) {
  9285. 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)
  9286. }
  9287. .bind(this))
  9288. }
  9289. ,
  9290. n.prototype.showAllLabels = function(t, i) {
  9291. this.model.labels.forEach(function(e) {
  9292. this.showLabel(e, t, i)
  9293. }
  9294. .bind(this))
  9295. }
  9296. ,
  9297. n.prototype.hideAllLabels = function(t, i) {
  9298. this.model.labels.forEach(function(e) {
  9299. this.hideLabel(e, t, i)
  9300. }
  9301. .bind(this))
  9302. }
  9303. ,
  9304. n.prototype.showLabel = function(e, t, i) {
  9305. this.model.showingLabels && (e.visible || (e.visible = !0,
  9306. e.labelGui.style.display = "block",
  9307. e.labelGui.style.opacity = 0,
  9308. $(e.labelGui).delay(t).fadeTo(i, 1)))
  9309. }
  9310. ,
  9311. n.prototype.hideLabel = function(e, t, i) {
  9312. e.visible && (e.visible = !1,
  9313. u.isMobile() ? $(e.labelGui).hide() : $(e.labelGui).delay(t).fadeOut(i))
  9314. }
  9315. ,
  9316. n.prototype.supportedMode = function() {
  9317. return this.player.mode === h.FLOORPLAN
  9318. }
  9319. ,
  9320. n.prototype.updateLabelDisplay = (new r.Vector3,
  9321. new r.Vector3,
  9322. o = [],
  9323. function() {
  9324. var e = this.player.getLabelScaleFactor()
  9325. , t = 1.2 * (1 - e) + .6
  9326. , i = u.isMobile() ? l.labels.zoomTruncateThreshhold.mobile : l.labels.zoomTruncateThreshhold.desktop;
  9327. this.getLabelsForCurrentFloor(o);
  9328. for (var n = 0; n < o.length; n++) {
  9329. var r = o[n];
  9330. this.supportedMode() && r.labelGui && (this.updateProjectedGuiElement(r.labelGui, r.textBlock, r.position, t, t),
  9331. 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)
  9332. }
  9333. }
  9334. ),
  9335. n.prototype.updateProjectedGuiElement = (c = new r.Vector3,
  9336. new r.Vector3,
  9337. function(e, t, i, n, r) {
  9338. t.style.fontSize = 100 * r + "%";
  9339. var o = .5 * $("#player").width()
  9340. , a = .5 * $("#player").height();
  9341. c.copy(i),
  9342. c.project(this.player.camera);
  9343. var s = c.x * o + o
  9344. , l = -c.y * a + a;
  9345. s -= e.offsetWidth / 2,
  9346. l -= e.offsetHeight / 2,
  9347. e.style.left = s + "px",
  9348. e.style.top = l + "px"
  9349. }
  9350. ),
  9351. n.prototype.handleStartInside = function(e) {
  9352. this.updateLabelVisibility()
  9353. }
  9354. ,
  9355. n.prototype.handleStartOutside = function() {
  9356. this.updateLabelVisibility()
  9357. }
  9358. ,
  9359. t.exports = n
  9360. }
  9361. , {
  9362. "../enum/DirectorEvents": 23,
  9363. "../enum/ModelManagerEvents": 33,
  9364. "../enum/PlayerEvents": 40,
  9365. "../enum/Viewmode": 51,
  9366. "../enum/WarpStyle": 52,
  9367. "../settings": 166,
  9368. "../util/browser": 182,
  9369. "../util/common": 185,
  9370. "../util/lerp": 188,
  9371. "../util/transitions": 195,
  9372. three: 217
  9373. }],
  9374. 92: [function(e, t, i) {
  9375. "use strict";
  9376. Array.prototype.findIndex || (Array.prototype.findIndex = function(e) {
  9377. if (null == this)
  9378. throw new TypeError("Array.prototype.findIndex called on null or undefined");
  9379. if ("function" != typeof e)
  9380. throw new TypeError("predicate must be a function");
  9381. for (var t, i = Object(this), n = i.length >>> 0, r = arguments[1], o = 0; o < n; o++)
  9382. if (t = i[o],
  9383. e.call(r, t, o, i))
  9384. return o;
  9385. return -1
  9386. }
  9387. ),
  9388. Array.prototype.find || Object.defineProperty(Array.prototype, "find", {
  9389. value: function(e) {
  9390. if (null == this)
  9391. throw new TypeError('"this" is null or not defined');
  9392. var t = Object(this)
  9393. , i = t.length >>> 0;
  9394. if ("function" != typeof e)
  9395. throw new TypeError("predicate must be a function");
  9396. for (var n = arguments[1], r = 0; r < i; ) {
  9397. var o = t[r];
  9398. if (e.call(n, o, r, t))
  9399. return o;
  9400. r++
  9401. }
  9402. }
  9403. })
  9404. }
  9405. , {}],
  9406. 93: [function(e, t, i) {
  9407. "use strict";
  9408. 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 || {};
  9409. function te() {
  9410. this.backgroundElement = document.createElement("div"),
  9411. r.extend(this.backgroundElement.style, {
  9412. backgroundColor: "rgba(0,0,0,0.8)",
  9413. top: 0,
  9414. left: 0,
  9415. display: "none",
  9416. zIndex: "1000",
  9417. opacity: 0,
  9418. WebkitTransition: "opacity 0.2s linear"
  9419. }),
  9420. n.makeFullscreen(this.backgroundElement),
  9421. this.backgroundElement.style.position = "fixed",
  9422. this.domElement = document.createElement("div"),
  9423. r.extend(this.domElement.style, {
  9424. position: "fixed",
  9425. display: "none",
  9426. zIndex: "1001",
  9427. opacity: 0,
  9428. WebkitTransition: "-webkit-transform 0.2s ease-out, opacity 0.2s linear"
  9429. }),
  9430. document.body.appendChild(this.backgroundElement),
  9431. document.body.appendChild(this.domElement);
  9432. var e = this;
  9433. n.bind(this.backgroundElement, "click", function() {
  9434. e.hide()
  9435. })
  9436. }
  9437. function ie(e, t, i) {
  9438. Object.defineProperty(e, t, {
  9439. get: function() {
  9440. return "RGB" === this.__state.space || re(this, t, i),
  9441. this.__state[t]
  9442. },
  9443. set: function(e) {
  9444. "RGB" !== this.__state.space && (re(this, t, i),
  9445. this.__state.space = "RGB"),
  9446. this.__state[t] = e
  9447. }
  9448. })
  9449. }
  9450. function ne(e, t) {
  9451. Object.defineProperty(e, t, {
  9452. get: function() {
  9453. return "HSV" === this.__state.space || oe(this),
  9454. this.__state[t]
  9455. },
  9456. set: function(e) {
  9457. "HSV" !== this.__state.space && (oe(this),
  9458. this.__state.space = "HSV"),
  9459. this.__state[t] = e
  9460. }
  9461. })
  9462. }
  9463. function re(e, t, i) {
  9464. if ("HEX" === e.__state.space)
  9465. e.__state[t] = a.component_from_hex(e.__state.hex, i);
  9466. else {
  9467. if ("HSV" !== e.__state.space)
  9468. throw "Corrupted color state";
  9469. l.extend(e.__state, a.hsv_to_rgb(e.__state.h, e.__state.s, e.__state.v))
  9470. }
  9471. }
  9472. function oe(e) {
  9473. var t = a.rgb_to_hsv(e.r, e.g, e.b);
  9474. l.extend(e.__state, {
  9475. s: t.s,
  9476. v: t.v
  9477. }),
  9478. l.isNaN(t.h) ? l.isUndefined(e.__state.h) && (e.__state.h = 0) : e.__state.h = t.h
  9479. }
  9480. function ae() {
  9481. if (this.__state = o.apply(this, arguments),
  9482. !1 === this.__state)
  9483. throw "Failed to interpret color arguments";
  9484. this.__state.a = this.__state.a || 1
  9485. }
  9486. function se(e) {
  9487. return -1 < (e = e.toString()).indexOf(".") ? e.length - e.indexOf(".") - 1 : 0
  9488. }
  9489. function le(e, t) {
  9490. this.initialValue = e[t],
  9491. this.domElement = document.createElement("div"),
  9492. this.object = e,
  9493. this.property = t,
  9494. this.__onChange = void 0,
  9495. this.__onFinishChange = void 0
  9496. }
  9497. (t.exports = ee).gui = ee.gui || {},
  9498. ee.utils = ee.utils || {},
  9499. ee.controllers = ee.controllers || {},
  9500. ee.dom = ee.dom || {},
  9501. ee.color = ee.color || {},
  9502. ee.utils.css = {
  9503. load: function(e, t) {
  9504. var i = (t = t || document).createElement("link");
  9505. i.type = "text/css",
  9506. i.rel = "stylesheet",
  9507. i.href = e,
  9508. t.getElementsByTagName("head")[0].appendChild(i)
  9509. },
  9510. inject: function(e, t) {
  9511. t = t || document;
  9512. var i = document.createElement("style");
  9513. i.type = "text/css",
  9514. i.innerHTML = e,
  9515. t.getElementsByTagName("head")[0].appendChild(i)
  9516. }
  9517. },
  9518. ee.utils.common = (Q = Array.prototype.forEach,
  9519. J = Array.prototype.slice,
  9520. {
  9521. BREAK: {},
  9522. extend: function(i) {
  9523. return this.each(J.call(arguments, 1), function(e) {
  9524. for (var t in e)
  9525. this.isUndefined(e[t]) || (i[t] = e[t])
  9526. }, this),
  9527. i
  9528. },
  9529. defaults: function(i) {
  9530. return this.each(J.call(arguments, 1), function(e) {
  9531. for (var t in e)
  9532. this.isUndefined(i[t]) && (i[t] = e[t])
  9533. }, this),
  9534. i
  9535. },
  9536. compose: function() {
  9537. var i = J.call(arguments);
  9538. return function() {
  9539. for (var e = J.call(arguments), t = i.length - 1; 0 <= t; t--)
  9540. e = [i[t].apply(this, e)];
  9541. return e[0]
  9542. }
  9543. },
  9544. each: function(e, t, i) {
  9545. if (e)
  9546. if (Q && e.forEach && e.forEach === Q)
  9547. e.forEach(t, i);
  9548. else if (e.length === e.length + 0) {
  9549. for (var n = 0, r = e.length; n < r; n++)
  9550. if (n in e && t.call(i, e[n], n) === this.BREAK)
  9551. return
  9552. } else
  9553. for (var n in e)
  9554. if (t.call(i, e[n], n) === this.BREAK)
  9555. return
  9556. },
  9557. defer: function(e) {
  9558. setTimeout(e, 0)
  9559. },
  9560. toArray: function(e) {
  9561. return e.toArray ? e.toArray() : J.call(e)
  9562. },
  9563. isUndefined: function(e) {
  9564. return void 0 === e
  9565. },
  9566. isNull: function(e) {
  9567. return null === e
  9568. },
  9569. isNaN: function(e) {
  9570. return e != e
  9571. },
  9572. isArray: Array.isArray || function(e) {
  9573. return e.constructor === Array
  9574. }
  9575. ,
  9576. isObject: function(e) {
  9577. return e === Object(e)
  9578. },
  9579. isNumber: function(e) {
  9580. return e === e + 0
  9581. },
  9582. isString: function(e) {
  9583. return e === e + ""
  9584. },
  9585. isBoolean: function(e) {
  9586. return !1 === e || !0 === e
  9587. },
  9588. isFunction: function(e) {
  9589. return "[object Function]" === Object.prototype.toString.call(e)
  9590. }
  9591. }),
  9592. ee.controllers.Controller = (ee.utils.common.extend(le.prototype, {
  9593. onChange: function(e) {
  9594. return this.__onChange = e,
  9595. this
  9596. },
  9597. onFinishChange: function(e) {
  9598. return this.__onFinishChange = e,
  9599. this
  9600. },
  9601. setValue: function(e) {
  9602. return this.object[this.property] = e,
  9603. this.__onChange && this.__onChange.call(this, e),
  9604. this.updateDisplay(),
  9605. this
  9606. },
  9607. getValue: function() {
  9608. return this.object[this.property]
  9609. },
  9610. updateDisplay: function() {
  9611. return this
  9612. },
  9613. isModified: function() {
  9614. return this.initialValue !== this.getValue()
  9615. }
  9616. }),
  9617. le),
  9618. ee.dom.dom = function(c) {
  9619. function i(e) {
  9620. if ("0" === e || c.isUndefined(e))
  9621. return 0;
  9622. var t = e.match(n);
  9623. return c.isNull(t) ? 0 : parseFloat(t[1])
  9624. }
  9625. var h = {};
  9626. c.each({
  9627. HTMLEvents: ["change"],
  9628. MouseEvents: ["click", "mousemove", "mousedown", "mouseup", "mouseover"],
  9629. KeyboardEvents: ["keydown"]
  9630. }, function(e, t) {
  9631. c.each(e, function(e) {
  9632. h[e] = t
  9633. })
  9634. });
  9635. var n = /(\d+(\.\d+)?)px/
  9636. , r = {
  9637. makeSelectable: function(e, t) {
  9638. void 0 !== e && void 0 !== e.style && (e.onselectstart = t ? function() {
  9639. return !1
  9640. }
  9641. : function() {}
  9642. ,
  9643. e.style.MozUserSelect = t ? "auto" : "none",
  9644. e.style.KhtmlUserSelect = t ? "auto" : "none",
  9645. e.unselectable = t ? "on" : "off")
  9646. },
  9647. makeFullscreen: function(e, t, i) {
  9648. c.isUndefined(t) && (t = !0),
  9649. c.isUndefined(i) && (i = !0),
  9650. e.style.position = "absolute",
  9651. t && (e.style.left = 0,
  9652. e.style.right = 0),
  9653. i && (e.style.top = 0,
  9654. e.style.bottom = 0)
  9655. },
  9656. fakeEvent: function(e, t, i, n) {
  9657. i = i || {};
  9658. var r = h[t];
  9659. if (!r)
  9660. throw new Error("Event type " + t + " not supported.");
  9661. var o = document.createEvent(r);
  9662. switch (r) {
  9663. case "MouseEvents":
  9664. var a = i.x || i.clientX || 0
  9665. , s = i.y || i.clientY || 0;
  9666. o.initMouseEvent(t, i.bubbles || !1, i.cancelable || !0, window, i.clickCount || 1, 0, 0, a, s, !1, !1, !1, !1, 0, null);
  9667. break;
  9668. case "KeyboardEvents":
  9669. var l = o.initKeyboardEvent || o.initKeyEvent;
  9670. c.defaults(i, {
  9671. cancelable: !0,
  9672. ctrlKey: !1,
  9673. altKey: !1,
  9674. shiftKey: !1,
  9675. metaKey: !1,
  9676. keyCode: void 0,
  9677. charCode: void 0
  9678. }),
  9679. l(t, i.bubbles || !1, i.cancelable, window, i.ctrlKey, i.altKey, i.shiftKey, i.metaKey, i.keyCode, i.charCode);
  9680. break;
  9681. default:
  9682. o.initEvent(t, i.bubbles || !1, i.cancelable || !0)
  9683. }
  9684. c.defaults(o, n),
  9685. e.dispatchEvent(o)
  9686. },
  9687. bind: function(e, t, i, n) {
  9688. return n = n || !1,
  9689. e.addEventListener ? e.addEventListener(t, i, n) : e.attachEvent && e.attachEvent("on" + t, i),
  9690. r
  9691. },
  9692. unbind: function(e, t, i, n) {
  9693. return n = n || !1,
  9694. e.removeEventListener ? e.removeEventListener(t, i, n) : e.detachEvent && e.detachEvent("on" + t, i),
  9695. r
  9696. },
  9697. addClass: function(e, t) {
  9698. if (void 0 === e.className)
  9699. e.className = t;
  9700. else if (e.className !== t) {
  9701. var i = e.className.split(/ +/);
  9702. -1 == i.indexOf(t) && (i.push(t),
  9703. e.className = i.join(" ").replace(/^\s+/, "").replace(/\s+$/, ""))
  9704. }
  9705. return r
  9706. },
  9707. removeClass: function(e, t) {
  9708. if (t)
  9709. if (void 0 === e.className)
  9710. ;
  9711. else if (e.className === t)
  9712. e.removeAttribute("class");
  9713. else {
  9714. var i = e.className.split(/ +/)
  9715. , n = i.indexOf(t);
  9716. -1 != n && (i.splice(n, 1),
  9717. e.className = i.join(" "))
  9718. }
  9719. else
  9720. e.className = void 0;
  9721. return r
  9722. },
  9723. hasClass: function(e, t) {
  9724. return new RegExp("(?:^|\\s+)" + t + "(?:\\s+|$)").test(e.className) || !1
  9725. },
  9726. getWidth: function(e) {
  9727. var t = getComputedStyle(e);
  9728. return i(t["border-left-width"]) + i(t["border-right-width"]) + i(t["padding-left"]) + i(t["padding-right"]) + i(t.width)
  9729. },
  9730. getHeight: function(e) {
  9731. var t = getComputedStyle(e);
  9732. return i(t["border-top-width"]) + i(t["border-bottom-width"]) + i(t["padding-top"]) + i(t["padding-bottom"]) + i(t.height)
  9733. },
  9734. getOffset: function(e) {
  9735. var t = {
  9736. left: 0,
  9737. top: 0
  9738. };
  9739. if (e.offsetParent)
  9740. for (; t.left += e.offsetLeft,
  9741. t.top += e.offsetTop,
  9742. e = e.offsetParent; )
  9743. ;
  9744. return t
  9745. },
  9746. isActive: function(e) {
  9747. return e === document.activeElement && (e.type || e.href)
  9748. }
  9749. };
  9750. return r
  9751. }(ee.utils.common),
  9752. ee.controllers.OptionController = (q = ee.controllers.Controller,
  9753. X = ee.dom.dom,
  9754. Z = ee.utils.common,
  9755. (K = function(e, t, i) {
  9756. K.superclass.call(this, e, t);
  9757. var n = this;
  9758. if (this.__select = document.createElement("select"),
  9759. Z.isArray(i)) {
  9760. var r = {};
  9761. Z.each(i, function(e) {
  9762. r[e] = e
  9763. }),
  9764. i = r
  9765. }
  9766. Z.each(i, function(e, t) {
  9767. var i = document.createElement("option");
  9768. i.innerHTML = t,
  9769. i.setAttribute("value", e),
  9770. n.__select.appendChild(i)
  9771. }),
  9772. this.updateDisplay(),
  9773. X.bind(this.__select, "change", function() {
  9774. var e = this.options[this.selectedIndex].value;
  9775. n.setValue(e)
  9776. }),
  9777. this.domElement.appendChild(this.__select)
  9778. }
  9779. ).superclass = q,
  9780. Z.extend(K.prototype, q.prototype, {
  9781. setValue: function(e) {
  9782. var t = K.superclass.prototype.setValue.call(this, e);
  9783. return this.__onFinishChange && this.__onFinishChange.call(this, this.getValue()),
  9784. t
  9785. },
  9786. updateDisplay: function() {
  9787. return this.__select.value = this.getValue(),
  9788. K.superclass.prototype.updateDisplay.call(this)
  9789. }
  9790. }),
  9791. K),
  9792. ee.controllers.NumberController = (W = ee.controllers.Controller,
  9793. j = ee.utils.common,
  9794. (Y = function(e, t, i) {
  9795. Y.superclass.call(this, e, t),
  9796. i = i || {},
  9797. this.__min = i.min,
  9798. this.__max = i.max,
  9799. this.__step = i.step,
  9800. 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,
  9801. this.__precision = se(this.__impliedStep)
  9802. }
  9803. ).superclass = W,
  9804. j.extend(Y.prototype, W.prototype, {
  9805. setValue: function(e) {
  9806. return void 0 !== this.__min && e < this.__min ? e = this.__min : void 0 !== this.__max && e > this.__max && (e = this.__max),
  9807. void 0 !== this.__step && e % this.__step != 0 && (e = Math.round(e / this.__step) * this.__step),
  9808. Y.superclass.prototype.setValue.call(this, e)
  9809. },
  9810. min: function(e) {
  9811. return this.__min = e,
  9812. this
  9813. },
  9814. max: function(e) {
  9815. return this.__max = e,
  9816. this
  9817. },
  9818. step: function(e) {
  9819. return this.__step = e,
  9820. this.__impliedStep = e,
  9821. this.__precision = se(e),
  9822. this
  9823. }
  9824. }),
  9825. Y),
  9826. ee.controllers.NumberControllerBox = (U = ee.controllers.NumberController,
  9827. H = ee.dom.dom,
  9828. z = ee.utils.common,
  9829. (G = function(e, t, i) {
  9830. function n() {
  9831. var e = parseFloat(s.__input.value);
  9832. z.isNaN(e) || s.setValue(e)
  9833. }
  9834. function r(e) {
  9835. var t = a - e.clientY;
  9836. s.setValue(s.getValue() + t * s.__impliedStep),
  9837. a = e.clientY
  9838. }
  9839. function o() {
  9840. H.unbind(window, "mousemove", r),
  9841. H.unbind(window, "mouseup", o)
  9842. }
  9843. this.__truncationSuspended = !1,
  9844. G.superclass.call(this, e, t, i);
  9845. var a, s = this;
  9846. this.__input = document.createElement("input"),
  9847. this.__input.setAttribute("type", "text"),
  9848. H.bind(this.__input, "change", n),
  9849. H.bind(this.__input, "blur", function() {
  9850. n(),
  9851. s.__onFinishChange && s.__onFinishChange.call(s, s.getValue())
  9852. }),
  9853. H.bind(this.__input, "mousedown", function(e) {
  9854. H.bind(window, "mousemove", r),
  9855. H.bind(window, "mouseup", o),
  9856. a = e.clientY
  9857. }),
  9858. H.bind(this.__input, "keydown", function(e) {
  9859. 13 === e.keyCode && (s.__truncationSuspended = !0,
  9860. this.blur(),
  9861. s.__truncationSuspended = !1)
  9862. }),
  9863. this.updateDisplay(),
  9864. this.domElement.appendChild(this.__input)
  9865. }
  9866. ).superclass = U,
  9867. z.extend(G.prototype, U.prototype, {
  9868. updateDisplay: function() {
  9869. return this.__input.value = this.__truncationSuspended ? this.getValue() : function(e, t) {
  9870. var i = Math.pow(10, t);
  9871. return Math.round(e * i) / i
  9872. }(this.getValue(), this.__precision),
  9873. G.superclass.prototype.updateDisplay.call(this)
  9874. }
  9875. }),
  9876. G),
  9877. ee.controllers.NumberControllerSlider = (N = ee.controllers.NumberController,
  9878. F = ee.dom.dom,
  9879. B = ee.utils.css,
  9880. V = ee.utils.common,
  9881. (k = function(e, t, i, n, r) {
  9882. function o(e) {
  9883. e.preventDefault();
  9884. var t = F.getOffset(s.__background)
  9885. , i = F.getWidth(s.__background);
  9886. return s.setValue(function(e, t, i, n, r) {
  9887. return n + (e - t) / (i - t) * (r - n)
  9888. }(e.clientX, t.left, t.left + i, s.__min, s.__max)),
  9889. !1
  9890. }
  9891. function a() {
  9892. F.unbind(window, "mousemove", o),
  9893. F.unbind(window, "mouseup", a),
  9894. s.__onFinishChange && s.__onFinishChange.call(s, s.getValue())
  9895. }
  9896. k.superclass.call(this, e, t, {
  9897. min: i,
  9898. max: n,
  9899. step: r
  9900. });
  9901. var s = this;
  9902. this.__background = document.createElement("div"),
  9903. this.__foreground = document.createElement("div"),
  9904. F.bind(this.__background, "mousedown", function(e) {
  9905. F.bind(window, "mousemove", o),
  9906. F.bind(window, "mouseup", a),
  9907. o(e)
  9908. }),
  9909. F.addClass(this.__background, "slider"),
  9910. F.addClass(this.__foreground, "slider-fg"),
  9911. this.updateDisplay(),
  9912. this.__background.appendChild(this.__foreground),
  9913. this.domElement.appendChild(this.__background)
  9914. }
  9915. ).superclass = N,
  9916. k.useDefaultStyles = function() {
  9917. 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}")
  9918. }
  9919. ,
  9920. V.extend(k.prototype, N.prototype, {
  9921. updateDisplay: function() {
  9922. var e = (this.getValue() - this.__min) / (this.__max - this.__min);
  9923. return this.__foreground.style.width = 100 * e + "%",
  9924. k.superclass.prototype.updateDisplay.call(this)
  9925. }
  9926. }),
  9927. k),
  9928. ee.controllers.FunctionController = (P = ee.controllers.Controller,
  9929. O = ee.dom.dom,
  9930. L = ee.utils.common,
  9931. (D = function(e, t, i) {
  9932. D.superclass.call(this, e, t);
  9933. var n = this;
  9934. this.__button = document.createElement("div"),
  9935. this.__button.innerHTML = void 0 === i ? "Fire" : i,
  9936. O.bind(this.__button, "click", function(e) {
  9937. return e.preventDefault(),
  9938. n.fire(),
  9939. !1
  9940. }),
  9941. O.addClass(this.__button, "button"),
  9942. this.domElement.appendChild(this.__button)
  9943. }
  9944. ).superclass = P,
  9945. L.extend(D.prototype, P.prototype, {
  9946. fire: function() {
  9947. this.__onChange && this.__onChange.call(this),
  9948. this.__onFinishChange && this.__onFinishChange.call(this, this.getValue()),
  9949. this.getValue().call(this.object)
  9950. }
  9951. }),
  9952. D),
  9953. ee.controllers.BooleanController = (x = ee.controllers.Controller,
  9954. S = ee.dom.dom,
  9955. M = ee.utils.common,
  9956. (R = function(e, t) {
  9957. R.superclass.call(this, e, t);
  9958. var i = this;
  9959. this.__prev = this.getValue(),
  9960. this.__checkbox = document.createElement("input"),
  9961. this.__checkbox.setAttribute("type", "checkbox"),
  9962. S.bind(this.__checkbox, "change", function() {
  9963. i.setValue(!i.__prev)
  9964. }, !1),
  9965. this.domElement.appendChild(this.__checkbox),
  9966. this.updateDisplay()
  9967. }
  9968. ).superclass = x,
  9969. M.extend(R.prototype, x.prototype, {
  9970. setValue: function(e) {
  9971. var t = R.superclass.prototype.setValue.call(this, e);
  9972. return this.__onFinishChange && this.__onFinishChange.call(this, this.getValue()),
  9973. this.__prev = this.getValue(),
  9974. t
  9975. },
  9976. updateDisplay: function() {
  9977. return !0 === this.getValue() ? (this.__checkbox.setAttribute("checked", "checked"),
  9978. this.__checkbox.checked = !0) : this.__checkbox.checked = !1,
  9979. R.superclass.prototype.updateDisplay.call(this)
  9980. }
  9981. }),
  9982. R),
  9983. ee.color.toString = (T = ee.utils.common,
  9984. function(e) {
  9985. if (1 == e.a || T.isUndefined(e.a)) {
  9986. for (var t = e.hex.toString(16); t.length < 6; )
  9987. t = "0" + t;
  9988. return "#" + t
  9989. }
  9990. return "rgba(" + Math.round(e.r) + "," + Math.round(e.g) + "," + Math.round(e.b) + "," + e.a + ")"
  9991. }
  9992. ),
  9993. ee.color.interpret = (I = ee.color.toString,
  9994. E = ee.utils.common,
  9995. w = [{
  9996. litmus: E.isString,
  9997. conversions: {
  9998. THREE_CHAR_HEX: {
  9999. read: function(e) {
  10000. var t = e.match(/^#([A-F0-9])([A-F0-9])([A-F0-9])$/i);
  10001. return null !== t && {
  10002. space: "HEX",
  10003. hex: parseInt("0x" + t[1].toString() + t[1].toString() + t[2].toString() + t[2].toString() + t[3].toString() + t[3].toString())
  10004. }
  10005. },
  10006. write: I
  10007. },
  10008. SIX_CHAR_HEX: {
  10009. read: function(e) {
  10010. var t = e.match(/^#([A-F0-9]{6})$/i);
  10011. return null !== t && {
  10012. space: "HEX",
  10013. hex: parseInt("0x" + t[1].toString())
  10014. }
  10015. },
  10016. write: I
  10017. },
  10018. CSS_RGB: {
  10019. read: function(e) {
  10020. var t = e.match(/^rgb\(\s*(.+)\s*,\s*(.+)\s*,\s*(.+)\s*\)/);
  10021. return null !== t && {
  10022. space: "RGB",
  10023. r: parseFloat(t[1]),
  10024. g: parseFloat(t[2]),
  10025. b: parseFloat(t[3])
  10026. }
  10027. },
  10028. write: I
  10029. },
  10030. CSS_RGBA: {
  10031. read: function(e) {
  10032. var t = e.match(/^rgba\(\s*(.+)\s*,\s*(.+)\s*,\s*(.+)\s*\,\s*(.+)\s*\)/);
  10033. return null !== t && {
  10034. space: "RGB",
  10035. r: parseFloat(t[1]),
  10036. g: parseFloat(t[2]),
  10037. b: parseFloat(t[3]),
  10038. a: parseFloat(t[4])
  10039. }
  10040. },
  10041. write: I
  10042. }
  10043. }
  10044. }, {
  10045. litmus: E.isNumber,
  10046. conversions: {
  10047. HEX: {
  10048. read: function(e) {
  10049. return {
  10050. space: "HEX",
  10051. hex: e,
  10052. conversionName: "HEX"
  10053. }
  10054. },
  10055. write: function(e) {
  10056. return e.hex
  10057. }
  10058. }
  10059. }
  10060. }, {
  10061. litmus: E.isArray,
  10062. conversions: {
  10063. RGB_ARRAY: {
  10064. read: function(e) {
  10065. return 3 == e.length && {
  10066. space: "RGB",
  10067. r: e[0],
  10068. g: e[1],
  10069. b: e[2]
  10070. }
  10071. },
  10072. write: function(e) {
  10073. return [e.r, e.g, e.b]
  10074. }
  10075. },
  10076. RGBA_ARRAY: {
  10077. read: function(e) {
  10078. return 4 == e.length && {
  10079. space: "RGB",
  10080. r: e[0],
  10081. g: e[1],
  10082. b: e[2],
  10083. a: e[3]
  10084. }
  10085. },
  10086. write: function(e) {
  10087. return [e.r, e.g, e.b, e.a]
  10088. }
  10089. }
  10090. }
  10091. }, {
  10092. litmus: E.isObject,
  10093. conversions: {
  10094. RGBA_OBJ: {
  10095. read: function(e) {
  10096. return !!(E.isNumber(e.r) && E.isNumber(e.g) && E.isNumber(e.b) && E.isNumber(e.a)) && {
  10097. space: "RGB",
  10098. r: e.r,
  10099. g: e.g,
  10100. b: e.b,
  10101. a: e.a
  10102. }
  10103. },
  10104. write: function(e) {
  10105. return {
  10106. r: e.r,
  10107. g: e.g,
  10108. b: e.b,
  10109. a: e.a
  10110. }
  10111. }
  10112. },
  10113. RGB_OBJ: {
  10114. read: function(e) {
  10115. return !!(E.isNumber(e.r) && E.isNumber(e.g) && E.isNumber(e.b)) && {
  10116. space: "RGB",
  10117. r: e.r,
  10118. g: e.g,
  10119. b: e.b
  10120. }
  10121. },
  10122. write: function(e) {
  10123. return {
  10124. r: e.r,
  10125. g: e.g,
  10126. b: e.b
  10127. }
  10128. }
  10129. },
  10130. HSVA_OBJ: {
  10131. read: function(e) {
  10132. return !!(E.isNumber(e.h) && E.isNumber(e.s) && E.isNumber(e.v) && E.isNumber(e.a)) && {
  10133. space: "HSV",
  10134. h: e.h,
  10135. s: e.s,
  10136. v: e.v,
  10137. a: e.a
  10138. }
  10139. },
  10140. write: function(e) {
  10141. return {
  10142. h: e.h,
  10143. s: e.s,
  10144. v: e.v,
  10145. a: e.a
  10146. }
  10147. }
  10148. },
  10149. HSV_OBJ: {
  10150. read: function(e) {
  10151. return !!(E.isNumber(e.h) && E.isNumber(e.s) && E.isNumber(e.v)) && {
  10152. space: "HSV",
  10153. h: e.h,
  10154. s: e.s,
  10155. v: e.v
  10156. }
  10157. },
  10158. write: function(e) {
  10159. return {
  10160. h: e.h,
  10161. s: e.s,
  10162. v: e.v
  10163. }
  10164. }
  10165. }
  10166. }
  10167. }],
  10168. function() {
  10169. b = !1;
  10170. var i = 1 < arguments.length ? E.toArray(arguments) : arguments[0];
  10171. return E.each(w, function(e) {
  10172. if (e.litmus(i))
  10173. return E.each(e.conversions, function(e, t) {
  10174. if (_ = e.read(i),
  10175. !1 === b && !1 !== _)
  10176. return (b = _).conversionName = t,
  10177. _.conversion = e,
  10178. E.BREAK
  10179. }),
  10180. E.BREAK
  10181. }),
  10182. b
  10183. }
  10184. ),
  10185. ee.GUI = ee.gui.GUI = function(e, t, i, c, h, u, d, p, f, n, g, r, o, m, v) {
  10186. function y(e, t, i, n) {
  10187. if (void 0 === t[i])
  10188. throw new Error("Object " + t + ' has no property "' + i + '"');
  10189. var r;
  10190. if (n.color)
  10191. r = new g(t,i);
  10192. else {
  10193. var o = [t, i].concat(n.factoryArgs);
  10194. r = c.apply(e, o)
  10195. }
  10196. n.before instanceof h && (n.before = n.before.__li),
  10197. C(e, r),
  10198. m.addClass(r.domElement, "c");
  10199. var a = document.createElement("span");
  10200. m.addClass(a, "property-name"),
  10201. a.innerHTML = r.property;
  10202. var s = document.createElement("div");
  10203. s.appendChild(a),
  10204. s.appendChild(r.domElement);
  10205. var l = A(e, s, n.before);
  10206. return m.addClass(l, R.CLASS_CONTROLLER_ROW),
  10207. m.addClass(l, typeof r.getValue()),
  10208. function(t, i, n) {
  10209. if (n.__li = i,
  10210. n.__gui = t,
  10211. v.extend(n, {
  10212. options: function(e) {
  10213. return 1 < arguments.length ? (n.remove(),
  10214. y(t, n.object, n.property, {
  10215. before: n.__li.nextElementSibling,
  10216. factoryArgs: [v.toArray(arguments)]
  10217. })) : v.isArray(e) || v.isObject(e) ? (n.remove(),
  10218. y(t, n.object, n.property, {
  10219. before: n.__li.nextElementSibling,
  10220. factoryArgs: [e]
  10221. })) : void 0
  10222. },
  10223. name: function(e) {
  10224. return n.__li.firstElementChild.firstElementChild.innerHTML = e,
  10225. n
  10226. },
  10227. listen: function() {
  10228. return n.__gui.listen(n),
  10229. n
  10230. },
  10231. remove: function() {
  10232. return n.__gui.remove(n),
  10233. n
  10234. }
  10235. }),
  10236. n instanceof f) {
  10237. var r = new p(n.object,n.property,{
  10238. min: n.__min,
  10239. max: n.__max,
  10240. step: n.__step
  10241. });
  10242. v.each(["updateDisplay", "onChange", "onFinishChange"], function(e) {
  10243. var t = n[e]
  10244. , i = r[e];
  10245. n[e] = r[e] = function() {
  10246. var e = Array.prototype.slice.call(arguments);
  10247. return t.apply(n, e),
  10248. i.apply(r, e)
  10249. }
  10250. }),
  10251. m.addClass(i, "has-slider"),
  10252. n.domElement.insertBefore(r.domElement, n.domElement.firstElementChild)
  10253. } else if (n instanceof p) {
  10254. var e = function(e) {
  10255. return v.isNumber(n.__min) && v.isNumber(n.__max) ? (n.remove(),
  10256. y(t, n.object, n.property, {
  10257. before: n.__li.nextElementSibling,
  10258. factoryArgs: [n.__min, n.__max, n.__step]
  10259. })) : e
  10260. };
  10261. n.min = v.compose(e, n.min),
  10262. n.max = v.compose(e, n.max)
  10263. } else
  10264. n instanceof u ? (m.bind(i, "click", function() {
  10265. m.fakeEvent(n.__checkbox, "click")
  10266. }),
  10267. m.bind(n.__checkbox, "click", function(e) {
  10268. e.stopPropagation()
  10269. })) : n instanceof d ? (m.bind(i, "click", function() {
  10270. m.fakeEvent(n.__button, "click")
  10271. }),
  10272. m.bind(i, "mouseover", function() {
  10273. m.addClass(n.__button, "hover")
  10274. }),
  10275. m.bind(i, "mouseout", function() {
  10276. m.removeClass(n.__button, "hover")
  10277. })) : n instanceof g && (m.addClass(i, "color"),
  10278. n.updateDisplay = v.compose(function(e) {
  10279. return i.style.borderLeftColor = n.__color.toString(),
  10280. e
  10281. }, n.updateDisplay),
  10282. n.updateDisplay());
  10283. n.setValue = v.compose(function(e) {
  10284. return t.getRoot().__preset_select && n.isModified() && _(t.getRoot(), !0),
  10285. e
  10286. }, n.setValue)
  10287. }(e, l, r),
  10288. e.__controllers.push(r),
  10289. r
  10290. }
  10291. function A(e, t, i) {
  10292. var n = document.createElement("li");
  10293. return t && n.appendChild(t),
  10294. i ? e.__ul.insertBefore(n, params.before) : e.__ul.appendChild(n),
  10295. e.onResize(),
  10296. n
  10297. }
  10298. function C(e, t) {
  10299. var i = e.getRoot()
  10300. , n = i.__rememberedObjects.indexOf(t.object);
  10301. if (-1 != n) {
  10302. var r = i.__rememberedObjectIndecesToControllers[n];
  10303. if (void 0 === r && (r = {},
  10304. i.__rememberedObjectIndecesToControllers[n] = r),
  10305. r[t.property] = t,
  10306. i.load && i.load.remembered) {
  10307. var o, a = i.load.remembered;
  10308. if (a[e.preset])
  10309. o = a[e.preset];
  10310. else {
  10311. if (!a[T])
  10312. return;
  10313. o = a[T]
  10314. }
  10315. if (o[n] && void 0 !== o[n][t.property]) {
  10316. var s = o[n][t.property];
  10317. t.initialValue = s,
  10318. t.setValue(s)
  10319. }
  10320. }
  10321. }
  10322. }
  10323. function I(e, t) {
  10324. return document.location.href + "." + t
  10325. }
  10326. function l(e, t) {
  10327. e.domElement.style.width = t + "px",
  10328. e.__save_row && e.autoPlace && (e.__save_row.style.width = t + "px"),
  10329. e.__closeButton && (e.__closeButton.style.width = t + "px")
  10330. }
  10331. function a(r, o) {
  10332. var a = {};
  10333. return v.each(r.__rememberedObjects, function(e, t) {
  10334. var i = {}
  10335. , n = r.__rememberedObjectIndecesToControllers[t];
  10336. v.each(n, function(e, t) {
  10337. i[t] = o ? e.initialValue : e.getValue()
  10338. }),
  10339. a[t] = i
  10340. }),
  10341. a
  10342. }
  10343. function E(e, t, i) {
  10344. var n = document.createElement("option");
  10345. n.innerHTML = t,
  10346. n.value = t,
  10347. e.__preset_select.appendChild(n),
  10348. i && (e.__preset_select.selectedIndex = e.__preset_select.length - 1)
  10349. }
  10350. function _(e, t) {
  10351. var i = e.__preset_select[e.__preset_select.selectedIndex];
  10352. i.innerHTML = t ? i.value + "*" : i.value
  10353. }
  10354. 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");
  10355. var b, w, T = "Default", x = function() {
  10356. try {
  10357. return "localStorage"in window && null !== window.localStorage
  10358. } catch (e) {
  10359. return !1
  10360. }
  10361. }(), S = !0, s = !1, M = [], R = function(t) {
  10362. var i = this;
  10363. this.domElement = document.createElement("div"),
  10364. this.__ul = document.createElement("ul"),
  10365. this.domElement.appendChild(this.__ul),
  10366. m.addClass(this.domElement, "dg"),
  10367. this.__folders = {},
  10368. this.__controllers = [],
  10369. this.__rememberedObjects = [],
  10370. this.__rememberedObjectIndecesToControllers = [],
  10371. this.__listening = [],
  10372. t = t || {},
  10373. t = v.defaults(t, {
  10374. autoPlace: !0,
  10375. width: R.DEFAULT_WIDTH
  10376. }),
  10377. t = v.defaults(t, {
  10378. resizable: t.autoPlace,
  10379. hideable: t.autoPlace
  10380. }),
  10381. v.isUndefined(t.load) ? t.load = {
  10382. preset: T
  10383. } : t.preset && (t.load.preset = t.preset),
  10384. v.isUndefined(t.parent) && t.hideable && M.push(this),
  10385. t.resizable = v.isUndefined(t.parent) && t.resizable,
  10386. t.autoPlace && v.isUndefined(t.scrollable) && (t.scrollable = !0);
  10387. var n, e, r = x && "true" === localStorage.getItem(I(0, "isLocal"));
  10388. if (Object.defineProperties(this, {
  10389. parent: {
  10390. get: function() {
  10391. return t.parent
  10392. }
  10393. },
  10394. scrollable: {
  10395. get: function() {
  10396. return t.scrollable
  10397. }
  10398. },
  10399. autoPlace: {
  10400. get: function() {
  10401. return t.autoPlace
  10402. }
  10403. },
  10404. preset: {
  10405. get: function() {
  10406. return i.parent ? i.getRoot().preset : t.load.preset
  10407. },
  10408. set: function(e) {
  10409. i.parent ? i.getRoot().preset = e : t.load.preset = e,
  10410. function(e) {
  10411. for (var t = 0; t < e.__preset_select.length; t++)
  10412. e.__preset_select[t].value == e.preset && (e.__preset_select.selectedIndex = t)
  10413. }(this),
  10414. i.revert()
  10415. }
  10416. },
  10417. width: {
  10418. get: function() {
  10419. return t.width
  10420. },
  10421. set: function(e) {
  10422. t.width = e,
  10423. l(i, e)
  10424. }
  10425. },
  10426. name: {
  10427. get: function() {
  10428. return t.name
  10429. },
  10430. set: function(e) {
  10431. t.name = e,
  10432. a && (a.innerHTML = t.name)
  10433. }
  10434. },
  10435. closed: {
  10436. get: function() {
  10437. return t.closed
  10438. },
  10439. set: function(e) {
  10440. t.closed = e,
  10441. t.closed ? m.addClass(i.__ul, R.CLASS_CLOSED) : m.removeClass(i.__ul, R.CLASS_CLOSED),
  10442. this.onResize(),
  10443. i.__closeButton && (i.__closeButton.innerHTML = e ? R.TEXT_OPEN : R.TEXT_CLOSED)
  10444. }
  10445. },
  10446. load: {
  10447. get: function() {
  10448. return t.load
  10449. }
  10450. },
  10451. useLocalStorage: {
  10452. get: function() {
  10453. return r
  10454. },
  10455. set: function(e) {
  10456. x && ((r = e) ? m.bind(window, "unload", n) : m.unbind(window, "unload", n),
  10457. localStorage.setItem(I(0, "isLocal"), e))
  10458. }
  10459. }
  10460. }),
  10461. v.isUndefined(t.parent)) {
  10462. if (t.closed = !1,
  10463. m.addClass(this.domElement, R.CLASS_MAIN),
  10464. m.makeSelectable(this.domElement, !1),
  10465. x && r) {
  10466. i.useLocalStorage = !0;
  10467. var o = localStorage.getItem(I(0, "gui"));
  10468. o && (t.load = JSON.parse(o))
  10469. }
  10470. this.__closeButton = document.createElement("div"),
  10471. this.__closeButton.innerHTML = R.TEXT_CLOSED,
  10472. m.addClass(this.__closeButton, R.CLASS_CLOSE_BUTTON),
  10473. this.domElement.appendChild(this.__closeButton),
  10474. m.bind(this.__closeButton, "click", function() {
  10475. i.closed = !i.closed
  10476. })
  10477. } else {
  10478. void 0 === t.closed && (t.closed = !0);
  10479. var a = document.createTextNode(t.name);
  10480. m.addClass(a, "controller-name");
  10481. var s = A(i, a);
  10482. m.addClass(this.__ul, R.CLASS_CLOSED),
  10483. m.addClass(s, "title"),
  10484. m.bind(s, "click", function(e) {
  10485. return e.preventDefault(),
  10486. i.closed = !i.closed,
  10487. !1
  10488. }),
  10489. t.closed || (this.closed = !1)
  10490. }
  10491. t.autoPlace && (v.isUndefined(t.parent) && (S && (w = document.createElement("div"),
  10492. m.addClass(w, "dg"),
  10493. m.addClass(w, R.CLASS_AUTO_PLACE_CONTAINER),
  10494. document.body.appendChild(w),
  10495. S = !1),
  10496. w.appendChild(this.domElement),
  10497. m.addClass(this.domElement, R.CLASS_AUTO_PLACE)),
  10498. this.parent || l(i, t.width)),
  10499. m.bind(window, "resize", function() {
  10500. i.onResize()
  10501. }),
  10502. m.bind(this.__ul, "webkitTransitionEnd", function() {
  10503. i.onResize()
  10504. }),
  10505. m.bind(this.__ul, "transitionend", function() {
  10506. i.onResize()
  10507. }),
  10508. m.bind(this.__ul, "oTransitionEnd", function() {
  10509. i.onResize()
  10510. }),
  10511. this.onResize(),
  10512. t.resizable && function(t) {
  10513. function e(e) {
  10514. return e.preventDefault(),
  10515. r = e.clientX,
  10516. m.addClass(t.__closeButton, R.CLASS_DRAG),
  10517. m.bind(window, "mousemove", i),
  10518. m.bind(window, "mouseup", n),
  10519. !1
  10520. }
  10521. function i(e) {
  10522. return e.preventDefault(),
  10523. t.width += r - e.clientX,
  10524. t.onResize(),
  10525. r = e.clientX,
  10526. !1
  10527. }
  10528. function n() {
  10529. m.removeClass(t.__closeButton, R.CLASS_DRAG),
  10530. m.unbind(window, "mousemove", i),
  10531. m.unbind(window, "mouseup", n)
  10532. }
  10533. var r;
  10534. t.__resize_handle = document.createElement("div"),
  10535. v.extend(t.__resize_handle.style, {
  10536. width: "6px",
  10537. marginLeft: "-3px",
  10538. height: "200px",
  10539. cursor: "ew-resize",
  10540. position: "absolute"
  10541. }),
  10542. m.bind(t.__resize_handle, "mousedown", e),
  10543. m.bind(t.__closeButton, "mousedown", e),
  10544. t.domElement.insertBefore(t.__resize_handle, t.domElement.firstElementChild)
  10545. }(this),
  10546. n = function() {
  10547. x && "true" === localStorage.getItem(I(0, "isLocal")) && localStorage.setItem(I(0, "gui"), JSON.stringify(i.getSaveObject()))
  10548. }
  10549. ,
  10550. this.saveToLocalStorageIfPossible = n,
  10551. i.getRoot(),
  10552. t.parent || ((e = i.getRoot()).width += 1,
  10553. v.defer(function() {
  10554. e.width -= 1
  10555. }))
  10556. };
  10557. return R.toggleHide = function() {
  10558. s = !s,
  10559. v.each(M, function(e) {
  10560. e.domElement.style.zIndex = s ? -999 : 999,
  10561. e.domElement.style.opacity = s ? 0 : 1
  10562. })
  10563. }
  10564. ,
  10565. R.CLASS_AUTO_PLACE = "a",
  10566. R.CLASS_AUTO_PLACE_CONTAINER = "ac",
  10567. R.CLASS_MAIN = "main",
  10568. R.CLASS_CONTROLLER_ROW = "cr",
  10569. R.CLASS_TOO_TALL = "taller-than-window",
  10570. R.CLASS_CLOSED = "closed",
  10571. R.CLASS_CLOSE_BUTTON = "close-button",
  10572. R.CLASS_DRAG = "drag",
  10573. R.DEFAULT_WIDTH = 245,
  10574. R.TEXT_CLOSED = "Close Controls",
  10575. R.TEXT_OPEN = "Open Controls",
  10576. m.bind(window, "keydown", function(e) {
  10577. "text" === document.activeElement.type || 72 !== e.which && 72 != e.keyCode || R.toggleHide()
  10578. }, !1),
  10579. v.extend(R.prototype, {
  10580. add: function(e, t) {
  10581. return y(this, e, t, {
  10582. factoryArgs: Array.prototype.slice.call(arguments, 2)
  10583. })
  10584. },
  10585. addColor: function(e, t) {
  10586. return y(this, e, t, {
  10587. color: !0
  10588. })
  10589. },
  10590. remove: function(e) {
  10591. this.__ul.removeChild(e.__li),
  10592. this.__controllers.slice(this.__controllers.indexOf(e), 1);
  10593. var t = this;
  10594. v.defer(function() {
  10595. t.onResize()
  10596. })
  10597. },
  10598. destroy: function() {
  10599. this.autoPlace && w.removeChild(this.domElement)
  10600. },
  10601. addFolder: function(e) {
  10602. if (void 0 !== this.__folders[e])
  10603. throw new Error('You already have a folder in this GUI by the name "' + e + '"');
  10604. var t = {
  10605. name: e,
  10606. parent: this
  10607. };
  10608. t.autoPlace = this.autoPlace,
  10609. this.load && this.load.folders && this.load.folders[e] && (t.closed = this.load.folders[e].closed,
  10610. t.load = this.load.folders[e]);
  10611. var i = new R(t);
  10612. this.__folders[e] = i;
  10613. var n = A(this, i.domElement);
  10614. return m.addClass(n, "folder"),
  10615. i
  10616. },
  10617. open: function() {
  10618. this.closed = !1
  10619. },
  10620. close: function() {
  10621. this.closed = !0
  10622. },
  10623. onResize: function() {
  10624. var t = this.getRoot();
  10625. if (t.scrollable) {
  10626. var e = m.getOffset(t.__ul).top
  10627. , i = 0;
  10628. v.each(t.__ul.childNodes, function(e) {
  10629. t.autoPlace && e === t.__save_row || (i += m.getHeight(e))
  10630. }),
  10631. $("#player").height() - e - 20 < i ? (m.addClass(t.domElement, R.CLASS_TOO_TALL),
  10632. t.__ul.style.height = $("#player").height() - e - 20 + "px") : (m.removeClass(t.domElement, R.CLASS_TOO_TALL),
  10633. t.__ul.style.height = "auto")
  10634. }
  10635. t.__resize_handle && v.defer(function() {
  10636. t.__resize_handle.style.height = t.__ul.offsetHeight + "px"
  10637. }),
  10638. t.__closeButton && (t.__closeButton.style.width = t.width + "px")
  10639. },
  10640. remember: function() {
  10641. 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>'),
  10642. this.parent)
  10643. throw new Error("You can only call remember on a top level GUI.");
  10644. var t = this;
  10645. v.each(Array.prototype.slice.call(arguments), function(e) {
  10646. 0 == t.__rememberedObjects.length && function(i) {
  10647. var e = i.__save_row = document.createElement("li");
  10648. m.addClass(i.domElement, "has-save"),
  10649. i.__ul.insertBefore(e, i.__ul.firstChild),
  10650. m.addClass(e, "save-row");
  10651. var t = document.createElement("span");
  10652. t.innerHTML = "&nbsp;",
  10653. m.addClass(t, "button gears");
  10654. var n = document.createElement("span");
  10655. n.innerHTML = "Save",
  10656. m.addClass(n, "button"),
  10657. m.addClass(n, "save");
  10658. var r = document.createElement("span");
  10659. r.innerHTML = "New",
  10660. m.addClass(r, "button"),
  10661. m.addClass(r, "save-as");
  10662. var o = document.createElement("span");
  10663. o.innerHTML = "Revert",
  10664. m.addClass(o, "button"),
  10665. m.addClass(o, "revert");
  10666. var a = i.__preset_select = document.createElement("select");
  10667. if (i.load && i.load.remembered ? v.each(i.load.remembered, function(e, t) {
  10668. E(i, t, t == i.preset)
  10669. }) : E(i, T, !1),
  10670. m.bind(a, "change", function() {
  10671. for (var e = 0; e < i.__preset_select.length; e++)
  10672. i.__preset_select[e].innerHTML = i.__preset_select[e].value;
  10673. i.preset = this.value
  10674. }),
  10675. e.appendChild(a),
  10676. e.appendChild(t),
  10677. e.appendChild(n),
  10678. e.appendChild(r),
  10679. e.appendChild(o),
  10680. x) {
  10681. var s = document.getElementById("dg-save-locally")
  10682. , l = document.getElementById("dg-local-explain");
  10683. s.style.display = "block";
  10684. var c = document.getElementById("dg-local-storage");
  10685. "true" === localStorage.getItem(I(0, "isLocal")) && c.setAttribute("checked", "checked");
  10686. var h = function() {
  10687. l.style.display = i.useLocalStorage ? "block" : "none"
  10688. };
  10689. h(),
  10690. m.bind(c, "change", function() {
  10691. i.useLocalStorage = !i.useLocalStorage,
  10692. h()
  10693. })
  10694. }
  10695. var u = document.getElementById("dg-new-constructor");
  10696. m.bind(u, "keydown", function(e) {
  10697. !e.metaKey || 67 !== e.which && 67 != e.keyCode || b.hide()
  10698. }),
  10699. m.bind(t, "click", function() {
  10700. u.innerHTML = JSON.stringify(i.getSaveObject(), void 0, 2),
  10701. b.show(),
  10702. u.focus(),
  10703. u.select()
  10704. }),
  10705. m.bind(n, "click", function() {
  10706. i.save()
  10707. }),
  10708. m.bind(r, "click", function() {
  10709. var e = prompt("Enter a new preset name.");
  10710. e && i.saveAs(e)
  10711. }),
  10712. m.bind(o, "click", function() {
  10713. i.revert()
  10714. })
  10715. }(t),
  10716. -1 == t.__rememberedObjects.indexOf(e) && t.__rememberedObjects.push(e)
  10717. }),
  10718. this.autoPlace && l(this, this.width)
  10719. },
  10720. getRoot: function() {
  10721. for (var e = this; e.parent; )
  10722. e = e.parent;
  10723. return e
  10724. },
  10725. getSaveObject: function() {
  10726. var i = this.load;
  10727. return i.closed = this.closed,
  10728. 0 < this.__rememberedObjects.length && (i.preset = this.preset,
  10729. i.remembered || (i.remembered = {}),
  10730. i.remembered[this.preset] = a(this)),
  10731. i.folders = {},
  10732. v.each(this.__folders, function(e, t) {
  10733. i.folders[t] = e.getSaveObject()
  10734. }),
  10735. i
  10736. },
  10737. save: function() {
  10738. this.load.remembered || (this.load.remembered = {}),
  10739. this.load.remembered[this.preset] = a(this),
  10740. _(this, !1),
  10741. this.saveToLocalStorageIfPossible()
  10742. },
  10743. saveAs: function(e) {
  10744. this.load.remembered || (this.load.remembered = {},
  10745. this.load.remembered[T] = a(this, !0)),
  10746. this.load.remembered[e] = a(this),
  10747. this.preset = e,
  10748. E(this, e, !0),
  10749. this.saveToLocalStorageIfPossible()
  10750. },
  10751. revert: function(t) {
  10752. v.each(this.__controllers, function(e) {
  10753. this.getRoot().load.remembered ? C(t || this.getRoot(), e) : e.setValue(e.initialValue)
  10754. }, this),
  10755. v.each(this.__folders, function(e) {
  10756. e.revert(e)
  10757. }),
  10758. t || _(this.getRoot(), !1)
  10759. },
  10760. listen: function(e) {
  10761. var t = 0 == this.__listening.length;
  10762. this.__listening.push(e),
  10763. t && function e(t) {
  10764. 0 != t.length && r(function() {
  10765. e(t)
  10766. }),
  10767. v.each(t, function(e) {
  10768. e.updateDisplay()
  10769. })
  10770. }(this.__listening)
  10771. }
  10772. }),
  10773. R
  10774. }(ee.utils.css, 0, 0, ee.controllers.factory = (h = ee.controllers.OptionController,
  10775. u = ee.controllers.NumberControllerBox,
  10776. d = ee.controllers.NumberControllerSlider,
  10777. p = ee.controllers.StringController = (v = ee.controllers.Controller,
  10778. y = ee.dom.dom,
  10779. A = ee.utils.common,
  10780. (C = function(e, t) {
  10781. function i() {
  10782. n.setValue(n.__input.value)
  10783. }
  10784. C.superclass.call(this, e, t);
  10785. var n = this;
  10786. this.__input = document.createElement("input"),
  10787. this.__input.setAttribute("type", "text"),
  10788. y.bind(this.__input, "keyup", i),
  10789. y.bind(this.__input, "change", i),
  10790. y.bind(this.__input, "blur", function() {
  10791. n.__onFinishChange && n.__onFinishChange.call(n, n.getValue())
  10792. }),
  10793. y.bind(this.__input, "keydown", function(e) {
  10794. 13 === e.keyCode && this.blur()
  10795. }),
  10796. this.updateDisplay(),
  10797. this.domElement.appendChild(this.__input)
  10798. }
  10799. ).superclass = v,
  10800. A.extend(C.prototype, v.prototype, {
  10801. updateDisplay: function() {
  10802. return y.isActive(this.__input) || (this.__input.value = this.getValue()),
  10803. C.superclass.prototype.updateDisplay.call(this)
  10804. }
  10805. }),
  10806. C),
  10807. f = ee.controllers.FunctionController,
  10808. g = ee.controllers.BooleanController,
  10809. m = ee.utils.common,
  10810. function(e, t) {
  10811. var i = e[t];
  10812. 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,{
  10813. min: arguments[2],
  10814. max: arguments[3]
  10815. }) : m.isString(i) ? new p(e,t) : m.isFunction(i) ? new f(e,t,"") : m.isBoolean(i) ? new g(e,t) : void 0
  10816. }
  10817. ), 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) {
  10818. function f(t, i, n, r) {
  10819. t.style.background = "",
  10820. p.each(o, function(e) {
  10821. t.style.cssText += "background: " + e + "linear-gradient(" + i + ", " + n + " 0%, " + r + " 100%); "
  10822. })
  10823. }
  10824. var g = function(e, t) {
  10825. function i(e) {
  10826. a(e),
  10827. h.bind(window, "mousemove", a),
  10828. h.bind(window, "mouseup", n)
  10829. }
  10830. function n() {
  10831. h.unbind(window, "mousemove", a),
  10832. h.unbind(window, "mouseup", n)
  10833. }
  10834. function r() {
  10835. var e = d(this.value);
  10836. !1 !== e ? (l.__color.__state = e,
  10837. l.setValue(l.__color.toOriginal())) : this.value = l.__color.toString()
  10838. }
  10839. function o() {
  10840. h.unbind(window, "mousemove", s),
  10841. h.unbind(window, "mouseup", o)
  10842. }
  10843. function a(e) {
  10844. e.preventDefault();
  10845. var t = h.getWidth(l.__saturation_field)
  10846. , i = h.getOffset(l.__saturation_field)
  10847. , n = (e.clientX - i.left + document.body.scrollLeft) / t
  10848. , r = 1 - (e.clientY - i.top + document.body.scrollTop) / t;
  10849. return 1 < r ? r = 1 : r < 0 && (r = 0),
  10850. 1 < n ? n = 1 : n < 0 && (n = 0),
  10851. l.__color.v = r,
  10852. l.__color.s = n,
  10853. l.setValue(l.__color.toOriginal()),
  10854. !1
  10855. }
  10856. function s(e) {
  10857. e.preventDefault();
  10858. var t = h.getHeight(l.__hue_field)
  10859. , i = h.getOffset(l.__hue_field)
  10860. , n = 1 - (e.clientY - i.top + document.body.scrollTop) / t;
  10861. return 1 < n ? n = 1 : n < 0 && (n = 0),
  10862. l.__color.h = 360 * n,
  10863. l.setValue(l.__color.toOriginal()),
  10864. !1
  10865. }
  10866. g.superclass.call(this, e, t),
  10867. this.__color = new u(this.getValue()),
  10868. this.__temp = new u(0);
  10869. var l = this;
  10870. this.domElement = document.createElement("div"),
  10871. h.makeSelectable(this.domElement, !1),
  10872. this.__selector = document.createElement("div"),
  10873. this.__selector.className = "selector",
  10874. this.__saturation_field = document.createElement("div"),
  10875. this.__saturation_field.className = "saturation-field",
  10876. this.__field_knob = document.createElement("div"),
  10877. this.__field_knob.className = "field-knob",
  10878. this.__field_knob_border = "2px solid ",
  10879. this.__hue_knob = document.createElement("div"),
  10880. this.__hue_knob.className = "hue-knob",
  10881. this.__hue_field = document.createElement("div"),
  10882. this.__hue_field.className = "hue-field",
  10883. this.__input = document.createElement("input"),
  10884. this.__input.type = "text",
  10885. this.__input_textShadow = "0 1px 1px ",
  10886. h.bind(this.__input, "keydown", function(e) {
  10887. 13 === e.keyCode && r.call(this)
  10888. }),
  10889. h.bind(this.__input, "blur", r),
  10890. h.bind(this.__selector, "mousedown", function(e) {
  10891. h.addClass(this, "drag").bind(window, "mouseup", function(e) {
  10892. h.removeClass(l.__selector, "drag")
  10893. })
  10894. });
  10895. var c = document.createElement("div");
  10896. p.extend(this.__selector.style, {
  10897. width: "122px",
  10898. height: "102px",
  10899. padding: "3px",
  10900. backgroundColor: "#222",
  10901. boxShadow: "0px 1px 3px rgba(0,0,0,0.3)"
  10902. }),
  10903. p.extend(this.__field_knob.style, {
  10904. position: "absolute",
  10905. width: "12px",
  10906. height: "12px",
  10907. border: this.__field_knob_border + (this.__color.v < .5 ? "#fff" : "#000"),
  10908. boxShadow: "0px 1px 3px rgba(0,0,0,0.5)",
  10909. borderRadius: "12px",
  10910. zIndex: 1
  10911. }),
  10912. p.extend(this.__hue_knob.style, {
  10913. position: "absolute",
  10914. width: "15px",
  10915. height: "2px",
  10916. borderRight: "4px solid #fff",
  10917. zIndex: 1
  10918. }),
  10919. p.extend(this.__saturation_field.style, {
  10920. width: "100px",
  10921. height: "100px",
  10922. border: "1px solid #555",
  10923. marginRight: "3px",
  10924. display: "inline-block",
  10925. cursor: "pointer"
  10926. }),
  10927. p.extend(c.style, {
  10928. width: "100%",
  10929. height: "100%",
  10930. background: "none"
  10931. }),
  10932. f(c, "top", "rgba(0,0,0,0)", "#000"),
  10933. p.extend(this.__hue_field.style, {
  10934. width: "15px",
  10935. height: "100px",
  10936. display: "inline-block",
  10937. border: "1px solid #555",
  10938. cursor: "ns-resize"
  10939. }),
  10940. function(e) {
  10941. e.style.background = "",
  10942. e.style.cssText += "background: -moz-linear-gradient(top, #ff0000 0%, #ff00ff 17%, #0000ff 34%, #00ffff 50%, #00ff00 67%, #ffff00 84%, #ff0000 100%);",
  10943. e.style.cssText += "background: -webkit-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);",
  10944. e.style.cssText += "background: -o-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);",
  10945. e.style.cssText += "background: -ms-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);",
  10946. e.style.cssText += "background: linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);"
  10947. }(this.__hue_field),
  10948. p.extend(this.__input.style, {
  10949. outline: "none",
  10950. textAlign: "center",
  10951. color: "#fff",
  10952. border: 0,
  10953. fontWeight: "bold",
  10954. textShadow: this.__input_textShadow + "rgba(0,0,0,0.7)"
  10955. }),
  10956. h.bind(this.__saturation_field, "mousedown", i),
  10957. h.bind(this.__field_knob, "mousedown", i),
  10958. h.bind(this.__hue_field, "mousedown", function(e) {
  10959. s(e),
  10960. h.bind(window, "mousemove", s),
  10961. h.bind(window, "mouseup", o)
  10962. }),
  10963. this.__saturation_field.appendChild(c),
  10964. this.__selector.appendChild(this.__field_knob),
  10965. this.__selector.appendChild(this.__saturation_field),
  10966. this.__selector.appendChild(this.__hue_field),
  10967. this.__hue_field.appendChild(this.__hue_knob),
  10968. this.domElement.appendChild(this.__input),
  10969. this.domElement.appendChild(this.__selector),
  10970. this.updateDisplay()
  10971. };
  10972. g.superclass = e,
  10973. p.extend(g.prototype, e.prototype, {
  10974. updateDisplay: function() {
  10975. var t = d(this.getValue());
  10976. if (!1 !== t) {
  10977. var i = !1;
  10978. p.each(u.COMPONENTS, function(e) {
  10979. if (!p.isUndefined(t[e]) && !p.isUndefined(this.__color.__state[e]) && t[e] !== this.__color.__state[e])
  10980. return i = !0,
  10981. {}
  10982. }, this),
  10983. i && p.extend(this.__color.__state, t)
  10984. }
  10985. p.extend(this.__temp.__state, this.__color.__state),
  10986. this.__temp.a = 1;
  10987. var e = this.__color.v < .5 || .5 < this.__color.s ? 255 : 0
  10988. , n = 255 - e;
  10989. p.extend(this.__field_knob.style, {
  10990. marginLeft: 100 * this.__color.s - 7 + "px",
  10991. marginTop: 100 * (1 - this.__color.v) - 7 + "px",
  10992. backgroundColor: this.__temp.toString(),
  10993. border: this.__field_knob_border + "rgb(" + e + "," + e + "," + e + ")"
  10994. }),
  10995. this.__hue_knob.style.marginTop = 100 * (1 - this.__color.h / 360) + "px",
  10996. this.__temp.s = 1,
  10997. this.__temp.v = 1,
  10998. f(this.__saturation_field, "left", "#fff", this.__temp.toString()),
  10999. p.extend(this.__input.style, {
  11000. backgroundColor: this.__input.value = this.__color.toString(),
  11001. color: "rgb(" + e + "," + e + "," + e + ")",
  11002. textShadow: this.__input_textShadow + "rgba(" + n + "," + n + "," + n + ",.7)"
  11003. })
  11004. }
  11005. });
  11006. var o = ["-moz-", "-o-", "-webkit-", "-ms-", ""];
  11007. return g
  11008. }(ee.controllers.Controller, ee.dom.dom, ee.color.Color = (o = ee.color.interpret,
  11009. a = ee.color.math = {
  11010. hsv_to_rgb: function(e, t, i) {
  11011. var n = Math.floor(e / 60) % 6
  11012. , r = e / 60 - Math.floor(e / 60)
  11013. , o = i * (1 - t)
  11014. , a = i * (1 - r * t)
  11015. , s = i * (1 - (1 - r) * t)
  11016. , l = [[i, s, o], [a, i, o], [o, i, s], [o, a, i], [s, o, i], [i, o, a]][n];
  11017. return {
  11018. r: 255 * l[0],
  11019. g: 255 * l[1],
  11020. b: 255 * l[2]
  11021. }
  11022. },
  11023. rgb_to_hsv: function(e, t, i) {
  11024. var n, r = Math.min(e, t, i), o = Math.max(e, t, i), a = o - r;
  11025. return 0 == o ? {
  11026. h: NaN,
  11027. s: 0,
  11028. v: 0
  11029. } : (n = e == o ? (t - i) / a : t == o ? 2 + (i - e) / a : 4 + (e - t) / a,
  11030. (n /= 6) < 0 && (n += 1),
  11031. {
  11032. h: 360 * n,
  11033. s: a / o,
  11034. v: o / 255
  11035. })
  11036. },
  11037. rgb_to_hex: function(e, t, i) {
  11038. var n = this.hex_with_component(0, 2, e);
  11039. return n = this.hex_with_component(n, 1, t),
  11040. this.hex_with_component(n, 0, i)
  11041. },
  11042. component_from_hex: function(e, t) {
  11043. return e >> 8 * t & 255
  11044. },
  11045. hex_with_component: function(e, t, i) {
  11046. return i << (c = 8 * t) | e & ~(255 << c)
  11047. }
  11048. },
  11049. s = ee.color.toString,
  11050. l = ee.utils.common,
  11051. ae.COMPONENTS = ["r", "g", "b", "h", "s", "v", "hex", "a"],
  11052. l.extend(ae.prototype, {
  11053. toString: function() {
  11054. return s(this)
  11055. },
  11056. toOriginal: function() {
  11057. return this.__state.conversion.write(this)
  11058. }
  11059. }),
  11060. ie(ae.prototype, "r", 2),
  11061. ie(ae.prototype, "g", 1),
  11062. ie(ae.prototype, "b", 0),
  11063. ne(ae.prototype, "h"),
  11064. ne(ae.prototype, "s"),
  11065. ne(ae.prototype, "v"),
  11066. Object.defineProperty(ae.prototype, "a", {
  11067. get: function() {
  11068. return this.__state.a
  11069. },
  11070. set: function(e) {
  11071. this.__state.a = e
  11072. }
  11073. }),
  11074. Object.defineProperty(ae.prototype, "hex", {
  11075. get: function() {
  11076. return "HEX" !== !this.__state.space && (this.__state.hex = a.rgb_to_hex(this.r, this.g, this.b)),
  11077. this.__state.hex
  11078. },
  11079. set: function(e) {
  11080. this.__state.space = "HEX",
  11081. this.__state.hex = e
  11082. }
  11083. }),
  11084. ae), ee.color.interpret, ee.utils.common), ee.utils.requestAnimationFrame = window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || window.oRequestAnimationFrame || window.msRequestAnimationFrame || function(e, t) {
  11085. window.setTimeout(e, 1e3 / 60)
  11086. }
  11087. , ee.dom.CenteredDiv = (n = ee.dom.dom,
  11088. r = ee.utils.common,
  11089. te.prototype.show = function() {
  11090. var e = this;
  11091. this.backgroundElement.style.display = "block",
  11092. this.domElement.style.display = "block",
  11093. this.domElement.style.opacity = 0,
  11094. this.domElement.style.webkitTransform = "scale(1.1)",
  11095. this.layout(),
  11096. r.defer(function() {
  11097. e.backgroundElement.style.opacity = 1,
  11098. e.domElement.style.opacity = 1,
  11099. e.domElement.style.webkitTransform = "scale(1)"
  11100. })
  11101. }
  11102. ,
  11103. te.prototype.hide = function() {
  11104. var e = this
  11105. , t = function() {
  11106. e.domElement.style.display = "none",
  11107. e.backgroundElement.style.display = "none",
  11108. n.unbind(e.domElement, "webkitTransitionEnd", t),
  11109. n.unbind(e.domElement, "transitionend", t),
  11110. n.unbind(e.domElement, "oTransitionEnd", t)
  11111. };
  11112. n.bind(this.domElement, "webkitTransitionEnd", t),
  11113. n.bind(this.domElement, "transitionend", t),
  11114. n.bind(this.domElement, "oTransitionEnd", t),
  11115. this.backgroundElement.style.opacity = 0,
  11116. this.domElement.style.opacity = 0,
  11117. this.domElement.style.webkitTransform = "scale(1.1)"
  11118. }
  11119. ,
  11120. te.prototype.layout = function() {
  11121. this.domElement.style.left = $("#player").width() / 2 - n.getWidth(this.domElement) / 2 + "px",
  11122. this.domElement.style.top = $("#player").height() / 2 - n.getHeight(this.domElement) / 2 + "px"
  11123. }
  11124. ,
  11125. te), ee.dom.dom, ee.utils.common)
  11126. }
  11127. , {}],
  11128. 94: [function(e, t, i) {
  11129. (function(J) {
  11130. "use strict";
  11131. function i(e) {
  11132. function t(e, t) {
  11133. for (var i = 0, n = 0, r = new Array, o = 1; o <= 16; o++) {
  11134. for (var a = 1; a <= e[o]; a++)
  11135. r[t[n]] = [],
  11136. r[t[n]][0] = i,
  11137. r[t[n]][1] = o,
  11138. n++,
  11139. i++;
  11140. i *= 2
  11141. }
  11142. return r
  11143. }
  11144. function _(e) {
  11145. for (var t = e[0], i = e[1] - 1; 0 <= i; )
  11146. t & 1 << i && (B |= 1 << V),
  11147. i--,
  11148. --V < 0 && (255 == B ? (b(255),
  11149. b(0)) : b(B),
  11150. V = 7,
  11151. B = 0)
  11152. }
  11153. function b(e) {
  11154. F.push(e)
  11155. }
  11156. function w(e) {
  11157. b(e >> 8 & 255),
  11158. b(255 & e)
  11159. }
  11160. function T(e, t, i, n, r) {
  11161. for (var o, a = r[0], s = r[240], l = function(e, t) {
  11162. var i, n, r, o, a, s, l, c, h, u, d = 0;
  11163. for (h = 0; h < 8; ++h) {
  11164. i = e[d],
  11165. n = e[d + 1],
  11166. r = e[d + 2],
  11167. o = e[d + 3],
  11168. a = e[d + 4],
  11169. s = e[d + 5],
  11170. l = e[d + 6];
  11171. var p = i + (c = e[d + 7])
  11172. , f = i - c
  11173. , g = n + l
  11174. , m = n - l
  11175. , v = r + s
  11176. , y = r - s
  11177. , A = o + a
  11178. , C = o - a
  11179. , I = p + A
  11180. , E = p - A
  11181. , _ = g + v
  11182. , b = g - v;
  11183. e[d] = I + _,
  11184. e[d + 4] = I - _;
  11185. var w = .707106781 * (b + E);
  11186. e[d + 2] = E + w,
  11187. e[d + 6] = E - w;
  11188. var T = .382683433 * ((I = C + y) - (b = m + f))
  11189. , x = .5411961 * I + T
  11190. , S = 1.306562965 * b + T
  11191. , M = .707106781 * (_ = y + m)
  11192. , R = f + M
  11193. , P = f - M;
  11194. e[d + 5] = P + x,
  11195. e[d + 3] = P - x,
  11196. e[d + 1] = R + S,
  11197. e[d + 7] = R - S,
  11198. d += 8
  11199. }
  11200. for (h = d = 0; h < 8; ++h) {
  11201. i = e[d],
  11202. n = e[d + 8],
  11203. r = e[d + 16],
  11204. o = e[d + 24],
  11205. a = e[d + 32],
  11206. s = e[d + 40],
  11207. l = e[d + 48];
  11208. var O = i + (c = e[d + 56])
  11209. , L = i - c
  11210. , D = n + l
  11211. , N = n - l
  11212. , F = r + s
  11213. , B = r - s
  11214. , V = o + a
  11215. , k = o - a
  11216. , U = O + V
  11217. , H = O - V
  11218. , z = D + F
  11219. , G = D - F;
  11220. e[d] = U + z,
  11221. e[d + 32] = U - z;
  11222. var W = .707106781 * (G + H);
  11223. e[d + 16] = H + W,
  11224. e[d + 48] = H - W;
  11225. var j = .382683433 * ((U = k + B) - (G = N + L))
  11226. , Y = .5411961 * U + j
  11227. , q = 1.306562965 * G + j
  11228. , X = .707106781 * (z = B + N)
  11229. , Z = L + X
  11230. , K = L - X;
  11231. e[d + 40] = K + Y,
  11232. e[d + 24] = K - Y,
  11233. e[d + 8] = Z + q,
  11234. e[d + 56] = Z - q,
  11235. d++
  11236. }
  11237. for (h = 0; h < 64; ++h)
  11238. u = e[h] * t[h],
  11239. Q[h] = 0 < u ? .5 + u | 0 : u - .5 | 0;
  11240. return Q
  11241. }(e, t), c = 0; c < 64; ++c)
  11242. A[C[c]] = l[c];
  11243. var h = A[0] - i;
  11244. i = A[0],
  11245. 0 == h ? _(n[0]) : (_(n[y[o = 32767 + h]]),
  11246. _(v[o]));
  11247. for (var u = 63; 0 < u && 0 == A[u]; u--)
  11248. ;
  11249. if (0 == u)
  11250. return _(a),
  11251. i;
  11252. for (var d, p = 1; p <= u; ) {
  11253. for (var f = p; 0 == A[p] && p <= u; ++p)
  11254. ;
  11255. var g = p - f;
  11256. if (16 <= g) {
  11257. d = g >> 4;
  11258. for (var m = 1; m <= d; ++m)
  11259. _(s);
  11260. g &= 15
  11261. }
  11262. o = 32767 + A[p],
  11263. _(r[(g << 4) + y[o]]),
  11264. _(v[o]),
  11265. p++
  11266. }
  11267. return 63 != u && _(a),
  11268. i
  11269. }
  11270. function x(e) {
  11271. if (e <= 0 && (e = 1),
  11272. 100 < e && (e = 100),
  11273. i != e) {
  11274. (function(e) {
  11275. 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++) {
  11276. var n = u((t[i] * e + 50) / 100);
  11277. n < 1 ? n = 1 : 255 < n && (n = 255),
  11278. O[C[i]] = n
  11279. }
  11280. 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++) {
  11281. var a = u((r[o] * e + 50) / 100);
  11282. a < 1 ? a = 1 : 255 < a && (a = 255),
  11283. L[C[o]] = a
  11284. }
  11285. for (var s = [1, 1.387039845, 1.306562965, 1.175875602, 1, .785694958, .5411961, .275899379], l = 0, c = 0; c < 8; c++)
  11286. for (var h = 0; h < 8; h++)
  11287. D[l] = 1 / (O[C[l]] * s[c] * s[h] * 8),
  11288. N[l] = 1 / (L[C[l]] * s[c] * s[h] * 8),
  11289. l++
  11290. }
  11291. )(e < 50 ? Math.floor(5e3 / e) : Math.floor(200 - 2 * e)),
  11292. i = e
  11293. }
  11294. }
  11295. var S, M, R, P, i, u = (Math.round,
  11296. 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];
  11297. this.encode = function(e, t) {
  11298. var i = ((new Date).getTime(),
  11299. t.quality);
  11300. i && x(i),
  11301. F = new Array,
  11302. B = 0,
  11303. V = 7,
  11304. w(65496),
  11305. w(65504),
  11306. w(16),
  11307. b(74),
  11308. b(70),
  11309. b(73),
  11310. b(70),
  11311. b(0),
  11312. b(1),
  11313. b(1),
  11314. b(0),
  11315. w(1),
  11316. w(1),
  11317. b(0),
  11318. b(0),
  11319. function() {
  11320. w(65499),
  11321. w(132),
  11322. b(0);
  11323. for (var e = 0; e < 64; e++)
  11324. b(O[e]);
  11325. b(1);
  11326. for (var t = 0; t < 64; t++)
  11327. b(L[t])
  11328. }(),
  11329. function(e, t) {
  11330. w(65472),
  11331. w(17),
  11332. b(8),
  11333. w(t),
  11334. w(e),
  11335. b(3),
  11336. b(1),
  11337. b(17),
  11338. b(0),
  11339. b(2),
  11340. b(17),
  11341. b(1),
  11342. b(3),
  11343. b(17),
  11344. b(1)
  11345. }(e.width, e.height),
  11346. function() {
  11347. w(65476),
  11348. w(418),
  11349. b(0);
  11350. for (var e = 0; e < 16; e++)
  11351. b(G[e + 1]);
  11352. for (var t = 0; t <= 11; t++)
  11353. b(W[t]);
  11354. b(16);
  11355. for (var i = 0; i < 16; i++)
  11356. b(j[i + 1]);
  11357. for (var n = 0; n <= 161; n++)
  11358. b(Y[n]);
  11359. b(1);
  11360. for (var r = 0; r < 16; r++)
  11361. b(q[r + 1]);
  11362. for (var o = 0; o <= 11; o++)
  11363. b(X[o]);
  11364. b(17);
  11365. for (var a = 0; a < 16; a++)
  11366. b(Z[a + 1]);
  11367. for (var s = 0; s <= 161; s++)
  11368. b(K[s])
  11369. }(),
  11370. w(65498),
  11371. w(12),
  11372. b(3),
  11373. b(1),
  11374. b(0),
  11375. b(2),
  11376. b(17),
  11377. b(3),
  11378. b(17),
  11379. b(0),
  11380. b(63),
  11381. b(0);
  11382. var n = 0
  11383. , r = 0
  11384. , o = 0;
  11385. B = 0,
  11386. V = 7,
  11387. this.encode.displayName = "_encode_";
  11388. 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; ) {
  11389. for (a = 0; a < A; ) {
  11390. for (u = h = A * C + a,
  11391. d = -1,
  11392. f = p = 0; f < 64; f++)
  11393. u = h + (p = (y ? 63 - f : f) >> 3) * A + (d = 4 * (7 & f)),
  11394. v <= C + p && (u -= A * (C + 1 + p - v)),
  11395. A <= a + d && (u -= a + d - A + 4),
  11396. s = g[u++],
  11397. l = g[u++],
  11398. c = g[u++],
  11399. k[f] = (z[s] + z[l + 256 >> 0] + z[c + 512 >> 0] >> 16) - 128,
  11400. U[f] = (z[s + 768 >> 0] + z[l + 1024 >> 0] + z[c + 1280 >> 0] >> 16) - 128,
  11401. H[f] = (z[s + 1280 >> 0] + z[l + 1536 >> 0] + z[c + 1792 >> 0] >> 16) - 128;
  11402. n = T(k, D, n, S, R),
  11403. r = T(U, N, r, M, P),
  11404. o = T(H, N, o, M, P),
  11405. a += 32
  11406. }
  11407. C += I
  11408. }
  11409. if (0 <= V) {
  11410. var E = [];
  11411. E[1] = V + 1,
  11412. E[0] = (1 << V + 1) - 1,
  11413. _(E)
  11414. }
  11415. return w(65497),
  11416. new J(F)
  11417. }
  11418. ,
  11419. (new Date).getTime(),
  11420. e = e || 50,
  11421. function() {
  11422. for (var e = String.fromCharCode, t = 0; t < 256; t++)
  11423. n[t] = e(t)
  11424. }(),
  11425. S = t(G, W),
  11426. M = t(q, X),
  11427. R = t(j, Y),
  11428. P = t(Z, K),
  11429. function() {
  11430. for (var e = 1, t = 2, i = 1; i <= 15; i++) {
  11431. for (var n = e; n < t; n++)
  11432. y[32767 + n] = i,
  11433. v[32767 + n] = [],
  11434. v[32767 + n][1] = i,
  11435. v[32767 + n][0] = n;
  11436. for (var r = -(t - 1); r <= -e; r++)
  11437. y[32767 + r] = i,
  11438. v[32767 + r] = [],
  11439. v[32767 + r][1] = i,
  11440. v[32767 + r][0] = t - 1 + r;
  11441. e <<= 1,
  11442. t <<= 1
  11443. }
  11444. }(),
  11445. function() {
  11446. for (var e = 0; e < 256; e++)
  11447. z[e] = 19595 * e,
  11448. z[e + 256 >> 0] = 38470 * e,
  11449. z[e + 512 >> 0] = 7471 * e + 32768,
  11450. z[e + 768 >> 0] = -11059 * e,
  11451. z[e + 1024 >> 0] = -21709 * e,
  11452. z[e + 1280 >> 0] = 32768 * e + 8421375,
  11453. z[e + 1536 >> 0] = -27439 * e,
  11454. z[e + 1792 >> 0] = -5329 * e
  11455. }(),
  11456. x(e),
  11457. (new Date).getTime()
  11458. }
  11459. t.exports.encode = function(e, t) {
  11460. return (t = t || {}).quality = t.quality || 50,
  11461. {
  11462. data: new i(t.quality).encode(e, t),
  11463. width: e.width,
  11464. height: e.height
  11465. }
  11466. }
  11467. }
  11468. ).call(this, e("buffer").Buffer)
  11469. }
  11470. , {
  11471. buffer: 198
  11472. }],
  11473. 95: [function(e, t, i) {
  11474. "use strict";
  11475. !function() {
  11476. if ("performance"in window == 0 && (window.performance = {}),
  11477. Date.now = Date.now || function() {
  11478. return (new Date).getTime()
  11479. }
  11480. ,
  11481. "now"in window.performance == 0) {
  11482. var e = Date.now();
  11483. performance.timing && performance.timing.navigationStart && (e = performance.timing.navigationStart),
  11484. window.performance.now = function() {
  11485. return Date.now() - e
  11486. }
  11487. }
  11488. }()
  11489. }
  11490. , {}],
  11491. 96: [function(e, t, i) {
  11492. "use strict";
  11493. var a = e("three");
  11494. a.EffectComposer = function(e, t) {
  11495. if (this.renderer = e,
  11496. void 0 === t) {
  11497. var i = {
  11498. minFilter: a.LinearFilter,
  11499. magFilter: a.LinearFilter,
  11500. format: a.RGBAFormat,
  11501. stencilBuffer: !1
  11502. }
  11503. , n = e.getSize();
  11504. t = new a.WebGLRenderTarget(n.width,n.height,i)
  11505. }
  11506. this.renderTarget1 = t,
  11507. this.renderTarget2 = t.clone(),
  11508. this.writeBuffer = this.renderTarget1,
  11509. this.readBuffer = this.renderTarget2,
  11510. this.passes = [],
  11511. void 0 === a.CopyShader && console.error("THREE.EffectComposer relies on THREE.CopyShader"),
  11512. this.copyPass = new a.ShaderPass(a.CopyShader)
  11513. }
  11514. ,
  11515. a.EffectComposer.prototype = {
  11516. swapBuffers: function() {
  11517. var e = this.readBuffer;
  11518. this.readBuffer = this.writeBuffer,
  11519. this.writeBuffer = e
  11520. },
  11521. addPass: function(e) {
  11522. this.passes.push(e)
  11523. },
  11524. insertPass: function(e, t) {
  11525. this.passes.splice(t, 0, e)
  11526. },
  11527. render: function(e) {
  11528. this.writeBuffer = this.renderTarget1,
  11529. this.readBuffer = this.renderTarget2;
  11530. var t, i, n = !1, r = this.passes.length;
  11531. for (i = 0; i < r; i++)
  11532. if ((t = this.passes[i]).enabled) {
  11533. if (t.render(this.renderer, this.writeBuffer, this.readBuffer, e, n),
  11534. t.needsSwap) {
  11535. if (n) {
  11536. var o = this.renderer.context;
  11537. o.stencilFunc(o.NOTEQUAL, 1, 4294967295),
  11538. this.copyPass.render(this.renderer, this.writeBuffer, this.readBuffer, e),
  11539. o.stencilFunc(o.EQUAL, 1, 4294967295)
  11540. }
  11541. this.swapBuffers()
  11542. }
  11543. t instanceof a.MaskPass ? n = !0 : t instanceof a.ClearMaskPass && (n = !1)
  11544. }
  11545. },
  11546. reset: function(e) {
  11547. if (void 0 === e) {
  11548. var t = this.renderer.getSize();
  11549. (e = this.renderTarget1.clone()).setSize(t.width, t.height)
  11550. }
  11551. this.renderTarget1.dispose(),
  11552. this.renderTarget2.dispose(),
  11553. this.renderTarget1 = e,
  11554. this.renderTarget2 = e.clone(),
  11555. this.writeBuffer = this.renderTarget1,
  11556. this.readBuffer = this.renderTarget2
  11557. },
  11558. setSize: function(e, t) {
  11559. this.renderTarget1.setSize(e, t),
  11560. this.renderTarget2.setSize(e, t)
  11561. this.passes.forEach(a=>{//add for TransitionPass
  11562. a.setSize && a.setSize(e, t)
  11563. })
  11564. }
  11565. }
  11566. }
  11567. , {
  11568. three: 217
  11569. }],
  11570. 97: [function(e, t, i) {
  11571. "use strict";
  11572. var n = e("three");
  11573. n.MaskPass = function(e, t) {
  11574. this.scene = e,
  11575. this.camera = t,
  11576. this.enabled = !0,
  11577. this.clear = !0,
  11578. this.needsSwap = !1,
  11579. this.inverse = !1
  11580. }
  11581. ,
  11582. n.MaskPass.prototype = {
  11583. render: function(e, t, i, n) {
  11584. var r, o, a = e.context;
  11585. a.colorMask(!1, !1, !1, !1),
  11586. a.depthMask(!1),
  11587. o = this.inverse ? (r = 0,
  11588. 1) : (r = 1,
  11589. 0),
  11590. a.enable(a.STENCIL_TEST),
  11591. a.stencilOp(a.REPLACE, a.REPLACE, a.REPLACE),
  11592. a.stencilFunc(a.ALWAYS, r, 4294967295),
  11593. a.clearStencil(o),
  11594. e.render(this.scene, this.camera, i, this.clear),
  11595. e.render(this.scene, this.camera, t, this.clear),
  11596. a.colorMask(!0, !0, !0, !0),
  11597. a.depthMask(!0),
  11598. a.stencilFunc(a.EQUAL, 1, 4294967295),
  11599. a.stencilOp(a.KEEP, a.KEEP, a.KEEP)
  11600. }
  11601. },
  11602. n.ClearMaskPass = function() {
  11603. this.enabled = !0
  11604. }
  11605. ,
  11606. n.ClearMaskPass.prototype = {
  11607. render: function(e, t, i, n) {
  11608. var r = e.context;
  11609. r.disable(r.STENCIL_TEST)
  11610. }
  11611. }
  11612. }
  11613. , {
  11614. three: 217
  11615. }],
  11616. 98: [function(e, t, i) {
  11617. "use strict";
  11618. var o = e("three");
  11619. o.RenderPass = function(e, t, i, n, r) {
  11620. this.scene = e,
  11621. this.camera = t,
  11622. this.overrideMaterial = i,
  11623. this.clearColor = n,
  11624. this.clearAlpha = void 0 !== r ? r : 1,
  11625. this.oldClearColor = new o.Color,
  11626. this.oldClearAlpha = 1,
  11627. this.enabled = !0,
  11628. this.clear = !0,
  11629. this.needsSwap = !1
  11630. }
  11631. ,
  11632. o.RenderPass.prototype = {
  11633. render: function(e, t, i, n) {
  11634. this.scene.overrideMaterial = this.overrideMaterial,
  11635. this.clearColor && (this.oldClearColor.copy(e.getClearColor()),
  11636. this.oldClearAlpha = e.getClearAlpha(),
  11637. e.setClearColor(this.clearColor, this.clearAlpha)),
  11638. e.render(this.scene, this.camera, i, this.clear),
  11639. this.clearColor && e.setClearColor(this.oldClearColor, this.oldClearAlpha),
  11640. this.scene.overrideMaterial = null
  11641. }
  11642. }
  11643. }
  11644. , {
  11645. three: 217
  11646. }],
  11647. 99: [function(e, t, i) {
  11648. "use strict";
  11649. var n = e("three");
  11650. n.ShaderPass = function(e, t) {
  11651. this.textureID = void 0 !== t ? t : "tDiffuse",
  11652. e instanceof n.ShaderMaterial ? (this.uniforms = e.uniforms,
  11653. this.material = e) : e && (this.uniforms = n.UniformsUtils.clone(e.uniforms),
  11654. this.material = new n.ShaderMaterial({
  11655. defines: e.defines || {},
  11656. uniforms: this.uniforms,
  11657. vertexShader: e.vertexShader,
  11658. fragmentShader: e.fragmentShader
  11659. })),
  11660. this.renderToScreen = !1,
  11661. this.enabled = !0,
  11662. this.needsSwap = !0,
  11663. this.clear = !1,
  11664. this.camera = new n.OrthographicCamera(-1,1,1,-1,0,1),
  11665. this.scene = new n.Scene,
  11666. this.quad = new n.Mesh(new n.PlaneBufferGeometry(2,2),null),
  11667. this.scene.add(this.quad)
  11668. }
  11669. ,
  11670. n.ShaderPass.prototype = {
  11671. render: function(e, t, i, n) {
  11672. this.uniforms[this.textureID] && (this.uniforms[this.textureID].value = i),
  11673. this.quad.material = this.material,
  11674. this.renderToScreen ? e.render(this.scene, this.camera) : e.render(this.scene, this.camera, t, this.clear)
  11675. }
  11676. }
  11677. }
  11678. , {
  11679. three: 217
  11680. }],
  11681. 100: [function(e, t, i) {
  11682. "use strict";
  11683. e("three").CopyShader = {
  11684. uniforms: {
  11685. tDiffuse: {
  11686. type: "t",
  11687. value: null
  11688. },
  11689. opacity: {
  11690. type: "f",
  11691. value: 1
  11692. }
  11693. },
  11694. vertexShader: ["varying vec2 vUv;", "void main() {", "vUv = uv;", "gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );", "}"].join("\n"),
  11695. fragmentShader: ["uniform float opacity;", "uniform sampler2D tDiffuse;", "varying vec2 vUv;", "void main() {", "vec4 texel = texture2D( tDiffuse, vUv );", "gl_FragColor = opacity * texel;", "}"].join("\n")
  11696. }
  11697. }
  11698. , {
  11699. three: 217
  11700. }],
  11701. 101: [function(e, t, i) {
  11702. "use strict";
  11703. e("three").HorizontalBlurShader = {
  11704. uniforms: {
  11705. tDiffuse: {
  11706. type: "t",
  11707. value: null
  11708. },
  11709. h: {
  11710. type: "f",
  11711. value: 1 / 512
  11712. }
  11713. },
  11714. vertexShader: ["varying vec2 vUv;", "void main() {", "vUv = uv;", "gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );", "}"].join("\n"),
  11715. 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")
  11716. }
  11717. }
  11718. , {
  11719. three: 217
  11720. }],
  11721. 102: [function(e, t, i) {
  11722. "use strict";
  11723. e("three").VerticalBlurShader = {
  11724. uniforms: {
  11725. tDiffuse: {
  11726. type: "t",
  11727. value: null
  11728. },
  11729. v: {
  11730. type: "f",
  11731. value: 1 / 512
  11732. }
  11733. },
  11734. vertexShader: ["varying vec2 vUv;", "void main() {", "vUv = uv;", "gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );", "}"].join("\n"),
  11735. 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")
  11736. }
  11737. }
  11738. , {
  11739. three: 217
  11740. }],
  11741. 103: [function(e, t, i) {
  11742. "use strict";
  11743. var z = e("three");
  11744. !function() {
  11745. if ("performance"in window == 0 && (window.performance = {}),
  11746. "now"in window.performance == 0) {
  11747. var e = Date.now();
  11748. performance.timing && performance.timing.navigationStart && (e = performance.timing.navigationStart),
  11749. window.performance.now = function() {
  11750. return Date.now() - e
  11751. }
  11752. }
  11753. }(),
  11754. z.WebGLRenderer.prototype.paramThreeToGL = function(e) {
  11755. var t, i = this.extensions, n = this.context;
  11756. if (e === z.RepeatWrapping)
  11757. return n.REPEAT;
  11758. if (e === z.ClampToEdgeWrapping)
  11759. return n.CLAMP_TO_EDGE;
  11760. if (e === z.MirroredRepeatWrapping)
  11761. return n.MIRRORED_REPEAT;
  11762. if (e === z.NearestFilter)
  11763. return n.NEAREST;
  11764. if (e === z.NearestMipMapNearestFilter)
  11765. return n.NEAREST_MIPMAP_NEAREST;
  11766. if (e === z.NearestMipMapLinearFilter)
  11767. return n.NEAREST_MIPMAP_LINEAR;
  11768. if (e === z.LinearFilter)
  11769. return n.LINEAR;
  11770. if (e === z.LinearMipMapNearestFilter)
  11771. return n.LINEAR_MIPMAP_NEAREST;
  11772. if (e === z.LinearMipMapLinearFilter)
  11773. return n.LINEAR_MIPMAP_LINEAR;
  11774. if (e === z.UnsignedByteType)
  11775. return n.UNSIGNED_BYTE;
  11776. if (e === z.UnsignedShort4444Type)
  11777. return n.UNSIGNED_SHORT_4_4_4_4;
  11778. if (e === z.UnsignedShort5551Type)
  11779. return n.UNSIGNED_SHORT_5_5_5_1;
  11780. if (e === z.UnsignedShort565Type)
  11781. return n.UNSIGNED_SHORT_5_6_5;
  11782. if (e === z.ByteType)
  11783. return n.BYTE;
  11784. if (e === z.ShortType)
  11785. return n.SHORT;
  11786. if (e === z.UnsignedShortType)
  11787. return n.UNSIGNED_SHORT;
  11788. if (e === z.IntType)
  11789. return n.INT;
  11790. if (e === z.UnsignedIntType)
  11791. return n.UNSIGNED_INT;
  11792. if (e === z.FloatType)
  11793. return n.FLOAT;
  11794. if (null !== (t = i.get("OES_texture_half_float")) && e === z.HalfFloatType)
  11795. return t.HALF_FLOAT_OES;
  11796. if (e === z.AlphaFormat)
  11797. return n.ALPHA;
  11798. if (e === z.RGBFormat)
  11799. return n.RGB;
  11800. if (e === z.RGBAFormat)
  11801. return n.RGBA;
  11802. if (e === z.LuminanceFormat)
  11803. return n.LUMINANCE;
  11804. if (e === z.LuminanceAlphaFormat)
  11805. return n.LUMINANCE_ALPHA;
  11806. if (e === z.AddEquation)
  11807. return n.FUNC_ADD;
  11808. if (e === z.SubtractEquation)
  11809. return n.FUNC_SUBTRACT;
  11810. if (e === z.ReverseSubtractEquation)
  11811. return n.FUNC_REVERSE_SUBTRACT;
  11812. if (e === z.ZeroFactor)
  11813. return n.ZERO;
  11814. if (e === z.OneFactor)
  11815. return n.ONE;
  11816. if (e === z.SrcColorFactor)
  11817. return n.SRC_COLOR;
  11818. if (e === z.OneMinusSrcColorFactor)
  11819. return n.ONE_MINUS_SRC_COLOR;
  11820. if (e === z.SrcAlphaFactor)
  11821. return n.SRC_ALPHA;
  11822. if (e === z.OneMinusSrcAlphaFactor)
  11823. return n.ONE_MINUS_SRC_ALPHA;
  11824. if (e === z.DstAlphaFactor)
  11825. return n.DST_ALPHA;
  11826. if (e === z.OneMinusDstAlphaFactor)
  11827. return n.ONE_MINUS_DST_ALPHA;
  11828. if (e === z.DstColorFactor)
  11829. return n.DST_COLOR;
  11830. if (e === z.OneMinusDstColorFactor)
  11831. return n.ONE_MINUS_DST_COLOR;
  11832. if (e === z.SrcAlphaSaturateFactor)
  11833. return n.SRC_ALPHA_SATURATE;
  11834. if (null !== (t = i.get("WEBGL_compressed_texture_s3tc"))) {
  11835. if (e === z.RGB_S3TC_DXT1_Format)
  11836. return t.COMPRESSED_RGB_S3TC_DXT1_EXT;
  11837. if (e === z.RGBA_S3TC_DXT1_Format)
  11838. return t.COMPRESSED_RGBA_S3TC_DXT1_EXT;
  11839. if (e === z.RGBA_S3TC_DXT3_Format)
  11840. return t.COMPRESSED_RGBA_S3TC_DXT3_EXT;
  11841. if (e === z.RGBA_S3TC_DXT5_Format)
  11842. return t.COMPRESSED_RGBA_S3TC_DXT5_EXT
  11843. }
  11844. if (null !== (t = i.get("WEBGL_compressed_texture_pvrtc"))) {
  11845. if (e === z.RGB_PVRTC_4BPPV1_Format)
  11846. return t.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;
  11847. if (e === z.RGB_PVRTC_2BPPV1_Format)
  11848. return t.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;
  11849. if (e === z.RGBA_PVRTC_4BPPV1_Format)
  11850. return t.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;
  11851. if (e === z.RGBA_PVRTC_2BPPV1_Format)
  11852. return t.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG
  11853. }
  11854. if (null !== (t = i.get("WEBGL_compressed_texture_etc1")) && e === z.RGB_ETC1_Format)
  11855. return t.COMPRESSED_RGB_ETC1_WEBGL;
  11856. if (null !== (t = i.get("EXT_blend_minmax"))) {
  11857. if (e === z.MinEquation)
  11858. return t.MIN_EXT;
  11859. if (e === z.MaxEquation)
  11860. return t.MAX_EXT
  11861. }
  11862. return 0
  11863. }
  11864. ,
  11865. z.WebGLState = function(l, i, c) {
  11866. var n = this
  11867. , r = new z.Vector4
  11868. , e = l.getParameter(l.MAX_VERTEX_ATTRIBS)
  11869. , o = new Uint8Array(e)
  11870. , a = new Uint8Array(e)
  11871. , s = new Uint8Array(e)
  11872. , t = {}
  11873. , h = null
  11874. , u = null
  11875. , d = null
  11876. , p = null
  11877. , f = null
  11878. , g = null
  11879. , m = null
  11880. , v = null
  11881. , y = !1
  11882. , A = null
  11883. , C = null
  11884. , I = null
  11885. , E = null
  11886. , _ = null
  11887. , b = null
  11888. , w = null
  11889. , T = null
  11890. , x = null
  11891. , S = null
  11892. , M = null
  11893. , R = null
  11894. , P = null
  11895. , O = null
  11896. , L = null
  11897. , D = l.getParameter(l.MAX_TEXTURE_IMAGE_UNITS)
  11898. , N = void 0
  11899. , F = {}
  11900. , B = new z.Vector4
  11901. , V = null
  11902. , k = null
  11903. , U = new z.Vector4
  11904. , H = new z.Vector4;
  11905. this.init = function() {
  11906. this.clearColor(0, 0, 0, 1),
  11907. this.clearDepth(1),
  11908. this.clearStencil(0),
  11909. this.enable(l.DEPTH_TEST),
  11910. l.depthFunc(l.LEQUAL),
  11911. l.frontFace(l.CCW),
  11912. l.cullFace(l.BACK),
  11913. this.enable(l.CULL_FACE),
  11914. this.enable(l.BLEND),
  11915. l.blendEquation(l.FUNC_ADD),
  11916. l.blendFunc(l.SRC_ALPHA, l.ONE_MINUS_SRC_ALPHA)
  11917. }
  11918. ,
  11919. this.initAttributes = function() {
  11920. for (var e = 0, t = o.length; e < t; e++)
  11921. o[e] = 0
  11922. }
  11923. ,
  11924. this.enableAttribute = function(e) {
  11925. o[e] = 1,
  11926. 0 === a[e] && (l.enableVertexAttribArray(e),
  11927. a[e] = 1),
  11928. 0 !== s[e] && (i.get("ANGLE_instanced_arrays").vertexAttribDivisorANGLE(e, 0),
  11929. s[e] = 0)
  11930. }
  11931. ,
  11932. this.enableAttributeAndDivisor = function(e, t, i) {
  11933. o[e] = 1,
  11934. 0 === a[e] && (l.enableVertexAttribArray(e),
  11935. a[e] = 1),
  11936. s[e] !== t && (i.vertexAttribDivisorANGLE(e, t),
  11937. s[e] = t)
  11938. }
  11939. ,
  11940. this.disableUnusedAttributes = function() {
  11941. for (var e = 0, t = a.length; e < t; e++)
  11942. a[e] !== o[e] && (l.disableVertexAttribArray(e),
  11943. a[e] = 0)
  11944. }
  11945. ,
  11946. this.enable = function(e) {
  11947. !0 !== t[e] && (l.enable(e),
  11948. t[e] = !0)
  11949. }
  11950. ,
  11951. this.disable = function(e) {
  11952. !1 !== t[e] && (l.disable(e),
  11953. t[e] = !1)
  11954. }
  11955. ,
  11956. this.getCompressedTextureFormats = function() {
  11957. if (null === h && (h = [],
  11958. i.get("WEBGL_compressed_texture_pvrtc") || i.get("WEBGL_compressed_texture_s3tc") || i.get("WEBGL_compressed_texture_etc1")))
  11959. for (var e = l.getParameter(l.COMPRESSED_TEXTURE_FORMATS), t = 0; t < e.length; t++)
  11960. h.push(e[t]);
  11961. return h
  11962. }
  11963. ,
  11964. this.setBlending = function(e, t, i, n, r, o, a, s) {
  11965. e === z.NoBlending ? this.disable(l.BLEND) : this.enable(l.BLEND),
  11966. e === u && s === y || (e === z.AdditiveBlending ? s ? (l.blendEquationSeparate(l.FUNC_ADD, l.FUNC_ADD),
  11967. l.blendFuncSeparate(l.ONE, l.ONE, l.ONE, l.ONE)) : (l.blendEquation(l.FUNC_ADD),
  11968. l.blendFunc(l.SRC_ALPHA, l.ONE)) : e === z.SubtractiveBlending ? s ? (l.blendEquationSeparate(l.FUNC_ADD, l.FUNC_ADD),
  11969. l.blendFuncSeparate(l.ZERO, l.ZERO, l.ONE_MINUS_SRC_COLOR, l.ONE_MINUS_SRC_ALPHA)) : (l.blendEquation(l.FUNC_ADD),
  11970. l.blendFunc(l.ZERO, l.ONE_MINUS_SRC_COLOR)) : e === z.MultiplyBlending ? s ? (l.blendEquationSeparate(l.FUNC_ADD, l.FUNC_ADD),
  11971. l.blendFuncSeparate(l.ZERO, l.ZERO, l.SRC_COLOR, l.SRC_ALPHA)) : (l.blendEquation(l.FUNC_ADD),
  11972. l.blendFunc(l.ZERO, l.SRC_COLOR)) : s ? (l.blendEquationSeparate(l.FUNC_ADD, l.FUNC_ADD),
  11973. l.blendFuncSeparate(l.ONE, l.ONE_MINUS_SRC_ALPHA, l.ONE, l.ONE_MINUS_SRC_ALPHA)) : (l.blendEquationSeparate(l.FUNC_ADD, l.FUNC_ADD),
  11974. l.blendFuncSeparate(l.SRC_ALPHA, l.ONE_MINUS_SRC_ALPHA, l.ONE, l.ONE_MINUS_SRC_ALPHA)),
  11975. u = e,
  11976. y = s),
  11977. e === z.CustomBlending ? (r = r || t,
  11978. o = o || i,
  11979. a = a || n,
  11980. t === d && r === g || (l.blendEquationSeparate(c(t), c(r)),
  11981. d = t,
  11982. g = r),
  11983. i === p && n === f && o === m && a === v || (l.blendFuncSeparate(c(i), c(n), c(o), c(a)),
  11984. p = i,
  11985. f = n,
  11986. m = o,
  11987. v = a)) : v = m = g = f = p = d = null
  11988. }
  11989. ,
  11990. this.setDepthFunc = function(e) {
  11991. if (A !== e) {
  11992. if (e)
  11993. switch (e) {
  11994. case z.NeverDepth:
  11995. l.depthFunc(l.NEVER);
  11996. break;
  11997. case z.AlwaysDepth:
  11998. l.depthFunc(l.ALWAYS);
  11999. break;
  12000. case z.LessDepth:
  12001. l.depthFunc(l.LESS);
  12002. break;
  12003. case z.LessEqualDepth:
  12004. l.depthFunc(l.LEQUAL);
  12005. break;
  12006. case z.EqualDepth:
  12007. l.depthFunc(l.EQUAL);
  12008. break;
  12009. case z.GreaterEqualDepth:
  12010. l.depthFunc(l.GEQUAL);
  12011. break;
  12012. case z.GreaterDepth:
  12013. l.depthFunc(l.GREATER);
  12014. break;
  12015. case z.NotEqualDepth:
  12016. l.depthFunc(l.NOTEQUAL);
  12017. break;
  12018. default:
  12019. l.depthFunc(l.LEQUAL)
  12020. }
  12021. else
  12022. l.depthFunc(l.LEQUAL);
  12023. A = e
  12024. }
  12025. }
  12026. ,
  12027. this.setDepthTest = function(e) {
  12028. e ? this.enable(l.DEPTH_TEST) : this.disable(l.DEPTH_TEST)
  12029. }
  12030. ,
  12031. this.setDepthWrite = function(e) {
  12032. C !== e && (l.depthMask(e),
  12033. C = e)
  12034. }
  12035. ,
  12036. this.setColorWrite = function(e) {
  12037. I !== e && (l.colorMask(e, e, e, e),
  12038. I = e)
  12039. }
  12040. ,
  12041. this.setStencilFunc = function(e, t, i) {
  12042. _ === e && b === t && w === i || (l.stencilFunc(e, t, i),
  12043. _ = e,
  12044. b = t,
  12045. w = i)
  12046. }
  12047. ,
  12048. this.setStencilOp = function(e, t, i) {
  12049. T === e && x === t && S === i || (l.stencilOp(e, t, i),
  12050. T = e,
  12051. x = t,
  12052. S = i)
  12053. }
  12054. ,
  12055. this.setStencilTest = function(e) {
  12056. e ? this.enable(l.STENCIL_TEST) : this.disable(l.STENCIL_TEST)
  12057. }
  12058. ,
  12059. this.setStencilWrite = function(e) {
  12060. E !== e && (l.stencilMask(e),
  12061. E = e)
  12062. }
  12063. ,
  12064. this.setFlipSided = function(e) {
  12065. M !== e && (e ? l.frontFace(l.CW) : l.frontFace(l.CCW),
  12066. M = e)
  12067. }
  12068. ,
  12069. this.setLineWidth = function(e) {
  12070. e !== R && (l.lineWidth(e),
  12071. R = e)
  12072. }
  12073. ,
  12074. this.setPolygonOffset = function(e, t, i) {
  12075. e ? this.enable(l.POLYGON_OFFSET_FILL) : this.disable(l.POLYGON_OFFSET_FILL),
  12076. !e || P === t && O === i || (l.polygonOffset(t, i),
  12077. P = t,
  12078. O = i)
  12079. }
  12080. ,
  12081. this.getScissorTest = function() {
  12082. return L
  12083. }
  12084. ,
  12085. this.setScissorTest = function(e) {
  12086. (L = e) ? this.enable(l.SCISSOR_TEST) : this.disable(l.SCISSOR_TEST)
  12087. }
  12088. ,
  12089. this.activeTexture = function(e) {
  12090. void 0 === e && (e = l.TEXTURE0 + D - 1),
  12091. N !== e && (l.activeTexture(e),
  12092. N = e)
  12093. }
  12094. ,
  12095. this.bindTexture = function(e, t) {
  12096. void 0 === N && n.activeTexture();
  12097. var i = F[N];
  12098. void 0 === i && (i = {
  12099. type: void 0,
  12100. texture: void 0
  12101. },
  12102. F[N] = i),
  12103. i.type === e && i.texture === t || (l.bindTexture(e, t),
  12104. i.type = e,
  12105. i.texture = t)
  12106. }
  12107. ,
  12108. this.compressedTexImage2D = function() {
  12109. try {
  12110. l.compressedTexImage2D.apply(l, arguments)
  12111. } catch (e) {
  12112. console.error(e)
  12113. }
  12114. }
  12115. ,
  12116. this.texImage2D = function() {
  12117. try {
  12118. l.texImage2D.apply(l, arguments)
  12119. } catch (e) {
  12120. console.error(e)
  12121. }
  12122. }
  12123. ,
  12124. this.clearColor = function(e, t, i, n) {
  12125. r.set(e, t, i, n),
  12126. !1 === B.equals(r) && (l.clearColor(e, t, i, n),
  12127. B.copy(r))
  12128. }
  12129. ,
  12130. this.clearDepth = function(e) {
  12131. V !== e && (l.clearDepth(e),
  12132. V = e)
  12133. }
  12134. ,
  12135. this.clearStencil = function(e) {
  12136. k !== e && (l.clearStencil(e),
  12137. k = e)
  12138. }
  12139. ,
  12140. this.scissor = function(e) {
  12141. !1 === U.equals(e) && (l.scissor(e.x, e.y, e.z, e.w),
  12142. U.copy(e))
  12143. }
  12144. ,
  12145. this.viewport = function(e) {
  12146. !1 === H.equals(e) && (l.viewport(e.x, e.y, e.z, e.w),
  12147. H.copy(e))
  12148. }
  12149. ,
  12150. this.reset = function() {
  12151. for (var e = 0; e < a.length; e++)
  12152. 1 === a[e] && (l.disableVertexAttribArray(e),
  12153. a[e] = 0);
  12154. t = {},
  12155. N = void 0,
  12156. F = {},
  12157. M = E = C = I = u = h = null
  12158. }
  12159. }
  12160. }
  12161. , {
  12162. three: 217
  12163. }],
  12164. 104: [function(a, h, e) {
  12165. (function(i, e) {
  12166. "use strict";
  12167. function t(e) {
  12168. this.urls = e;
  12169. var t = i("bWVzc2FnZSBiaW5hcnlfbWVzaCB7CglyZXBlYXRlZCBjaHVua19zaW1wbGUgY2h1bmsgPSAxOwoJcmVwZWF0ZWQgY2h1bmtfcXVhbnRpemVkIHF1YW50aXplZF9jaHVuayA9IDI7Cn0KCi8vIERlZmluaXRpb24gb2YgdmVydGljZXM6IDNEIGNvb3JkaW5hdGVzLCBhbmQgMkQgdGV4dHVyZSBjb29yZGluYXRlcy4KbWVzc2FnZSB2ZXJ0aWNlc19zaW1wbGUgewoJcmVwZWF0ZWQgZmxvYXQgeHl6ID0gMSBbcGFja2VkPXRydWVdOyAgLy8geF8wLHlfMCx6XzAsIHhfMSx5XzEsel8xLCAuLi4KCXJlcGVhdGVkIGZsb2F0IHV2ID0gMiBbcGFja2VkPXRydWVdOyAgLy8gdV8wLHZfMCwgdV8xLHZfMSwgLi4uCn0KCi8vIEluZGV4ZXMgb2YgdmVydGljZXMgb2YgZmFjZXMKbWVzc2FnZSBmYWNlc19zaW1wbGUgewoJcmVwZWF0ZWQgdWludDMyIGZhY2VzID0gMSBbcGFja2VkPXRydWVdOyAvLyBpMDAsaTAxLGkwMiwgaTEwLGkxMSxpMTIsIC4uLgp9CgovLyBBIHNpbXBseSBlbmNvZGVkIGNodW5rLgovLyBUT0RPOiBhZGQgY2h1bmsgcHJvcGVyaXRlcyAoc3VjaCBhcyAicmVmbGVjdGl2ZSIpCm1lc3NhZ2UgY2h1bmtfc2ltcGxlIHsKCW9wdGlvbmFsIHZlcnRpY2VzX3NpbXBsZSB2ZXJ0aWNlcyA9IDE7CglvcHRpb25hbCBmYWNlc19zaW1wbGUgZmFjZXMgPSAyOwoJb3B0aW9uYWwgc3RyaW5nIGNodW5rX25hbWUgPSAzOwoJb3B0aW9uYWwgc3RyaW5nIG1hdGVyaWFsX25hbWUgPSA0Owp9CgovLyBRdWFudGl6ZWQgdmVyc2lvbnMgZm9sbG93OgptZXNzYWdlIHZlcnRpY2VzX3F1YW50aXplZCB7CglvcHRpb25hbCBmbG9hdCBxdWFudGl6YXRpb24gPSAxOwoJcmVwZWF0ZWQgZmxvYXQgdHJhbnNsYXRpb24gPSAyOwoJcmVwZWF0ZWQgc2ludDMyIHggPSAzIFtwYWNrZWQ9dHJ1ZV07CglyZXBlYXRlZCBzaW50MzIgeSA9IDQgW3BhY2tlZD10cnVlXTsKCXJlcGVhdGVkIHNpbnQzMiB6ID0gNSBbcGFja2VkPXRydWVdOwp9CgptZXNzYWdlIHV2X3F1YW50aXplZCB7CglvcHRpb25hbCBzdHJpbmcgbmFtZSA9IDE7CglvcHRpb25hbCBmbG9hdCBxdWFudGl6YXRpb24gPSAyOwoJcmVwZWF0ZWQgc2ludDMyIHUgPSAzIFtwYWNrZWQ9dHJ1ZV07CglyZXBlYXRlZCBzaW50MzIgdiA9IDQgW3BhY2tlZD10cnVlXTsKfQoKLy8gSW5kZXhlcyBvZiB2ZXJ0aWNlcyBvZiBmYWNlcwptZXNzYWdlIGZhY2VzX2NvbXByZXNzZWQgewoJcmVwZWF0ZWQgc2ludDMyIGZhY2VzID0gMSBbcGFja2VkPXRydWVdOyAvLyBpMDAsaTAxLGkwMiwgaTEwLGkxMSxpMTIsIC4uLgp9CgptZXNzYWdlIGNodW5rX3F1YW50aXplZCB7CglvcHRpb25hbCBzdHJpbmcgY2h1bmtfbmFtZSA9IDE7CglvcHRpb25hbCBzdHJpbmcgbWF0ZXJpYWxfbmFtZSA9IDI7CglvcHRpb25hbCB2ZXJ0aWNlc19xdWFudGl6ZWQgdmVydGljZXMgPSAzOwoJcmVwZWF0ZWQgdXZfcXVhbnRpemVkIHV2cyA9IDQ7CglvcHRpb25hbCBmYWNlc19zaW1wbGUgZmFjZXMgPSA1Owp9Cg==", "base64");
  12170. this.builder = n.loadProto(t),
  12171. this.decoder = this.builder.build("binary_mesh")
  12172. }
  12173. var s = a("three")
  12174. , n = a("protobufjs")
  12175. , r = a("../util/logger")
  12176. , o = (a("../util/common"),
  12177. a("../util/ajax"))
  12178. , l = a("../objects/Chunk")
  12179. , c = new r(e);
  12180. t.prototype = {
  12181. constructor: t,
  12182. load: function(t, i, n, r) {
  12183. return c.time("download"),
  12184. o.get(t, {
  12185. responseType: "arraybuffer"
  12186. }).done(function(e) {
  12187. c.timeEnd("download"),
  12188. this.parse(e, t, i, n, r)
  12189. }
  12190. .bind(this)).fail(r)
  12191. },
  12192. parse: function(e, t, i, n, r) {
  12193. var o = this.readProtobuf(e);
  12194. if (!o)
  12195. return r();
  12196. try {
  12197. c.time("convert to webgl"),
  12198. this.convertProtobufToSceneObject(o, t, i, n, r),
  12199. c.timeEnd("convert to webgl")
  12200. } catch (e) {
  12201. return c.error("failed parsing .dam"),
  12202. c.error(e.message),
  12203. r()
  12204. }
  12205. },
  12206. readProtobuf: function(e) {
  12207. var t;
  12208. try {
  12209. c.time("parse proto"),
  12210. t = this.decoder.decode(e),
  12211. c.timeEnd("parse proto")
  12212. } catch (e) {
  12213. return c.error("failed parsing proto for .dam"),
  12214. c.error(e.message),
  12215. null
  12216. }
  12217. return t
  12218. },
  12219. convertProtobufToSceneObject: function(e, i, t, n, r) {
  12220. if (0 === e.chunk.length)
  12221. return c.warn("No chunks in damfile..."),
  12222. t([]);
  12223. var o = new s.Matrix4;
  12224. o.set(1, 0, 0, 0, 0, 0, 1, 0, 0, -1, 0, 0, 0, 0, 0, 1);
  12225. var a = e.chunk.map(function(e) {
  12226. var t = new s.BufferGeometry;
  12227. return t.addAttribute("position", new s.BufferAttribute(new Float32Array(e.vertices.xyz,0,3),3)),
  12228. 0 < e.vertices.uv.length && t.addAttribute("uv", new s.BufferAttribute(new Float32Array(e.vertices.uv,0,2),2)),
  12229. t.setIndex(new s.BufferAttribute(new Uint32Array(e.faces.faces,0,1),1)),
  12230. t.applyMatrix(o),
  12231. t.computeBoundingBox(),
  12232. new l({
  12233. geometry: t,
  12234. textureName: e.material_name,
  12235. name: e.chunk_name,
  12236. meshUrl: i
  12237. })
  12238. });
  12239. return a ? t(a) : (c.error(".dam protobuf came out with no chunks..."),
  12240. r())
  12241. }
  12242. },
  12243. h.exports = t
  12244. }
  12245. ).call(this, a("buffer").Buffer, "/js/loaders/DamLoader.js")
  12246. }
  12247. , {
  12248. "../objects/Chunk": 144,
  12249. "../util/ajax": 181,
  12250. "../util/common": 185,
  12251. "../util/logger": 189,
  12252. buffer: 198,
  12253. protobufjs: 214,
  12254. three: 217
  12255. }],
  12256. 105: [function(n, r, e) {
  12257. (function(e) {
  12258. "use strict";
  12259. var t = (n("three"),
  12260. n("../settings"),
  12261. n("../util/browser"),
  12262. n("./DamLoader"))
  12263. , i = n("../util/logger")
  12264. , u = (n("../ab"),
  12265. new i(e));
  12266. r.exports = {
  12267. getLoaders: function() {
  12268. return [["_50k", ".dam", t], ["", ".dam", t]]
  12269. },
  12270. load: function(e, t, i, n, r, o) {
  12271. var a = this.getLoaders()[o = o || 0];
  12272. if (a) {
  12273. var s = a[0]
  12274. , l = a[1]
  12275. , c = new a[2](t)
  12276. , h = t.get(e + s + l);
  12277. h ? (u.debug("Trying " + s + l),
  12278. c.load(h, i, n, function() {
  12279. this.load(e, t, i, n, r, ++o)
  12280. }
  12281. .bind(this))) : (u.debug("Skipping " + l + ", not available"),
  12282. this.load(e, t, i, n, r, ++o))
  12283. } else
  12284. r && r("No suitable model file found...")
  12285. }
  12286. }
  12287. }
  12288. ).call(this, "/js/loaders/ModelLoader.js")
  12289. }
  12290. , {
  12291. "../ab": 3,
  12292. "../settings": 166,
  12293. "../util/browser": 182,
  12294. "../util/logger": 189,
  12295. "./DamLoader": 104,
  12296. three: 217
  12297. }],
  12298. 106: [function(i, n, e) {
  12299. (function(e) {
  12300. "use strict";
  12301. var l = i("../util/common")
  12302. , c = i("../util/texture")
  12303. , h = i("../util/browser")
  12304. , t = i("../util/logger")
  12305. , u = i("../settings")
  12306. , d = new t(e);
  12307. n.exports = {
  12308. load: function(i, n) {
  12309. if (!i.chunks[0] || !i.chunks[0].meshUrl)
  12310. return $.when();
  12311. var r = l.countUnique(i.chunks.map(function(e) {
  12312. return e.textureName
  12313. }))
  12314. , e = -1 !== i.chunks[0].meshUrl.indexOf("_50k") ? "_50k" : ""
  12315. , t = "_50k" == e ? "high" : "low";
  12316. u.minimalMemoryMode && "high" === t && (h.detectSamsungS6() ? (d.warn("Galaxy S6 cannot handle large textures, turning down quality."),
  12317. t = "low") : r > u.maxMobileTextures && (d.warn("Model probably too large for mobile, turning down quality."),
  12318. t = "low"));
  12319. var o = i.data.job.uuid + e + "_texture_jpg_" + t + "/"
  12320. , a = $.Deferred()
  12321. , s = 0;
  12322. return i.chunks.forEach(function(e) {
  12323. if (!e.material.map && e.textureName) {
  12324. var t = i.urls.get(o + e.textureName);
  12325. e.setTextureMap(c.load(t, function(e, t) {
  12326. e || (n.push(t),
  12327. s++,
  12328. a.notify(s, r),
  12329. s === r && a.resolve())
  12330. }
  12331. .bind(this, c.isLoaded(t))))
  12332. }
  12333. }),
  12334. a.promise()
  12335. }
  12336. }
  12337. }
  12338. ).call(this, "/js/loaders/ModelTextureLoader.js")
  12339. }
  12340. , {
  12341. "../settings": 166,
  12342. "../util/browser": 182,
  12343. "../util/common": 185,
  12344. "../util/logger": 189,
  12345. "../util/texture": 194
  12346. }],
  12347. 107: [function(s, l, e) {
  12348. (function(n, e) {
  12349. "use strict";
  12350. function t(e) {
  12351. this.model = e,
  12352. this.modelDataPath = this.model.urls.get("vision.modeldata")+"?m="+new Date().getTime(),
  12353. this.sweepLocationsPath = this.model.urls.get("sweep_locations.csv");
  12354. var t = n("Ly8gUHJvdG9jb2wgQnVmZmVyIGZvciBwdWNrIHZpc2liaWxpdHkgYW5kIHJlbGF0ZWQgZGF0YQovLwovLyBUbyBkdW1wIG91dCBhIGJpbnJheSBtYW5pZmVzdCBpbiB0ZXh0IGZvcm1hdCwgeW91IGNhbiB1c2UgcHJvdG9jIGRpcmVjdGx5OgovLyAgIHByb3RvYyAtLXByb3RvX3BhdGggfi9kZXYvbXBfdmlzaW9uLyAgLS1kZWNvZGU9ZW9zLnN0b3JhZ2UuVmlzaW9uTW9kZWxkYXRhIH4vZGV2L21wX3Zpc2lvbi9lb3Mvc3RvcmFnZS92aXNpb25fbW9kZWxkYXRhLnByb3RvIDwgdmlzaW9uLm1vZGVsZGF0YQoKLy8gcGFja2FnZSBlb3Muc3RvcmFnZTsKCi8vIGltcG9ydCAiZW9zL2luZnJhL2NvbW1vbi5wcm90byI7Ci8vIFRoZSBmb2xsb3dpbmcgd2VyZSBtYW51YWxseSBleHRyYWN0ZWQgaGVyZSwgSlMgZG9lcyBub3QgbGlrZSBwcm90b2J1ZiBpbXBvcnRzCgptZXNzYWdlIEFmZmluZTNmIHsKCW9wdGlvbmFsIFF1YXRlcm5pb25mIHJvdGF0aW9uID0gMTsKCW9wdGlvbmFsIFZlY3RvcjNmIHRyYW5zbGF0aW9uID0gMjsKfQoKbWVzc2FnZSBRdWF0ZXJuaW9uZiB7CglvcHRpb25hbCBmbG9hdCB3ID0gMTsKCW9wdGlvbmFsIGZsb2F0IHggPSAyOwoJb3B0aW9uYWwgZmxvYXQgeSA9IDM7CglvcHRpb25hbCBmbG9hdCB6ID0gNDsKfQoKbWVzc2FnZSBWZWN0b3IzZiB7CglvcHRpb25hbCBmbG9hdCB4ID0gMTsKCW9wdGlvbmFsIGZsb2F0IHkgPSAyOwoJb3B0aW9uYWwgZmxvYXQgeiA9IDM7Cn0KCi8vCi8vIE9uZSBzd2VlcCAvIHBhbm8KLy8KbWVzc2FnZSBTd2VlcExvY2F0aW9uIHsKCW9wdGlvbmFsIGJ5dGVzIHV1aWQgPSAxOyAgLyogdXVpZCAqLwoJb3B0aW9uYWwgQWZmaW5lM2YgcG9zZSA9IDI7ICAvKiBjYW1lcmEgcG9zZSAoeCwgeSx6KSBpbiBtZXRlciBhbmQgYSBxdWF0ZXJuaW9uKi8KCW9wdGlvbmFsIFZlY3RvcjNmIHB1Y2sgPSAzOyAgLyogcHVjayBsb2NhdGlvbiAtIHggYW55IGlzIGdlbmVyYWxseSB0aGUgc2FtZSBhcyBwb3NlLCB6IGlzIHRoZSBoZWlnaHQgb2YgdGhlIGNsb3Nlc3QgZmxvb3IgdW5kZXIgdGhlIGNhbWVyYSAqLwoJb3B0aW9uYWwgaW50MzIgZ3JvdXAgPSA0OyAgLyogZmxvb3IgaW5kZXggKi8KCW9wdGlvbmFsIGludDMyIHN1Ymdyb3VwID0gNTsgIC8qIHJvb20gaW5kZXggKi8KCXJlcGVhdGVkIGludDMyIHZpc2libGVzID0gNjsgIC8qIGxpc3Qgb2YgaW5kaWNlcyB0byBhbGwgcHVja3MgdmlzaWJsZSBmcm9tIHRoaXMgcHVjayAqLwoJcmVwZWF0ZWQgZmxvYXQgc2NvcmVzID0gNzsgLyogdXNlZCBhcyBwYXJ0IG9mIHNjb3JpbmcgZnVuY3Rpb24gZm9yIGRldGVybWluaW5nIHdoaWNoIHB1Y2sgdG8gZ28gdG8gbmV4dCAqLwogIG9wdGlvbmFsIHN0cmluZyBzd2VlcF9uYW1lID0gODsKCiAgLy8gV2l0aCBvdXRkb29yIHBhbm9zLCB3ZSBoYXZlIGEgY291cGxlIG9mIGRpZmZlcmVudCBzaXR1YXRpb25zIGZvciBhbGlnbm1lbnQuIFRoZSBjb21tb24KICAvLyBjYXNlIGlzIHRoYXQgdGhlIHBhbm8gYWxpZ25lZCBub3JtYWxseS4gSXQgY291bGQgYWxzbyBoYXZlIGJlZW4gcGxhY2VkIG1hbnVhbGx5IGluCiAgLy8gQ2FwdHVyZUFwcCBvciBXb3Jrc2hvcCwgb3IgbGVmdCB1bmFsaWduZWQgZm9yIGhpZ2hsaWdodC1yZWVsIHZpZXdpbmcuCiAgZW51bSBBbGlnbm1lbnRUeXBlCiAgewogICAgICBVTktOT1dOID0gMDsKICAgICAgQUxJR05FRCA9IDE7CiAgICAgIFVOQUxJR05FRCA9IDI7CiAgICAgIE1BTlVBTExZX1BMQUNFRCA9IDM7CiAgfQogIG9wdGlvbmFsIEFsaWdubWVudFR5cGUgYWxpZ25tZW50X3R5cGUgPSA5IFtkZWZhdWx0ID0gQUxJR05FRF07Cn0KCm1lc3NhZ2UgU3ViZ3JvdXBJbmZvIHsKCW9wdGlvbmFsIGludDMyIHN1Ymdyb3VwID0gMTsKCW9wdGlvbmFsIGZsb2F0IGFyZWEgPSAyOyAvKiBmbG9vciBhcmVhIGluIG1eMiAoc3F1YXJlIG1ldGVyYWdlKSAqLwp9CgovKiBBbGwgcHVja3MgaW4gYSBtb2RlbC4gUHVja3MgYXJlIHN0b3JlZCBpbiBzY2FubmluZyBvcmRlci4gKi8KbWVzc2FnZSBWaXNpb25Nb2RlbGRhdGEgewoJcmVwZWF0ZWQgU3dlZXBMb2NhdGlvbiBzd2VlcExvY2F0aW9ucyA9IDE7CglyZXBlYXRlZCBTdWJncm91cEluZm8gc3ViZ3JvdXBJbmZvcyA9IDI7Cn0K", "base64")
  12355. , i = r.loadProto(t);
  12356. this.decoder = i.build("VisionModeldata")
  12357. }
  12358. var r = s("protobufjs")
  12359. , i = s("../util/ajax")
  12360. , o = (s("../util/common"),
  12361. s("../util/math"))
  12362. , a = new (s("../util/logger"))(e);
  12363. t.prototype.load = function() {
  12364. return this.modelDataPath ? (a.info("Using vision.modeldata"),
  12365. this.loadVisionModelData()) : this.sweepLocationsPath ? (a.warn("Using sweep_locations.csv"),
  12366. this.loadSweepLocationsCSV()) : (a.warn("No sweep file found"),
  12367. $.when([]))
  12368. }
  12369. ,
  12370. t.prototype.loadVisionModelData = function() {
  12371. return i.get(this.modelDataPath, {
  12372. responseType: "arraybuffer"
  12373. }).then(function(e) {
  12374. var t;
  12375. try {
  12376. t = this.decoder.decode(e)
  12377. } catch (e) {
  12378. return a.warn("Could not decode vision.modeldata, trying sweep_locations.csv"),
  12379. this.loadSweepLocationsCSV()
  12380. }
  12381. var i = t.sweepLocations.map(function(e) {
  12382. return {
  12383. uuid: e.uuid.toUTF8().replace(/-/g, ""),
  12384. position: {
  12385. x: e.pose.translation.x,
  12386. y: e.pose.translation.y,
  12387. z: e.pose.translation.z
  12388. },
  12389. quaternion: {
  12390. x: e.pose.rotation.x,
  12391. y: e.pose.rotation.y,
  12392. z: e.pose.rotation.z,
  12393. w: e.pose.rotation.w
  12394. },
  12395. puck: {
  12396. x: e.puck.x,
  12397. y: e.puck.y,
  12398. z: e.puck.z
  12399. },
  12400. floor: window.sceneFrom == 'kankan' ? e.subgroup : e.group,
  12401. neighbours: e.visibles,
  12402. alignmentType: e.alignment_type
  12403. }
  12404. }).map(function(e) {
  12405. return e.position = o.convertVisionVector(e.position),
  12406. e.quaternion = o.convertVisionQuaternion(e.quaternion),
  12407. e.puck = o.convertVisionVector(e.puck),
  12408. e
  12409. });
  12410. return i.forEach(function(e) {
  12411. /* if(e.neighbours.find(a=>a==-1)){
  12412. console.log('%c neighbours 存在-1 ' +e.uuid ,"color:#f00")
  12413. } */
  12414. e.neighbours = e.neighbours.filter(e=>i[e])
  12415. e.neighbours = e.neighbours.map(function(e) {
  12416. return i[e].uuid
  12417. })
  12418. }),
  12419. i
  12420. }
  12421. .bind(this), function() {
  12422. return a.warn("Could not load vision.modeldata, trying sweep_locations.csv"),
  12423. this.loadSweepLocationsCSV()
  12424. }
  12425. .bind(this))
  12426. }
  12427. ,
  12428. t.prototype.loadSweepLocationsCSV = function() {
  12429. return i.get(this.sweepLocationsPath).then(function(e) {
  12430. return e.split("\n").map(function(e) {
  12431. return e.split(", ")
  12432. }).filter(function(e) {
  12433. return 1 < e.length
  12434. }).map(function(e) {
  12435. return {
  12436. uuid: e[0],
  12437. position: {
  12438. x: parseFloat(e[1]),
  12439. y: parseFloat(e[2]),
  12440. z: parseFloat(e[3])
  12441. },
  12442. quaternion: {
  12443. x: parseFloat(e[4]),
  12444. y: parseFloat(e[5]),
  12445. z: parseFloat(e[6]),
  12446. w: parseFloat(e[7])
  12447. }
  12448. }
  12449. }).map(function(e) {
  12450. return e.position = o.convertVisionVector(e.position),
  12451. e.quaternion = o.convertVisionQuaternion(e.quaternion),
  12452. e
  12453. })
  12454. }).fail(function() {
  12455. a.warn("Could not load sweep_locations.csv, no sweeps loaded.")
  12456. })
  12457. }
  12458. ,
  12459. l.exports = t
  12460. }
  12461. ).call(this, s("buffer").Buffer, "/js/loaders/SweepDataLoader.js")
  12462. }
  12463. , {
  12464. "../util/ajax": 181,
  12465. "../util/common": 185,
  12466. "../util/logger": 189,
  12467. "../util/math": 190,
  12468. buffer: 198,
  12469. protobufjs: 214
  12470. }],
  12471. 108: [function(s, l, e) {
  12472. (function(e) {
  12473. "use strict";
  12474. function t() {
  12475. this.locale = null
  12476. }
  12477. var i = s("../settings")
  12478. , n = s("../util/common")
  12479. , r = s("../util/logger")
  12480. , o = s("../enum/Locale")
  12481. , a = new r(e);
  12482. t.prototype.init = function() {
  12483. var e;
  12484. switch (i.languageTag) {
  12485. case null:
  12486. case "en":
  12487. case o.EN_US:
  12488. this.locale = o.EN_US,
  12489. e = s("./strings-en-US");
  12490. break;
  12491. case "es":
  12492. case o.ES_MX:
  12493. this.locale = o.ES_MX,
  12494. e = s("./strings-es-MX");
  12495. break;
  12496. case "fr":
  12497. case o.FR_FR:
  12498. this.locale = o.FR_FR,
  12499. e = s("./strings-fr-FR");
  12500. break;
  12501. case "de":
  12502. case o.DE_DE:
  12503. this.locale = o.DE_DE,
  12504. e = s("./strings-de-DE");
  12505. break;
  12506. case "ru":
  12507. case o.RU_RU:
  12508. this.locale = o.RU_RU,
  12509. e = s("./strings-ru-RU");
  12510. break;
  12511. case "cn":
  12512. case o.CN_CN:
  12513. this.locale = o.CN_CN,
  12514. e = s("./strings-cn-CN");
  12515. break;
  12516. case "jp":
  12517. case o.JP_JP:
  12518. this.locale = o.JP_JP,
  12519. e = s("./strings-jp-JP");
  12520. break;
  12521. default:
  12522. a.info("Unsupported language tag, defaulting to 'en-US'"),
  12523. this.locale = o.EN_US,
  12524. e = s("./strings-en-US")
  12525. }
  12526. a.info("Using locale '" + this.locale + "'"),
  12527. n.extendObject(this, e)
  12528. }
  12529. ,
  12530. t.prototype.localizeGUI = function() {
  12531. var e = document.querySelector("#gui-parent");
  12532. this.localizeTree(e),
  12533. this.localizeLoadingText()
  12534. }
  12535. ,
  12536. t.prototype.localizeLoadingText = function() {
  12537. document.querySelector("#help-dialog").classList.add(this.locale),
  12538. document.querySelector("#interaction-modal").classList.add(this.locale),
  12539. document.querySelector("#gui").classList.add(this.locale)
  12540. }
  12541. ,
  12542. t.prototype.localizeTree = function(e) {
  12543. var t, i, n = /{\[{ ?(\w+) ?}\]}/;
  12544. if (e.nodeType === Node.TEXT_NODE)
  12545. (t = e.data.match(n)) && (i = t[1],
  12546. e.data = this.localizeText(i) || i);
  12547. else if (e.nodeType === Node.ELEMENT_NODE) {
  12548. var r = e.getAttribute("title");
  12549. r && ((t = r.match(n)) && (i = t[1],
  12550. e.setAttribute("title", this.localizeText(i) || i)))
  12551. }
  12552. for (e = e.firstChild; e; )
  12553. this.localizeTree(e),
  12554. e = e.nextSibling
  12555. }
  12556. ,
  12557. t.prototype.localizeText = function(e) {
  12558. var t = this[e];
  12559. return t || this.locale === o.EN_US || (a.warn("Localization key '" + e + "' not available for locale '" + this.locale + "', defaulting to English."),
  12560. t = s("./strings-en-US")[e]),
  12561. t || a.warn("Localization key '" + e + "' not available for locale 'en-US'"),
  12562. t
  12563. }
  12564. ,
  12565. l.exports = new t
  12566. }
  12567. ).call(this, "/js/localization/localize.js")
  12568. }
  12569. , {
  12570. "../enum/Locale": 31,
  12571. "../settings": 166,
  12572. "../util/common": 185,
  12573. "../util/logger": 189,
  12574. "./strings-cn-CN": 109,
  12575. "./strings-de-DE": 110,
  12576. "./strings-en-US": 111,
  12577. "./strings-es-MX": 112,
  12578. "./strings-fr-FR": 113,
  12579. "./strings-jp-JP": 114,
  12580. "./strings-ru-RU": 115
  12581. }],
  12582. 109: [function(e, t, i) {
  12583. "use strict";
  12584. t.exports = {
  12585. PAGE_TITLE: "",
  12586. LOADING: "正在加载",
  12587. PRESENTED_BY_CAPS: "呈现者:",
  12588. POWERED_BY: "技术支持:",
  12589. POWERED_BY_CAPS: "技术支持:",
  12590. DESKTOP_SHORT_CTA: "点击一次以探索这个 3D 空间。",
  12591. MOBILE_SHORT_CTA: "点击一次以探索这个 3D 空间。",
  12592. PRESENTED_BY: "呈现者:",
  12593. MORE: "更多 ",
  12594. LESS: "更少 ",
  12595. TAG_CONTENT: "tag™ 内容",
  12596. SHOW: "显示",
  12597. HIDE: "隐藏",
  12598. DOLLHOUSE: "场景屋",
  12599. FLOOR_PLAN: "楼层平面图",
  12600. OPEN_HIGHLIGHTS: "打开精彩片段",
  12601. CLOSE_HIGHLIGHTS: "关闭",
  12602. PREVIOUS: "上一个",
  12603. PLAY: "播放",
  12604. PAUSE: "暂停",
  12605. NEXT: "下一个",
  12606. EXPLORE_3D_SPACE: "探索 3D 空间",
  12607. VIEW_DOLLHOUSE: "观看场景屋",
  12608. SOCIAL_SHARING: "分享这个空间",
  12609. VIEW_IN_VR: "以 VR 观看",
  12610. VIEW_FULLSCREEN: "全屏观看",
  12611. EXIT_FULLSCREEN: " 退出全屏",
  12612. ZOOM_IN: "放大",
  12613. ZOOM_OUT: "缩小",
  12614. FLOOR_NAME: "楼层",
  12615. FLOOR_ALL: "ALL",
  12616. FLOOR_Lang: ["Floor", ""],
  12617. TERMS: "条款",
  12618. PORT_TERMS: "port 条款",
  12619. TERMS_OF_USE: "使用条款",
  12620. CLOSE_TERMS: "关闭",
  12621. TERMS_TEXT_FILE: "terms-cn-CN.html",
  12622. TERMS_FAIL: "无法获取条款。请确保您有互联网连接以查看使用条款。",
  12623. WEBVR_FOR_DAYDREAM: "用于 Daydream 视图",
  12624. WEBVR_ENTER_WEBVR: "进入 VR",
  12625. WEBVR_DIFFERENT_HEADSET: "有其他耳机吗?",
  12626. WEBVR_LEARN_MORE: "了解更多",
  12627. WEBVR_VIEW_SPACE: "在 VR 中观看空间",
  12628. WEBVR_DAYDREAM_VIEW: "Daydream 视图",
  12629. WEBVR_DAYDREAM_PHONE: "支持 Daydream 的手机",
  12630. WEBVR_FOR_CARDBOARD: "用于 Google Cardboard",
  12631. WEBVR_VIEW_CARDBOARD: "或在 Google Cardboard 上观看",
  12632. VR_VIEW_SPACE: "在虚拟现实中观看空间",
  12633. VR_LEARN_MORE_CAPS: "了解更多",
  12634. VR_PREVIOUS_CAPS: "上一个’,",
  12635. VR_NEXT_CAPS: "下一个",
  12636. VR_GOT_IT_CAPS: "明白了",
  12637. VR_SHOW_SUPPORTED: "点击以使用 VR 观看空间",
  12638. VR_SHOW_UNSUPPORTED: "很遗憾,您的设备不符合在 VR 中观看空间的最低要求。",
  12639. VR_SHOW_IOS_1: "点击以使用 VR 观看空间",
  12640. VR_SHOW_IOS_2: "需要有 port VR 应用程序和兼容的 iPhone 才能观看",
  12641. VR_WHAT_YOU_NEED: "关于...您需要什么",
  12642. VR_NEED_CARDBOARD: "您使用 Google Cardboard 时需要什么",
  12643. VR_NEED_SAMSUNG: "您使用 Samsung Gear VR 时需要什么",
  12644. VR_NEED_DAYDREAM: "需要事先与 DAYDREAM VIEW 配对",
  12645. VR_NEED_DAYDREAM_PHONE: "支持 Daydream 的手机",
  12646. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  12647. VR_GOOGLE_DAYDREAM: "Google Daydream",
  12648. VR_APP: "port VR 应用程序",
  12649. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  12650. VR_COMPATIBLE_IPHONES_1: "iPhones",
  12651. VR_COMPATIBLE_IPHONES_2: "iPhone 5s 和更高版本,运行 iOS 9.1 和更高版本",
  12652. VR_COMPATIBLE_IPHONES_3: "兼容的 iPhone",
  12653. VR_COMPATIBLE_ANDROID: "兼容的 Android 设备",
  12654. VR_COMPATIBLE_ANDROID_LONG: "4.5-5.5 英寸、运行 Android OS 4.4.4 和更高版本的兼容型 Android 设备显示屏",
  12655. VR_ANDROID_DETAIL: "4.5 至 5.5 英寸、运行 Android OS 4.4.4 和更高版本的显示屏",
  12656. VR_ANDROID_DVICES: "Android 设备",
  12657. VR_COMPATIBLE_SAMSUNG: "兼容的 Samsung 设备",
  12658. VR_SAMSUNG_DETAIL: "Galaxy S6 和更高版本",
  12659. VR_APP_FOR_CARDBOARD: "用于 Google Cardboard 的 port VR 应用程序",
  12660. VR_APP_FOR_SAMSUNG: "用于 Gear VR 的 port VR 应用程序",
  12661. VR_APP_FOR_ANDROID: "用于 Android 手机的 port VR 应用程序",
  12662. VR_APP_OPEN: "请使用 port VR 应用程序打开",
  12663. VR_DOWNLOAD_HERE: "在此下载",
  12664. VR_REQUIRE_HEADSET: "需要一副 VR 耳机并安装用于 Android 的 port VR 应用程序",
  12665. VR_REDIRECT_TO_STORE: "如果未安装应用程序,您将跳转到应用程序商店。",
  12666. VR_IMPROPER_EMBED: "port 空间未正确嵌入,无法在您的 Web 浏览器支持 VR。",
  12667. VR_OPEN_ANDROID_LINK: "在您的手机上打开链接",
  12668. VR_ANDROID_OPTIONS: "可用的 VR 耳机选项",
  12669. SHARE_TO: "分享到",
  12670. SHARE_LINK: "直接链接",
  12671. SHARE_EXPLORE: "探索",
  12672. SHARE_AT: "在",
  12673. SHARE_WITH: "使用",
  12674. SHARE_3D: "以 3D",
  12675. SHARE_COPIED: "已复制!",
  12676. ERROR_BROWSER_SOLUTION: "安装更新的浏览器以探索 3D。",
  12677. ERROR_BROWSER_EXPLANATION: "WebGL 需要现代的浏览器。",
  12678. ERROR_GENERIC_PROBLEM: "糟糕,出现问题。",
  12679. ERROR_GENERIC_SOLUTION: "重新启动您的浏览器。",
  12680. ERROR_GENERIC_ACTIONS_1: "如果问题仍然存在,",
  12681. ERROR_GENERIC_ACTIONS_2: "请安装支持的浏览器",
  12682. ERROR_GENERIC_ACTIONS_3: " 或",
  12683. ERROR_GENERIC_ACTIONS_4: "查看我们的故障排除指南",
  12684. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "浏览器不受支持。",
  12685. ERROR_WEBGL_IOS_PROBLEM: "iOS 版本不受支持。",
  12686. ERROR_WEBGL_IOS_SOLUTION: "升级到 iOS 8 或更高版本以在 3D 中探索。",
  12687. ERROR_WEBGL_IOS_ACTIONS_1: "点击 ",
  12688. ERROR_WEBGL_IOS_ACTIONS_2: "设置 > 通用 > 软件更新",
  12689. ERROR_WEBGL_SAFARI_PROBLEM: "启用 WebGL 以在 3D 中探索。",
  12690. ERROR_WEBGL_SAFARI_ACTIONS_1: "单击",
  12691. ERROR_WEBGL_SAFARI_ACTIONS_2: "菜单栏中的首选项 > 高级 > 显示开发菜单",
  12692. ERROR_WEBGL_SAFARI_ACTIONS_3: "然后单击",
  12693. ERROR_WEBGL_SAFARI_ACTIONS_4: "开发 > 启用 WebGL",
  12694. ERROR_MISSING_URLS_PROBLEM: "糟糕,没有此模型的全景。",
  12695. ERROR_MISSING_URLS_EXPLANATION: "这是较早的模型。网站所有者可能正在开发一种新模型。",
  12696. ERROR_LOADING_FAILED_PROBLEM: "糟糕,模式不可用。",
  12697. ERROR_LOADING_FAILED_ACTIONS_1: "如果问题仍然存在,",
  12698. ERROR_LOADING_FAILED_ACTIONS_2: "查看我们的故障排除指南",
  12699. ERROR_MAINTENANCE_PROBLEM: "正在进行维护",
  12700. ERROR_MAINTENANCE_SOLUTION: "请过几分钟再来。",
  12701. LINK_TO_LOCATION: "地点链接",
  12702. MENU_COPY: "复制",
  12703. LINK_ALERT_COPY: "请使用 CTRL/CMD + C 复制。",
  12704. ROTATE: "旋转",
  12705. MOVE: "移动",
  12706. INSIDE: "内部",
  12707. ZOOM: "缩放",
  12708. HELP: "小帮手",
  12709. HELP_NAVIGATION_TAB: "导航",
  12710. HELP_MORE_HELP_TAB: "更多帮助",
  12711. HELP_DESKTOP_PANORAMA_1A: "单击并拖动以环顾空间。",
  12712. HELP_DESKTOP_PANORAMA_2A: "单击整个空间内的圆环以四处移动。",
  12713. HELP_DESKTOP_PANORAMA_3A: "使用鼠标滚轮来放大和缩小。",
  12714. HELP_DESKTOP_PANORAMA_1B: "或者,使用箭头键向左向右转。",
  12715. HELP_DESKTOP_PANORAMA_2B: "或者,使用箭头键向前移动和向后移动。",
  12716. HELP_DESKTOP_PANORAMA_3B: "或者,使用加号和减号键来放大和缩小。",
  12717. HELP_DESKTOP_360_2A: "单击内部视图图标以进入空间。",
  12718. HELP_DESKTOP_360_2B: "或者,按 1 号键进入内部视图。 ",
  12719. HELP_DESKTOP_DOLLHOUSE_1A: "左键单击并向左、向右、向上和向下拖动以旋转场景屋。",
  12720. HELP_DESKTOP_DOLLHOUSE_2A: "右键单击并向左、向右、向上和向下拖动以改变场景屋在屏幕上的位置。",
  12721. HELP_DESKTOP_DOLLHOUSE_3A: "使用鼠标滚轮来放大和缩小。",
  12722. HELP_DESKTOP_DOLLHOUSE_1B: "或者,使用箭头键来旋转场景屋。",
  12723. HELP_DESKTOP_FLOORPLAN_1A: "左键单击并向左、向右、向上和向下拖动以改变楼层平面图在屏幕上的位置。",
  12724. HELP_DESKTOP_FLOORPLAN_2A: "右键单击并向左或向右拖动以旋转楼层平面图。",
  12725. HELP_DESKTOP_FLOORPLAN_3A: "使用鼠标滚轮来放大和缩小。",
  12726. HELP_DESKTOP_FLOORPLAN_2B: "或者,使用箭头键以向左或向右旋转。",
  12727. HELP_DESKTOP_FLOORPLAN_3B: "或者,使用箭头键来放大和缩小。",
  12728. HELP_MOBILE_PANORAMA_1: "触摸并拖动以环顾空间。",
  12729. HELP_MOBILE_PANORAMA_2: "点击整个空间内的圆环以四处移动。",
  12730. HELP_MOBILE_3: "使用捏合手势来放大和缩小。",
  12731. HELP_MOBILE_360_2: "点击内部视图图标以进入空间。",
  12732. HELP_MOBILE_DOLLHOUSE_1: "触摸并向上、向下、向左和向右拖动以旋转场景屋。",
  12733. HELP_MOBILE_DOLLHOUSE_2: "用两指触摸并拖动以定位场景屋。",
  12734. HELP_MOBILE_FLOORPLAN_1: "触摸并拖动以定位楼层平面图。",
  12735. HELP_MOBILE_FLOORPLAN_2: "用两指触摸并拖动以旋转楼层平面图。",
  12736. HELP_MORE_HLR_A: "精彩片段集锦",
  12737. HELP_DESKTOP_MORE_HLR_B: "打开以使用缩略图图像在空间中流览。",
  12738. HELP_MORE_DOLLHOUSE_A: "场景屋",
  12739. HELP_DESKTOP_MORE_DOLLHOUSE_B: "单击以查看和旋转 3D 内整个空间的俯视图。",
  12740. HELP_MOBILE_MORE_DOLLHOUSE_B: "点击以查看和旋转 3D 内整个空间的俯视图。",
  12741. HELP_MORE_FLOORS_A: "楼层选择器",
  12742. HELP_DESKTOP_MORE_FLOORS_B: "在空间中的楼层之间切换。",
  12743. HELP_MORE_TAG_A: "tag™ 贴文",
  12744. HELP_DESKTOP_MORE_TAG_B: "单击或悬停鼠标以查看空间中的功能信息。",
  12745. HELP_MOBILE_MORE_TAG_B: "点击以查看空间中的功能信息。",
  12746. HELP_MORE_ZOOM_A: "缩放控件",
  12747. HELP_DESKTOP_MORE_ZOOM_B: "使用这些控件来放大和缩小或使用滚轮。",
  12748. HELP_MORE_TOUR_A: "导览控件",
  12749. HELP_DESKTOP_MORE_TOUR_B: "通过导览播放、暂停以及向前和向后流览。",
  12750. HELP_MORE_INSIDE_A: "内部视图",
  12751. HELP_DESKTOP_MORE_INSIDE_B: "单击以探索空间内部。",
  12752. HELP_MOBILE_MORE_INSIDE_B: "点击以探索空间内部。",
  12753. HELP_MORE_VR_A: "VR 模式",
  12754. HELP_DESKTOP_MORE_VR_B: "单击以在虚拟现实中启动空间。",
  12755. HELP_MOBILE_MORE_VR_B: "点击以在虚拟现实中启动空间。",
  12756. HELP_MORE_360_A: "360° 视图",
  12757. HELP_DESKTOP_MORE_360_B: "单击精彩片段集锦中的 360 视图中以观看室外场景。",
  12758. HELP_MOBILE_MORE_360_B: "点击精彩片段集锦中的 360 视图中以观看室外场景。",
  12759. HELP_MORE_FULLSCREEN_A: "全屏",
  12760. HELP_DESKTOP_MORE_FULLSCREEN_B: "将 3D Showcase 扩展到全屏。",
  12761. CLOSE: "关闭"
  12762. }
  12763. }
  12764. , {}],
  12765. 110: [function(e, t, i) {
  12766. "use strict";
  12767. t.exports = {
  12768. PAGE_TITLE: "",
  12769. LOADING: "Lädt",
  12770. PRESENTED_BY_CAPS: "PRÄSENTIERT VON",
  12771. POWERED_BY: "Angetrieben von",
  12772. POWERED_BY_CAPS: "ANGETRIEBEN VON",
  12773. DESKTOP_SHORT_CTA: "Sehen sie sich in diesem 3D Raum um.",
  12774. MOBILE_SHORT_CTA: "Sehen sie sich in diesem 3D Raum um.",
  12775. PRESENTED_BY: "Präsentiert von ",
  12776. MORE: "Mehr ",
  12777. LESS: "Weniger ",
  12778. TAG_CONTENT: "tag™ Inhalt",
  12779. SHOW: "Anzeigen",
  12780. HIDE: "Verbergen",
  12781. DOLLHOUSE: "Puppenhaus",
  12782. FLOOR_PLAN: "Grundriss",
  12783. OPEN_HIGHLIGHTS: "Highlights anzeigen",
  12784. CLOSE_HIGHLIGHTS: "Schließen",
  12785. PREVIOUS: "Vorheriges",
  12786. PLAY: "Abspielen",
  12787. PAUSE: "Pausieren",
  12788. NEXT: "Nächstes",
  12789. EXPLORE_3D_SPACE: "Innenraum betreten",
  12790. VIEW_DOLLHOUSE: "Puppenhaus ansehen",
  12791. SOCIAL_SHARING: "Teilen Sie diesen Raum",
  12792. VIEW_IN_VR: "In VR ansehen",
  12793. VIEW_FULLSCREEN: "Ansicht im Vollbildmodus",
  12794. EXIT_FULLSCREEN: "Beenden des Vollbildmodus",
  12795. ZOOM_IN: "Vergrößern",
  12796. ZOOM_OUT: "Verkleinern",
  12797. FLOOR_NAME: "Etage ",
  12798. FLOOR_ALL: "Alle",
  12799. TERMS: "Bedingungen",
  12800. PORT_TERMS: "port Bedingungen",
  12801. TERMS_OF_USE: "Nutzungsbedingungen",
  12802. TERMS_TEXT_FILE: "terms-de-DE.html",
  12803. CLOSE_TERMS: "Schließen",
  12804. TERMS_FAIL: "Konnte die Nutzungsbedingungen nicht abrufen. Bitte stellen Sie sicher, dass Sie zum Internet verbunden sind.",
  12805. HELP: "Hilfe",
  12806. HELP_NAVIGATION_TAB: "Navigation",
  12807. HELP_MORE_HELP_TAB: "Hilfe-Details",
  12808. CLOSE: "Schließen",
  12809. HELP_DESKTOP_PANORAMA_1A: "Klicken und ziehen Sie um sich im Raum umzusehen.",
  12810. HELP_DESKTOP_PANORAMA_2A: "Klicken Sie auf die Ringe im Raum um sich zu bewegen.",
  12811. HELP_DESKTOP_PANORAMA_3A: "Verwenden Sie das Scrollrad zum Vergrößern und Verkleinern.",
  12812. HELP_DESKTOP_PANORAMA_1B: "Oder verwenden Sie die Pfeiltasten um sich nach links und rechts zu bewegen.",
  12813. HELP_DESKTOP_PANORAMA_2B: "Oder verwenden Sie die Pfeiltasten um sich vorwärts und rückwärts zubewegen.",
  12814. HELP_DESKTOP_PANORAMA_3B: "Oder verwenden Sie die Plus- und Minus-Tasten zum Vergrößern und Verkleinern.",
  12815. HELP_DESKTOP_360_2A: "Klicken Sie die Innenansicht ikone, um diesen Raum zu starten .",
  12816. HELP_DESKTOP_360_2B: "Oder, drücken Sie die 1-Taste um die Innenraumansicht zu starten.",
  12817. HELP_DESKTOP_DOLLHOUSE_1A: "Klicken Sie mit der linken Maustaste und ziehen Sie nach links, rechts, oben und unten um das Puppenhaus zu drehen.",
  12818. 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.",
  12819. HELP_DESKTOP_DOLLHOUSE_3A: "Verwenden Sie das Scrollrad zum Vergrößern und Verkleinern.",
  12820. HELP_DESKTOP_DOLLHOUSE_1B: "Oder verwenden Sie die Pfeiltasten um das Puppenhaus zu drehen.",
  12821. 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.",
  12822. HELP_DESKTOP_FLOORPLAN_2A: "Klicken Sie mit der rechten Maustaste und ziehen Sie nach links oder rechts um den Grundriss zu drehen.",
  12823. HELP_DESKTOP_FLOORPLAN_3A: "Verwenden Sie das Scrollrad zum Vergrößern und Verkleinern.",
  12824. HELP_DESKTOP_FLOORPLAN_2B: "Oder verwenden Sie die Pfeiltasten um das Modell nach links oder rechts zu drehen.",
  12825. HELP_DESKTOP_FLOORPLAN_3B: "Oder verwenden Sie die Pfeiltasten zum Vergrößern und Verkleinern.",
  12826. HELP_MOBILE_PANORAMA_1: "Berühren und ziehen an dem Raum um sich umzusehen.",
  12827. HELP_MOBILE_PANORAMA_2: "Klicken Sie auf die Ringe im Raum, um sich zu bewegen.",
  12828. HELP_MOBILE_3: "Benutzen Sie die Zoom-Gäste zum Vergrößern und Verkleinern.",
  12829. HELP_MOBILE_360_2: "Tippen Sie die Innenansicht ikone, um diesen Raum zu starten.",
  12830. HELP_MOBILE_DOLLHOUSE_1: "Berühren und nach oben, unten, links und rechts ziehen um das Puppenhaus zu drehen.",
  12831. HELP_MOBILE_DOLLHOUSE_2: "Berühren und mit zwei Fingern ziehen um das Puppenhaus zu positionieren.",
  12832. HELP_MOBILE_FLOORPLAN_1: "Berühren und ziehen, um den Grundriss zu positionieren.",
  12833. HELP_MOBILE_FLOORPLAN_2: "Berühren und ziehen mit zwei Fingern, um den Grundriss zu drehen.",
  12834. HELP_MORE_HLR_A: "Liste das Highlight",
  12835. HELP_DESKTOP_MORE_HLR_B: "Öffnen um durch den Raum mit Vorschau-Bildern zu navigieren.",
  12836. HELP_MORE_DOLLHOUSE_A: "Puppenhaus Ansicht",
  12837. HELP_DESKTOP_MORE_DOLLHOUSE_B: "Klicken Sie um die von oben nach unten Sicht des gesamten Raumes in 3D anzuzeigen und zu drehen.",
  12838. HELP_MOBILE_MORE_DOLLHOUSE_B: "Tippen Sie um die von oben nach unten Sicht des gesamten Raumes in 3D anzuzeigen und zu drehen.",
  12839. HELP_MORE_FLOORS_A: "Etage auswählen",
  12840. HELP_DESKTOP_MORE_FLOORS_B: "Zwischen den Etagen im Raum wechseln.",
  12841. HELP_MORE_TAG_A: "tag™ Posts",
  12842. HELP_DESKTOP_MORE_TAG_B: "Klicken Sie auf oder bewegen Sie Ihren Mauszeiger über die Informationen über die Funktionen im Raum.",
  12843. HELP_MOBILE_MORE_TAG_B: "Tippen Sie für Informationen über die Funktionen im Raum.",
  12844. HELP_MORE_ZOOM_A: "Zoom Steuerung",
  12845. HELP_DESKTOP_MORE_ZOOM_B: "Verwenden Sie diese Steuerung oder das Scrollrad zum Vergrößern und Verkleinern.",
  12846. HELP_MORE_TOUR_A: "Tour Steuerung",
  12847. HELP_DESKTOP_MORE_TOUR_B: "Abspielen, pausieren und vorwärts und rückwärts durch eine geführte Tour navigieren.",
  12848. HELP_MORE_INSIDE_A: "Innenansicht",
  12849. HELP_DESKTOP_MORE_INSIDE_B: "Klicken Sie hier um sich im Raum umzusehen.",
  12850. HELP_MOBILE_MORE_INSIDE_B: "Sehen Sie sich in diesen 3D Raum um.",
  12851. HELP_MORE_VR_A: "VR Modus",
  12852. HELP_DESKTOP_MORE_VR_B: "Klicken Sie hier, um den Raum in der virtuellen Realität zu starten.",
  12853. HELP_MOBILE_MORE_VR_B: "Tippen Sie um den Raum in der virtuellen Realität zu starten.",
  12854. HELP_MORE_360_A: "360° Views Ansicht ",
  12855. HELP_DESKTOP_MORE_360_B: "Klicken Sie die 360° Views Ansicht in das Highlight um Aussen-Szenen zu sehen.",
  12856. HELP_MOBILE_MORE_360_B: "Tippen Sie die 360° Views Ansicht in das Highlight um Aussen-Szenen zu sehen.",
  12857. HELP_MORE_FULLSCREEN_A: "Vollbild",
  12858. HELP_DESKTOP_MORE_FULLSCREEN_B: "Erweitern Sie 3D Showcase im Vollbildmodus.",
  12859. WEBVR_FOR_CARDBOARD: "Für Google Cardboard",
  12860. WEBVR_FOR_DAYDREAM: "Für Daydream View",
  12861. WEBVR_ENTER_WEBVR: "Starten Sie VR",
  12862. WEBVR_DIFFERENT_HEADSET: "Haben Sie anderes Headset?",
  12863. WEBVR_LEARN_MORE: "Mehr Infos",
  12864. WEBVR_VIEW_SPACE: "Ansicht des Raumes in VR",
  12865. WEBVR_DAYDREAM_VIEW: "Daydream View",
  12866. WEBVR_DAYDREAM_PHONE: "Daydream-fähiges Handy",
  12867. WEBVR_VIEW_CARDBOARD: "Oder mit Google Cardboard ansehen",
  12868. VR_WHAT_YOU_NEED: "Was Sie dafür brauchen...",
  12869. VR_NEED_DAYDREAM_PHONE: "Daydream-fähiges Handy",
  12870. VR_GOOGLE_DAYDREAM: "Google Daydream",
  12871. VR_APP: "port VR App",
  12872. VR_APP_OPEN: "Oder öffnen Sie die port VR App",
  12873. 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",
  12874. VR_SAMSUNG_DETAIL: "Galaxy S6 und neuer",
  12875. VR_APP_FOR_ANDROID: "port VR app für Android",
  12876. VR_NEED_DAYDREAM: "ERFORDERT VOR DER 'PAIRING' MIT DAYDREAM VIEW",
  12877. VR_VIEW_SPACE: "Ansicht des Raumes in VR",
  12878. VR_LEARN_MORE_CAPS: "MEHR INFOS",
  12879. VR_PREVIOUS_CAPS: "ZURÜCK",
  12880. VR_NEXT_CAPS: "WEITER",
  12881. VR_GOT_IT_CAPS: "VERSTANDEN",
  12882. VR_SHOW_SUPPORTED: "Tippen Sie um den Raum in VR zu sehen",
  12883. VR_SHOW_UNSUPPORTED: "Schade, aber Ihr Gerät erfüllt nicht die Mindestanforderungen um den Raum in VR zu sehen.",
  12884. VR_SHOW_IOS_1: "Tippen Sie um den Raum in VR zu sehen",
  12885. VR_SHOW_IOS_2: "port VR App sowie kompatibles iPhone sind von nöten um diesen Raum zu sehen",
  12886. VR_NEED_CARDBOARD: "Was Sie dafür brauchen ist Google Cardboard",
  12887. VR_NEED_SAMSUNG: "Was Sie dafür brauchen ist Samsung Gear VR",
  12888. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  12889. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  12890. VR_COMPATIBLE_IPHONES_1: "iPhones",
  12891. VR_COMPATIBLE_IPHONES_2: "iPhone 5s oder neuer, mit iOS 9.1 und später",
  12892. VR_COMPATIBLE_IPHONES_3: "Kompatibles iPhones",
  12893. VR_COMPATIBLE_ANDROID: "Kompatibles Android Gerät",
  12894. VR_ANDROID_DETAIL: "Bildschirmdiagonale von 11,5 bis 14 cm (4,5 - 5,5 Zoll) und Android 4.4.4 und neuer",
  12895. VR_ANDROID_DVICES: "Android Geräte",
  12896. VR_COMPATIBLE_SAMSUNG: "Kompatible Samsung Geräte",
  12897. VR_APP_FOR_CARDBOARD: "port VR App für Google Cardboard",
  12898. VR_APP_FOR_SAMSUNG: "port VR App für Gear VR",
  12899. VR_DOWNLOAD_HERE: "Hier runterladen",
  12900. VR_REQUIRE_HEADSET: "Benötigt das ein VR-Headset und port VR App für Android installiert wird",
  12901. VR_REDIRECT_TO_STORE: "Wenn App nicht installiert ist, werden Sie zum App Store umgeleitet.",
  12902. VR_IMPROPER_EMBED: "Der port Raum ist nicht richtig eingebettet um VR in Ihrem Webbrowser zu unterstützen.",
  12903. VR_OPEN_ANDROID_LINK: "Öffnen Sie den Link auf Ihrem Handy",
  12904. VR_ANDROID_OPTIONS: "VR Headset Optionen",
  12905. SHARE_TO: "Teilen auf",
  12906. SHARE_LINK: "Direkter Link",
  12907. SHARE_EXPLORE: "Umsehen",
  12908. SHARE_AT: "auf",
  12909. SHARE_WITH: "mit",
  12910. SHARE_3D: "in 3D",
  12911. SHARE_COPIED: "Kopiert!",
  12912. ERROR_BROWSER_SOLUTION: "Installieren Sie einen neueren Browser um sich in 3D umzusehen.",
  12913. ERROR_BROWSER_EXPLANATION: "WebGL benötigt einen modernen Browser.",
  12914. ERROR_GENERIC_PROBLEM: "Huch, etwas ist schief gelaufen.",
  12915. ERROR_GENERIC_SOLUTION: "Starten Sie Ihren Browser neu.",
  12916. ERROR_GENERIC_ACTIONS_1: "Wenn das Problem weiterhin besteht, ",
  12917. ERROR_GENERIC_ACTIONS_2: "Installieren Sie einen unterstützten Browser",
  12918. ERROR_GENERIC_ACTIONS_3: " oder ",
  12919. ERROR_GENERIC_ACTIONS_4: "Sehen Sie unseren Leitfaden zur Fehlerbehebung",
  12920. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "Browser wird nicht unterstützt.",
  12921. ERROR_WEBGL_IOS_PROBLEM: "iOS-Version wird nicht unterstützt.",
  12922. ERROR_WEBGL_IOS_SOLUTION: "Aktualisieren Sie auf iOS 8 oder neuer um sich in 3D umzusehen.",
  12923. ERROR_WEBGL_IOS_ACTIONS_1: "Tippen ",
  12924. ERROR_WEBGL_IOS_ACTIONS_2: "Einstellungen > Allgemein > Softwareaktualisierung",
  12925. ERROR_WEBGL_SAFARI_PROBLEM: "Aktivieren Sie WebVR um sich in 3D umzusehen.",
  12926. ERROR_WEBGL_SAFARI_ACTIONS_1: "Klicken ",
  12927. ERROR_WEBGL_SAFARI_ACTIONS_2: "Präferenzen > Fortgeschrittene > Entwickler-Menü anzeigen",
  12928. ERROR_WEBGL_SAFARI_ACTIONS_3: "Klicken Sie dann ",
  12929. ERROR_WEBGL_SAFARI_ACTIONS_4: "Entwickler > WebGL Aktivieren",
  12930. ERROR_MISSING_URLS_PROBLEM: "Huch, es gibt keine Panoramen für dieses Modell .",
  12931. ERROR_MISSING_URLS_EXPLANATION: "Dies ist ein älteres Modell. Der Website-Besitzer hat eventuell ein neues Modell in Arbeit.",
  12932. ERROR_LOADING_FAILED_PROBLEM: "Huch, das Modell ist nicht verfügbar.",
  12933. ERROR_LOADING_FAILED_ACTIONS_1: "Wenn das Problem weiterhin besteht, ",
  12934. ERROR_LOADING_FAILED_ACTIONS_2: "sehen Sie unseren Leitfaden zur Fehlerbehebung",
  12935. ERROR_MAINTENANCE_PROBLEM: "Wartung im Gange.",
  12936. ERROR_MAINTENANCE_SOLUTION: "Bitte versuchen Sie es in ein paar Minuten nochmal.",
  12937. LINK_TO_LOCATION: "Link zu",
  12938. MENU_COPY: "Kopieren",
  12939. LINK_ALERT_COPY: "Bitte benutzen Sie CTRL/CMD + C zum kopieren.",
  12940. ROTATE: "Drehen",
  12941. INSIDE: "Drinnen",
  12942. MOVE: "Bewegen",
  12943. ZOOM: "Vergrößern"
  12944. }
  12945. }
  12946. , {}],
  12947. 111: [function(e, t, i) {
  12948. "use strict";
  12949. t.exports = {
  12950. PAGE_TITLE: "",
  12951. LOADING: "Loading",
  12952. PRESENTED_BY_CAPS: "PRESENTED BY",
  12953. POWERED_BY: "powered by ",
  12954. POWERED_BY_CAPS: "POWERED BY",
  12955. DESKTOP_SHORT_CTA: "Click to explore this 3D space.",
  12956. MOBILE_SHORT_CTA: "Tap to explore this 3D space.",
  12957. PRESENTED_BY: "Presented by ",
  12958. MORE: "More ",
  12959. LESS: "Less ",
  12960. TAG_CONTENT: "tag™ Content",
  12961. SHOW: "Show",
  12962. HIDE: "Hide",
  12963. DOLLHOUSE: "Dollhouse",
  12964. FLOOR_PLAN: "Floor plan",
  12965. OPEN_HIGHLIGHTS: "Open Highlights",
  12966. CLOSE_HIGHLIGHTS: "Close",
  12967. PREVIOUS: "Previous",
  12968. PLAY: "Play",
  12969. PAUSE: "Pause",
  12970. NEXT: "Next",
  12971. EXPLORE_3D_SPACE: "Explore 3D Space",
  12972. VIEW_DOLLHOUSE: "View dollhouse",
  12973. SOCIAL_SHARING: "Share this Space",
  12974. VIEW_IN_VR: "View in VR",
  12975. VIEW_FULLSCREEN: "全屏",
  12976. EXIT_FULLSCREEN: "退出全屏",
  12977. ZOOM_IN: "Zoom in",
  12978. ZOOM_OUT: "Zoom out",
  12979. FLOOR_NAME: "Floor ",
  12980. FLOOR_ALL: "全部",
  12981. TERMS: "Terms",
  12982. PORT_TERMS: "port terms",
  12983. TERMS_OF_USE: "Terms of Use",
  12984. TERMS_TEXT_FILE: "terms-en-US.html",
  12985. CLOSE_TERMS: "Close",
  12986. TERMS_FAIL: "Could not fetch terms. Please make sure you have an internet connection to view the terms of use.",
  12987. HELP: "Help",
  12988. HELP_NAVIGATION_TAB: "Navigation",
  12989. HELP_MORE_HELP_TAB: "More Help",
  12990. CLOSE: "Close",
  12991. HELP_DESKTOP_PANORAMA_1A: "Click and Drag to look around the Space.",
  12992. HELP_DESKTOP_PANORAMA_2A: "Click on the rings throughout the space to move around.",
  12993. HELP_DESKTOP_PANORAMA_3A: "Use the scroll wheel to zoom in and out.",
  12994. HELP_DESKTOP_PANORAMA_1B: "Or, use the arrow keys to turn left and right.",
  12995. HELP_DESKTOP_PANORAMA_2B: "Or, use the arrow keys to move forward and back.",
  12996. HELP_DESKTOP_PANORAMA_3B: "Or, use the plus and minus keys to zoom in and out.",
  12997. HELP_DESKTOP_360_2A: "Click the Inside View icon to enter the Space.",
  12998. HELP_DESKTOP_360_2B: "Or, press the number 1 key to enter Inside View.",
  12999. HELP_DESKTOP_DOLLHOUSE_1A: "Left click and drag left, right, up, and down to rotate the Dollhouse.",
  13000. HELP_DESKTOP_DOLLHOUSE_2A: "Right click and drag left, right, up, and down to change the Dollhouse position on screen.",
  13001. HELP_DESKTOP_DOLLHOUSE_3A: "Use the scroll wheel to zoom in and out.",
  13002. HELP_DESKTOP_DOLLHOUSE_1B: "Or, use the arrow keys to rotate the Dollhouse.",
  13003. HELP_DESKTOP_FLOORPLAN_1A: "Left click and drag left, right, up, and down to change the Floorplan position on screen.",
  13004. HELP_DESKTOP_FLOORPLAN_2A: "Right click and drag left or right to rotate the Floorplan.",
  13005. HELP_DESKTOP_FLOORPLAN_3A: "Use the scroll wheel to zoom in and out.",
  13006. HELP_DESKTOP_FLOORPLAN_2B: "Or, use the arrow keys to rotate left or right.",
  13007. HELP_DESKTOP_FLOORPLAN_3B: "Or, use the arrow keys to zoom in and out.",
  13008. HELP_MOBILE_PANORAMA_1: "Touch and Drag to look around the Space.",
  13009. HELP_MOBILE_PANORAMA_2: "Tap on the rings throughout the Space to move around.",
  13010. HELP_MOBILE_3: "Use a pinch gesture to zoom in and out.",
  13011. HELP_MOBILE_360_2: "Tap the Inside View icon to enter the Space.",
  13012. HELP_MOBILE_DOLLHOUSE_1: "Touch and drag up, down, left, and right to rotate the Dollhouse.",
  13013. HELP_MOBILE_DOLLHOUSE_2: "Touch and drag with two fingers to position the Dollhouse.",
  13014. HELP_MOBILE_FLOORPLAN_1: "Touch and drag to position the Floorplan.",
  13015. HELP_MOBILE_FLOORPLAN_2: "Touch and drag with two fingers to rotate the Floorplan.",
  13016. HELP_MORE_HLR_A: "Highlight Reel",
  13017. HELP_DESKTOP_MORE_HLR_B: "Open to navigate through the Space using thumbnail images.",
  13018. HELP_MORE_DOLLHOUSE_A: "Dollhouse View",
  13019. HELP_DESKTOP_MORE_DOLLHOUSE_B: "Click to view and rotate a top-down view of the entire Space in 3D.",
  13020. HELP_MOBILE_MORE_DOLLHOUSE_B: "Tap to view and rotate a top-down view of the entire Space in 3D.",
  13021. HELP_MORE_FLOORS_A: "Floor Selector",
  13022. HELP_DESKTOP_MORE_FLOORS_B: "Switch between floors in the Space.",
  13023. HELP_MORE_TAG_A: "tag™ Posts",
  13024. HELP_DESKTOP_MORE_TAG_B: "Click or hover over for information about features in the Space.",
  13025. HELP_MOBILE_MORE_TAG_B: "Tap for information about features in the Space.",
  13026. HELP_MORE_ZOOM_A: "Zoom Controls",
  13027. HELP_DESKTOP_MORE_ZOOM_B: "Use these controls to zoom in and out or use the scroll wheel.",
  13028. HELP_MORE_TOUR_A: "Tour Controls",
  13029. HELP_DESKTOP_MORE_TOUR_B: "Play, pause, and navigate forward and backward through a Guided Tour.",
  13030. HELP_MORE_INSIDE_A: "Inside View",
  13031. HELP_DESKTOP_MORE_INSIDE_B: "Click to explore inside the Space.",
  13032. HELP_MOBILE_MORE_INSIDE_B: "Tap to explore inside the Space.",
  13033. HELP_MORE_VR_A: "VR Mode",
  13034. HELP_DESKTOP_MORE_VR_B: "Click to launch the Space in virtual reality.",
  13035. HELP_MOBILE_MORE_VR_B: "Tap to launch the Space in virtual reality.",
  13036. HELP_MORE_360_A: "360° Views",
  13037. HELP_DESKTOP_MORE_360_B: "Click 360 Views in the Highlight Reel to view outdoor scenes.",
  13038. HELP_MOBILE_MORE_360_B: "Tap 360 Views in the Highlight Reel to view outdoor scenes.",
  13039. HELP_MORE_FULLSCREEN_A: "Full screen",
  13040. HELP_DESKTOP_MORE_FULLSCREEN_B: "Expand 3D Showcase to full screen.",
  13041. WEBVR_FOR_CARDBOARD: "For Google Cardboard",
  13042. WEBVR_VIEW_CARDBOARD: "Or View on Google Cardboard",
  13043. WEBVR_FOR_DAYDREAM: "For Daydream View",
  13044. WEBVR_ENTER_WEBVR: "ENTER VR",
  13045. WEBVR_DIFFERENT_HEADSET: "Have a different headset?",
  13046. WEBVR_LEARN_MORE: "Learn more",
  13047. WEBVR_VIEW_SPACE: "View Space in VR",
  13048. WEBVR_DAYDREAM_VIEW: "Daydream View",
  13049. WEBVR_DAYDREAM_PHONE: "Daydream-ready phone",
  13050. VR_VIEW_SPACE: "View Space in Virtual Reality",
  13051. VR_LEARN_MORE_CAPS: "LEARN MORE",
  13052. VR_PREVIOUS_CAPS: "PREVIOUS",
  13053. VR_NEXT_CAPS: "NEXT",
  13054. VR_GOT_IT_CAPS: "GOT IT",
  13055. VR_SHOW_SUPPORTED: "Tap to view the Space in VR with",
  13056. VR_SHOW_UNSUPPORTED: "Sorry, but your device doesn't meet the minimum requirements to view a space in VR.",
  13057. VR_SHOW_IOS_1: "Tap to view the space in VR",
  13058. VR_SHOW_IOS_2: "Requires port VR app and compatible iPhone to view",
  13059. VR_WHAT_YOU_NEED: "What You'll Need For...",
  13060. VR_NEED_CARDBOARD: "What you'll need with Google Cardboard",
  13061. VR_NEED_SAMSUNG: "What you'll need with Samsung Gear VR",
  13062. VR_NEED_DAYDREAM: "NEEDS PRIOR PAIRING WITH DAYDREAM VIEW",
  13063. VR_NEED_DAYDREAM_PHONE: "Daydream-ready phone",
  13064. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  13065. VR_GOOGLE_DAYDREAM: "Google Daydream",
  13066. VR_APP: "port VR App",
  13067. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  13068. VR_COMPATIBLE_IPHONES_1: "iPhones",
  13069. VR_COMPATIBLE_IPHONES_2: "iPhone 5s and newer, running iOS 9.1 and higher",
  13070. VR_COMPATIBLE_IPHONES_3: "Compatible iPhones",
  13071. VR_COMPATIBLE_ANDROID: "Compatible Android Devices",
  13072. VR_COMPATIBLE_ANDROID_LONG: 'Compatible Android Devices Displays from 4.5"-5.5" running Android OS 4.4.4 and higher',
  13073. VR_ANDROID_DETAIL: 'Displays from 4.5"-5.5" running Android OS 4.4.4 and higher',
  13074. VR_ANDROID_DVICES: "Android Devices",
  13075. VR_COMPATIBLE_SAMSUNG: "Compatible Samsung Devices",
  13076. VR_SAMSUNG_DETAIL: "Galaxy S6 and Above",
  13077. VR_APP_FOR_CARDBOARD: "port VR app for Google Cardboard",
  13078. VR_APP_FOR_SAMSUNG: "port VR app for Gear VR",
  13079. VR_APP_FOR_ANDROID: "port VR app for Android Phones",
  13080. VR_APP_OPEN: "Open with the port VR app instead",
  13081. VR_DOWNLOAD_HERE: "Download here",
  13082. VR_REQUIRE_HEADSET: "Requires a VR headset and port VR app for Android to be installed",
  13083. VR_REDIRECT_TO_STORE: "If app is not installed, you will be redirected to the app store.",
  13084. VR_IMPROPER_EMBED: "The port Space is not embedded properly to support VR in your web browser.",
  13085. VR_OPEN_ANDROID_LINK: "Open the Link on Your Mobile Phone",
  13086. VR_ANDROID_OPTIONS: "Available VR Headset Options",
  13087. SHARE_TO: "Share to",
  13088. SHARE_LINK: "Direct Link",
  13089. SHARE_EXPLORE: "Explore ",
  13090. SHARE_AT: "at",
  13091. SHARE_WITH: "with",
  13092. SHARE_3D: " in 3D",
  13093. SHARE_COPIED: "Copied!",
  13094. ERROR_BROWSER_SOLUTION: "Install a new browser to explore in 3D.",
  13095. ERROR_BROWSER_EXPLANATION: "WebGL requires a modern browser.",
  13096. ERROR_GENERIC_PROBLEM: "Oops, something went wrong.",
  13097. ERROR_GENERIC_SOLUTION: "Restart your browser.",
  13098. ERROR_GENERIC_ACTIONS_1: "If the problem persists, ",
  13099. ERROR_GENERIC_ACTIONS_2: "install a supported browser",
  13100. ERROR_GENERIC_ACTIONS_3: " or ",
  13101. ERROR_GENERIC_ACTIONS_4: "see our troubleshooting guide",
  13102. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "Browser not supported.",
  13103. ERROR_WEBGL_IOS_PROBLEM: "iOS version not supported.",
  13104. ERROR_WEBGL_IOS_SOLUTION: "Upgrade to iOS 8 or higher to explore in 3D.",
  13105. ERROR_WEBGL_IOS_ACTIONS_1: "Tap ",
  13106. ERROR_WEBGL_IOS_ACTIONS_2: "Settings > General > Software Update",
  13107. ERROR_WEBGL_SAFARI_PROBLEM: "Enable WebGL to explore in 3D.",
  13108. ERROR_WEBGL_SAFARI_ACTIONS_1: "Click ",
  13109. ERROR_WEBGL_SAFARI_ACTIONS_2: "Preferences > Advanced > Show Develop menu",
  13110. ERROR_WEBGL_SAFARI_ACTIONS_3: "Then click ",
  13111. ERROR_WEBGL_SAFARI_ACTIONS_4: "Develop > Enable WebGL",
  13112. ERROR_MISSING_URLS_PROBLEM: "Oops, there are no panoramas for this model.",
  13113. ERROR_MISSING_URLS_EXPLANATION: "This is an older model. The website owner may have a new model on the way.",
  13114. ERROR_LOADING_FAILED_PROBLEM: "模型不可用.",
  13115. ERROR_LOADING_FAILED_ACTIONS_1: "If the problem persists, ",
  13116. ERROR_LOADING_FAILED_ACTIONS_2: "see our troubleshooting guide",
  13117. ERROR_MAINTENANCE_PROBLEM: "Maintenance in progress.",
  13118. ERROR_MAINTENANCE_SOLUTION: "Please come back in a few minutes.",
  13119. LINK_TO_LOCATION: "Link to location",
  13120. MENU_COPY: "Copy",
  13121. LINK_ALERT_COPY: "Please use CTRL/CMD + C to copy.",
  13122. ROTATE: "Rotate",
  13123. INSIDE: "Inside",
  13124. MOVE: "Move",
  13125. ZOOM: "Zoom"
  13126. }
  13127. }
  13128. , {}],
  13129. 112: [function(e, t, i) {
  13130. "use strict";
  13131. t.exports = {
  13132. PAGE_TITLE: "",
  13133. LOADING: "Cargando",
  13134. PRESENTED_BY_CAPS: "PRESENTADO POR",
  13135. POWERED_BY: "potenciando por ",
  13136. POWERED_BY_CAPS: "POTENCIADO POR ",
  13137. DESKTOP_SHORT_CTA: "Haga clic para explorar este Espacio 3D.",
  13138. MOBILE_SHORT_CTA: "Pulse para explorar este Espacio 3D.",
  13139. PRESENTED_BY: "Presentado por ",
  13140. MORE: "Más ",
  13141. LESS: "Menos ",
  13142. TAG_CONTENT: "Contenido de tag™",
  13143. SHOW: "Mostrar",
  13144. HIDE: "Ocultar",
  13145. DOLLHOUSE: "Dollhouse",
  13146. FLOOR_PLAN: "Planos",
  13147. OPEN_HIGHLIGHTS: "Aspectos Destacados",
  13148. CLOSE_HIGHLIGHTS: "Cerrar",
  13149. PREVIOUS: "Anterior",
  13150. PLAY: "Play",
  13151. PAUSE: "Pausa",
  13152. NEXT: "Siguiente",
  13153. EXPLORE_3D_SPACE: "Explorar el Espacio 3D",
  13154. VIEW_DOLLHOUSE: "Ver dollhouse",
  13155. SOCIAL_SHARING: "Compartir este espacio",
  13156. VIEW_IN_VR: "Ver en realidad virtual",
  13157. VIEW_FULLSCREEN: "Ver en pantalla completa",
  13158. EXIT_FULLSCREEN: "Salir de pantalla completa",
  13159. ZOOM_IN: "Acercar",
  13160. ZOOM_OUT: "Alejar",
  13161. FLOOR_NAME: "Piso ",
  13162. FLOOR_ALL: "Todas",
  13163. TERMS: "Condiciones",
  13164. PORT_TERMS: "port términos de uso",
  13165. TERMS_OF_USE: "Términos de uso",
  13166. TERMS_TEXT_FILE: "terms-es-MX.html",
  13167. CLOSE_TERMS: "Cerrar",
  13168. 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.",
  13169. HELP: "Ayuda",
  13170. HELP_NAVIGATION_TAB: "Navegación",
  13171. HELP_MORE_HELP_TAB: "Más Ayuda",
  13172. CLOSE: "Cerrar",
  13173. HELP_DESKTOP_PANORAMA_1A: "Haga clic y arrastre para mirar alrededor del espacio.",
  13174. HELP_DESKTOP_PANORAMA_2A: "Haga clic en los aros a lo largo del espacio para moverse.",
  13175. HELP_DESKTOP_PANORAMA_3A: "Use la rueda de desplazamiento para acercar o alejar.",
  13176. HELP_DESKTOP_PANORAMA_1B: "O use las teclas de flecha para girar a la izquierda y a la derecha.",
  13177. HELP_DESKTOP_PANORAMA_2B: "O use las teclas de dirección para adelantar o retroceder.",
  13178. HELP_DESKTOP_PANORAMA_3B: "O use la tecla más para acercar y la tecla menos para alejar.",
  13179. HELP_DESKTOP_360_2A: "Haga clic en el icono Vista Interior para ingresar al Espacio.",
  13180. HELP_DESKTOP_360_2B: "O bien, presione la tecla numero 1 para entrar en la Vista Interior.",
  13181. HELP_DESKTOP_DOLLHOUSE_1A: "Haga clic izquierdo y arrastre hacia la izquierda, derecha, arriba o abajo para girar la Dollhouse.",
  13182. HELP_DESKTOP_DOLLHOUSE_2A: "Haga clic derecho y arrastre hacia la izquierda, derecha, arriba o abajo para cambiar la posición della dollhouse.",
  13183. HELP_DESKTOP_DOLLHOUSE_3A: "Use la rueda de desplazamiento para acercar o alejar.",
  13184. HELP_DESKTOP_DOLLHOUSE_1B: "O use las teclas de dirección para girar la Dollhouse.",
  13185. 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.",
  13186. HELP_DESKTOP_FLOORPLAN_2A: "Haga clic derecho y arrastre hacia la izquierda o derecha para girar la planta.",
  13187. HELP_DESKTOP_FLOORPLAN_3A: "Use la rueda de desplazamiento para acercar o alejar.",
  13188. HELP_DESKTOP_FLOORPLAN_2B: "O use las teclas para girar hacia la izquierda o derecha.",
  13189. HELP_DESKTOP_FLOORPLAN_3B: "O use las teclas de dirección para acercar o alejar.",
  13190. HELP_MOBILE_PANORAMA_1: "Toque y arrastre para mirar alrededor del espacio.",
  13191. HELP_MOBILE_PANORAMA_2: "Toque en los aros a lo largo del espacio para moverse.",
  13192. HELP_MOBILE_3: "Use el gesto de pellizcar para acercar o alejar.",
  13193. HELP_MOBILE_360_2: "Toque el ícono Vista Interior para entrar en el Espacio.",
  13194. HELP_MOBILE_DOLLHOUSE_1: "Toque y arrastre con dos dedos para cambiar la posición della dollhouse.",
  13195. HELP_MOBILE_DOLLHOUSE_2: "Toque y arrastre con dos dedos para cambiar la posición de la vista aérea.",
  13196. HELP_MOBILE_FLOORPLAN_1: "Toque y arrastre para cambiar la posición de la planta.",
  13197. HELP_MOBILE_FLOORPLAN_2: "Toque y arrastre con dos dedos para girar la planta.",
  13198. HELP_MORE_HLR_A: "Galería destacada",
  13199. HELP_DESKTOP_MORE_HLR_B: "Abra para navegar a través del espacio utilizando imágenes en miniatura.",
  13200. HELP_MORE_DOLLHOUSE_A: "Vista aérea por pisos",
  13201. HELP_DESKTOP_MORE_DOLLHOUSE_B: "Haga clic para ver y girar la Dollhouse del espacio completo en 3D.",
  13202. HELP_MOBILE_MORE_DOLLHOUSE_B: "Toque para ver y girar la vista Dollhouse del espacio completo en 3D.",
  13203. HELP_MORE_FLOORS_A: "Seleccionador de plantas",
  13204. HELP_DESKTOP_MORE_FLOORS_B: "Cambie de una planta a otra en el espacio.",
  13205. HELP_MORE_TAG_A: "tag™ Posts",
  13206. HELP_DESKTOP_MORE_TAG_B: "Haga clic o coloque el cursor para obtener más información acerca de las características del espacio.",
  13207. HELP_MOBILE_MORE_TAG_B: "Toque para obtener más información acerca de las características del espacio.",
  13208. HELP_MORE_ZOOM_A: "Controles de zoom",
  13209. HELP_DESKTOP_MORE_ZOOM_B: "Use estos controles o la rueda de desplazamiento para acercar o alejar.",
  13210. HELP_MORE_TOUR_A: "Controles de recorrido",
  13211. HELP_DESKTOP_MORE_TOUR_B: "Reproduzca, pause, adelante o retroceda a través de un recorrido guiado.",
  13212. HELP_MORE_INSIDE_A: "Vista interior",
  13213. HELP_DESKTOP_MORE_INSIDE_B: "Haga clic para explorar el interior del espacio.",
  13214. HELP_MOBILE_MORE_INSIDE_B: "Toque para explorar el interior del espacio.",
  13215. HELP_MORE_VR_A: "Modo de realidad virtual",
  13216. HELP_DESKTOP_MORE_VR_B: "Toque para ver el espacio en realidad virtual.",
  13217. HELP_MOBILE_MORE_VR_B: "Toque para ver el espacio en realidad virtual.",
  13218. HELP_MORE_360_A: "360° Views",
  13219. HELP_DESKTOP_MORE_360_B: "Una vez que se encuentre en galería destacada, haga clic en vistas de 360º para ver el exterior.",
  13220. HELP_MOBILE_MORE_360_B: "Una vez que se encuentre en galería destacada, toque en vistas de 360º para ver el exterior.",
  13221. HELP_MORE_FULLSCREEN_A: "Pantalla completa",
  13222. HELP_DESKTOP_MORE_FULLSCREEN_B: "Expanda el escenario 3D para verlo en pantalla completa.",
  13223. WEBVR_FOR_CARDBOARD: "Para Google Cardboard",
  13224. WEBVR_FOR_DAYDREAM: "Para Daydream View",
  13225. WEBVR_ENTER_WEBVR: "ENTRAR VR",
  13226. WEBVR_DIFFERENT_HEADSET: "¿Tiene un auricular diferente?",
  13227. WEBVR_LEARN_MORE: "Más información",
  13228. WEBVR_VIEW_SPACE: "Ver Espacio en VR",
  13229. WEBVR_DAYDREAM_VIEW: "Daydream View",
  13230. WEBVR_DAYDREAM_PHONE: "Daydream Teléfono listos",
  13231. WEBVR_VIEW_CARDBOARD: "O Ver en Google Cardboard",
  13232. VR_NEED_DAYDREAM: "Necesidades antes de acoplarse con Daydream View",
  13233. VR_NEED_DAYDREAM_PHONE: "Teléfono listo para Daydream",
  13234. VR_GOOGLE_DAYDREAM: "Daydream de Google",
  13235. VR_APP: "port VR App",
  13236. VR_COMPATIBLE_ANDROID_LONG: 'Compatible con los Dispositivos Android con Pantallas de 4.5"-5.5" operando Android OS 4.4.4 y posteriores',
  13237. VR_APP_FOR_ANDROID: "Aplicación port VR para Teléfonos Android",
  13238. VR_APP_OPEN: "Abrir con la aplicación port VR en su lugar",
  13239. VR_VIEW_SPACE: "Ver Espacio en realidad virtual",
  13240. VR_LEARN_MORE_CAPS: "SABER MÁS",
  13241. VR_PREVIOUS_CAPS: "ANTERIOR",
  13242. VR_NEXT_CAPS: "SIGUIENTE",
  13243. VR_GOT_IT_CAPS: "COMPRENDIDO",
  13244. VR_SHOW_SUPPORTED: "Pulse para ver el Espacio en realidad virtual con",
  13245. VR_SHOW_UNSUPPORTED: "Lo sentimos, pero su dispositivo no cumple los requisitos mínimos para ver un Espacio en realidad virtual.",
  13246. VR_SHOW_IOS_1: "Pulse para ver el Espacio en realidad virtual",
  13247. VR_SHOW_IOS_2: "Necesita la aplicación port VR y un iPhone compatible para ver",
  13248. VR_WHAT_YOU_NEED: "Lo que necesitaras...",
  13249. VR_NEED_CARDBOARD: "Lo que necesitaras con Google Cardboard",
  13250. VR_NEED_SAMSUNG: "Lo que necesitaras con el Samsung Gear VR",
  13251. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  13252. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  13253. VR_COMPATIBLE_IPHONES_1: "iPhones",
  13254. VR_COMPATIBLE_IPHONES_2: "Compatible con iPhone 6S o superior y con iOS 9.1 en adelante",
  13255. VR_COMPATIBLE_IPHONES_3: "iPhones compatibles",
  13256. VR_COMPATIBLE_ANDROID: "Dispositivos Android compatibles",
  13257. VR_ANDROID_DETAIL: "Pantallas de 11.43 cm a 13.97 cm con OS de Android 4.4.4 en adelante",
  13258. VR_ANDROID_DVICES: "Dispositivos Android",
  13259. VR_COMPATIBLE_SAMSUNG: "Dispositivos compatibles del Samsung",
  13260. VR_SAMSUNG_DETAIL: "Galaxy S5 en adelante",
  13261. VR_APP_FOR_CARDBOARD: "Aplicación port VR para Google Cardboard",
  13262. VR_APP_FOR_SAMSUNG: "Aplicación port VR para Gear VR",
  13263. VR_DOWNLOAD_HERE: "Descargar aquí",
  13264. VR_REQUIRE_HEADSET: "Necesita un casco de realidad virtual y que se instale la aplicación port VR para Android",
  13265. VR_REDIRECT_TO_STORE: "Si la aplicación no está instalada, se le redirigirá a la tienda de aplicaciones.",
  13266. VR_IMPROPER_EMBED: "El espacio de port no está incorporado correctamente para apoyar VR en su navegador web.",
  13267. VR_OPEN_ANDROID_LINK: "Abre el enlace en tu teléfono móvil",
  13268. VR_ANDROID_OPTIONS: "Opciones de auriculares en RV disponibles",
  13269. SHARE_TO: "Compartir en",
  13270. SHARE_LINK: "Enlace directo",
  13271. SHARE_EXPLORE: "Explorar ",
  13272. SHARE_AT: "en",
  13273. SHARE_WITH: "con",
  13274. SHARE_3D: " en 3D",
  13275. SHARE_COPIED: "¡Copiado!",
  13276. ERROR_BROWSER_SOLUTION: "Instale un nuevo navegador para explorar en 3D.",
  13277. ERROR_BROWSER_EXPLANATION: "WebGL requiere un navegador moderno.",
  13278. ERROR_GENERIC_PROBLEM: "Vaya, algo ha ido mal.",
  13279. ERROR_GENERIC_SOLUTION: "Reinicie su navegador.",
  13280. ERROR_GENERIC_ACTIONS_1: "Si el problema persiste, ",
  13281. ERROR_GENERIC_ACTIONS_2: "instale un navegador compatible",
  13282. ERROR_GENERIC_ACTIONS_3: " o ",
  13283. ERROR_GENERIC_ACTIONS_4: "consulte nuestra guía de solución de problemas",
  13284. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "Navegador no compatible.",
  13285. ERROR_WEBGL_IOS_PROBLEM: "Versión de iOS no compatible.",
  13286. ERROR_WEBGL_IOS_SOLUTION: "Actualice a iOS 8 o superior para explorar en 3D.",
  13287. ERROR_WEBGL_IOS_ACTIONS_1: "Pulse ",
  13288. ERROR_WEBGL_IOS_ACTIONS_2: "Ajustes > General > Actualización de software",
  13289. ERROR_WEBGL_SAFARI_PROBLEM: "Habilite WebGL para explorar en 3D.",
  13290. ERROR_WEBGL_SAFARI_ACTIONS_1: "Haga clic en ",
  13291. ERROR_WEBGL_SAFARI_ACTIONS_2: "Preferencias > Avanzado > Mostrar el menú Desarrollar",
  13292. ERROR_WEBGL_SAFARI_ACTIONS_3: "Después, haga clic en ",
  13293. ERROR_WEBGL_SAFARI_ACTIONS_4: "Desarrollar > Habilitar WebGL",
  13294. ERROR_MISSING_URLS_PROBLEM: "Vaya, no hay panoramas para este modelo.",
  13295. ERROR_MISSING_URLS_EXPLANATION: "Este es un modelo antiguo. El propietario del sitio web puede tener un nuevo modelo en mente.",
  13296. ERROR_LOADING_FAILED_PROBLEM: "Vaya, modelo no disponible.",
  13297. ERROR_LOADING_FAILED_ACTIONS_1: "Si el problema persiste, ",
  13298. ERROR_LOADING_FAILED_ACTIONS_2: "consulte nuestra guía de solución de problemas",
  13299. ERROR_MAINTENANCE_PROBLEM: "Mantenimiento en progreso.",
  13300. ERROR_MAINTENANCE_SOLUTION: "Regrese en unos minutos.",
  13301. LINK_TO_LOCATION: "Enlace a la ubicación",
  13302. MENU_COPY: "Copiar",
  13303. LINK_ALERT_COPY: "Utilice CTRL/CMD + C para copiar.",
  13304. ROTATE: "Girar",
  13305. INSIDE: "Interior",
  13306. MOVE: "Moverse",
  13307. ZOOM: "Acercar o alejar"
  13308. }
  13309. }
  13310. , {}],
  13311. 113: [function(e, t, i) {
  13312. "use strict";
  13313. t.exports = {
  13314. PAGE_TITLE: "",
  13315. LOADING: "Chargement",
  13316. PRESENTED_BY_CAPS: "PRÉSENTÉ PAR",
  13317. POWERED_BY: "alimenté par ",
  13318. POWERED_BY_CAPS: "ALIMENTÉ PAR",
  13319. DESKTOP_SHORT_CTA: "Cliquez pour explorer l'Espace 3D.",
  13320. MOBILE_SHORT_CTA: "Cliquez pour explorer l'Espace 3D.",
  13321. PRESENTED_BY: "Présenté par ",
  13322. MORE: "Plus ",
  13323. LESS: "Moins ",
  13324. TAG_CONTENT: "Contenu tag™",
  13325. SHOW: "Montrer",
  13326. HIDE: "Cacher",
  13327. DOLLHOUSE: "Dollhouse",
  13328. FLOOR_PLAN: "Plan de sol",
  13329. OPEN_HIGHLIGHTS: "Ouvrir les faits saillants",
  13330. CLOSE_HIGHLIGHTS: "Fermer",
  13331. PREVIOUS: "Précédent",
  13332. PLAY: "Lecture",
  13333. PAUSE: "Pause",
  13334. NEXT: "Suivant",
  13335. EXPLORE_3D_SPACE: "Explorer l'Espace en 3D",
  13336. VIEW_DOLLHOUSE: "Voir dollhouse",
  13337. SOCIAL_SHARING: "Partager cet espace",
  13338. VIEW_IN_VR: "Voir en VR",
  13339. VIEW_FULLSCREEN: "Plein écran",
  13340. EXIT_FULLSCREEN: "Fermer plein écran",
  13341. ZOOM_IN: "Zoom avant",
  13342. ZOOM_OUT: "Zoom arrière",
  13343. FLOOR_NAME: "Étage ",
  13344. FLOOR_ALL: "Tous",
  13345. TERMS: "Mentions légales",
  13346. PORT_TERMS: "port mentions légales",
  13347. TERMS_OF_USE: "Conditions d'utilisation",
  13348. TERMS_TEXT_FILE: "terms-fr-FR.html",
  13349. CLOSE_TERMS: "Fermer",
  13350. TERMS_FAIL: "Impossible d'accéder aux mentions légales. Vérifiez que vous avez une connexion Internet pour afficher les conditions d'utilisation.",
  13351. HELP: "Aide",
  13352. HELP_NAVIGATION_TAB: "Navigation",
  13353. HELP_MORE_HELP_TAB: "Aide",
  13354. CLOSE: "Fermer",
  13355. HELP_DESKTOP_PANORAMA_1A: "Cliquez et faites glisser pour regarder autour de l’espace.",
  13356. HELP_DESKTOP_PANORAMA_2A: "Cliquez sur les anneaux pour vous déplacer.",
  13357. HELP_DESKTOP_PANORAMA_3A: "Utilisez la molette de votre souris pour zoomer.",
  13358. HELP_DESKTOP_PANORAMA_1B: "Ou utilisez les touches pour tourner.",
  13359. HELP_DESKTOP_PANORAMA_2B: "Ou utilisez les touches pour avancer et reculer.",
  13360. HELP_DESKTOP_PANORAMA_3B: "Ou utilisez les touches plus et moins pour zoomer.",
  13361. HELP_DESKTOP_360_2A: "Cliquez sur l’icône Vue Intérieure pour entrer dans l’Espace.",
  13362. HELP_DESKTOP_360_2B: "Ou, appuyez sur la touche numéro 1 pour entrer dans la Vue Intérieure.",
  13363. HELP_DESKTOP_DOLLHOUSE_1A: "Faites un clic gauche et bougez votre souris pour faire pivoter la vue Dollhouse.",
  13364. HELP_DESKTOP_DOLLHOUSE_2A: "Faites un clic droit et bougez votre souris pour changer la position de la vue Dollhouse.",
  13365. HELP_DESKTOP_DOLLHOUSE_3A: "Utilisez la molette de votre souris pour zoomer.",
  13366. HELP_DESKTOP_DOLLHOUSE_1B: "Ou utilisez les touches pour faire pivoter la vue Dollhouse.",
  13367. HELP_DESKTOP_FLOORPLAN_1A: "Faites un clic droit pour changer la position du plan sur l’écran.",
  13368. HELP_DESKTOP_FLOORPLAN_2A: "Faites un clic droit et faites glisser à gauche ou à droite pour faire pivoter le plan.",
  13369. HELP_DESKTOP_FLOORPLAN_3A: "Utilisez la molette de votre souris pour zoomer.",
  13370. HELP_DESKTOP_FLOORPLAN_2B: "Ou utilisez les touches pour faire pivoter à gauche ou à droite.",
  13371. HELP_DESKTOP_FLOORPLAN_3B: "Ou utilisez les touches pour effectuer un zoom avant ou arrière.",
  13372. HELP_MOBILE_PANORAMA_1: "Touchez et faites glisser pour regarder autour de l’espace.",
  13373. HELP_MOBILE_PANORAMA_2: "Tapez sur les anneaux dans tout l’espace pour vous déplacer.",
  13374. HELP_MOBILE_3: "Utilisez un geste de pincement pour zoomer avant/arrière.",
  13375. HELP_MOBILE_360_2: "Tapez sur l’icône Vue Intérieure pour entrer dans l’Espace.",
  13376. HELP_MOBILE_DOLLHOUSE_1: "Touchez et faites glisser vers le haut/bas/gauche/droite pour faire pivoter la vue Dollhouse.",
  13377. HELP_MOBILE_DOLLHOUSE_2: "Touchez et faites glisser avec deux doigts pour positionner vue en coupe.",
  13378. HELP_MOBILE_FLOORPLAN_1: "Touchez et faites glisser pour positionner le plan.",
  13379. HELP_MOBILE_FLOORPLAN_2: "Touchez et faites glisser avec deux doigts pour faire pivoter le plan.",
  13380. HELP_MORE_HLR_A: "Carrousel",
  13381. HELP_DESKTOP_MORE_HLR_B: "Ouvrez pour naviguer dans l’espace en utilisant les vignettes.",
  13382. HELP_MORE_DOLLHOUSE_A: "Vue en coupe",
  13383. HELP_DESKTOP_MORE_DOLLHOUSE_B: "Cliquez pour afficher et faire pivoter l’espace entier en 3D.",
  13384. HELP_MOBILE_MORE_DOLLHOUSE_B: "Tapez pour afficher et faire pivoter l’espace entier en 3D.",
  13385. HELP_MORE_FLOORS_A: "Sélecteur d’étage",
  13386. HELP_DESKTOP_MORE_FLOORS_B: "Basculer entre les étages dans l’espace.",
  13387. HELP_MORE_TAG_A: "tag™ Posts",
  13388. HELP_DESKTOP_MORE_TAG_B: "Cliquez ou survolez pour obtenir des informations sur l’espace.",
  13389. HELP_MOBILE_MORE_TAG_B: "Tapez pour obtenir des informations sur l’espace.",
  13390. HELP_MORE_ZOOM_A: "Commandes de zoom",
  13391. HELP_DESKTOP_MORE_ZOOM_B: "Utilisez votre clavier ou la molette de votre souris pour zoomer.",
  13392. HELP_MORE_TOUR_A: "Commandes de la visite",
  13393. HELP_DESKTOP_MORE_TOUR_B: "Mettez en marche ou en pause, avancez et reculez lors d'une visite guidée.",
  13394. HELP_MORE_INSIDE_A: "Vue intérieure",
  13395. HELP_DESKTOP_MORE_INSIDE_B: "Cliquez pour explorer l’intérieur de l’espace.",
  13396. HELP_MOBILE_MORE_INSIDE_B: "Tapez pour explorer l’intérieur de l’espace.",
  13397. HELP_MORE_VR_A: "Mode RV",
  13398. HELP_DESKTOP_MORE_VR_B: "Cliquez pour lancer l’espace en réalité virtuelle.",
  13399. HELP_MOBILE_MORE_VR_B: "Tapez pour lancer l’espace en réalité virtuelle.",
  13400. HELP_MORE_360_A: "Vues 360°",
  13401. HELP_DESKTOP_MORE_360_B: "Cliquez sur vues 360°, dans le carrousel pour voir les scènes extérieures.",
  13402. HELP_MOBILE_MORE_360_B: "Tapez sur vues 360°, dans le carrousel pour voir les scènes extérieures.",
  13403. HELP_MORE_FULLSCREEN_A: "Plein écran",
  13404. HELP_DESKTOP_MORE_FULLSCREEN_B: "Voir 3D Showcase en plein écran.",
  13405. WEBVR_FOR_CARDBOARD: "Pour Google Cardboard",
  13406. WEBVR_FOR_DAYDREAM: "Pour Daydream View",
  13407. WEBVR_ENTER_WEBVR: "ENTRER VR",
  13408. WEBVR_DIFFERENT_HEADSET: "Avez-vous un casque différent?",
  13409. WEBVR_LEARN_MORE: "En savoir plus",
  13410. WEBVR_VIEW_SPACE: "Voir Espace en VR",
  13411. WEBVR_DAYDREAM_VIEW: "Daydream View",
  13412. WEBVR_DAYDREAM_PHONE: "Téléphone compatibles Daydream",
  13413. WEBVR_VIEW_CARDBOARD: "Ou Afficher sur Google Cardboard",
  13414. VR_VIEW_SPACE: "Voir l'Espace en Réalité Virtuelle",
  13415. VR_LEARN_MORE_CAPS: "EN SAVOIR PLUS",
  13416. VR_PREVIOUS_CAPS: "PRÉCÉDENT",
  13417. VR_NEXT_CAPS: "SUIVANT",
  13418. VR_GOT_IT_CAPS: "BIEN COMPRIS",
  13419. VR_SHOW_SUPPORTED: "Taper pour voir l'Espace en VR avec",
  13420. VR_SHOW_UNSUPPORTED: "Désolé mais votre appareil ne répond pas aux critères minimaux pour voir cet Espace en mode VR.",
  13421. VR_SHOW_IOS_1: "Taper pour voir l’Espace en Realité Virtuelle",
  13422. VR_SHOW_IOS_2: "Nécessite l’application port VR et un iPhone compatible pour voir",
  13423. VR_WHAT_YOU_NEED: "Ce dont vous aurez besoin pour...",
  13424. VR_NEED_CARDBOARD: "Ce dont vous aurez besoin avec Google Cardboard",
  13425. VR_NEED_SAMSUNG: "Ce dont vous aurez besoin avec Samsung Gear VR",
  13426. VR_NEED_DAYDREAM: "BESOINS AVANT APPARIEMENT AVEC DAYDREAM VIEW",
  13427. VR_NEED_DAYDREAM_PHONE: "Téléphone compatible avec Daydream",
  13428. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  13429. VR_GOOGLE_DAYDREAM: "Google Daydream",
  13430. VR_APP: "port VR App",
  13431. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  13432. VR_COMPATIBLE_IPHONES_1: "iPhones",
  13433. VR_COMPATIBLE_IPHONES_2: "iPhone 5s et plus récent, avec iOS 9.1 et plus récent",
  13434. VR_COMPATIBLE_IPHONES_3: "iPhones compatibles",
  13435. VR_COMPATIBLE_ANDROID: "Appareils Android compatibles",
  13436. 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",
  13437. VR_ANDROID_DETAIL: 'Écrans 4.5" à 5.5" avec Android 4.4.4 ou plus récent',
  13438. VR_ANDROID_DVICES: "Appareils Android",
  13439. VR_COMPATIBLE_SAMSUNG: "Appareils Samsung Compatibles",
  13440. VR_SAMSUNG_DETAIL: "Galaxy S6 et plus récents",
  13441. VR_APP_FOR_CARDBOARD: "Application port VR pour Google Cardboard",
  13442. VR_APP_FOR_SAMSUNG: "Application port VR pour Gear VR",
  13443. VR_APP_FOR_ANDROID: "Application port VR pour téléphones Android",
  13444. VR_APP_OPEN: "Ouvrir plutôt avec l’application port VR",
  13445. VR_DOWNLOAD_HERE: "Télécharger ici",
  13446. VR_REQUIRE_HEADSET: "Nécessite un casque VR et l'application port VR pour Android afin d'être installé",
  13447. VR_REDIRECT_TO_STORE: "Si l'application n'est pas installée, vous serez rediriger vers l'App store.",
  13448. VR_IMPROPER_EMBED: "L'Espace port n'est pas correctement intégré pour supporter VR dans votre navigateur Web.",
  13449. VR_OPEN_ANDROID_LINK: "Ouvrez ce lien avec votre appareil mobile",
  13450. VR_ANDROID_OPTIONS: "Options disponibles pour casque VR sous",
  13451. SHARE_TO: "Partager sur",
  13452. SHARE_LINK: "Lien direct",
  13453. SHARE_EXPLORE: "Explorer ",
  13454. SHARE_AT: "à",
  13455. SHARE_WITH: "avec",
  13456. SHARE_3D: " en 3D",
  13457. SHARE_COPIED: "Copié!",
  13458. ERROR_BROWSER_SOLUTION: "Installer un nouveau navigateur pour explorer en 3D.",
  13459. ERROR_BROWSER_EXPLANATION: "WebGL a besoin d'un navigateur récent.",
  13460. ERROR_GENERIC_PROBLEM: "Il y eu un problème.",
  13461. ERROR_GENERIC_SOLUTION: "Redémarrer votre navigateur.",
  13462. ERROR_GENERIC_ACTIONS_1: "Si le problème persiste, ",
  13463. ERROR_GENERIC_ACTIONS_2: "installez un navigateur plus récent",
  13464. ERROR_GENERIC_ACTIONS_3: " ou ",
  13465. ERROR_GENERIC_ACTIONS_4: "voir notre guide de dépannage",
  13466. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "Navigateur non-supporté.",
  13467. ERROR_WEBGL_IOS_PROBLEM: "Version iOS non-supportée.",
  13468. ERROR_WEBGL_IOS_SOLUTION: "Mettre à jour avec iOS8 au minimum pour voir l'Espace en 3D.",
  13469. ERROR_WEBGL_IOS_ACTIONS_1: "Tapez ",
  13470. ERROR_WEBGL_IOS_ACTIONS_2: "Paramètres > Général > Mise à jour Software",
  13471. ERROR_WEBGL_SAFARI_PROBLEM: "Activez WegGL pour explorer en 3D.",
  13472. ERROR_WEBGL_SAFARI_ACTIONS_1: "Cliquez ",
  13473. ERROR_WEBGL_SAFARI_ACTIONS_2: "Préferences > Avancés > Voir menu développeur",
  13474. ERROR_WEBGL_SAFARI_ACTIONS_3: "Puis cliquez ",
  13475. ERROR_WEBGL_SAFARI_ACTIONS_4: "Développe > Activé WebGL",
  13476. ERROR_MISSING_URLS_PROBLEM: "Il n'y a pas de panoromas pour ce modèle.",
  13477. ERROR_MISSING_URLS_EXPLANATION: "Ceci est un ancien modèle. Le propriétaire du site a peut-être un nouveau modèle en cours.",
  13478. ERROR_LOADING_FAILED_PROBLEM: "Ce modèle n'est pas disponible.",
  13479. ERROR_LOADING_FAILED_ACTIONS_1: "Si le problème persiste, ",
  13480. ERROR_LOADING_FAILED_ACTIONS_2: "voir notre guide de dépannage",
  13481. ERROR_MAINTENANCE_PROBLEM: "Maintenance en cours.",
  13482. ERROR_MAINTENANCE_SOLUTION: "Revenez dans quelques instants.",
  13483. LINK_TO_LOCATION: "Lien vers l'emplacement",
  13484. MENU_COPY: "Copie",
  13485. LINK_ALERT_COPY: "Utiliser CTRL+CMD C pour copier.",
  13486. ROTATE: "Faire pivoter",
  13487. INSIDE: "Intérieure",
  13488. MOVE: "Se déplacer",
  13489. ZOOM: "Zoom"
  13490. }
  13491. }
  13492. , {}],
  13493. 114: [function(e, t, i) {
  13494. "use strict";
  13495. t.exports = {
  13496. PAGE_TITLE: "",
  13497. LOADING: "読み込み中",
  13498. PRESENTED_BY_CAPS: "PRESENTED BY",
  13499. POWERED_BY: "powered by",
  13500. POWERED_BY_CAPS: "POWERED BY",
  13501. DESKTOP_SHORT_CTA: "クリックしてこの3D Spaceを探索",
  13502. MOBILE_SHORT_CTA: "タップしてこの3D Spaceを探索",
  13503. PRESENTED_BY: "Presented by ",
  13504. MORE: "全て表示 ",
  13505. LESS: "閉じる ",
  13506. TAG_CONTENT: "tag™コンテンツ ",
  13507. SHOW: "表示",
  13508. HIDE: "非表示",
  13509. DOLLHOUSE: "ドールハウス",
  13510. FLOOR_PLAN: "フロアプラン",
  13511. OPEN_HIGHLIGHTS: "ハイライトを開く",
  13512. CLOSE_HIGHLIGHTS: "閉じる",
  13513. PREVIOUS: "前へ",
  13514. PLAY: "再生",
  13515. PAUSE: "一時停止",
  13516. NEXT: "次へ",
  13517. EXPLORE_3D_SPACE: "3DSpaceの探索",
  13518. VIEW_DOLLHOUSE: "ドールハウスの表示",
  13519. SOCIAL_SHARING: "このSpaceを共有する",
  13520. VIEW_IN_VR: "VRで表示",
  13521. VIEW_FULLSCREEN: "フルスクリーン表示",
  13522. EXIT_FULLSCREEN: "フルスクリーン表示を終了",
  13523. ZOOM_IN: "ズームイン",
  13524. ZOOM_OUT: "ズームアウト",
  13525. FLOOR_NAME: "フロア ",
  13526. FLOOR_ALL: "すべて",
  13527. TERMS: "規約",
  13528. PORT_TERMS: "port規約",
  13529. TERMS_OF_USE: "利用規約",
  13530. CLOSE_TERMS: "閉じる",
  13531. TERMS_TEXT_FILE: "terms-jp-JP.html",
  13532. TERMS_FAIL: "規約を取得できませんでした。利用規約を表示するためにインターネットに接続されていることを確認してください。",
  13533. WEBVR_FOR_DAYDREAM: "Daydream View用",
  13534. WEBVR_ENTER_WEBVR: "VRに入る",
  13535. WEBVR_DIFFERENT_HEADSET: "別のヘッドセットをお持ちですか?",
  13536. WEBVR_LEARN_MORE: "もっと詳しく",
  13537. WEBVR_VIEW_SPACE: "VRでSpaceを表示",
  13538. WEBVR_DAYDREAM_VIEW: "Daydream View",
  13539. WEBVR_DAYDREAM_PHONE: "Daydream対応スマホ",
  13540. WEBVR_FOR_CARDBOARD: "Google Cardboard用",
  13541. WEBVR_VIEW_CARDBOARD: "またはGoogle Cardboardで表示",
  13542. VR_VIEW_SPACE: "バーチャルリアリティでSpaceを表示",
  13543. VR_LEARN_MORE_CAPS: "もっと詳しく",
  13544. VR_PREVIOUS_CAPS: "前へ",
  13545. VR_NEXT_CAPS: "次へ",
  13546. VR_GOT_IT_CAPS: "了解",
  13547. VR_SHOW_SUPPORTED: "タップして次を使用してVRでSpaceを表示: ",
  13548. VR_SHOW_UNSUPPORTED: "お使いのデバイスはVRでSpaceを表示する最低要件を満たしていません",
  13549. VR_SHOW_IOS_1: "タップしてVRでSpaceを表示",
  13550. VR_SHOW_IOS_2: "表示するにはport VRアプリと互換性のあるiPhoneが必要です",
  13551. VR_WHAT_YOU_NEED: "必要なもの",
  13552. VR_NEED_CARDBOARD: "Google Cardboardに必要なもの",
  13553. VR_NEED_SAMSUNG: "Samsung Gear VRに必要なもの",
  13554. VR_NEED_DAYDREAM: "事前にDaydream Viewとのペアリングが必要です",
  13555. VR_NEED_DAYDREAM_PHONE: "Daydream対応スマホ",
  13556. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  13557. VR_GOOGLE_DAYDREAM: "Google Daydream",
  13558. VR_APP: "port VRアプリ",
  13559. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  13560. VR_COMPATIBLE_IPHONES_1: "iPhone",
  13561. VR_COMPATIBLE_IPHONES_2: "iOS 9.1以降で動作するiPhone 5s以降のモデル",
  13562. VR_COMPATIBLE_IPHONES_3: "互換性のあるiPhone",
  13563. VR_COMPATIBLE_ANDROID: "互換性のあるAndroidデバイス",
  13564. VR_COMPATIBLE_ANDROID_LONG: "Android OS 4.4.4以降で動作する互換性のあるAndroidデバイスの4.5~5.5インチディスプレイ",
  13565. VR_ANDROID_DETAIL: "Android OS 4.4.4以降で動作する4.5~5.5インチディスプレイ",
  13566. VR_ANDROID_DVICES: "Androidデバイス",
  13567. VR_COMPATIBLE_SAMSUNG: "互換性のあるSamsungデバイス",
  13568. VR_SAMSUNG_DETAIL: "Galaxy S5以降のモデル",
  13569. VR_APP_FOR_CARDBOARD: "Google Cardboard用のport VRアプリ",
  13570. VR_APP_FOR_SAMSUNG: "Gear VR 用のport VRアプリ",
  13571. VR_APP_FOR_ANDROID: "Androidフォン用のport VRアプリ",
  13572. VR_APP_OPEN: "port VRアプリで開く",
  13573. VR_DOWNLOAD_HERE: "ここからダウンロード",
  13574. VR_REQUIRE_HEADSET: "Android 用のVRヘッドセットとport VRアプリ をインストールする必要があります",
  13575. VR_REDIRECT_TO_STORE: "アプリがインストールされていない場合、App Storeにリダイレクトされます",
  13576. VR_IMPROPER_EMBED: "お使いのウェブブラウザでVRがサポートされるようport Spaceが適切に埋め込まれていません。",
  13577. VR_OPEN_ANDROID_LINK: "お使いの携帯電話でリンクを開いてください",
  13578. VR_ANDROID_OPTIONS: "利用可能なVRヘッドセットオプション",
  13579. SHARE_TO: "共有先",
  13580. SHARE_LINK: "ダイレクトリンク",
  13581. SHARE_EXPLORE: "探索",
  13582. SHARE_AT: "場所",
  13583. SHARE_WITH: "使用アプリ",
  13584. SHARE_3D: "3Dで",
  13585. SHARE_COPIED: "コピーされました!",
  13586. ERROR_BROWSER_SOLUTION: "3D探索するには、新しいバージョンのブラウザをインストールしてください",
  13587. ERROR_BROWSER_EXPLANATION: "WebGLにはモダンブラウザが必要です。",
  13588. ERROR_GENERIC_PROBLEM: "問題が発生しました。",
  13589. ERROR_GENERIC_SOLUTION: "ブラウザを再起動してください。",
  13590. ERROR_GENERIC_ACTIONS_1: "問題が解決しない場合は、",
  13591. ERROR_GENERIC_ACTIONS_2: "サポートされているブラウザをインストールしてください",
  13592. ERROR_GENERIC_ACTIONS_3: "または",
  13593. ERROR_GENERIC_ACTIONS_4: "トラブルシューティングガイドを参照してください",
  13594. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "ブラウザがサポートされていません。",
  13595. ERROR_WEBGL_IOS_PROBLEM: "サポートされていないiOSバージョンです。",
  13596. ERROR_WEBGL_IOS_SOLUTION: "3D探索するには、iOS 8以降にアップグレードしてください。",
  13597. ERROR_WEBGL_IOS_ACTIONS_1: "以下の順にタップします:",
  13598. ERROR_WEBGL_IOS_ACTIONS_2: "設定 > 全般 > ソフトウェアの更新",
  13599. ERROR_WEBGL_SAFARI_PROBLEM: "WebGLを有効にして3Dで探索します。",
  13600. ERROR_WEBGL_SAFARI_ACTIONS_1: "以下の順にクリックします:",
  13601. ERROR_WEBGL_SAFARI_ACTIONS_2: "環境設定 > 詳細 > メニューバーに開発メニューを表示",
  13602. ERROR_WEBGL_SAFARI_ACTIONS_3: "その後、以下の順にクリックします:",
  13603. ERROR_WEBGL_SAFARI_ACTIONS_4: "開発 > WebGLを有効にする",
  13604. ERROR_MISSING_URLS_PROBLEM: "このモデルではパノラマを使用できません。",
  13605. ERROR_MISSING_URLS_EXPLANATION: "これは古いモデルです。ウェブサイト所有者が新しいモデルを開発中かもしれません。",
  13606. ERROR_LOADING_FAILED_PROBLEM: "モデルは利用できません。",
  13607. ERROR_LOADING_FAILED_ACTIONS_1: "問題が解決しない場合は、",
  13608. ERROR_LOADING_FAILED_ACTIONS_2: "トラブルシューティングガイドを参照してください",
  13609. ERROR_MAINTENANCE_PROBLEM: "メンテナンスは進行中です。",
  13610. ERROR_MAINTENANCE_SOLUTION: "しばらくしてからやり直し てください。",
  13611. LINK_TO_LOCATION: "ロケーションへのリンク",
  13612. MENU_COPY: "コピー",
  13613. LINK_ALERT_COPY: "コピーするにはCTRL/CMD + Cを使用してください。",
  13614. ROTATE: "回転",
  13615. MOVE: "移動",
  13616. INSIDE: "内側",
  13617. ZOOM: "ズーム",
  13618. HELP: "ヘルプ",
  13619. HELP_NAVIGATION_TAB: "ナビゲーション",
  13620. HELP_MORE_HELP_TAB: "その他のヘルプ",
  13621. HELP_DESKTOP_PANORAMA_1A: "Spaceを見回すには、クリックしてドラッグします。",
  13622. HELP_DESKTOP_PANORAMA_2A: "移動するには、Space全体にあるリングをクリックします。",
  13623. HELP_DESKTOP_PANORAMA_3A: "スクロールホイールを使用してズームイン、ズームアウトします。",
  13624. HELP_DESKTOP_PANORAMA_1B: "または、矢印キーを使用して左右に向きを変えます。",
  13625. HELP_DESKTOP_PANORAMA_2B: "または、矢印キーを使用して前後に向きを変えます。",
  13626. HELP_DESKTOP_PANORAMA_3B: "あるいは、プラス(+)キーまたはマイナス(-)キーを使用して、ズームイン、ズームアウトします。",
  13627. HELP_DESKTOP_360_2A: "内側ビューアイコンをクリックしてSpaceに入ります。",
  13628. HELP_DESKTOP_360_2B: "または、数字キー1を押して内側ビューに入ります。",
  13629. HELP_DESKTOP_DOLLHOUSE_1A: "左クリックと左右、上下のドラッグでドールハウスを回転します。",
  13630. HELP_DESKTOP_DOLLHOUSE_2A: "右クリックと左右、上下のドラッグでドールハウスの画面上の位置を変更します。",
  13631. HELP_DESKTOP_DOLLHOUSE_3A: "スクロールホイールを使用してズームイン、ズームアウトします。",
  13632. HELP_DESKTOP_DOLLHOUSE_1B: "または、矢印キーを使用してドールハウスを回転します。",
  13633. HELP_DESKTOP_FLOORPLAN_1A: "左ボタンを押しながら、上下左右にドラッグしてフロアプランの画面上の位置を変更します。",
  13634. HELP_DESKTOP_FLOORPLAN_2A: "右ボタンを押しながら左右にドラッグして、フロアプランを回転します。",
  13635. HELP_DESKTOP_FLOORPLAN_3A: "スクロールホイールを使用してズームイン、ズームアウトします。",
  13636. HELP_DESKTOP_FLOORPLAN_2B: "または、矢印キーを使用して左右に回転します。",
  13637. HELP_DESKTOP_FLOORPLAN_3B: "または、矢印キーを使用して、ズームイン、ズームアウトします。",
  13638. HELP_MOBILE_PANORAMA_1: "Spaceを見回すには、タッチしてドラッグします。",
  13639. HELP_MOBILE_PANORAMA_2: "移動するには、Space全体にあるリングをタップします。",
  13640. HELP_MOBILE_3: "ピンチジェスチャーを使用してズームイン、ズームアウトします。",
  13641. HELP_MOBILE_360_2: "内側ビューアイコンをタップしてSpaceに入ります。",
  13642. HELP_MOBILE_DOLLHOUSE_1: "タッチして上下左右にドラッグしてドールハウスを回転します。",
  13643. HELP_MOBILE_DOLLHOUSE_2: "タッチして、2本指でドラッグしてドールハウスを配置します。",
  13644. HELP_MOBILE_FLOORPLAN_1: "タッチ&ドラッグしてフロアプランを配置します。",
  13645. HELP_MOBILE_FLOORPLAN_2: "タッチして、2本指でドラッグしてフロアプランを回転します。",
  13646. HELP_MORE_HLR_A: "ハイライト",
  13647. HELP_DESKTOP_MORE_HLR_B: "サムネイル画像を使用してSpaceを移動するために開きます。",
  13648. HELP_MORE_DOLLHOUSE_A: "ドールハウス",
  13649. HELP_DESKTOP_MORE_DOLLHOUSE_B: "クリックして3DでSpace全体のトップダウンビューを表示して回転します。",
  13650. HELP_MOBILE_MORE_DOLLHOUSE_B: "タップして3DでSpace全体のトップダウンビューを表示して回転します。",
  13651. HELP_MORE_FLOORS_A: "フロアセレクター",
  13652. HELP_DESKTOP_MORE_FLOORS_B: "Space内のフロアを切り替えます。",
  13653. HELP_MORE_TAG_A: "tag™ Posts",
  13654. HELP_DESKTOP_MORE_TAG_B: "クリックするか、カーソルを置くとSpace内の機能についての説明が表示されます。",
  13655. HELP_MOBILE_MORE_TAG_B: "タップするとSpace内の機能についての説明が表示されます。",
  13656. HELP_MORE_ZOOM_A: "ズームコントロール",
  13657. HELP_DESKTOP_MORE_ZOOM_B: "これらのコントロールまたはスクロールホイールを使用して、ズームイン、ズームアウトします。",
  13658. HELP_MORE_TOUR_A: "ツアーコントロール",
  13659. HELP_DESKTOP_MORE_TOUR_B: "ガイド付きツアー中に再生、一時停止、前方・後方に移動します。",
  13660. HELP_MORE_INSIDE_A: "内側ビュー",
  13661. HELP_DESKTOP_MORE_INSIDE_B: "クリックしてSpace内を探索します。",
  13662. HELP_MOBILE_MORE_INSIDE_B: "タップしてSpace内を探索します。",
  13663. HELP_MORE_VR_A: "VRモード",
  13664. HELP_DESKTOP_MORE_VR_B: "クリックしてバーチャルリアリティでSpaceを起動します。",
  13665. HELP_MOBILE_MORE_VR_B: "タップしてバーチャルリアリティでSpaceを起動します。",
  13666. HELP_MORE_360_A: "360° Views",
  13667. HELP_DESKTOP_MORE_360_B: "Highlight Reelの360° Viewsをクリックして屋外シーンを表示します。",
  13668. HELP_MOBILE_MORE_360_B: "Highlight Reelの360° Viewsをタップして屋外シーンを表示します。",
  13669. HELP_MORE_FULLSCREEN_A: "フルスクリーン",
  13670. HELP_DESKTOP_MORE_FULLSCREEN_B: "3D Showcaseをフルスクリーン表示にします。",
  13671. CLOSE: "閉じる"
  13672. }
  13673. }
  13674. , {}],
  13675. 115: [function(e, t, i) {
  13676. "use strict";
  13677. t.exports = {
  13678. PAGE_TITLE: "",
  13679. LOADING: "Загрузка",
  13680. PRESENTED_BY_CAPS: "ПРЕДСТАВЛЕНО",
  13681. POWERED_BY: "разработано на платформе ",
  13682. POWERED_BY_CAPS: "РАЗРАБОТАНО НА ПЛАТФОРМЕ",
  13683. DESKTOP_SHORT_CTA: "Нажмите для просмотра.",
  13684. MOBILE_SHORT_CTA: "Нажмите для просмотра.",
  13685. PRESENTED_BY: "Представлено ",
  13686. MORE: "Больше ",
  13687. LESS: "Меньше ",
  13688. TAG_CONTENT: "tag™ Контент",
  13689. SHOW: "Показать",
  13690. HIDE: "Скрыть",
  13691. DOLLHOUSE: "Dollhouse",
  13692. FLOOR_PLAN: "Планировка",
  13693. OPEN_HIGHLIGHTS: "Открыть Фотоколлаж",
  13694. CLOSE_HIGHLIGHTS: "Закрыть",
  13695. PREVIOUS: "Предыдущий",
  13696. PLAY: "Воспроизвести",
  13697. PAUSE: "Пауза",
  13698. NEXT: "Следующий",
  13699. EXPLORE_3D_SPACE: "Просмотреть 3D модель",
  13700. VIEW_DOLLHOUSE: "Посмотреть Dollhouse",
  13701. SOCIAL_SHARING: "Поделиться этой моделью",
  13702. VIEW_IN_VR: "Посмотреть в VR",
  13703. VIEW_FULLSCREEN: "Полный экран",
  13704. EXIT_FULLSCREEN: "Выйти из полноэкранного режима",
  13705. ZOOM_IN: "Увеличить",
  13706. ZOOM_OUT: "Уменьшить",
  13707. FLOOR_NAME: "Этаж ",
  13708. FLOOR_ALL: "Все",
  13709. TERMS: "Условия",
  13710. PORT_TERMS: "Правила пользования",
  13711. TERMS_OF_USE: "Условия использования",
  13712. TERMS_TEXT_FILE: "terms-ru-RU.html",
  13713. CLOSE_TERMS: "Закрыть",
  13714. TERMS_FAIL: "Не удалось загрузить условия использования. Для просмотра условий использования, пожалуйста, убедитесь, что у Вас есть подключение к Интернету.",
  13715. HELP: "Помощь",
  13716. HELP_NAVIGATION_TAB: "Навигация",
  13717. HELP_MORE_HELP_TAB: "Доп. Помощь",
  13718. CLOSE: "Закрыть",
  13719. HELP_DESKTOP_PANORAMA_1A: "Нажмите и перетащите, чтобы осмотреть пространство вокруг.",
  13720. HELP_DESKTOP_PANORAMA_2A: "Для передвижения по модели нажимайте на круги .",
  13721. HELP_DESKTOP_PANORAMA_3A: "Используйте колесо прокрутки для увеличения и уменьшения.",
  13722. HELP_DESKTOP_PANORAMA_1B: "Или используйте клавиши со стрелками для поворота влево и вправо.",
  13723. HELP_DESKTOP_PANORAMA_2B: "Или используйте стрелки для перемещения вперед и назад.",
  13724. HELP_DESKTOP_PANORAMA_3B: "Или используйте клавиши ‘плюс’ и ‘минус’ для увеличения и уменьшения изображения.",
  13725. HELP_DESKTOP_360_2A: "Нажмите на значок ‘Вид Изнутри’, чтобы увидеть внутреннюю панораму.",
  13726. HELP_DESKTOP_360_2B: "или нажмите 1 на клавиатуре, чтобы увидеть внутреннюю панораму.",
  13727. HELP_DESKTOP_DOLLHOUSE_1A: "Нажмите левую кнопку мыши и перетащите влево, вправо, вверх и вниз, чтобы повернуть Dollhouse.",
  13728. HELP_DESKTOP_DOLLHOUSE_2A: "Нажмите правую кнопку мыши и перетащите влево, вправо, вверх и вниз, чтобы изменить позицию Dollhouse на экране.",
  13729. HELP_DESKTOP_DOLLHOUSE_3A: "Используйте колесо прокрутки чтобы увеличить и уменьшить.",
  13730. HELP_DESKTOP_DOLLHOUSE_1B: "Или используйте клавиши со стрелками, чтобы повернуть Dollhouse.",
  13731. HELP_DESKTOP_FLOORPLAN_1A: "Нажмите левую кнопку мыши и перетащите влево, вправо, вверх и вниз, чтобы изменить положение Планировки на экране.",
  13732. HELP_DESKTOP_FLOORPLAN_2A: "Нажмите правую кнопку мыши и перетащите влево или вправо, чтобы повернуть Планировку.",
  13733. HELP_DESKTOP_FLOORPLAN_3A: "Используйте колесо прокрутки чтобы увеличить и уменьшить.",
  13734. HELP_DESKTOP_FLOORPLAN_2B: "Или используйте клавиши со стрелками для поворота влево или вправо.",
  13735. HELP_DESKTOP_FLOORPLAN_3B: "Или используйте стрелки для увеличения и уменьшения.",
  13736. HELP_MOBILE_PANORAMA_1: "Нажмите и перетащите, чтобы осмотреть модель.",
  13737. HELP_MOBILE_PANORAMA_2: "Для передвижения по модели нажимайте на круги.",
  13738. HELP_MOBILE_3: "Используйте движение двумя пальцами в разные стороны, чтобы увеличить и уменьшить.",
  13739. HELP_MOBILE_360_2: "Нажмите на значок ‘Вид Изнутри’, чтобы увидеть внутреннюю панораму.",
  13740. HELP_MOBILE_DOLLHOUSE_1: "Нажмите и перетащите вверх, вниз, влево и вправо, чтобы повернуть Dollhouse.",
  13741. HELP_MOBILE_DOLLHOUSE_2: "Нажмите и перетащите, чтобы расположить Dollhouse.",
  13742. HELP_MOBILE_FLOORPLAN_1: "Нажмите и перетащите, чтобы расположить план здания.",
  13743. HELP_MOBILE_FLOORPLAN_2: "Коснитесь и перетащите двумя пальцами, чтобы повернуть план здания.",
  13744. HELP_MORE_HLR_A: "Фотоколлаж",
  13745. HELP_DESKTOP_MORE_HLR_B: "Откройте для перемещения по модели, используя иконки изображений.",
  13746. HELP_MORE_DOLLHOUSE_A: "Dollhouse",
  13747. HELP_DESKTOP_MORE_DOLLHOUSE_B: "Нажмите и поверните сверху вниз чтобы просмотреть всю 3D модель.",
  13748. HELP_MOBILE_MORE_DOLLHOUSE_B: "Нажмите и поверните сверху вниз чтобы просмотреть всю 3D модель.",
  13749. HELP_MORE_FLOORS_A: "Выбор Этажа",
  13750. HELP_DESKTOP_MORE_FLOORS_B: "Переключение между этажами.",
  13751. HELP_MORE_TAG_A: "tag™ Posts",
  13752. HELP_DESKTOP_MORE_TAG_B: "Нажмите или наведите курсор мыши для получения информации о функциях в Пространстве.",
  13753. HELP_MOBILE_MORE_TAG_B: "Нажмите для получения информации о функциях.",
  13754. HELP_MORE_ZOOM_A: "Масштаб",
  13755. HELP_DESKTOP_MORE_ZOOM_B: "Используйте эти кнопки для увеличения и уменьшения изображения или используйте колесо прокрутки.",
  13756. HELP_MORE_TOUR_A: "Управление Туром",
  13757. HELP_DESKTOP_MORE_TOUR_B: "Используйте кнопки Воспроизвести, Пауза, Вперед и Назад для управления фотоколлажем.",
  13758. HELP_MORE_INSIDE_A: "Вид Изнутри",
  13759. HELP_DESKTOP_MORE_INSIDE_B: "Нажмите, чтобы просмотреть модель изнутри.",
  13760. HELP_MOBILE_MORE_INSIDE_B: "Нажмите, чтобы просмотреть модель изнутри.",
  13761. HELP_MORE_VR_A: "Режим VR",
  13762. HELP_DESKTOP_MORE_VR_B: "Нажмите, чтобы запустить модель в виртуальной реальности.",
  13763. HELP_MOBILE_MORE_VR_B: "Нажмите, чтобы запустить модель в виртуальной реальности.",
  13764. HELP_MORE_360_A: "360° Views",
  13765. HELP_DESKTOP_MORE_360_B: "Нажмите на “360 Views” в фотоколлаже, чтобы просмотреть внешний пейзаж.",
  13766. HELP_MOBILE_MORE_360_B: "Нажмите на “360 Views” в фотоколлаже, чтобы просмотреть внешний пейзаж.",
  13767. HELP_MORE_FULLSCREEN_A: "Полный экран",
  13768. HELP_DESKTOP_MORE_FULLSCREEN_B: "Развернуть 3D Showcase во весь экран.",
  13769. WEBVR_FOR_CARDBOARD: "Для Google Cardboard",
  13770. WEBVR_FOR_DAYDREAM: "Для просмотра в Daydream",
  13771. WEBVR_ENTER_WEBVR: "ВОЙТИ В VR ",
  13772. WEBVR_DIFFERENT_HEADSET: "Есть другой VR-шлем?",
  13773. WEBVR_LEARN_MORE: "Узнать больше",
  13774. WEBVR_VIEW_SPACE: "Запустить модель в VR",
  13775. WEBVR_DAYDREAM_VIEW: "Посмотреть в Daydream",
  13776. WEBVR_DAYDREAM_PHONE: "Daydream-готовый телефон",
  13777. WEBVR_VIEW_CARDBOARD: "Или просмотреть в Google Cardboard",
  13778. VR_WHAT_YOU_NEED: "Что Вам потребуется...",
  13779. VR_NEED_DAYDREAM_PHONE: "Daydream-готовый телефон",
  13780. VR_GOOGLE_DAYDREAM: "Google Daydream",
  13781. VR_APP: "port VR App",
  13782. VR_APP_OPEN: "Или открыть через приложение port VR",
  13783. VR_COMPATIBLE_ANDROID_LONG: 'Совместимые Android устройства с диагональю экрана 4.5"-5.5" дюймов и Android версией 4.4.4, и выше',
  13784. VR_SAMSUNG_DETAIL: "Galaxy S6 и выше",
  13785. VR_APP_FOR_ANDROID: "Приложение port VR для Android",
  13786. VR_NEED_DAYDREAM: "Необходимо для соединением с Daydream",
  13787. VR_VIEW_SPACE: "Запустить модель в VR",
  13788. VR_LEARN_MORE_CAPS: "УЗНАТЬ БОЛЬШЕ",
  13789. VR_PREVIOUS_CAPS: "ПРЕДЫДУЩИЙ",
  13790. VR_NEXT_CAPS: "СЛЕДУЮЩИЙ",
  13791. VR_GOT_IT_CAPS: "ЯСНО",
  13792. VR_SHOW_SUPPORTED: "Нажмите, чтобы просмотреть модель в VR с помощью",
  13793. VR_SHOW_UNSUPPORTED: "Извините, но Ваше устройство не соответствует минимальным требованиям для просмотра модели в VR.",
  13794. VR_SHOW_IOS_1: "Нажмите, чтобы просмотреть модель в VR",
  13795. VR_SHOW_IOS_2: "Для просмотра требуется приложение port VR и совместимый iPhone",
  13796. VR_NEED_CARDBOARD: "Что Вам потребуется для Google Cardboard",
  13797. VR_NEED_SAMSUNG: "Что Вам потребуется для Samsung Gear VR",
  13798. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  13799. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  13800. VR_COMPATIBLE_IPHONES_1: "iPhones",
  13801. VR_COMPATIBLE_IPHONES_2: "iPhone 5s или новее с iOS 9.1 и выше",
  13802. VR_COMPATIBLE_IPHONES_3: "Совместимые модели iPhone",
  13803. VR_COMPATIBLE_ANDROID: "Совместимые Android устройства",
  13804. VR_ANDROID_DETAIL: 'Экран от 4.5" до 5.5" и Android 4.4.4, и выше',
  13805. VR_ANDROID_DVICES: "Android устройства",
  13806. VR_COMPATIBLE_SAMSUNG: "Совместимые Samsung устройства",
  13807. VR_APP_FOR_CARDBOARD: "Приложение port VR для Google Cardboard",
  13808. VR_APP_FOR_SAMSUNG: "Приложение port VR для Gear VR",
  13809. VR_DOWNLOAD_HERE: "Скачать здесь",
  13810. VR_REQUIRE_HEADSET: "Требуется VR-шлем и установленное приложение port VR для Android",
  13811. VR_REDIRECT_TO_STORE: "Если приложение не установлено, Вы будете перенаправлены на страницу магазина приложений.",
  13812. VR_IMPROPER_EMBED: "port модель не встроена должным образом для поддержки VR в вашем веб-браузере.",
  13813. VR_OPEN_ANDROID_LINK: "Откройте ссылку на Вашем мобильном телефоне",
  13814. VR_ANDROID_OPTIONS: "Доступные опции VR-шлемов",
  13815. SHARE_TO: "Поделиться",
  13816. SHARE_LINK: "Прямая ссылка",
  13817. SHARE_EXPLORE: "просмотреть",
  13818. SHARE_AT: "на",
  13819. SHARE_WITH: "с",
  13820. SHARE_3D: "в 3D",
  13821. SHARE_COPIED: "Скопировано!",
  13822. ERROR_BROWSER_SOLUTION: "установите новый браузер, чтобы просмотреть 3D пространство.",
  13823. ERROR_BROWSER_EXPLANATION: "WebGL требует современный браузер.",
  13824. ERROR_GENERIC_PROBLEM: "Ой, что-то пошло не так.",
  13825. ERROR_GENERIC_SOLUTION: "Перезапустите браузер.",
  13826. ERROR_GENERIC_ACTIONS_1: "Если проблема не устранена, ",
  13827. ERROR_GENERIC_ACTIONS_2: "установите поддерживаемый браузер",
  13828. ERROR_GENERIC_ACTIONS_3: " или ",
  13829. ERROR_GENERIC_ACTIONS_4: "смотрите наше руководство по устранению неполадок",
  13830. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "Браузер не поддерживается.",
  13831. ERROR_WEBGL_IOS_PROBLEM: "iOS-версия не поддерживается.",
  13832. ERROR_WEBGL_IOS_SOLUTION: "Обновите до iOS 8 или выше, чтобы просмотреть пространство в 3D.",
  13833. ERROR_WEBGL_IOS_ACTIONS_1: "Нажмите ",
  13834. ERROR_WEBGL_IOS_ACTIONS_2: "Настройки > Общие > Обновление ПО",
  13835. ERROR_WEBGL_SAFARI_PROBLEM: "Включите WebGL для 3D-просмотра.",
  13836. ERROR_WEBGL_SAFARI_ACTIONS_1: "Нажмите ",
  13837. ERROR_WEBGL_SAFARI_ACTIONS_2: "Настойки > Дополнения > Показывать меню “Разработка” в строке меню",
  13838. ERROR_WEBGL_SAFARI_ACTIONS_3: "Затем нажмите ",
  13839. ERROR_WEBGL_SAFARI_ACTIONS_4: "Разработка > Разрешить WebGL",
  13840. ERROR_MISSING_URLS_PROBLEM: "Ой, для этой модели нет панорамы.",
  13841. ERROR_MISSING_URLS_EXPLANATION: "Эта модель устарела. У владельца веб-сайта может быть новая модель.",
  13842. ERROR_LOADING_FAILED_PROBLEM: "Ой, модель недоступна.",
  13843. ERROR_LOADING_FAILED_ACTIONS_1: "Если проблема не устранена, ",
  13844. ERROR_LOADING_FAILED_ACTIONS_2: "посмотрите наше руководство по устранению неполадок",
  13845. ERROR_MAINTENANCE_PROBLEM: "Выполняется техническое обслуживание.",
  13846. ERROR_MAINTENANCE_SOLUTION: "Пожалуйста, попробуйте снова через несколько минут.",
  13847. LINK_TO_LOCATION: "Ссылка на местоположение",
  13848. MENU_COPY: "Копировать",
  13849. LINK_ALERT_COPY: "Для того, чтобы скопировать, пожалуйста, используйте CTRL/CMD + C.",
  13850. ROTATE: "Вращать",
  13851. MOVE: "Передвигаться",
  13852. INSIDE: "Вид изнутри",
  13853. ZOOM: "Масштаб"
  13854. }
  13855. }
  13856. , {}],
  13857. 116: [function(r, e, t) {
  13858. (function(i) {
  13859. "use strict";
  13860. function re(e) {
  13861. console.log("e1:" + e),
  13862. e = Math.round(.4 * e * 100),
  13863. console.log("e2:" + e);
  13864. var t = $(".progressbar");
  13865. t.find(".bar").css("width", e + "%"),
  13866. t.find(".label").css("left", t.width() * e / 100 - 15 + "px"),
  13867. t.find(".perc").text(e + "%")
  13868. }
  13869. $("#gui-loading").fadeIn(200),
  13870. re(.1);
  13871. var e = g_version ? "modeldata.js" : "someData.json";
  13872. $.ajax(g_Prefix + "data/" + window.number + "/" + e + "?" + randomTime().getTime(), {
  13873. dataType: "json"
  13874. }).done(function(e) {
  13875. var t = matcher(e);
  13876. t.files.templates[0] = g_Prefix + e.files.templates[0].replace("{{number}}", window.number),
  13877. t.user = {
  13878. is_authenticated: !1,
  13879. 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"]
  13880. }
  13881. try{//处理一下导览数据
  13882. t.model.images = t.model.images.filter(e=>{
  13883. if(!e.locations && !e.thumbnail_signed_src)return; //旧的曾有导览数据是错误的,将它删除
  13884. if(e.locations)e.locations = e.locations.filter(e=>e)
  13885. if(e.locations && e.locations.length == 0)return;
  13886. return e
  13887. })
  13888. }catch(e){console.log(e) }
  13889. window.editTool = new EditTools()
  13890. t.hotIconScale = parseFloat(t.hotIconScale || 1)
  13891. window.DATA = t
  13892. t.model.summary = t.summary
  13893. t.model.name = t.name
  13894. for(let i in t){
  13895. t[i] == "false" && (t[i] = false)
  13896. }
  13897. re(.7),
  13898. function() {
  13899. function y(e) {
  13900. t.update(e)
  13901. }
  13902. function A(e, t) {
  13903. ne.error(t),
  13904. n.error(t),
  13905. N.report(e, "error-" + t)
  13906. }
  13907. function C(e, t, i) {
  13908. try {
  13909. e.start(t)
  13910. } catch (e) {
  13911. throw ne.warn(e.message),
  13912. function(e) {
  13913. var t = O.details();
  13914. t && "Safari" === t.name && 500 < t.version && t.version < 600 ? (n.error("webgl-safari"),
  13915. N.report(e, "error-webgl-safari")) : (n.error("webgl-generic"),
  13916. N.report(e, "error-webgl-generic"))
  13917. }(i.sid),
  13918. e
  13919. }
  13920. }
  13921. function I(e) {
  13922. e.stopPropagation(),
  13923. e.preventDefault()
  13924. }
  13925. window.DATA.hoticon && (g_HotImage = {
  13926. point: window.DATA.hoticon.default || "https://super.4dage.com/images/4dagePoint2.png",
  13927. point2: window.DATA.hoticon.higt || "https://super.4dage.com/images/4dagePoint.png"
  13928. });
  13929. if (window.DATA.backgroundMusic) {
  13930. if(window.isLocal){
  13931. SoundManager.setSrc('bgm', manage.dealURL(window.DATA.backgroundMusic))
  13932. }else{
  13933. SoundManager.setSrc('bgm', window.DATA.backgroundMusic )
  13934. }
  13935. $("#volume").show();
  13936. }else if (g_version === "one"){
  13937. SoundManager.setSrc('bgm', manage.dealURL( g_Prefix+"/audio/"+"audio"+window.number + "/background.mp3"))
  13938. $("#volume").show();
  13939. }
  13940. //隐藏公司logo
  13941. window.DATA.loadlogo && showLogo();
  13942. // 隐藏顶部介绍
  13943. window.DATA.topText && topTextHide();
  13944. r("./lib/three75-shim"),
  13945. r("./lib/array-polyfill"),
  13946. r("./lib/performance-polyfill"),
  13947. r("./lib/shaders/CopyShader.js"),
  13948. r("./lib/shaders/HorizontalBlurShader.js"),
  13949. r("./lib/shaders/VerticalBlurShader.js"),
  13950. r("./lib/postprocessing/EffectComposer.js"),
  13951. r("./lib/postprocessing/RenderPass.js"),
  13952. r("./lib/postprocessing/MaskPass.js"),
  13953. r("./lib/postprocessing/ShaderPass.js"),
  13954. window.Promise || (window.Promise = r("promise-polyfill"));
  13955. var E = r("three")
  13956. , _ = r("three")
  13957. , b = (r("./util/sentry"),
  13958. r("./player"))
  13959. , w = r("./director")
  13960. , T = r("./controls/CameraControls")
  13961. , x = r("./model/ModelManager")
  13962. , S = r("./DisplayController")
  13963. , M = r("./label/LabelDisplayController")
  13964. , R = r("./enum/Viewmode")
  13965. , e = r("./util/logger")
  13966. , P = r("./showcase")
  13967. , O = r("./util/browser")
  13968. , L = r("./settings")
  13969. , D = r("./gui/gui")
  13970. , n = r("./gui/error")
  13971. , N = r("./analytics")
  13972. , F = r("./util/transitions")
  13973. , B = r("./effects")
  13974. , V = r("./objects/Skybox")
  13975. , k = (r("./util/common"),
  13976. r("./util/PanoramaCollection"),
  13977. r("./util/math"),
  13978. r("./util/showcase"))
  13979. , U = r("./util/camera")
  13980. , H = (r("./objects/Panorama"),
  13981. r("./cameras/PanoramaCamera"),
  13982. r("./preloaders"))
  13983. , z = r("events").EventEmitter
  13984. , G = r("./featureflags")
  13985. , W = (r("./util/lerp"),
  13986. r("./util/ajax"),
  13987. r("./ab"))
  13988. , j = r("./sdk/automation.js")
  13989. , Y = r("./scene/SceneRenderer")
  13990. , q = r("./scene/QuickstartManager")
  13991. , X = r("./tile/QualityManager.js")
  13992. , Z = r("./localization/localize")
  13993. , K = r("./tag/tagManager")
  13994. , Q = r("./tile/TileDownloader")
  13995. , J = r("./tile/PanoRenderer")
  13996. , ee = (r("./enum/PanoSizeClass"),
  13997. r("./enum/PanoramaEvents"),
  13998. r("./enum/SceneRendererEvents"))
  13999. , t = r("./gui/memoryUsage")
  14000. , te = r("./enum/RenderLayers")
  14001. , ie = r("./TimingData")
  14002. , ne = new e(i);
  14003. e.level = L.logLevel,
  14004. e.consoleEnabled = L.console,
  14005. function() {
  14006. var e = window.number//k.getModelIDFromQueryString();
  14007. if (!e)
  14008. return A(null, "loading-failed");
  14009. var t = k.parseSidUrl(e)
  14010. , i = O.valueFromHash("play", !1) ? "autoplay" : O.inIframe() ? "click" : "fullpage"
  14011. , n = {
  14012. panoElementsToLoad: 6,
  14013. modelElementsToLoad: 0,
  14014. totalElementsLoaded: 0,
  14015. totalElementsToLoad: 0,
  14016. totalPercentageLoaded: 0,
  14017. progressCallback: null
  14018. }
  14019. , r = document.getElementById("player")
  14020. , o = L.quickstart.enabled
  14021. , a = null
  14022. , s = null
  14023. , l = null
  14024. , c = null
  14025. , h = null
  14026. , u = null
  14027. , d = null
  14028. , p = null
  14029. , f = null
  14030. , g = null
  14031. , m = null
  14032. , v = new ie;
  14033. !function(e) {
  14034. ne.info("Version", "2.25.6-0-gd87e5b1"),
  14035. z.defaultMaxListeners = 1e3,
  14036. function(e) {
  14037. e.addEventListener("dragenter", I, !1),
  14038. e.addEventListener("dragover", I, !1)
  14039. }(e),
  14040. O.valueFromHash("title", !0) || $(document).ready(function() {
  14041. $(".model-title").hide()
  14042. })
  14043. }(r),
  14044. function(e) {
  14045. return G.loadFeatureFlags(e).done(function(e) {
  14046. G.updateDependentSettings(e, L)
  14047. })
  14048. }({
  14049. urlBase: t.urlBase
  14050. }).then(function() {
  14051. return Z.init(),
  14052. function(e, t) {
  14053. var i = P.getModel({
  14054. url: t,
  14055. floors: O.valueFromHash("f", !0),
  14056. autoload: !1
  14057. });
  14058. return $.when(i, y).then(null, function(e) {
  14059. return this
  14060. })
  14061. }(0, e)
  14062. }).then(function(e) {
  14063. return re(.9),
  14064. function(e, t, i, n, r) {
  14065. ne.info("Model data loaded"),
  14066. ne.debug("UUID: " + e.data.job.uuid),
  14067. W.init(G.getFlags()),
  14068. i && N.initKeen({
  14069. token: i,
  14070. appId: n
  14071. }),
  14072. N.initSegment({
  14073. model: e.sid,
  14074. version: "2.25.6-0-gd87e5b1",
  14075. startSource: r.startSource,
  14076. token: t,
  14077. autoplay: r.autoplay,
  14078. quickstart: r.quickstart
  14079. })
  14080. }(g = e, L.appConfig.segment_key, L.appConfig.keen_write_key, L.appConfig.keen_project_id, {
  14081. startSource: i,
  14082. autoplay: L.autoplay,
  14083. quickstart: o
  14084. }),
  14085. g.urls.init()
  14086. }).then(function() {
  14087. return g.loadPanos()
  14088. }).then(function() {
  14089. s = U.getStartCameraOptions(g, g.panos);
  14090. //初始画面
  14091. window.DATA.camera_start && window.DATA.camera_start.thumbImg && function(e) {
  14092. $("<img/>").attr("src", e).on("load", function() {
  14093. $("#gui-thumb").css("backgroundImage", "url(" + e + ")").fadeIn(500),
  14094. $(this).remove()
  14095. $(".screen .shotImg.innerBtn").removeClass('blank').css("background-image", "url(" + e + ")")
  14096. })
  14097. }(window.DATA.camera_start.thumbImg);
  14098. {//初始化导览时间
  14099. if(DATA.tourBlackSpeed == void 0)DATA.tourBlackSpeed = 100
  14100. window._settings.warp.teleportTime = settings.teleportTime / DATA.tourBlackSpeed * 100;
  14101. if(DATA.tourWalkSpeed == void 0)DATA.tourWalkSpeed = 100
  14102. /* if(DATA.tourWalkSpeed!=void 0){
  14103. let r = 100 / DATA.tourWalkSpeed;
  14104. window._settings.warp.flytimeDistanceMultiplier = settings.flytimeDistanceMultiplier * r
  14105. window._settings.warp.flyTime = settings.flyTime * r
  14106. }else{
  14107. window._settings.warp.flyTime = settings.flyTime
  14108. } */
  14109. if(DATA.tourRotTime == '' || DATA.tourRotTime == void 0){
  14110. DATA.tourRotTime = settings.tourRotTime; //默认停留2秒
  14111. }
  14112. }
  14113. {//其他
  14114. _settings.floorPlanAngle = DATA.floorPlanAngle || 0
  14115. }
  14116. d = function(e) {
  14117. var t = new E.PerspectiveCamera;
  14118. t.layers.enable(te.PANOMARKERS),
  14119. t.layers.enable(te.RETICULE),
  14120. t.layers.enable(te.TAG);
  14121. var o = new E.Scene
  14122. , i = new E.AmbientLight(16777215);
  14123. return o.add(i),
  14124. o.skybox = new V,
  14125. o.add(o.skybox),
  14126. o.plane = new E.Mesh(new E.PlaneBufferGeometry(1e5,1e5),new E.RawShaderMaterial({
  14127. side: E.DoubleSide
  14128. })),
  14129. o.plane.position.y = 0,
  14130. o.plane.rotateX(-Math.PI / 2),
  14131. o.plane.material.visible = !1,
  14132. o.add(o.plane),
  14133. o.updateMatrixWorld(),
  14134. L.showScreenshotLocations && e.data.images.forEach(function(e) {
  14135. if (e.metadata && e.metadata.camera_position) {
  14136. var t = e.metadata.camera_position
  14137. , i = new E.Mesh(new E.BoxGeometry(.3,.3,.3));
  14138. i.position = t.clone(),
  14139. o.add(i);
  14140. var n = e.metadata.camera_quaternion
  14141. , r = new E.Vector3(0,0,-1).applyQuaternion(n);
  14142. o.add(new E.ArrowHelper(r,t.clone(),1,16711680))
  14143. }
  14144. }),
  14145. L.showAxis && (o.add(new E.ArrowHelper(new E.Vector3(0,1,0),new E.Vector3(0,0,0),1,255)),
  14146. o.add(new E.ArrowHelper(new E.Vector3(0,0,1),new E.Vector3(0,0,0),1,16711680)),
  14147. o.add(new E.ArrowHelper(new E.Vector3(1,0,0),new E.Vector3(0,0,0),1,65280))),
  14148. new Y(o,t,B)
  14149. }(g),
  14150. m = function(e, t) {
  14151. var i = e ? 1 : 1e3
  14152. , n = W.tilegen || W.imgopt ? 6 : 2;
  14153. n = O.valueFromHash("tileconc", n);
  14154. var r = new X
  14155. , o = new Q({
  14156. concurrentDownloads: n
  14157. })
  14158. , a = new J
  14159. , s = new x
  14160. , l = new w
  14161. , c = new b(t)
  14162. , h = new T
  14163. , u = new S(i)
  14164. , d = new M
  14165. , p = new K;
  14166. return {
  14167. qualityManager: r,
  14168. panoRenderer: a,
  14169. tileDownloader: o,
  14170. player: c,
  14171. director: l,
  14172. modelManager: s,
  14173. tagManager: p,
  14174. displayController: u,
  14175. labelDisplayController: d,
  14176. controls: h
  14177. }
  14178. }(o, s.mode),
  14179. l = m.controls,
  14180. c = m.player,
  14181. h = m.director,
  14182. u = m.tagManager,
  14183. p = m.tileDownloader,
  14184. f = m.qualityManager,
  14185. m.panoRenderer,
  14186. function(e, t, i, n) {
  14187. var r = i.controls
  14188. , o = i.qualityManager
  14189. , a = i.panoRenderer
  14190. , s = i.tileDownloader
  14191. , l = i.modelManager;
  14192. r.init(n, l),
  14193. j.init(i.director, r, i.player, l, t),
  14194. o.init(l),
  14195. s.init(o),
  14196. a.init(t, s, o),
  14197. l.init(s, a, o),
  14198. l.addModel(e),
  14199. t.addComponent(F)
  14200. }(g, d, m, r),
  14201. c.director = h,
  14202. g.supportsTiles && p.start(),
  14203. !o || s.mode === R.PANORAMA && s.pano || (ne.warn("Tried to quickstart, but failed as we are not starting in inside mode."),
  14204. o = !1);
  14205. var e = null;
  14206. if (o) {
  14207. ne.warn("Quickstart engaged. Hold on to your knickers.");
  14208. var t = l.controls[R.PANORAMA];
  14209. a = new q(f,d.scene,d.camera,t,r),
  14210. C(d, r, g),
  14211. e = a.load(s).then(function() {
  14212. d.addComponent(a),
  14213. d.once(ee.AfterRender, function() {
  14214. ne.warn("First render after quickstart load finished.")
  14215. })
  14216. })
  14217. }
  14218. return window.flyToFirst = function() {
  14219. var e = c.model.panos.get("8d778e19657f433fb9cf8947d823bb70")
  14220. , t = new _.Quaternion(.7099827027821568,-.07708150183830938,.6958985789714591,.07555241737970636)
  14221. , i = new _.Vector3(0,0,-1).applyQuaternion(t).add(e.position);
  14222. c.flyToPano({
  14223. pano: e,
  14224. lookAtPoint: i
  14225. })
  14226. }
  14227. ,
  14228. $.when(e, D.startLoading(g, c, h, L.autoplay, o, v))
  14229. }).then(function() {
  14230. return function(e, t, i, n, r) {
  14231. return r.progressCallback = t,
  14232. N.sessionStart(),
  14233. e.load(n).progress(function(e, t) {
  14234. e.modelElementsToLoad = t[1],
  14235. function(e) {
  14236. e.totalElementsToLoad = e.modelElementsToLoad + e.panoElementsToLoad
  14237. }(e),
  14238. function(e) {
  14239. e.totalElementsLoaded++,
  14240. e.totalPercentageLoaded = e.totalElementsLoaded / e.totalElementsToLoad,
  14241. isNaN(e.totalPercentageLoaded) && (e.totalPercentageLoaded = 0),
  14242. e.totalPercentageLoaded = .4 + .6 * e.totalPercentageLoaded,
  14243. console.log("pro:" + e.totalPercentageLoaded),
  14244. e.progressCallback && e.progressCallback(100 * e.totalPercentageLoaded)
  14245. }(e)
  14246. }
  14247. .bind(this, r))
  14248. }(g, D.onProgress, 0, !o, n)
  14249. }).then(function() {
  14250. s.quickstart = o,
  14251. function(e, t, i, n) {
  14252. var r = i.qualityManager
  14253. , o = i.panoRenderer
  14254. , a = i.tileDownloader
  14255. , s = i.modelManager
  14256. , l = i.player
  14257. , c = i.director
  14258. , h = i.tagManager
  14259. , u = i.displayController
  14260. , d = i.labelDisplayController
  14261. , p = i.controls;
  14262. t.scene.add(e),
  14263. t.qualityManager = r;
  14264. var f = {
  14265. camera: t.camera,
  14266. director: c,
  14267. modelManager: s,
  14268. tileDownloader: a,
  14269. panoRenderer: o,
  14270. qualityManager: r,
  14271. tagManager: h,
  14272. container: n,
  14273. controls: p
  14274. };
  14275. l.init(f),
  14276. l.setScene(t.scene),
  14277. h.init(s, l),
  14278. c.init(l, s),
  14279. u.init(c, l, s, h, n),
  14280. d.init(l, s, n),
  14281. B.bindEvents(l),
  14282. t.addComponent(h),
  14283. t.addComponent(l),
  14284. t.addComponent(o),
  14285. l.sceneRenderer = t
  14286. }(g, d, m, r),
  14287. d.started || C(d, r, g),
  14288. N.modelLoaded(g, c, l, L.autoplay),
  14289. function(e, t, i, n) {
  14290. return ne.info("Starting player in " + i.mode),
  14291. N.report(t.sid, "started-playing", n, i.quickstart),
  14292. e.start(i)
  14293. }(c, g, s, L.autoplay).done(function() {
  14294. h.autoTour()
  14295. }),
  14296. g.supportsTiles || new H(g,c).start();
  14297. o && (d.removeComponent(a),
  14298. a.destroy(),
  14299. s.pano.enter()),
  14300. D.init(g, h, c, l, d, s, N.getSessionId()),
  14301. D.endLoading(g, h, u),
  14302. d.once(ee.AfterRender, function() {
  14303. v.setAppReadyTime();
  14304. var e = v.calcFullLoadingTime();
  14305. ne.warn("Total load time: " + e / 1e3),
  14306. N.loadComplete(e),
  14307. ne.warn("First render after model load finished.");
  14308. editTool.loadDone('data', window.DATA)
  14309. }),
  14310. d.on(ee.MemoryUsageUpdated, y)
  14311. }).fail(A.bind(this, e))
  14312. }()
  14313. }()
  14314. }).fail(e=>{
  14315. alert("缺少someData文件,请检查场景码是否正确。")
  14316. })
  14317. }
  14318. ).call(this, "/js/main.js")
  14319. }
  14320. , {
  14321. "./DisplayController": 1,
  14322. "./TimingData": 2,
  14323. "./ab": 3,
  14324. "./analytics": 4,
  14325. "./cameras/PanoramaCamera": 7,
  14326. "./controls/CameraControls": 9,
  14327. "./director": 15,
  14328. "./effects": 16,
  14329. "./enum/PanoSizeClass": 36,
  14330. "./enum/PanoramaEvents": 37,
  14331. "./enum/RenderLayers": 41,
  14332. "./enum/SceneRendererEvents": 43,
  14333. "./enum/Viewmode": 51,
  14334. "./featureflags": 59,
  14335. "./gui/error": 64,
  14336. "./gui/gui": 65,
  14337. "./gui/memoryUsage": 73,
  14338. "./label/LabelDisplayController": 91,
  14339. "./lib/array-polyfill": 92,
  14340. "./lib/performance-polyfill": 95,
  14341. "./lib/postprocessing/EffectComposer.js": 96,
  14342. "./lib/postprocessing/MaskPass.js": 97,
  14343. "./lib/postprocessing/RenderPass.js": 98,
  14344. "./lib/postprocessing/ShaderPass.js": 99,
  14345. "./lib/shaders/CopyShader.js": 100,
  14346. "./lib/shaders/HorizontalBlurShader.js": 101,
  14347. "./lib/shaders/VerticalBlurShader.js": 102,
  14348. "./lib/three75-shim": 103,
  14349. "./localization/localize": 108,
  14350. "./tag/tagManager": 124,
  14351. "./model/ModelManager": 140,
  14352. "./objects/Panorama": 148,
  14353. "./objects/Skybox": 152,
  14354. "./player": 155,
  14355. "./preloaders": 156,
  14356. "./scene/QuickstartManager": 157,
  14357. "./scene/SceneRenderer": 158,
  14358. "./sdk/automation.js": 164,
  14359. "./settings": 166,
  14360. "./showcase": 168,
  14361. "./tile/PanoRenderer": 169,
  14362. "./tile/QualityManager.js": 170,
  14363. "./tile/TileDownloader": 171,
  14364. "./util/PanoramaCollection": 178,
  14365. "./util/ajax": 181,
  14366. "./util/browser": 182,
  14367. "./util/camera": 183,
  14368. "./util/common": 185,
  14369. "./util/lerp": 188,
  14370. "./util/logger": 189,
  14371. "./util/math": 190,
  14372. "./util/sentry": 192,
  14373. "./util/showcase": 193,
  14374. "./util/transitions": 195,
  14375. events: 202,
  14376. "promise-polyfill": 213,
  14377. three: 217
  14378. }],
  14379. 117: [function(e, t, i) {
  14380. "use strict";
  14381. function n(e) {
  14382. e = e || {},
  14383. r.RawShaderMaterial.call(this, a.extendObject({
  14384. fragmentShader: o.cube.fragmentShader,
  14385. vertexShader: o.cube.vertexShader,
  14386. uniforms: r.UniformsUtils.clone(o.cube.uniforms),
  14387. name: "CubemapMaterial"
  14388. }, e))
  14389. }
  14390. var r = e("three")
  14391. , o = e("../shaders")
  14392. , a = e("../util/common");
  14393. (n.prototype = Object.create(r.RawShaderMaterial.prototype)).constructor = n,
  14394. t.exports = n
  14395. }
  14396. , {
  14397. "../shaders": 167,
  14398. "../util/common": 185,
  14399. three: 217
  14400. }],
  14401. 118: [function(e, t, i) {
  14402. "use strict";
  14403. function n(e) {
  14404. e = e || {},
  14405. r.RawShaderMaterial.call(this, a.extendObject({
  14406. fragmentShader: o.model.fragmentShader,
  14407. vertexShader: o.model.vertexShader,
  14408. uniforms: r.UniformsUtils.clone(o.model.uniforms),
  14409. name: "ModelTextureMaterial"
  14410. }, e))
  14411. }
  14412. var r = e("three")
  14413. , o = e("../shaders")
  14414. , a = e("../util/common");
  14415. ((n.prototype = Object.create(r.RawShaderMaterial.prototype)).constructor = n).prototype.setProjectedPanos = function(e, t, i) {
  14416. i && (this.uniforms.progress.value = 0),
  14417. e.ensureSkyboxReadyForRender(),
  14418. this.uniforms.pano0Map.value = e.getSkyboxTexture(),
  14419. this.uniforms.pano0Position.value.copy(e.position),
  14420. this.uniforms.pano0Matrix.value.copy(e.skyboxMesh.matrixWorld),
  14421. t.ensureSkyboxReadyForRender(),
  14422. this.uniforms.pano1Map.value = t.getSkyboxTexture(),
  14423. this.uniforms.pano1Position.value.copy(t.position),
  14424. this.uniforms.pano1Matrix.value.copy(t.skyboxMesh.matrixWorld)
  14425. }
  14426. ,
  14427. t.exports = n
  14428. }
  14429. , {
  14430. "../shaders": 167,
  14431. "../util/common": 185,
  14432. three: 217
  14433. }],
  14434. 119: [function(m, v, e) {
  14435. (function(e) {
  14436. "use strict";
  14437. function t(e, t, i, n) {
  14438. this.div = null,
  14439. this.body = null,
  14440. this.label = e,
  14441. this.description = t,
  14442. this.parsedDescription = [],
  14443. this.media = i || {
  14444. type: null
  14445. },
  14446. this.loadingSpinner = null,
  14447. this.parser = new r({
  14448. supportLinks: !c.valueFromHash("mls"),
  14449. keepLinkLabels: !0
  14450. }),
  14451. this.state = g.CLOSED,
  14452. this.orientation = "",
  14453. this.initialTransform = "",
  14454. this.hovering = !1,
  14455. this.openTransition = null,
  14456. this.closeTransition = null,
  14457. this.openPromise = null,
  14458. this.closePromise = null,
  14459. this.animationTransition = null,
  14460. this.animationScale = 0
  14461. }
  14462. var r = m("../Parser/DescriptionParser")
  14463. , i = m("../Media/Link")
  14464. , n = m("../Media/Image")
  14465. , o = m("../Media/EmbedlyPlayer")
  14466. , a = m("../Media/EmbedlyEmbed")
  14467. , s = m("../../util/transitions")
  14468. , l = m("../../util/lerp")
  14469. , c = m("../../util/browser")
  14470. , b = m("./BillboardEvent")
  14471. , w = m("../Media/MediaEvent")
  14472. , h = m("../Parser/DescriptionChunkType")
  14473. , u = m("events").EventEmitter
  14474. , d = m("./billboardSettings")
  14475. , T = m("./overlaySettings")
  14476. , p = new (m("../../util/logger"))(e)
  14477. , f = document.getElementById("tag-billboards");
  14478. f.addEventListener("touchend", function(e) {
  14479. f.style.pointerEvents = "none"
  14480. }),
  14481. f.addEventListener("touchcancel", function(e) {
  14482. f.style.pointerEvents = "none"
  14483. });
  14484. var g = {
  14485. CLOSED: "closed",
  14486. OPENING: "opening",
  14487. OPEN: "open",
  14488. CLOSING: "closing",
  14489. ACTIVE: "active"
  14490. };
  14491. (t.prototype = Object.create(u.prototype)).build = function(e) {
  14492. this.parsedDescription = this.parser.parse(this.description);
  14493. var t = document.createElement("div");
  14494. t.className = "tag-container has-hotzone",
  14495. this.div = t,
  14496. this.body = document.createElement("div"),
  14497. this.body.className = "tag-body";
  14498. var i = document.createElement("div");
  14499. i.classList.add("tag-content");
  14500. var n = document.createElement("div");
  14501. n.classList.add("tag-text-content");
  14502. var r = document.createElement("div");
  14503. r.className = "tag-label",
  14504. r.textContent = this.label,
  14505. n.appendChild(r);
  14506. var o = document.createElement("div");
  14507. o.className = "tag-desc",
  14508. n.appendChild(o),
  14509. i.appendChild(n),
  14510. this.body.appendChild(i),
  14511. this.appendDescriptionElements(this.parsedDescription, o),
  14512. this.appendMedia(),
  14513. t.appendChild(this.body),
  14514. f.appendChild(t),
  14515. this.bindEvents(t, this.body)
  14516. }
  14517. ,
  14518. t.prototype.bindEvents = function(i, e) {
  14519. function t(n) {
  14520. return function(e) {
  14521. if (!this.div.classList.contains("overlay")) {
  14522. var t, i = document.getElementById("player");
  14523. try {
  14524. t = new MouseEvent(n,e)
  14525. } catch (i) {
  14526. (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)
  14527. }
  14528. i.dispatchEvent(t)
  14529. }
  14530. }
  14531. }
  14532. e.addEventListener("mousedown", function(e) {
  14533. e.stopPropagation()
  14534. }),
  14535. e.addEventListener("mouseup", function(e) {
  14536. e.stopPropagation()
  14537. }),
  14538. i.addEventListener("touchstart", function(e) {
  14539. f.style.pointerEvents = "auto"
  14540. }),
  14541. i.addEventListener("mousedown", t("mousedown").bind(this)),
  14542. i.addEventListener("mouseup", t("mouseup").bind(this)),
  14543. e.addEventListener("mouseover", function(e) {
  14544. this.state === g.OPEN && i.classList.remove("has-hotzone")
  14545. }
  14546. .bind(this)),
  14547. i.addEventListener("mouseenter", function(e) {
  14548. this.state !== g.CLOSING && (this.hovering = !0,
  14549. this.emit(b.ENTER))
  14550. }
  14551. .bind(this)),
  14552. i.addEventListener("mouseleave", function(e) {
  14553. this.hovering = !1,
  14554. this.emit(b.LEAVE)
  14555. }
  14556. .bind(this)),
  14557. i.addEventListener("gesturestart", function(e) {
  14558. e.preventDefault()
  14559. });
  14560. var n = i.querySelector(".tag-text-content")
  14561. , r = 0;
  14562. n.addEventListener("touchstart", function(e) {
  14563. r = e.changedTouches[0].clientY
  14564. }),
  14565. n.addEventListener("touchmove", function(t) {
  14566. function e(e) {
  14567. e && (0 === e.scrollTop && t.changedTouches[0].clientY > r || e.scrollTop + e.clientHeight - e.scrollHeight == 0 && t.changedTouches[0].clientY < r) && t.preventDefault()
  14568. }
  14569. return i.classList.contains("overlay") ? e(this.querySelector(".tag-desc")) : void e(this)
  14570. }),
  14571. i.addEventListener("touchmove", function(e) {
  14572. 0 == (n.compareDocumentPosition(e.target) & Node.DOCUMENT_POSITION_CONTAINED_BY) && e.preventDefault()
  14573. })
  14574. }
  14575. ,
  14576. t.prototype.appendDescriptionElements = function(e, i) {
  14577. 0 < e.length && this.div.classList.add("has-text"),
  14578. e.forEach(function(e, t) {
  14579. switch (e.type) {
  14580. case h.TEXT:
  14581. i.appendChild(this.createTextElement(e.text));
  14582. break;
  14583. case h.LINK:
  14584. i.appendChild(this.createLinkElement(e.link))
  14585. }
  14586. }
  14587. .bind(this))
  14588. }
  14589. ,
  14590. t.prototype.appendLoadingSpinner = function() {
  14591. this.loadingSpinner = document.createElement("div"),
  14592. this.loadingSpinner.classList.add("loading-spinner");
  14593. var e = document.createElement("div");
  14594. e.classList.add("gui-spinner-icon"),
  14595. this.loadingSpinner.appendChild(e),
  14596. this.body.appendChild(this.loadingSpinner)
  14597. }
  14598. ,
  14599. t.prototype.onMediaLoadFinished = function() {
  14600. this.loadingSpinner && (this.loadingSpinner.parentNode.removeChild(this.loadingSpinner),
  14601. this.applyOrientation(this.orientation),
  14602. this.loadingSpinner = null)
  14603. }
  14604. ,
  14605. t.prototype.appendMedia = function() {
  14606. if (this.media && this.media.type && "error" !== this.media.type && (!c.valueFromHash("mls", 0) || this.media.type === h.IMAGE)) {
  14607. this.appendLoadingSpinner();
  14608. var e = document.createElement("div");
  14609. e.classList.add("tag-media-content");
  14610. var t = document.createElement("i");
  14611. switch (["icon", "icon-close-thin", "close"].forEach(function(e) {
  14612. t.classList.add(e)
  14613. }),
  14614. this.body.appendChild(t),
  14615. this.body.appendChild(e),
  14616. this.media.type) {
  14617. case h.IMAGE:
  14618. e.appendChild(this.createImageElement(this.media, this.body));
  14619. break;
  14620. case h.VIDEO:
  14621. e.appendChild(this.createVideoElement(this.media, this.body));
  14622. break;
  14623. case h.RICH:
  14624. e.appendChild(this.createEmbedElement(this.media, this.body))
  14625. }
  14626. }
  14627. }
  14628. ,
  14629. t.prototype.createTextElement = function(e) {
  14630. var t = document.createElement("span");
  14631. return t.textContent = e,
  14632. t
  14633. }
  14634. ,
  14635. t.prototype.createLinkElement = function(e) {
  14636. var t = new i(e);
  14637. return t.on(w.LINK_CLICK, this.emit.bind(this, w.LINK_CLICK)),
  14638. t.createDomElement()
  14639. }
  14640. ,
  14641. t.prototype.createImageElement = function(t, C) {
  14642. function e() {
  14643. function e() {
  14644. p || (E.classList.remove("view-image"),
  14645. a.classList.add("overlay"),
  14646. t(),
  14647. window.addEventListener("resize", A),
  14648. a.addEventListener("click", i),
  14649. c.addEventListener("click", r),
  14650. o.addEventListener("click", n),
  14651. p = !0,
  14652. _.emit(w.IMAGE_OPENED))
  14653. }
  14654. function t() {
  14655. C.classList.add("show-info"),
  14656. s.classList.remove("collapsible"),
  14657. s.style.height = "";
  14658. var e = parseFloat(getComputedStyle(v).lineHeight)
  14659. , t = g + e
  14660. , i = a.clientWidth - 2 * T.boundaryWidth - m
  14661. , n = a.clientHeight - 2 * T.boundaryHeight - m - t
  14662. , r = n
  14663. , o = r * I.aspect;
  14664. i < o && (r = (o = i) / I.aspect),
  14665. n < r && (o = (r = n) * I.aspect),
  14666. o += m,
  14667. r += m + t,
  14668. C.style.width = o + "px",
  14669. C.style.height = r + "px",
  14670. l.style.paddingTop = e + m + "px",
  14671. 0 < _.description.length && (s.classList.add("collapsible"),
  14672. s.style.height = s.clientHeight + 12 + "px",
  14673. y.style.height = "calc(100% - " + v.clientHeight + "px)")
  14674. }
  14675. function i(e) {
  14676. e.target === a && n()
  14677. }
  14678. function n() {
  14679. p && (p = !1,
  14680. E.classList.add("view-image"),
  14681. a.classList.remove("overlay"),
  14682. s.style.height = "",
  14683. l.style.paddingTop = "",
  14684. C.style.width = "",
  14685. C.style.height = "",
  14686. window.removeEventListener("resize", A),
  14687. a.removeEventListener("click", i),
  14688. c.removeEventListener("click", r),
  14689. o.removeEventListener("click", n),
  14690. _.emit(w.IMAGE_CLOSED),
  14691. _.close(!0))
  14692. }
  14693. function r(e) {
  14694. C.classList.toggle("show-info")
  14695. }
  14696. var a = _.div
  14697. , s = a.getElementsByClassName("tag-content")[0]
  14698. , l = a.getElementsByClassName("tag-media-content")[0]
  14699. , o = C.getElementsByClassName("close")[0]
  14700. , c = s.getElementsByClassName("tag-label")[0];
  14701. a.classList.add("has-image"),
  14702. E.classList.add("view-image"),
  14703. a.classList.add(1 <= I.aspect ? "image-landscape" : "image-portrait"),
  14704. _.applyOrientation(_.orientation);
  14705. 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,
  14706. function() {
  14707. clearInterval(h),
  14708. clearTimeout(u),
  14709. h = setInterval(function() {
  14710. var e = a.clientHeight;
  14711. d !== e && (t(),
  14712. d = e)
  14713. }, 100),
  14714. u = setTimeout(clearInterval.bind(this, h), 1e3)
  14715. }
  14716. );
  14717. I.on(w.IMAGE_OPENING, e),
  14718. _.on(b.ACTIVATE, e),
  14719. _.on(w.IMAGE_CLOSED, I.onClosed.bind(I)),
  14720. _.on(b.CLOSING, n)
  14721. }
  14722. var I = new n
  14723. , E = I.createDomElement();
  14724. this.once(b.OPENED, function() {
  14725. I.load(t.src).then(e).catch(function(e) {
  14726. p.warn("Failed to load image:", t.src),
  14727. p.warn("with error:", e)
  14728. }).then(this.onMediaLoadFinished.bind(this))
  14729. });
  14730. var _ = this;
  14731. return E
  14732. }
  14733. ,
  14734. t.prototype.createVideoElement = function(t, e) {
  14735. var i = new o({
  14736. autoPlay: !0,
  14737. autoResume: !0,
  14738. startMuted: !1,
  14739. loop: !1
  14740. })
  14741. , n = i.createDomElement();
  14742. return this.once(b.OPENED, function() {
  14743. i.load(t.src).then(function() {
  14744. this.div.classList.add("has-video"),
  14745. this.state !== g.OPEN && this.state !== g.ACTIVE || (i.show(),
  14746. i.play()),
  14747. this.on(b.OPENING, i.show.bind(i)),
  14748. this.on(b.OPENED, i.play.bind(i)),
  14749. this.on(b.CLOSING, i.pause.bind(i)),
  14750. this.on(b.CLOSED, i.hide.bind(i))
  14751. }
  14752. .bind(this)).catch(function(e) {
  14753. p.warn("Failed to embed video:", t.src),
  14754. p.warn("with error:", e)
  14755. }).then(this.onMediaLoadFinished.bind(this))
  14756. }
  14757. .bind(this)),
  14758. n
  14759. }
  14760. ,
  14761. t.prototype.createEmbedElement = function(t, e) {
  14762. var i = new a
  14763. , n = i.createDomElement();
  14764. return this.once(b.OPENED, function() {
  14765. i.load(t.src).then(function() {
  14766. this.div.classList.add("has-embed"),
  14767. this.state !== g.OPEN && this.state !== g.ACTIVE || i.show(),
  14768. this.applyOrientation(this.orientation),
  14769. this.on(b.OPENING, i.show.bind(i)),
  14770. this.on(b.CLOSED, i.hide.bind(i))
  14771. }
  14772. .bind(this)).catch(function(e) {
  14773. p.warn("Failed to embed:", t.src),
  14774. p.warn("with error:", e)
  14775. }).then(this.onMediaLoadFinished.bind(this))
  14776. }
  14777. .bind(this)),
  14778. n
  14779. }
  14780. ,
  14781. t.prototype.open = function(e) {
  14782. return this.openPromise = $.Deferred(),
  14783. this.state === g.ACTIVE ? this.openPromise.resolve().promise() : (this.hovering || this.div.classList.add("has-hotzone"),
  14784. this.openTransition ? e && this.setActiveState() : this.openTransition = s.setTimeout(function() {
  14785. this.state !== g.OPEN && (this.emit(b.OPENING),
  14786. e && this.emit(b.ACTIVATING),
  14787. this.state = g.OPENING,
  14788. this.animateOpen(function() {
  14789. e && this.setActiveState(),
  14790. this.openPromise.resolve()
  14791. }
  14792. .bind(this)))
  14793. }
  14794. .bind(this), d.animation.openDelay),
  14795. s.cancel(this.closeTransition),
  14796. this.closePromise && this.closePromise.reject(),
  14797. this.closeTransition = void 0,
  14798. this.openPromise.promise())
  14799. }
  14800. ,
  14801. t.prototype.close = function(e) {
  14802. return this.closePromise = $.Deferred(),
  14803. !e && this.hovering ? this.closePromise.reject().promise() : (this.closeTransition || (this.closeTransition = s.setTimeout(function() {
  14804. this.state !== g.CLOSED && (this.emit(b.CLOSING),
  14805. this.state = g.CLOSING,
  14806. this.animateClose())
  14807. }
  14808. .bind(this), d.animation.closeDelay)),
  14809. s.cancel(this.openTransition),
  14810. this.openPromise && this.openPromise.reject(),
  14811. this.openTransition = void 0,
  14812. this.closePromise.resolve(),
  14813. this.closePromise.promise())
  14814. }
  14815. ,
  14816. t.prototype.setActiveState = function() {
  14817. this.state !== g.CLOSED && (this.state = g.ACTIVE,
  14818. this.emit(b.ACTIVATE),
  14819. this.div.classList.remove("has-hotzone"))
  14820. }
  14821. ,
  14822. t.prototype.animateOpen = function(e) {
  14823. if (this.state === g.OPENING) {
  14824. if (s.cancel(this.animationTransition),
  14825. c.detectSamsungNative())
  14826. return this.boardOrientation = null,
  14827. this.div.style.visibility = "visible",
  14828. this.emit(b.OPENED),
  14829. this.state = g.OPEN,
  14830. void (e && e());
  14831. this.div.style.webkitTransform = "scale(0)",
  14832. this.div.style.transform = "scale(0)",
  14833. this.div.style.visibility = "visible",
  14834. this.animationTransition = s.start(l.property(this, "animationScale", 1), d.animation.openDuration, function() {
  14835. this.emit(b.OPENED),
  14836. this.state = g.OPEN,
  14837. e && e()
  14838. }
  14839. .bind(this))
  14840. }
  14841. }
  14842. ,
  14843. t.prototype.animateClose = function(e) {
  14844. this.state === g.CLOSING && (s.cancel(this.animationTransition),
  14845. this.animationTransition = s.start(l.property(this, "animationScale", 0), d.animation.closeDuration, function() {
  14846. this.emit(b.CLOSED),
  14847. this.state = g.CLOSED,
  14848. this.div.style.visibility = "hidden",
  14849. this.div.classList.contains("has-hotzone") || this.div.classList.add("has-hotzone"),
  14850. e && e()
  14851. }
  14852. .bind(this)))
  14853. }
  14854. ,
  14855. t.prototype.needsUpdate = function() {
  14856. return this.state !== g.CLOSED
  14857. }
  14858. ,
  14859. t.prototype.update = function(e, t) {
  14860. if (this.needsUpdate()) {
  14861. var i = (this.updateOrientation(e),
  14862. this.calcScale(t))
  14863. , n = {
  14864. x: (e.x + 1) * $("#player").width() / 2,
  14865. y: (e.y + 1) * $("#player").height() / 2
  14866. };
  14867. this.div.screenTransform = this.initialTransform + " translate(" + n.x + "px, " + n.y + "px) scale(" + i * this.animationScale + ")",
  14868. this.div.style.webkitTransform = this.div.screenTransform,
  14869. this.div.style.transform = this.div.screenTransform
  14870. }
  14871. }
  14872. ,
  14873. t.prototype.getDimensions = function() {
  14874. return this.div.getBoundingClientRect()
  14875. }
  14876. ,
  14877. t.prototype.calcScale = function(e) {
  14878. return Math.sqrt(e / 40) * d.boardToDiscRatio
  14879. }
  14880. ,
  14881. t.prototype.updateOrientation = function(e) {
  14882. if (this.state !== g.ACTIVE) {
  14883. var t = e.y < -1 / 3 ? 0 : e.y < 1 / 3 ? 1 : 2
  14884. , i = e.x < -1 / 3 ? 0 : e.x < 1 / 3 ? 1 : 2
  14885. , n = "";
  14886. n += 0 == i ? "right" : 2 == i ? "left" : "",
  14887. n += 0 == t ? "-down" : 2 == t ? "-up" : "",
  14888. 1 == i && (n = 0 == t ? "bottom" : 2 == t ? "top" : "",
  14889. 1 == t && (n = $("#player").width() > $("#player").height() ? e.x < 0 ? "right" : "left" : e.y < 0 ? "bottom" : "top")),
  14890. 1 == i && 1 == t && n === this.orientation || this.applyOrientation(n)
  14891. }
  14892. }
  14893. ,
  14894. t.prototype.applyOrientation = function(e) {
  14895. this.div.style.transform = this.div.style.webkitTransform = "",
  14896. this.div.classList.remove("tag-container-" + this.orientation),
  14897. this.div.classList.add("tag-container-" + e);
  14898. var t = window.getComputedStyle(this.div);
  14899. this.initialTransform = t.transform || t.webkitTransform,
  14900. "none" === this.initialTransform && (this.initialTransform = "");
  14901. var i = t.transform.slice(7, -1).split(",")
  14902. , n = -i[4]
  14903. , r = -i[5];
  14904. this.div.style.webkitTransformOrigin = n + "px " + r + "px",
  14905. this.div.style.transformOrigin = n + "px " + r + "px",
  14906. this.orientation = e
  14907. }
  14908. ,
  14909. v.exports = t
  14910. }
  14911. ).call(this, "/js/tag/Billboard/Billboard.js")
  14912. }
  14913. , {
  14914. "../../util/browser": 182,
  14915. "../../util/lerp": 188,
  14916. "../../util/logger": 189,
  14917. "../../util/transitions": 195,
  14918. "../Media/EmbedlyEmbed": 125,
  14919. "../Media/EmbedlyPlayer": 126,
  14920. "../Media/Image": 128,
  14921. "../Media/Link": 129,
  14922. "../Media/MediaEvent": 131,
  14923. "../Parser/DescriptionChunkType": 133,
  14924. "../Parser/DescriptionParser": 134,
  14925. "./BillboardEvent": 120,
  14926. "./billboardSettings": 121,
  14927. "./overlaySettings": 122,
  14928. events: 202
  14929. }],
  14930. 120: [function(e, t, i) {
  14931. "use strict";
  14932. t.exports = Object.freeze({
  14933. ENTER: "billboard.enter",
  14934. LEAVE: "billboard.leave",
  14935. OPENING: "billboard.opening",
  14936. OPENED: "billboard.open",
  14937. CLOSING: "billboard.closing",
  14938. CLOSED: "billboard.closed",
  14939. ACTIVATING: "billboard.activating",
  14940. ACTIVATE: "billboard.activate"
  14941. })
  14942. }
  14943. , {}],
  14944. 121: [function(e, t, i) {
  14945. "use strict";
  14946. t.exports = Object.freeze({
  14947. animation: Object.freeze({
  14948. hoverOnClosing: !1,
  14949. openDelay: 100,
  14950. closeDelay: 50,
  14951. openDuration: 200,
  14952. closeDuration: 100
  14953. }),
  14954. boardToDiscRatio: 1.2
  14955. })
  14956. }
  14957. , {}],
  14958. 122: [function(e, t, i) {
  14959. "use strict";
  14960. t.exports = Object.freeze({
  14961. boundaryWidth: 30,
  14962. boundaryHeight: 0
  14963. })
  14964. }
  14965. , {}],
  14966. 123: [function(M, R, e) {
  14967. (function(e) {
  14968. "use strict";
  14969. function d(e, t, i) {
  14970. var n = i.version || "0";
  14971. "0" !== n && w.info("tag defined using version " + n),
  14972. this.model = e,
  14973. this.sid = t,
  14974. this.color = (new f.Color).set(i.color || o.tagDefault),
  14975. this.hoverColor = o._darken(this.color, .2),
  14976. this.floor = null,
  14977. this.floorIndex = i.floor,
  14978. this.mode = m.PANORAMA,
  14979. i.preferred_camera && i.preferred_camera.mode && (this.mode = i.preferred_camera.mode),
  14980. this.obj3d = null,
  14981. this.disc = null,
  14982. this.materials = {
  14983. disc: null,
  14984. pole: null
  14985. },
  14986. this.position = (new f.Vector3).copy(i.position),
  14987. this.discPosition = (new f.Vector3).copy(i.stem.direction),
  14988. this.discWorldPosition = null,
  14989. this.discScale = .05,
  14990. this.poleEnabled = i.stem.enabled,
  14991. this.billboard = new r(i.label,i.description,i.media,this),
  14992. this.visibleTransition = null,
  14993. this.hoveringDisc = !1
  14994. }
  14995. 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"),
  14996. 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);
  14997. d.prototype = Object.create(b.prototype),
  14998. d.raycaster = new f.Raycaster,
  14999. d.prototype.bindEvents = function() {
  15000. this.billboard.on(_.ENTER, this.setHoverState.bind(this)),
  15001. this.billboard.on(_.LEAVE, this.setFreeState.bind(this))
  15002. }
  15003. ,
  15004. d.prototype.build = function() {
  15005. return this.floor = this.model.floors.get(this.floorIndex) || this.model.floors.first(),
  15006. this.floor && (this.billboard.build(this.model.sid),
  15007. this.obj3d = this.buildObject3D(),
  15008. this.floor.add(this.obj3d)),
  15009. this
  15010. }
  15011. ,
  15012. d.prototype.buildObject3D = function() {
  15013. var e = new f.Object3D;
  15014. e.position.copy(this.position);
  15015. var t = f.UniformsUtils.clone(A.tagDisc.uniforms);
  15016. t.bg.value = x,
  15017. t.mask.value = T,
  15018. t.color.value.copy(this.color),
  15019. this.materials.disc = new f.RawShaderMaterial({
  15020. transparent: !0,
  15021. vertexShader: A.tagDisc.vertexShader,
  15022. fragmentShader: A.tagDisc.fragmentShader,
  15023. uniforms: t
  15024. }),
  15025. this.disc = new f.Mesh(S,this.materials.disc),
  15026. this.disc.layers.set(a.TAG),
  15027. this.disc.position.copy(this.discPosition),
  15028. this.disc.renderOrder = s.tagDisc;
  15029. var i = (this.disc.tag = this).buildPole();
  15030. return i.layers.set(a.TAG),
  15031. i.renderOrder = s.tagStem,
  15032. e.add(i),
  15033. e.layers.set(a.TAG),
  15034. e.add(this.disc)
  15035. }
  15036. ,
  15037. d.prototype.buildPole = function() {
  15038. var e = new f.BufferGeometry
  15039. , t = new Float32Array(6);
  15040. return t[0] = t[1] = t[2] = 0,
  15041. t[3] = this.discPosition.x,
  15042. t[4] = this.discPosition.y,
  15043. t[5] = this.discPosition.z,
  15044. e.addAttribute("position", new f.BufferAttribute(t,3)),
  15045. this.materials.pole = new f.LineBasicMaterial({
  15046. linewidth: g.tags.pole.width,
  15047. color: g.tags.pole.color,
  15048. opacity: 0,
  15049. visible: this.poleEnabled,
  15050. transparent: !0,
  15051. depthWrite: !1
  15052. }),
  15053. new f.Line(e,this.materials.pole)
  15054. }
  15055. ,
  15056. d.prototype.setFreeState = function(e) {
  15057. !e && this.hoveringDisc || this.billboard.close(e).then(function() {
  15058. this.materials.disc.uniforms.color.value = this.color
  15059. }
  15060. .bind(this))
  15061. }
  15062. ,
  15063. d.prototype.setHoverState = function(e) {
  15064. this.billboard.open(e),
  15065. this.materials.disc.uniforms.color.value = this.hoverColor
  15066. }
  15067. ,
  15068. d.prototype.hide = function(e, t) {
  15069. var i = $.Deferred();
  15070. if (0 === this.materials.disc.uniforms.opacity.value && !C.isRunning(this.visibleTransition))
  15071. return i.resolve().promise();
  15072. e = e || 0,
  15073. t = t || 0,
  15074. C.cancel(this.visibleTransition);
  15075. var n, r, o, a = this.materials.disc.uniforms.opacity.value / g.tags.disc.opacity, s = t + e, l = t / s;
  15076. return this.visibleTransition = C.start((n = this,
  15077. r = I.property(n.materials.disc.uniforms.opacity, "value", 0),
  15078. o = I.property(n.materials.pole, "opacity", 0),
  15079. function(e) {
  15080. r(e),
  15081. n.materials.pole && o(e)
  15082. }
  15083. ), s * a, function() {
  15084. i.resolve()
  15085. }, l, E[g.warp.blendEasing]),
  15086. i.promise()
  15087. }
  15088. ,
  15089. d.prototype.show = function(e, t) {
  15090. var i = $.Deferred();
  15091. if (this.materials.disc.uniforms.opacity.value === g.tags.disc.opacity && !C.isRunning(this.visibleTransition))
  15092. return i.resolve().promise();
  15093. e = e || 0,
  15094. t = t || 0,
  15095. C.cancel(this.visibleTransition);
  15096. 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;
  15097. return this.visibleTransition = C.start((n = this,
  15098. r = I.property(n.materials.disc.uniforms.opacity, "value", g.tags.disc.opacity),
  15099. o = I.property(n.materials.pole, "opacity", g.tags.pole.opacity),
  15100. function(e) {
  15101. r(e),
  15102. n.materials.pole && o(e)
  15103. }
  15104. ), s * a, function() {
  15105. i.resolve()
  15106. }, l, E[g.warp.blendEasing]),
  15107. i.promise()
  15108. }
  15109. ,
  15110. d.prototype.closestPanoTowardTag = function(e, t) {
  15111. var i = []
  15112. , n = []
  15113. , r = this.disc.getWorldPosition();
  15114. if (e === m.PANORAMA) {
  15115. var o = t.position.clone().sub(r).normalize();
  15116. i.push(y.filters.isPanoAligned()),
  15117. i.push(y.filters.isNeighbourPanoTo(t)),
  15118. i.push(y.filters.inPanoDirection(r, o, .5)),
  15119. n.push(y.scoreFunctions.direction(r, o))
  15120. }
  15121. var a = new f.Vector3;
  15122. i.push(function(e) {
  15123. return Math.abs(e.position.x - r.x) > g.tags.visibility.cameraClearance || Math.abs(e.position.z - r.z) > g.tags.visibility.cameraClearance
  15124. }, function(e) {
  15125. a.copy(r).sub(e.position);
  15126. var t = -f.Math.radToDeg(Math.atan(a.y / Math.sqrt(a.x * a.x + a.z * a.z)))
  15127. , i = g.tags.navigate.tiltTolerance;
  15128. return g.insideLookLimitDown - i < t && t < g.insideLookLimitUp + i
  15129. }),
  15130. n.push(y.scoreFunctions.distanceSquared(this, -2));
  15131. var s = this.model.panos.sortByScore(i, n);
  15132. if (g.tags.navigate.lineOfSight) {
  15133. for (var l = 0; l < s.length; l++) {
  15134. var c = s[l].item
  15135. , h = c.position.distanceTo(r);
  15136. if (!g.tags.visibility.anyDistance && h > g.tags.visibility.visibleDistance)
  15137. return null;
  15138. d.raycaster.set(c.position, r.clone().sub(c.position).normalize());
  15139. var u = d.raycaster.intersectObjects(this.model.colliders);
  15140. if (0 === u.length || u[0].distance > h)
  15141. return c
  15142. }
  15143. return null
  15144. }
  15145. return 0 < s.length && s[0].pano
  15146. }
  15147. ,
  15148. d.prototype.examine = function(i) {
  15149. if(!player.currentPano)return;
  15150. var e = i.mode
  15151. , n = g.tags.navigate.nearestPano && this.closestPanoTowardTag(e, i.currentPano) || i.currentPano
  15152. , t = this.disc.getWorldPosition();
  15153. this.billboard.setActiveState();
  15154. var r = function() {
  15155. var e = this.billboard.getDimensions()
  15156. , t = new f.Vector3;
  15157. v.convertScreenPositionToNDC(e.left + e.width / 2, e.top + e.height / 2, t),
  15158. t.unproject(i.camera),
  15159. i.flyToPano({
  15160. pano: n,
  15161. lookAtPoint: t
  15162. })
  15163. }
  15164. .bind(this);
  15165. if (e === m.PANORAMA)
  15166. if (n !== i.currentPano) {
  15167. var o = {
  15168. pano: n,
  15169. lookAtPoint: t,
  15170. duration: null,
  15171. maxDistanceOverride: null,
  15172. skipWarpingCheck: !1
  15173. };
  15174. i.flyToPano(o, r)
  15175. } else
  15176. setTimeout(function() {
  15177. this.billboard.open().then(function() {
  15178. r()
  15179. })
  15180. }
  15181. .bind(this), 0);
  15182. else {
  15183. var a = {
  15184. pano: n
  15185. };
  15186. if (t) {
  15187. var s = (new f.Matrix4).lookAt(n.position, t, new f.Vector3(0,1,0));
  15188. a.quaternion = (new f.Quaternion).setFromRotationMatrix(s)
  15189. }
  15190. a.callback = r,
  15191. a.duration = 1500,
  15192. a.mode = m.PANORAMA,
  15193. i.flyToNewMode(a)
  15194. }
  15195. }
  15196. ,
  15197. d.prototype.update = (n = new f.Vector3,
  15198. function(e, t) {
  15199. this.discWorldPosition = this.disc.getWorldPosition(),
  15200. this.updateDisc(e, t),
  15201. this.billboard.needsUpdate() && (n.copy(this.discWorldPosition).project(t),
  15202. n.z < 1 && (n.y *= -1,
  15203. this.billboard.update(n, this.getDiscRadius(n, t))))
  15204. }
  15205. ),
  15206. d.prototype.updateDisc = (l = new f.Vector3,
  15207. c = new f.Vector3,
  15208. h = new f.Vector3,
  15209. u = new f.Vector3,
  15210. p = new f.Vector3,
  15211. function(e, t) {
  15212. var i = g.tags.visibility
  15213. , n = g.tags.disc.scale
  15214. , r = e === m.DOLLHOUSE || e === m.FLOORPLAN ? g.tags.visibility.visibleDistance : t.position.distanceTo(this.discWorldPosition);
  15215. 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)),
  15216. this.obj3d.visible) {
  15217. this.disc.quaternion.copy(t.quaternion);
  15218. var o = n.maxSize - (n.maxSize - n.minSize) * f.Math.smoothstep(r, n.nearBound, n.farBound);
  15219. l.copy(this.discWorldPosition).project(t),
  15220. c.set($("#player").width() / 2, $("#player").height() / 2, 1).multiply(l),
  15221. h.set(o / 2, 0, 0).add(c),
  15222. u.set(2 / $("#player").width(), 2 / $("#player").height(), 1).multiply(h),
  15223. p.copy(u).unproject(t);
  15224. var a = p.distanceTo(this.discWorldPosition)
  15225. , s = 1 + g.tags.disc.scale.responsiveness / 100 * (d.viewportScale() - 1);
  15226. this.discScale = a * s,
  15227. this.disc.scale.set(this.discScale, this.discScale, this.discScale)
  15228. }
  15229. }
  15230. ),
  15231. d.prototype.getDiscRadius = (i = new f.Vector3,
  15232. function(e, t) {
  15233. return i.set(-this.discScale / 2, 0, 0).applyQuaternion(t.quaternion).add(this.discWorldPosition).project(t),
  15234. Math.abs(e.x - i.x) * $("#player").width()
  15235. }
  15236. ),
  15237. d.prototype.tagVisibleOnCurrentFloor = function(e) {
  15238. return !(e === m.DOLLHOUSE || e === m.FLOORPLAN) || this.model.allFloorsVisible || !this.floor.hidden
  15239. }
  15240. ,
  15241. d.prototype.offScreen = function(e, t) {
  15242. var i = e.getWorldPosition().project(t);
  15243. return !(-1 < i.x && i.x < 1 && -1 < i.y && i.y < 1)
  15244. }
  15245. ,
  15246. d.viewportScale = function() {
  15247. return d.viewportWidth === $("#player").width() && d.viewportHeight === $("#player").height() || (d.viewportWidth = $("#player").width(),
  15248. d.viewportHeight = $("#player").height(),
  15249. d.currentViewportScale = Math.sqrt(Math.min(d.viewportWidth, d.viewportHeight) / g.tags.disc.scale.baseViewportSize)),
  15250. d.currentViewportScale
  15251. }
  15252. ,
  15253. R.exports = d
  15254. }
  15255. ).call(this, "/js/tag/tag.js")
  15256. }
  15257. , {
  15258. "../enum/Colors": 19,
  15259. "../enum/RenderLayers": 41,
  15260. "../enum/RenderOrder": 42,
  15261. "../enum/Viewmode": 51,
  15262. "../objects/Panorama": 148,
  15263. "../settings": 166,
  15264. "../shaders": 167,
  15265. "../util/common": 185,
  15266. "../util/easing": 186,
  15267. "../util/lerp": 188,
  15268. "../util/logger": 189,
  15269. "../util/math": 190,
  15270. "../util/texture": 194,
  15271. "../util/transitions": 195,
  15272. "./Billboard/Billboard": 119,
  15273. "./Billboard/BillboardEvent": 120,
  15274. events: 202,
  15275. three: 217
  15276. }],
  15277. 124: [function(M, R, e) {
  15278. (function(e) {
  15279. "use strict";
  15280. function t() {
  15281. this.tagState = T.IDLE,
  15282. this.intersectTag = null,
  15283. this.hoveredTag = null,
  15284. this.activeTag = null,
  15285. this.tagDiscs = [],
  15286. this.raycaster = new i.Raycaster,
  15287. this.modelManager = null,
  15288. this.player = null,
  15289. this.totaltags = 0,
  15290. this.navigatingViaTag = !1,
  15291. this.enabled = !1
  15292. }
  15293. 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"),
  15294. M("../enum/TagStates")), x = M("events").EventEmitter, S = new n(e);
  15295. r.extend(t, x),
  15296. t.prototype.init = function(e, t) {
  15297. this.modelManager = e,
  15298. this.player = t,
  15299. this.updateModel(),
  15300. this.bindEvents()
  15301. }
  15302. ,
  15303. t.prototype.update = function(e) {
  15304. this.updateTags(this.player.mode, this.player.camera, this.player.currentPano, this.player.flying)
  15305. }
  15306. ,
  15307. t.prototype.updateTags = function(e, t, i, n) {
  15308. for (var r in this.model.tags)
  15309. this.model.tags[r].update(e, t, i, n)
  15310. }
  15311. ,
  15312. t.prototype.updateModel = function() {
  15313. this.model = this.modelManager.getActiveModel(),
  15314. this.gettagsFromModel(),
  15315. this.totaltags = Object.keys(this.model.tags).length
  15316. }
  15317. ,
  15318. t.prototype.gettagsFromModel = function() {
  15319. for (var e in this.tagDiscs = [],
  15320. this.model.tags) {
  15321. var t = this.model.tags[e].disc;
  15322. t && this.tagDiscs.push(t)
  15323. }
  15324. }
  15325. ,
  15326. t.prototype.bindEvents = function() {
  15327. function e() {
  15328. Object.keys(this.model.tags).forEach(function(e) {
  15329. var t = this.model.tags[e];
  15330. t.bindEvents(),
  15331. t.billboard.on(y.LINK_CLICK, function(e) {
  15332. e.type === A.NAVIGATION && this.navigateViaLink(e.url)
  15333. }
  15334. .bind(this)),
  15335. t.billboard.on(y.IMAGE_OPENED, function() {
  15336. this.tagState = T.EXAMINE,
  15337. this.emit(y.IMAGE_OPENED)
  15338. }
  15339. .bind(this)),
  15340. t.billboard.on(v.CLOSING, this.dismissExaminedTag.bind(this))
  15341. }
  15342. .bind(this))
  15343. }
  15344. this.modelManager.on(_.ActiveModelChanged, this.updateModel.bind(this)),
  15345. this.modelManager.on(_.ActiveModelChanged, e.bind(this)),
  15346. this.player.on(w.ModeChanging, this.onPlayerModeChanging.bind(this)),
  15347. this.player.on(w.PanoChosen, this.onPanoChange.bind(this)),
  15348. this.player.on(w.Ready, this.onPlayerReady.bind(this)),
  15349. this.player.on(w.FlyingEnded, this.onPlayerFlyingEnded.bind(this)),
  15350. this.player.on(w.WarpStarted, this.handleWarpStart.bind(this)),
  15351. this.player.on(w.WarpInterrupted, this.handleWarpInterruption.bind(this)),
  15352. e.call(this)
  15353. }
  15354. ,
  15355. t.prototype.navigateViaLink = function(e) {
  15356. var t = a.deserialize(e);
  15357. if (t)
  15358. if (t.mode === C.PANORAMA) {
  15359. try {
  15360. this.player.model.panos.get(t.panoId)
  15361. } catch (e) {
  15362. return void S.warn("Unable to find panorama location", t.panoId)
  15363. }
  15364. this.player.warpToPanoById(t.panoId, t.quaternion, null, null, I.BLACK)
  15365. } else {
  15366. var i = {
  15367. cameraMode: t.mode,
  15368. position: t.position,
  15369. quaternion: t.quaternion,
  15370. scanId: t.panoId,
  15371. orthoZoom: t.zoom,
  15372. floorVisibility: t.floorVisibility,
  15373. thumbUrl: null,
  15374. name: null
  15375. };
  15376. this.player.flyToNewMode({
  15377. mode: t.mode,
  15378. duration: m.warp.outsideTime,
  15379. warpDest: new g(i),
  15380. force: !0
  15381. })
  15382. }
  15383. }
  15384. ,
  15385. t.prototype.handleWarpStart = function(e, t, i, n) {
  15386. this.dismissExaminedTag(),
  15387. t === I.BLACK && (null != n || (n = m.warp.teleportTime),
  15388. e && (i = E.END),
  15389. this.hideShowTagsForBlackoutStyle(i, n))
  15390. }
  15391. ,
  15392. t.prototype.handleWarpInterruption = function(e, t, i) {
  15393. null != i || (i = m.warp.teleportTime),
  15394. this.hideShowTagsForBlackoutStyle(t, i)
  15395. }
  15396. ,
  15397. t.prototype.hideShowTagsForBlackoutStyle = function(e, t) {
  15398. var i = 0
  15399. , n = 0
  15400. , r = t / 2;
  15401. switch (null != e || (e = E.MIDDLE),
  15402. e) {
  15403. case E.END:
  15404. this.hideAlltags(r);
  15405. break;
  15406. case E.BEGINNING:
  15407. this.hideAlltags().done(this.showAlltags.bind(this, r));
  15408. break;
  15409. case E.NONE:
  15410. break;
  15411. case E.MIDDLE:
  15412. n = i = r,
  15413. this.hideAlltags(n),
  15414. setTimeout(function() {
  15415. this.showAlltags(i)
  15416. }
  15417. .bind(this), n);
  15418. break;
  15419. case E.FADEIN:
  15420. setTimeout(function() {
  15421. this.showAlltags(r)
  15422. }
  15423. .bind(this), r)
  15424. }
  15425. }
  15426. ,
  15427. t.prototype.onPlayerModeChanging = function(e, t) {
  15428. t !== C.PANORAMA && this.dismissExaminedTag(),
  15429. t === C.PANORAMA && player.currentPano && !player.currentPano.isAligned() && (t = C.OUTDOOR);
  15430. var i = t !== C.OUTDOOR;
  15431. i !== this.model.tagsShown && (i ? this.showAlltags(m.tags.startup.fadeInDuration) : this.hideAlltags(m.tags.startup.fadeInDuration))
  15432. }
  15433. ,
  15434. t.prototype.onPanoChange = function(e, t) {
  15435. var i = this.navigatingViaTag;
  15436. if (this.navigatingViaTag = !1,
  15437. !i) {
  15438. this.dismissExaminedTag();
  15439. var n = e && !e.isAligned() ? C.OUTDOOR : C.PANORAMA
  15440. , r = t && !t.isAligned() ? C.OUTDOOR : C.PANORAMA;
  15441. n !== r && (r === C.PANORAMA ? this.showAlltags(m.tags.startup.fadeInDuration, null, !0) : this.hideAlltags(m.tags.startup.fadeInDuration))
  15442. }
  15443. }
  15444. ,
  15445. t.prototype.onPlayerReady = function(e, t, i) {
  15446. this.startAlltags(e, t ? i : null)
  15447. }
  15448. ,
  15449. t.prototype.onPlayerFlyingEnded = function(e, t) {
  15450. this.updateClosestTags(e)
  15451. }
  15452. ,
  15453. t.prototype.dismissExaminedTag = function() {
  15454. this.activeTag && this.tagState === T.EXAMINE && this.dismissActiveTag(),
  15455. this.hoveredTag && (this.hoveredTag.setFreeState(!0),
  15456. this.hoveredTag = null)
  15457. }
  15458. ,
  15459. t.prototype.startAlltags = function(e, t) {
  15460. this.model.shouldShowtags = m.tags.enabled,
  15461. this.enabled = !0,
  15462. e || (this.showAlltags(m.tags.startup.fadeInDuration, m.tags.startup.fadeInDelay),
  15463. t && setTimeout(function() {
  15464. this.activateTag(this.model.getTagBySid(t))
  15465. }
  15466. .bind(this), m.tags.startup.fadeInDuration / 2))
  15467. }
  15468. ,
  15469. t.prototype.showAlltags = function(e, t, i) {
  15470. function n() {
  15471. ++o === this.totaltags && (this.model.tagsShown = !0,
  15472. r.resolve())
  15473. }
  15474. var r = $.Deferred();
  15475. if (!i && this.player.mode === C.PANORAMA && this.player.currentPano && !this.player.currentPano.isAligned() || !this.model.shouldShowtags)
  15476. return r.resolve().promise();
  15477. var o = 0;
  15478. for (var a in this.model.tags) {
  15479. this.model.tags[a].show(e, t).done(n.bind(this))
  15480. }
  15481. return r.promise()
  15482. }
  15483. ,
  15484. t.prototype.hideAlltags = function(e, t) {
  15485. function i() {
  15486. ++r === this.totaltags && (this.model.tagsShown = !1,
  15487. n.resolve())
  15488. }
  15489. var n = $.Deferred()
  15490. , r = 0;
  15491. for (var o in this.model.tags) {
  15492. var a = this.model.tags[o];
  15493. a.hide(e, t).done(i.bind(this)),
  15494. a === this.activeTag && this.dismissActiveTag()
  15495. }
  15496. return n.promise()
  15497. }
  15498. ,
  15499. t.prototype.enableHovering = function() {
  15500. this.enabled = !0
  15501. }
  15502. ,
  15503. t.prototype.disableHovering = function() {
  15504. this.enabled = !1
  15505. }
  15506. ,
  15507. t.prototype.activateTag = function(e, t) {
  15508. t = t || T.EXAMINE,
  15509. this.activeTag = e,
  15510. this.activeTag.hoveringDisc = !0,
  15511. this.activeTag.setHoverState(t === T.EXAMINE),
  15512. this.tagState = t,
  15513. this.emit(b.TagActivated, e)
  15514. }
  15515. ,
  15516. t.prototype.dismissActiveTag = function() {
  15517. this.activeTag.hoveringDisc = !1,
  15518. this.activeTag.setFreeState(!0);
  15519. var e = this.activeTag;
  15520. this.activeTag = null,
  15521. this.tagState = T.IDLE,
  15522. this.emit(b.TagDismissed, e)
  15523. }
  15524. ,
  15525. t.prototype.clickedOnTag = function(e) {
  15526. var t = function() {
  15527. this.navigatingViaTag = !0,
  15528. this.activeTag.examine(this.player),
  15529. this.emit(b.TagNavigation, this.activeTag)
  15530. }
  15531. .bind(this);
  15532. return this.tagState !== T.EXAMINE ? (this.activateTag(this.intersectTag, T.EXAMINE),
  15533. this.activeTag = this.intersectTag,
  15534. t(),
  15535. !0) : (this.dismissActiveTag(),
  15536. !1)
  15537. }
  15538. ,
  15539. t.prototype.intersecttag = (s = new i.Vector3,
  15540. l = new i.Vector3,
  15541. c = new i.Vector3,
  15542. function(e, t, i) {
  15543. if (!this.enabled)
  15544. return null;
  15545. var n = null
  15546. , r = this.tagDiscs.filter(function(e) {
  15547. return e.parent.visible
  15548. });
  15549. if (0 < r.length) {
  15550. var o = this.model.floors.reduce(function(e, t) {
  15551. return t.hidden ? e : e.concat(t.collider.children)
  15552. }, r);
  15553. s.set(e.x, e.y, -1).unproject(i),
  15554. l.set(e.x, e.y, 1).unproject(i),
  15555. c.copy(l).sub(s).normalize(),
  15556. this.raycaster.set(s, c);
  15557. var a = this.raycaster.intersectObjects(o);
  15558. 0 < a.length && -1 !== r.indexOf(a[0].object) && (n = a[0].object.tag)
  15559. }
  15560. return this.intersectTag = n,
  15561. t && (this.activeTag && n !== this.activeTag && (this.tagState === T.BROWSE || this.tagState === T.EXAMINE && n) && this.dismissActiveTag(),
  15562. n && n !== this.activeTag && (n.listeners(v.ENTER).length < 1 && (n.billboard.on(v.ENTER, function() {
  15563. this.hoveredTag = n
  15564. }
  15565. .bind(this)),
  15566. n.billboard.on(v.LEAVE, function() {
  15567. this.hoveredTag = null
  15568. }
  15569. .bind(this))),
  15570. this.activateTag(n, T.BROWSE))),
  15571. n
  15572. }
  15573. ),
  15574. t.prototype.rankedtagInDirection = (h = [],
  15575. u = [],
  15576. d = new i.Vector3,
  15577. p = new i.Vector3,
  15578. f = new i.Vector3,
  15579. function(e, t, i, n) {
  15580. for (var r = 0, o = u.length = 0; o < this.closesttags.length; o++) {
  15581. var a = this.closesttags[o];
  15582. p.copy(a.position),
  15583. p.add(a.discPosition),
  15584. d.copy(t),
  15585. d.sub(p).negate(),
  15586. d.normalize();
  15587. var s = d.dot(n);
  15588. if (0 <= s && (f.copy(p),
  15589. f.project(i),
  15590. this.intersecttag(f, !1, i))) {
  15591. if (r >= h.length)
  15592. for (var l = 0; l < 64; l++)
  15593. h.push({
  15594. tag: a,
  15595. dot: s
  15596. });
  15597. var c = h[r];
  15598. c.tag = a,
  15599. c.dot = s,
  15600. c.position = math.projectPositionToCanvas(p, i),
  15601. u.push(c),
  15602. r++
  15603. }
  15604. }
  15605. return u.sort(function(e, t) {
  15606. return e.dot > t.dot ? -1 : e.dot < t.dot ? 1 : 0
  15607. }),
  15608. e < u.length ? u[e].tag : null
  15609. }
  15610. ),
  15611. t.prototype.updateClosestTags = (o = new i.Vector3,
  15612. function(e) {
  15613. this.closesttags || (this.closesttags = []),
  15614. this.closesttags.length = 0;
  15615. var t = this.model.tags;
  15616. if (t)
  15617. for (var i in t)
  15618. if (t.hasOwnProperty(i)) {
  15619. var n = t[i]
  15620. , r = n.position;
  15621. o.copy(e),
  15622. o.sub(r).negate(),
  15623. o.lengthSq() < 30 && this.closesttags.push(n)
  15624. }
  15625. }
  15626. ),
  15627. R.exports = t
  15628. }
  15629. ).call(this, "/js/tag/tagManager.js")
  15630. }
  15631. , {
  15632. "../controls/serializer": 14,
  15633. "../enum/BlackoutStyle": 18,
  15634. "../enum/tagEvents": 32,
  15635. "../enum/ModelManagerEvents": 33,
  15636. "../enum/PlayerEvents": 40,
  15637. "../enum/TagStates": 44,
  15638. "../enum/Viewmode": 51,
  15639. "../enum/WarpStyle": 52,
  15640. "../objects/Snapshot": 153,
  15641. "../settings": 166,
  15642. "../util/common": 185,
  15643. "../util/lerp": 188,
  15644. "../util/logger": 189,
  15645. "./Billboard/BillboardEvent": 120,
  15646. "./Media/LinkType": 130,
  15647. "./Media/MediaEvent": 131,
  15648. events: 202,
  15649. three: 217
  15650. }],
  15651. 125: [function(r, o, e) {
  15652. (function(e) {
  15653. "use strict";
  15654. function t() {
  15655. this.embedWrapper = null,
  15656. this.embedElement = null
  15657. }
  15658. var i = r("../../util/ajax")
  15659. , a = r("./mediaSettings")
  15660. , n = r("../../settings")
  15661. , s = new (r("../../util/logger"))(e);
  15662. t.prototype.createDomElement = function() {
  15663. return this.embedWrapper = document.createElement("div"),
  15664. this.embedWrapper.classList.add("tag-embed"),
  15665. this.embedWrapper.classList.add("hidden"),
  15666. this.embedWrapper
  15667. }
  15668. ,
  15669. t.prototype.load = function(e) {
  15670. var t = "https://api.embedly.com/1/oembed?key=" + n.appConfig.embedly_key + "&url=" + encodeURIComponent(e) + "&maxwidth=" + a.maxEmbedWidth;
  15671. return new Promise(function(r, o) {
  15672. i.get(t).then(function(e) {
  15673. if ((e = JSON.parse(e)).html && -1 === e.html.indexOf("<script")) {
  15674. this.embedWrapper.innerHTML = e.html;
  15675. var t = Math.min(e.width, a.maxEmbedWidth) || a.maxEmbedWidth;
  15676. if (this.embedWrapper.style.width = t + "px",
  15677. e.height) {
  15678. var i = e.height / e.width;
  15679. this.embedWrapper.style.height = t * i + "px"
  15680. }
  15681. this.embedElement = this.embedWrapper.firstChild;
  15682. var n = [];
  15683. try {
  15684. n = [].slice.call(this.embedElement.querySelectorAll("a"))
  15685. } catch (e) {
  15686. s.debug("Error getting `a` elements for embed; was it an iframe?")
  15687. }
  15688. n.forEach(function(e) {
  15689. e.setAttribute("target", "_blank")
  15690. }),
  15691. this.embedElement.classList.add("hidden"),
  15692. this.embedWrapper.classList.remove("hidden"),
  15693. r()
  15694. } else
  15695. o("Not a valid embed")
  15696. }
  15697. .bind(this), function(e) {
  15698. o(e.response)
  15699. })
  15700. }
  15701. .bind(this))
  15702. }
  15703. ,
  15704. t.prototype.show = function() {
  15705. this.embedElement && this.embedElement.classList.remove("hidden")
  15706. }
  15707. ,
  15708. t.prototype.hide = function() {
  15709. this.embedElement && this.embedElement.classList.add("hidden")
  15710. }
  15711. ,
  15712. o.exports = t
  15713. }
  15714. ).call(this, "/js/tag/Media/EmbedlyEmbed.js")
  15715. }
  15716. , {
  15717. "../../settings": 166,
  15718. "../../util/ajax": 181,
  15719. "../../util/logger": 189,
  15720. "./mediaSettings": 132
  15721. }],
  15722. 126: [function(a, s, e) {
  15723. (function(e) {
  15724. "use strict";
  15725. function t(e) {
  15726. r.call(this),
  15727. this.options = e,
  15728. this.playerControls = null,
  15729. this.state = o.NOT_READY
  15730. }
  15731. var i, n = a("../../util/browser"), r = a("./EmbedlyEmbed"), o = (new (a("../../util/logger"))(e),
  15732. Object.freeze({
  15733. NOT_READY: "player.not.ready",
  15734. CUED: "player.cued",
  15735. PLAYING: "player.playing",
  15736. PAUSED: "player.paused"
  15737. }));
  15738. (t.prototype = Object.create(r.prototype)).createDomElement = function() {
  15739. return this.embedWrapper = document.createElement("div"),
  15740. this.embedWrapper.classList.add("tag-video"),
  15741. this.embedWrapper.classList.add("hidden"),
  15742. this.embedWrapper
  15743. }
  15744. ,
  15745. t.prototype.load = function(e) {
  15746. var t = function() {
  15747. function e(e) {
  15748. this.playerState = e
  15749. }
  15750. this.playerControls = new playerjs.Player(this.embedElement),
  15751. this.playerControls.on("ready", function(e) {
  15752. this.playerState = o.CUED,
  15753. this.options.startMuted && this.playerControls.mute()
  15754. }
  15755. .bind(this)),
  15756. this.playerControls.on("play", e.bind(this, o.PLAYING)),
  15757. this.playerControls.on("pause", e.bind(this, o.PAUSED)),
  15758. this.playerControls.on("ended", function(e) {
  15759. this.playerControls.setCurrentTime(0),
  15760. this.options.loop ? this.playerControls.play() : this.playerControls.pause()
  15761. }
  15762. .bind(this))
  15763. }
  15764. .bind(this);
  15765. return r.prototype.load.call(this, e).then(t.bind(this))
  15766. }
  15767. ,
  15768. t.prototype.play = (i = n.isMobile(),
  15769. function() {
  15770. this.playerState !== o.NOT_READY && this.playerControls && !i && (this.state === o.CUED && this.options.autoPlay || this.options.autoResume) && this.playerControls.play()
  15771. }
  15772. ),
  15773. t.prototype.pause = function() {
  15774. this.playerState !== o.NOT_READY && this.playerControls && this.playerControls.pause()
  15775. }
  15776. ,
  15777. s.exports = t
  15778. }
  15779. ).call(this, "/js/tag/Media/EmbedlyPlayer.js")
  15780. }
  15781. , {
  15782. "../../util/browser": 182,
  15783. "../../util/logger": 189,
  15784. "./EmbedlyEmbed": 125
  15785. }],
  15786. 127: [function(t, i, e) {
  15787. (function(e) {
  15788. "use strict";
  15789. var r = t("../../util/ajax")
  15790. , o = new (t("./mediaSettings"),
  15791. t("../../util/logger"))(e)
  15792. , a = Promise.resolve();
  15793. i.exports.enqueue = function(i) {
  15794. function n() {}
  15795. return a = new Promise(function(e, t) {
  15796. a.catch(n).then(function() {
  15797. (o.debug("requesting file from embedly:", i.href),
  15798. r.get(i.href, {
  15799. responseType: i.responseType
  15800. }).then(function(e) {
  15801. return o.debug("requesting file finished:", i.href),
  15802. e
  15803. })).then(e, t)
  15804. })
  15805. }
  15806. )
  15807. }
  15808. }
  15809. ).call(this, "/js/tag/Media/EmbedlyQueue.js")
  15810. }
  15811. , {
  15812. "../../util/ajax": 181,
  15813. "../../util/logger": 189,
  15814. "./mediaSettings": 132
  15815. }],
  15816. 128: [function(s, l, e) {
  15817. (function(e) {
  15818. "use strict";
  15819. function t() {
  15820. this.imageWrapper = null,
  15821. this.width = 0,
  15822. this.height = 0,
  15823. this.aspect = 1
  15824. }
  15825. var i = s("./MediaEvent")
  15826. , n = s("./EmbedlyQueue")
  15827. , r = s("events").EventEmitter
  15828. , o = s("../../util/logger")
  15829. , a = s("../../settings");
  15830. new o(e),
  15831. (t.prototype = Object.create(r.prototype)).createDomElement = function() {
  15832. return this.imageWrapper = document.createElement("div"),
  15833. this.imageWrapper.classList.add("tag-image"),
  15834. this.imageWrapper.classList.add("hidden"),
  15835. this.imageWrapper.addEventListener("click", function(e) {
  15836. e.stopPropagation(),
  15837. this.emit(i.IMAGE_OPENING),
  15838. this.imageWrapper.style.pointerEvents = "none"
  15839. }
  15840. .bind(this)),
  15841. this.imageWrapper
  15842. }
  15843. ,
  15844. t.prototype.onClosed = function() {
  15845. this.imageWrapper.style.pointerEvents = "auto"
  15846. }
  15847. ,
  15848. t.prototype.load = function(e) {
  15849. var t = Math.max(window.screen.height, window.screen.width)
  15850. , i = "https://i.embed.ly/1/display/resize?key=" + a.appConfig.embedly_key + "&url=" + encodeURIComponent(e) + "&width=" + t + "&height=" + t;
  15851. return new Promise(function(o, e) {
  15852. n.enqueue({
  15853. href: i,
  15854. responseType: "arraybuffer"
  15855. }).then(function(e) {
  15856. var t = new Uint8Array(e)
  15857. , i = new Blob([t])
  15858. , n = new window.Image;
  15859. n.addEventListener("load", function(e) {
  15860. var t = e.target;
  15861. this.width = t.naturalWidth,
  15862. this.height = t.naturalHeight,
  15863. this.aspect = this.width / this.height;
  15864. var i = e.target.src;
  15865. this.imageWrapper.style.backgroundImage = 'url("' + i + '")',
  15866. this.imageWrapper.style.width = this.width + "px",
  15867. this.imageWrapper.style.height = this.height + "px",
  15868. this.imageWrapper.classList.remove("hidden"),
  15869. o()
  15870. }
  15871. .bind(this));
  15872. var r = URL.createObjectURL(i);
  15873. n.src = r
  15874. }
  15875. .bind(this), e)
  15876. }
  15877. .bind(this))
  15878. }
  15879. ,
  15880. l.exports = t
  15881. }
  15882. ).call(this, "/js/tag/Media/Image.js")
  15883. }
  15884. , {
  15885. "../../settings": 166,
  15886. "../../util/logger": 189,
  15887. "./EmbedlyQueue": 127,
  15888. "./MediaEvent": 131,
  15889. events: 202
  15890. }],
  15891. 129: [function(e, t, i) {
  15892. "use strict";
  15893. function n(e) {
  15894. this.label = e.label,
  15895. this.href = e.url,
  15896. this.type = this.updateLinkForType(),
  15897. this.domElement = null,
  15898. this.id = c++
  15899. }
  15900. var r = e("./LinkType")
  15901. , o = e("./MediaEvent")
  15902. , a = e("../../util/browser")
  15903. , s = e("../../analytics")
  15904. , l = e("events").EventEmitter
  15905. , c = 0;
  15906. (n.prototype = Object.create(l.prototype)).updateLinkForType = function() {
  15907. var e, t = a.valueFromHash("m") || a.valueFromHash("model");
  15908. 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,
  15909. new RegExp("[#&?]start=([^#&?]*)").exec(e)[1]),
  15910. r.NAVIGATION) : (this.href = this.href + "&play=1",
  15911. r.MODEL) : r.EXT_LINK
  15912. }
  15913. ;
  15914. var h = {};
  15915. n.prototype.createDomElement = function() {
  15916. if (this.domElement = document.createElement("a"),
  15917. this.domElement.classList.add("tag-link"),
  15918. this.domElement.textContent = this.label,
  15919. this.type === r.EXT_LINK) {
  15920. this.domElement.textContent += " ";
  15921. var e = document.createElement("i");
  15922. e.classList.add("icon-ext-link"),
  15923. e.title = "Link to external web site",
  15924. this.domElement.appendChild(e)
  15925. }
  15926. return this.domElement.addEventListener("click", function(e) {
  15927. switch (e.stopPropagation(),
  15928. h[this.id] = !0,
  15929. s.trackAlways("click_tag_link", {
  15930. link_type: this.type,
  15931. link_count: c,
  15932. links_clicked: Object.keys(h).length
  15933. }),
  15934. this.type) {
  15935. case r.MODEL:
  15936. window.location.replace(this.href);
  15937. break;
  15938. case r.EXT_LINK:
  15939. window.open(this.href, "_blank")
  15940. }
  15941. this.emit(o.LINK_CLICK, {
  15942. type: this.type,
  15943. url: this.href
  15944. })
  15945. }
  15946. .bind(this)),
  15947. this.domElement
  15948. }
  15949. ,
  15950. t.exports = n
  15951. }
  15952. , {
  15953. "../../analytics": 4,
  15954. "../../util/browser": 182,
  15955. "./LinkType": 130,
  15956. "./MediaEvent": 131,
  15957. events: 202
  15958. }],
  15959. 130: [function(e, t, i) {
  15960. "use strict";
  15961. t.exports = {
  15962. NAVIGATION: "navigation",
  15963. MODEL: "model",
  15964. EXT_LINK: "ext-link"
  15965. }
  15966. }
  15967. , {}],
  15968. 131: [function(e, t, i) {
  15969. "use strict";
  15970. t.exports = Object.freeze({
  15971. LINK_CLICK: "mtmedia.link",
  15972. IMAGE_LOADED: "mtmedia.image.loaded",
  15973. IMAGE_OPENING: "mtmedia.image.opening",
  15974. IMAGE_OPENED: "mtmedia.image.opened",
  15975. IMAGE_CLOSING: "mtmedia.image.closing",
  15976. IMAGE_CLOSED: "mtmedia.image.closed",
  15977. VIDEO_START: "mtmedia.video.start",
  15978. VIDEO_PAUSE: "mtmedia.video.pause",
  15979. VIDEO_ENDED: "mtmedia.video.end"
  15980. })
  15981. }
  15982. , {}],
  15983. 132: [function(e, t, i) {
  15984. "use strict";
  15985. t.exports = Object.freeze({
  15986. maxEmbedWidth: 350,
  15987. defaultAspectRatio: .75
  15988. })
  15989. }
  15990. , {}],
  15991. 133: [function(e, t, i) {
  15992. "use strict";
  15993. t.exports = Object.freeze({
  15994. TEXT: "text",
  15995. LINK: "link",
  15996. IMAGE: "photo",
  15997. VIDEO: "video",
  15998. RICH: "rich"
  15999. })
  16000. }
  16001. , {}],
  16002. 134: [function(e, t, i) {
  16003. "use strict";
  16004. function n(e) {
  16005. this.capabilities = {
  16006. links: {
  16007. enable: e.supportLinks,
  16008. keepLabels: e.keepLinkLabels
  16009. }
  16010. }
  16011. }
  16012. var r = e("./DescriptionChunkType");
  16013. n.prototype.parse = function(e, i) {
  16014. var n = [];
  16015. return e.split("[").map(function(e, t) {
  16016. return 0 === t ? e : "[" + e
  16017. }).forEach(function(e) {
  16018. var t = this.findMarkdown(e);
  16019. if (t) {
  16020. if (-1 !== t.url.indexOf("javascript:"))
  16021. return;
  16022. this.addLinkChunk(n, t, i),
  16023. this.addTextChunk(n, e.slice(t.markdown.length))
  16024. } else
  16025. this.addTextChunk(n, e)
  16026. }
  16027. .bind(this)),
  16028. n
  16029. }
  16030. ,
  16031. n.prototype.findMarkdown = function(e) {
  16032. var t = e.match(/\[([^\]]*)\]\((.*)\)/);
  16033. if (t) {
  16034. for (var i = t[2], n = 1, r = 0; r < i.length && ("(" === i[r] ? n++ : ")" === i[r] && n--,
  16035. 0 !== n); )
  16036. r++;
  16037. var o = i.length - r;
  16038. return {
  16039. markdown: t[0].substring(0, t[0].length - o),
  16040. label: t[1],
  16041. url: t[2].substring(0, r)
  16042. }
  16043. }
  16044. }
  16045. ,
  16046. n.prototype.addTextChunk = function(e, t) {
  16047. 0 !== t.length && e.push({
  16048. type: r.TEXT,
  16049. text: t
  16050. })
  16051. }
  16052. ,
  16053. n.prototype.addLinkChunk = function(e, t) {
  16054. if (this.capabilities.links.enable) {
  16055. var i = {
  16056. label: t.label,
  16057. url: t.url
  16058. };
  16059. -1 === i.url.indexOf("://") && (i.url = "http://" + i.url),
  16060. e.push({
  16061. type: r.LINK,
  16062. link: i
  16063. })
  16064. } else
  16065. this.capabilities.links.keepLabels && this.addTextChunk(e, t.label)
  16066. }
  16067. ,
  16068. t.exports = n
  16069. }
  16070. , {
  16071. "./DescriptionChunkType": 133
  16072. }],
  16073. 135: [function(t, r, e) {
  16074. (function(e) {
  16075. "use strict";
  16076. var i = new (t("../util/logger"))(e)
  16077. , n = {
  16078. parseIdsFromChunkName: function(e, t) {
  16079. t.floorId = n.parseFloor(e),
  16080. t.roomId = n.parseRoom(e)
  16081. },
  16082. parseFloor: function(e) {
  16083. var t = e.match(/_group([0-9]+)/);
  16084. if (!t)
  16085. return 0;
  16086. try {
  16087. return parseInt(t[1], 10)
  16088. } catch (e) {
  16089. return i.warn('Non-int value "' + t[1] + '" for mesh group, defaulting to floor 0'),
  16090. 0
  16091. }
  16092. },
  16093. parseRoom: function(e) {
  16094. var t = e.match(/_sub([0-9]+)/);
  16095. if (!t)
  16096. return -1;
  16097. try {
  16098. return parseInt(t[1], 10)
  16099. } catch (e) {
  16100. return i.warn('Non-int value "' + t[1] + '" for mesh subgroup, defaulting to subgroup 0'),
  16101. 0
  16102. }
  16103. }
  16104. };
  16105. r.exports = n
  16106. }
  16107. ).call(this, "/js/model/Chunks.js")
  16108. }
  16109. , {
  16110. "../util/logger": 189
  16111. }],
  16112. 136: [function(a, c, e) {
  16113. (function(e) {
  16114. "use strict";
  16115. function t(e) {
  16116. r.call(this),
  16117. this.model = e,
  16118. this.exploded = !1
  16119. }
  16120. var i = a("../objects/Floor")
  16121. , n = (a("../settings"),
  16122. a("../util/logger"))
  16123. , s = a("../util/transitions")
  16124. , r = a("../util/IndexedCollection")
  16125. , o = a("../util/common")
  16126. , l = a("../util/easing");
  16127. new n(e),
  16128. o.inherit(t, r),
  16129. t.prototype.add = function(e) {
  16130. r.prototype.add.call(this, e),
  16131. this.model.add(e)
  16132. }
  16133. ,
  16134. t.prototype.getIndex = function(e) {
  16135. return e.floorIndex
  16136. }
  16137. ,
  16138. t.prototype.build = function() {
  16139. this.list.forEach(function(e) {
  16140. e.build()
  16141. })
  16142. }
  16143. ,
  16144. t.prototype.size = function() {
  16145. return this.length
  16146. }
  16147. ,
  16148. t.prototype.sort = function() {
  16149. r.prototype.sort.call(this, function(e, t) {
  16150. return e.floorIndex - t.floorIndex
  16151. })
  16152. }
  16153. ,
  16154. t.prototype.nextFloor = function(e, t) {
  16155. return this.index[e.floorIndex + t] || null
  16156. }
  16157. ,
  16158. t.prototype.getFloorAtPoint = function(e) {
  16159. for (var t = null, i = 1 / 0, n = 0; n < this.list.length; n++) {
  16160. var r = this.list[n]
  16161. , o = r.distanceToPoint(e);
  16162. (!t || o < i) && (i = o,
  16163. t = r)
  16164. }
  16165. return t
  16166. }
  16167. ,
  16168. t.prototype.getOrMakeFloor = function(e) {
  16169. var t = this.index[e];
  16170. return t || (t = new i(this.model,e),
  16171. this.add(t)),
  16172. t
  16173. }
  16174. ,
  16175. t.prototype.hide = function() {
  16176. this.list.forEach(function(e) {
  16177. e.hide()
  16178. })
  16179. }
  16180. ,
  16181. t.prototype.show = function() {
  16182. this.list.forEach(function(e) {
  16183. e.show()
  16184. })
  16185. }
  16186. ,
  16187. t.prototype.names = function() {
  16188. return this.list.reduce(function(e, t) {
  16189. return e.concat(t.name)
  16190. }, [])
  16191. }
  16192. ,
  16193. t.prototype.toggleExplodeHorizontal = function() {
  16194. function i(e, t) {
  16195. a.copy(e.position),
  16196. e.position.x = r[e.floorIndex] * t,
  16197. e.position.y = 1 * e.floorIndex * t,
  16198. a.sub(e.position).multiplyScalar(-1),
  16199. e.panos.forEach(function(e) {
  16200. e.translate(a)
  16201. })
  16202. }
  16203. var n, r = [], o = 0;
  16204. this.list.forEach(function(e, t, i) {
  16205. n = 0 < t ? Math.max(i[t - 1].boundingBox.max.x - e.boundingBox.min.x, e.boundingBox.size().x / 2) : 0,
  16206. o += n,
  16207. r[t] = o
  16208. }),
  16209. r = r.map(function(e) {
  16210. return e - o / 2
  16211. });
  16212. var a = this.list[0].position.clone();
  16213. this.exploded ? this.list.forEach(function(t) {
  16214. s.start(function(e) {
  16215. i(t, 1 - e)
  16216. }, 1500, null, 0, l.easeOutExpo)
  16217. }) : this.list.forEach(function(t) {
  16218. s.start(function(e) {
  16219. i(t, e)
  16220. }, 1500, null, 0, l.easeOutExpo)
  16221. }),
  16222. this.exploded = !this.exploded
  16223. }
  16224. ,
  16225. t.prototype.toggleExplodeVertical = function() {
  16226. function i(e, t) {
  16227. var i = i.copy(e.position);
  16228. e.position.y = (5 * e.floorIndex - n.y / 2) * t,
  16229. i.sub(e.position).multiplyScalar(-1),
  16230. e.panos.forEach(function(e) {
  16231. e.translate(i)
  16232. })
  16233. }
  16234. var n = this.model.size;
  16235. this.list[0].position.clone(),
  16236. this.exploded ? this.list.forEach(function(t) {
  16237. s.start(function(e) {
  16238. i(t, 1 - e)
  16239. }, 1500, null, 0, l.easeOutExpo)
  16240. }) : this.list.forEach(function(t) {
  16241. s.start(function(e) {
  16242. i(t, e)
  16243. }, 1500, null, 0, l.easeOutExpo)
  16244. }),
  16245. this.exploded = !this.exploded
  16246. }
  16247. ,
  16248. c.exports = t
  16249. }
  16250. ).call(this, "/js/model/FloorCollection.js")
  16251. }
  16252. , {
  16253. "../objects/Floor": 146,
  16254. "../settings": 166,
  16255. "../util/IndexedCollection": 175,
  16256. "../util/common": 185,
  16257. "../util/easing": 186,
  16258. "../util/logger": 189,
  16259. "../util/transitions": 195
  16260. }],
  16261. 137: [function(r, o, e) {
  16262. (function(e) {
  16263. "use strict";
  16264. function h() {
  16265. n.call(this)
  16266. }
  16267. var u = r("../settings")
  16268. , t = r("../util/logger")
  16269. , d = r("../enum/Viewmode")
  16270. , p = r("../objects/Snapshot")
  16271. , i = (r("../util/math"),
  16272. r("../util/common"))
  16273. , n = r("../util/IndexedCollection")
  16274. , l = new t(e);
  16275. i.inherit(h, n),
  16276. h.prototype.getImage = function(e) {
  16277. return e && this.index.hasOwnProperty(e) ? this.index[e] : null
  16278. }
  16279. ,
  16280. h.prototype.filterByModesAndReel = function(e, t) {
  16281. for (var i = [], n = 0; n < t.length; n += 1) {
  16282. var r = t[n]
  16283. , o = this.index[r.sid];
  16284. o && i.push(o)
  16285. }
  16286. var a = e[d.DOLLHOUSE]
  16287. , s = e[d.FLOORPLAN];
  16288. (i = i.filter(function(e) {
  16289. if (!e.metadata || void 0 === e.metadata.camera_mode)
  16290. return !0;
  16291. var t;
  16292. try {
  16293. t = d.convertWorkshopModeInt(e.metadata.camera_mode)
  16294. } catch (e) {
  16295. return l.debug(e.message),
  16296. !1
  16297. }
  16298. return t === d.PANORAMA || t === d.FLOORPLAN && s || t === d.DOLLHOUSE && a
  16299. })).length !== this.list.length && l.info("Disallowed " + (this.list.length - i.length) + " highlight images"),
  16300. this.list = i,
  16301. this.reIndex()
  16302. }
  16303. ,
  16304. h.prototype.getHeroLocations = function(panos) {//改 增加二级location
  16305. if (0 === this.list.length)
  16306. return [];
  16307. var locations = [];
  16308. var deal = (n, container)=>{
  16309. var r = n.thumbnail_signed_src,
  16310. o = n.name || "";
  16311. if (n.metadata && void 0 !== n.metadata.camera_quaternion) {
  16312. if (!u.show360Views.enabled && n.metadata.scan_id) {
  16313. var a = panos.get(n.metadata.scan_id);
  16314. if (a && !a.isAligned()) return
  16315. }
  16316. var s = d.convertWorkshopModeInt(n.metadata.camera_mode);
  16317. if (s === d.MESH) return
  16318. if(window.isLocal)var src = manage.dealURL(r)
  16319. else var src = "one" === g_version ? g_Prefix + r + "?" + randomTime().getTime() : r + "?" + randomTime().getTime()
  16320. var l = {
  16321. cameraMode: s,
  16322. position: n.metadata.camera_position,
  16323. quaternion: n.metadata.camera_quaternion,
  16324. zoom: n.metadata.zoom,
  16325. panoId: n.metadata.scan_id,
  16326. orthoZoom: n.metadata.ortho_zoom,
  16327. floorVisibility: void 0 !== n.metadata.floor_visibility ? n.metadata.floor_visibility.slice(0) : [],
  16328. thumbUrl: src,
  16329. name: h.filterImageName(o),
  16330. sid: n.sid
  16331. }
  16332. var item = new p(l);
  16333. item.momentTour = n.momentTour
  16334. item.dontRot = n.dontRot
  16335. item.rotTime = n.rotTime
  16336. container.push(item)
  16337. return item
  16338. }
  16339. }
  16340. this.list.forEach(image=>{
  16341. if(image.images){
  16342. var folder = $.extend({}, image )
  16343. folder.heroLocations = [];
  16344. image.images.list.forEach(child=>{
  16345. deal(child, folder.heroLocations);
  16346. })
  16347. folder.musicInfo = folder.musicInfo || {}
  16348. locations.push(folder)
  16349. delete folder.images;
  16350. delete folder.locations;
  16351. }else{
  16352. var item = deal(image, locations);
  16353. item.musicInfo = image.musicInfo || g_data2.tourAudio[item.sid] || {}//新的music数据统一写在每个info下,如果有musicInfo则覆盖g_data2.tourAudio
  16354. }
  16355. })
  16356. return locations
  16357. }
  16358. ,
  16359. h.prototype.getIndex = function(e) {
  16360. return e.sid
  16361. }
  16362. ,
  16363. h.filterImageName = function(e) {
  16364. return "" === e || e.match(/^[0-9.]+_[0-9.]+$/) ? null : e
  16365. }
  16366. ,
  16367. o.exports = h
  16368. }
  16369. ).call(this, "/js/model/ImageCollection.js")
  16370. }
  16371. , {
  16372. "../enum/Viewmode": 51,
  16373. "../objects/Snapshot": 153,
  16374. "../settings": 166,
  16375. "../util/IndexedCollection": 175,
  16376. "../util/common": 185,
  16377. "../util/logger": 189,
  16378. "../util/math": 190
  16379. }],
  16380. 138: [function(h, u, e) {
  16381. (function(e) {
  16382. "use strict";
  16383. function n() {
  16384. c.call(this)
  16385. }
  16386. var r = h("../label/Label")
  16387. , i = h("../settings")
  16388. , t = h("../util/logger")
  16389. , o = h("../util/math")
  16390. , a = h("../util/ajax")
  16391. , s = h("./RoomCollection")
  16392. , l = h("../util/common")
  16393. , c = h("../util/IndexedCollection");
  16394. new t(e),
  16395. l.inherit(n, c),
  16396. n.prototype.getIndex = function(e) {
  16397. return e.labelId
  16398. }
  16399. ,
  16400. n.prototype.associateWithRooms = function(e) {
  16401. this.forEach(function(t) {
  16402. e.forEach(function(e) {
  16403. e.roomId === t.roomId && (t.room = e)
  16404. })
  16405. })
  16406. }
  16407. ,
  16408. n.prototype.createFromLabelData = function(e) {
  16409. e.forEach(function(e) {
  16410. var t = n.parseRoomIndexFromWorkshopRoomId(e.roomId);
  16411. t = s.generateRoomId(e.floorId, t);
  16412. var i = new r(e.sid,e.position || e.positions[0],e.text,e.floorId,t);
  16413. i.position = o.convertWorkshopVector(i.position),
  16414. this.add(i),
  16415. i.build()
  16416. }
  16417. .bind(this))
  16418. }
  16419. ,
  16420. n.prototype.load = function(e, t) {
  16421. return a.get(e, {
  16422. responseType: "json",
  16423. auth: t ? i.authorizationHeader : null
  16424. }).done(function(e) {
  16425. var t = [];
  16426. for (var i in e) {
  16427. var n = e[i];
  16428. t.push(n)
  16429. }
  16430. this.createFromLabelData(t)
  16431. }
  16432. .bind(this))
  16433. }
  16434. ,
  16435. n.parseRoomIndexFromWorkshopRoomId = function(e) {
  16436. var t = -1;
  16437. if (e) {
  16438. if(typeof e == 'number'){
  16439. t = parseInt(e)
  16440. }else{
  16441. var i = e.split("_");
  16442. t = parseInt(i[0])
  16443. }
  16444. }
  16445. return t
  16446. }
  16447. ,
  16448. u.exports = n
  16449. }
  16450. ).call(this, "/js/model/LabelCollection.js")
  16451. }
  16452. , {
  16453. "../label/Label": 90,
  16454. "../settings": 166,
  16455. "../util/IndexedCollection": 175,
  16456. "../util/ajax": 181,
  16457. "../util/common": 185,
  16458. "../util/logger": 189,
  16459. "../util/math": 190,
  16460. "./RoomCollection": 141
  16461. }],
  16462. 139: [function(P, O, e) {
  16463. (function(e) {
  16464. "use strict";
  16465. function t(e, t) {
  16466. o.Object3D.call(this),
  16467. this.sid = window.number;//t.sid,
  16468. this.data = t,
  16469. this.options = e,
  16470. this.urls = new i(e.urlFiles),
  16471. this.isPublic = void 0 !== t.is_public && t.is_public,
  16472. //创建heroLocations
  16473. this.images = new E(this),
  16474. this.images.extend(t.images),
  16475. this.images.forEach((info)=>{
  16476. if(info.locations){
  16477. info.images = new E(this);
  16478. info.images.extend(info.locations)
  16479. }
  16480. })
  16481. this.heroLocations = []
  16482. //this.heroImage = this.images.getImage(t.icon), //初始画面沒有用到icon
  16483. this.outdoorPanoLocations = [],
  16484. this.floors = new c(this),
  16485. this.floorsEnabled = void 0 === e.floors || e.floors,
  16486. this.changingFloor = !1,
  16487. this.chunks = [],
  16488. this.panos = new g,
  16489. this.colliders = [],
  16490. this.loadPanosPromise = null,
  16491. this.loadMeshTexturesPromise = null,
  16492. this.auxDataPromise = null,
  16493. this.meshTexturesLoaded = !1,
  16494. this.meshTextures = [],
  16495. this.tags = {},
  16496. this.tagsShown = !1,
  16497. this.shouldShowtags = !1,
  16498. this.has360Views = !1,
  16499. this.showingLabels = u.labels.enabled && t.player_options.labels,
  16500. this.supportedModes = {},
  16501. this.supportedModes[s.PANORAMA] = !0,
  16502. this.supportedModes[s.DOLLHOUSE] = !t.player_options || t.player_options.dollhouse && I.valueFromHash("dh", 1),
  16503. this.supportedModes[s.FLOORPLAN] = !t.player_options || t.player_options.floor_plan && I.valueFromHash("dh", 1),
  16504. this.supportedModes[s.TRANSITIONING] = !0,
  16505. this.supportsTiles = this.configureTiling(),
  16506. this.supportsVR = window.DATA.supportsVR || false//!0,
  16507. this.mode = s.DOLLHOUSE,
  16508. this.size = null,
  16509. this.center = null,
  16510. this.boundingBox = new o.Box3,
  16511. this.currentFloor = null,
  16512. this.allFloorsVisible = !0,
  16513. this.projectedPano0 = null,
  16514. this.projectedPano1 = null,
  16515. this.floorsEnabled && t.floors && -1 !== t.floors.indexOf(",") && t.floors.split(",").forEach(function(e, t) {
  16516. this.addFloor(new r(this,t,e.trim()))
  16517. }
  16518. .bind(this)),
  16519. this.waitQueue = [],
  16520. this.on("load", function(e) {
  16521. 0 !== this.waitQueue.length && (this.waitQueue = this.waitQueue.filter(function(e) {
  16522. return !e.isLoadedCallback()
  16523. }),
  16524. 0 === this.waitQueue.length && this.emit("waiting-done"))
  16525. }
  16526. .bind(this)),
  16527. this.setupCustomProperties(),
  16528. this.hots = {}
  16529. }
  16530. var o = P("three")
  16531. , a = P("../util/ajax")
  16532. , i = P("../util/ModelUrls")
  16533. , n = P("../objects/BoundingTextureSkybox")
  16534. , s = P("../enum/Viewmode")
  16535. , l = P("../enum/RenderOrder")
  16536. , r = (P("../enum/AlignmentType"),
  16537. P("../objects/Floor"))
  16538. , c = P("./FloorCollection")
  16539. , h = P("../objects/Chunk")
  16540. , u = (P("../objects/Room"),
  16541. P("../objects/Snapshot"),
  16542. P("../label/Label"),
  16543. P("../util/math"),
  16544. P("../settings"))
  16545. , d = P("../shaders")
  16546. , p = P("../util/logger")
  16547. , f = (P("../tag/tag"),
  16548. P("../tag/tagManager"),
  16549. P("../objects/Panorama"))
  16550. , g = P("../util/PanoramaCollection")
  16551. , m = P("../loaders/ModelLoader")
  16552. , v = P("../loaders/ModelTextureLoader")
  16553. , y = P("../loaders/SweepDataLoader")
  16554. , A = P("../util/transitions")
  16555. , C = (P("../util/easing"),
  16556. P("../util/lerp"),
  16557. P("../util/common"))
  16558. , I = (P("../util/texture"),
  16559. P("./../util/browser"))
  16560. , E = P("./ImageCollection")
  16561. , _ = P("./RoomCollection")
  16562. , b = P("./LabelCollection")
  16563. , w = P("./Chunks")
  16564. , T = P("./../util/showcase")
  16565. , x = P("../exception/BasicException")
  16566. , S = (P("../constants"),
  16567. P("events").EventEmitter)
  16568. // , M = P("hot")
  16569. , R = new p(e);
  16570. t.prototype = Object.create(o.Object3D.prototype),
  16571. C.extend(t, S),
  16572. t.prototype.setupCustomProperties = function() {
  16573. var t = u.modelAlpha;
  16574. Object.defineProperty(this, "alpha", {
  16575. get: function() {
  16576. return t
  16577. },
  16578. set: function(e) {
  16579. t = e,
  16580. this.chunks.forEach(function(e) {
  16581. e.material && e.material.uniforms.modelAlpha && (e.material.uniforms.modelAlpha.value = t)
  16582. })
  16583. }
  16584. })
  16585. }
  16586. ,
  16587. t.prototype.configureTiling = function() {
  16588. var e = function() {
  16589. try {
  16590. var e = document.createElement("canvas")
  16591. , t = e.getContext("webgl");
  16592. return (t = t || e.getContext("experimental-webgl")).getParameter(t.MAX_CUBE_MAP_TEXTURE_SIZE)
  16593. } catch (e) {
  16594. return 0
  16595. }
  16596. }();
  16597. if (e < 2048)
  16598. return !1;
  16599. R.warn("Max cube texture size: " + e);
  16600. for (var t = 0; t < u.tiling.tilingFlagNames.length; t++) {
  16601. var i = u.tiling.tilingFlagNames[t];
  16602. if ("1" === I.valueFromHash(i, null))
  16603. return !0;
  16604. if ("0" === I.valueFromHash(i, null))
  16605. return !1
  16606. }
  16607. return !!T.modelDataPromisesTiles(this.data)
  16608. }
  16609. ,
  16610. t.prototype.toggleAlpha = function() {
  16611. this.alpha < 1 ? this.alpha = 1 : this.alpha = 0
  16612. }
  16613. ,
  16614. t.prototype.load = function(e) {
  16615. var t = this.urls.init().then(function() {
  16616. return $.when(this.loadPanos(), this.loadMesh())
  16617. }
  16618. .bind(this));
  16619. return e ? t = t.then(this.loadMeshTextures.bind(this)) : t.then(this.loadMeshTextures.bind(this)),
  16620. this.auxDataPromise = $.when(this.loadhots(), this.loadLabels()),
  16621. $.when(t, this.auxDataPromise).done(this.build.bind(this))
  16622. }
  16623. ,
  16624. t.prototype.loadMesh = function() {
  16625. var n = $.Deferred()
  16626. , r = this;
  16627. return m.load(r.data.job.uuid, r.urls, function(e, t) {
  16628. if (0 === e.length) {
  16629. R.warn("No geometry found for model, loading faux geometry, disabling outside mode"),
  16630. r.supportedModes[s.DOLLHOUSE] = !1,
  16631. r.supportedModes[s.FLOORPLAN] = !1;
  16632. var i = new h({
  16633. geometry: new o.PlaneBufferGeometry(5,5,1,1)
  16634. });
  16635. i.material.visible = !1,
  16636. i.rotateX(-Math.PI / 2),
  16637. i.geometry.computeBoundingBox(),
  16638. e = [i]
  16639. }
  16640. e.forEach(function(e) {
  16641. var t = r.floorsEnabled ? w.parseFloor(e.name) : 0;
  16642. r.addChunk(t, e)
  16643. }),
  16644. r.floors.sort(),
  16645. n.resolve(r)
  16646. }, function(e, t) {
  16647. n.notify(e, t)
  16648. }, function(e) {
  16649. R.error(e),
  16650. n.reject("loading-failed")
  16651. }),
  16652. n.promise()
  16653. }
  16654. ,
  16655. t.prototype.loadMeshTextures = function() {
  16656. return this.loadTexturesPromise || (this.loadTexturesPromise = v.load(this, this.meshTextures).then(function() {
  16657. this.meshTexturesLoaded = !0
  16658. }
  16659. .bind(this))),
  16660. this.loadTexturesPromise
  16661. }
  16662. ,
  16663. t.prototype.loadhots = function() {
  16664. initHot(this)
  16665. var r = $.Deferred()
  16666. , e = g_Prefix + "data/" + this.sid + "/data2.js?" + randomTime().getTime();
  16667. return a.get(e, {
  16668. responseType: "json",
  16669. auth: this.isPublic ? null : u.authorizationHeader
  16670. }).done(function(e) {
  16671. window.data2 = e;
  16672. this.roomLabels = []
  16673. editTool.loadDone('data2', e)
  16674. if(!e){
  16675. console.error("data2 is null")
  16676. }else{
  16677. g_data2 = hotMatcher(e)
  16678. this.hotsCount = 0;
  16679. //因为热点保存后在hots里的顺序会被修改,所以使用order来记录顺序,这里要重排序:
  16680. //window.hotData = {}
  16681. /* if(e.hots){
  16682. var sids = Object.keys(e.hots).sort((a,b)=>{return e.hots[a].order - e.hots[b].order});
  16683. sids.forEach((sid)=>{
  16684. this.hotsCount++,
  16685. this.hots[sid] = new M(sid,e.hots[sid] ,this);
  16686. //e.hots[sid].infoAttribute || (e.hots[sid].infoAttribute = {})
  16687. //this.hots[sid].initStyleImg(e.hots[sid].infoAttribute);
  16688. window.hotData[sid] = e.hots[sid];
  16689. })
  16690. }*/
  16691. if(e.hots){
  16692. var sids = Object.keys(e.hots).sort((a,b)=>{return e.hots[a].order - e.hots[b].order});
  16693. sids.forEach((sid)=>{
  16694. e.hots[sid].sid = sid
  16695. new Hot(e.hots[sid], e.hots[sid].version != 'multi' && "byHot" )
  16696. })
  16697. }
  16698. if(e.overlays){
  16699. e.overlays.forEach((info)=>{
  16700. new Hot(info, 'byOverlay')
  16701. })
  16702. }
  16703. Hot.createHotList();
  16704. if(DATA.roomLabels){
  16705. DATA.roomLabels.forEach((data)=>{
  16706. this.roomLabels.push(new RoomLabel(data))
  16707. })
  16708. }
  16709. /* if(e.multiOverlays){
  16710. e.multiOverlays.forEach((info)=>{
  16711. new Hot(info)
  16712. })
  16713. }) */
  16714. Hot.startLoad()
  16715. e.weixinDesc && (g_weixinObj.desc = e.weixinDesc)
  16716. }
  16717. r.resolve()
  16718. }
  16719. .bind(this)).fail(function() {
  16720. console.log("没有热点"),
  16721. editTool.loadDone('data2', null)
  16722. r.resolve()
  16723. }),
  16724. r
  16725. }
  16726. ,
  16727. t.prototype.loadPanos = function() {
  16728. if (this.loadPanosPromise)
  16729. return this.loadPanosPromise;
  16730. var e = new y(this);
  16731. return this.loadPanosPromise = e.load().then(function(e) {
  16732. window.panoListOriData = e.map(a=>a.uuid) //包括!enabled的点
  16733. return this.data.sweeps && 0 < Object.keys(this.data.sweeps).length && (e = e.filter(function(e) {
  16734. if(this.data.sweeps[e.uuid])return this.data.sweeps[e.uuid].enabled
  16735. else console.log(e.uuid)
  16736. //return this.data.sototype.loadOverlaysweeps[e.uuid].enabled
  16737. }
  16738. .bind(this))),
  16739. this.panos.extend(e.map(function(e) {
  16740. return new f(this,e.uuid,e,this.supportsTiles)
  16741. }
  16742. .bind(this))),
  16743. this.panos.forEach(function(i) {
  16744. i.neighbourUUIDs && (i.neighbourUUIDs.forEach(function(e) {
  16745. var t = this.panos.get(e);
  16746. t && this.panos.setNeighbour(i, t, !0)
  16747. }
  16748. .bind(this)),
  16749. i.neighbourPanos = this.panos.getNeighbours(i) || this.panos.setNeighbour(i, i, !0))
  16750. }
  16751. .bind(this)),
  16752. 0 === this.panos.length && (R.warn("Model has no panos, turning off inside mode"),
  16753. this.supportedModes[s.PANORAMA] = !1),
  16754. $.when(this)
  16755. }
  16756. .bind(this)),
  16757. this.loadPanosPromise
  16758. }
  16759. ,
  16760. t.prototype.loadHighlightReel = function() {
  16761. var t = $.Deferred()
  16762. , e = this.options.urlBase + "data/" + this.sid + "/active_reel.json";
  16763. return a.get(e, {
  16764. responseType: "json",
  16765. auth: this.isPublic ? null : u.authorizationHeader
  16766. }).done(function(e) {
  16767. e.reel ? (R.info("Got highlight reel with " + e.reel.length + " items"),
  16768. this.images.filterByModesAndReel(this.supportedModes, e.reel)) : R.info("No highlight reel found"),
  16769. t.resolve()
  16770. }
  16771. .bind(this)).fail(function() {
  16772. R.warn("Getting highlight reel failed, no highlights available"),
  16773. t.resolve()
  16774. }),
  16775. t
  16776. }
  16777. ,
  16778. t.prototype.waitForLoad = function(e, t) {
  16779. t() || (this.waitQueue.push({
  16780. object: e,
  16781. isLoadedCallback: t
  16782. }),
  16783. 1 === this.waitQueue.length && this.emit("waiting"))
  16784. }
  16785. ,
  16786. t.prototype.hide = function() {
  16787. this.floors.hide()
  16788. }
  16789. ,
  16790. t.prototype.show = function() {
  16791. this.floors.show()
  16792. }
  16793. ,
  16794. t.prototype.floorNames = function() {
  16795. return this.floors.names()
  16796. }
  16797. ,
  16798. t.prototype.warpDestFloors = function(e, t) {
  16799. if (e && this.floors.length === e.length) {
  16800. var i = e.findIndex(function(e) {
  16801. return e
  16802. }
  16803. .bind(this));
  16804. -1 !== i && this.setFloor(this.floors.list[i], null, t)
  16805. } else
  16806. this.toggleAllFloors(!0)
  16807. }
  16808. ,
  16809. t.prototype.setFloor = function(e, t, i) {
  16810. this.allFloorsVisible && this.emit("allfloors.toggled", !1, this.currentFloor),
  16811. this.allFloorsVisible = !1,
  16812. this._setFloor(e, t, i)
  16813. }
  16814. ,
  16815. t.prototype.toggleAllFloors = function(e) {
  16816. this.allFloorsVisible = void 0 !== e ? e : !this.allFloorsVisible,
  16817. this.emit("allfloors.toggled", this.allFloorsVisible, this.currentFloor),
  16818. this._setFloor(this.currentFloor)
  16819. }
  16820. ,
  16821. t.prototype._setFloor = function(e, t, i) {
  16822. var n;
  16823. if (t = t || this.mode,
  16824. this.emit("floor.changed", e, t, this.currentFloor),
  16825. this.currentFloor = e,
  16826. t === s.PANORAMA) {
  16827. if (this.show(),
  16828. this.shouldShowtags && this.tagsShown)
  16829. for (n in this.tags)
  16830. this.tags[n].show(u.showFloorDuration)
  16831. } else if ((t === s.FLOORPLAN || t === s.DOLLHOUSE) && (this.floors.list.forEach(function(e, t) {
  16832. e.toggle(e === this.currentFloor || this.allFloorsVisible, i || this.allFloorsVisible)
  16833. }
  16834. .bind(this)),
  16835. this.shouldShowtags && this.tagsShown))
  16836. for (n in this.tags) {
  16837. var r = this.tags[n];
  16838. this.allFloorsVisible ? r.show(u.showFloorDuration) : r.floor === this.currentFloor ? r.show(u.showFloorDuration, u.showFloorDelay) : r.hide(u.hideFloorDuration, u.hideFloorDelay)
  16839. }
  16840. var o = this
  16841. , a = e;
  16842. A.start(function() {}, u.showFloorDelay, function() {
  16843. o.floors.forEach(function(t) {
  16844. t.chunks.forEach(function(e) {
  16845. e.renderOrder = t === a ? l.visibleFloor : l.ghostFloor
  16846. })
  16847. })
  16848. }
  16849. .bind(this))
  16850. }
  16851. ,
  16852. t.prototype.toggleExplode = function() {
  16853. this.floors.toggleExplodeHorizontal()
  16854. }
  16855. ,
  16856. t.prototype.toggleExplodeUp = function() {
  16857. this.floors.toggleExplodeVertical()
  16858. }
  16859. ,
  16860. t.prototype.nextFloor = function(e) {
  16861. return this.floors.nextFloor(this.currentFloor, e)
  16862. }
  16863. ,
  16864. t.prototype.addFloor = function(e) {
  16865. this.floors.add(e)
  16866. }
  16867. ,
  16868. t.prototype.getFloorAtPoint = function(e) {
  16869. return this.floors.getFloorAtPoint(e)
  16870. }
  16871. ,
  16872. t.prototype.getTagBySid = function(e) {
  16873. return this.tags[e]
  16874. }
  16875. ,
  16876. t.prototype.addChunk = function(e, t) {
  16877. this.floors.getOrMakeFloor(e).addChunk(t),
  16878. this.chunks.push(t)
  16879. }
  16880. ,
  16881. t.prototype.setMode = function(t) {
  16882. if (!this.supportedModes[t])
  16883. throw new x("Mode not supported for this model: " + t);
  16884. this.mode = t
  16885. this.skybox.material.transparent = t == "panorama" ? false : true //xzw add // 如果skybox透明,会让其中其他mesh 如热点的透明出问题
  16886. this.chunks.forEach(function(e) {
  16887. e.setMode(t)
  16888. })
  16889. }
  16890. ,
  16891. t.prototype.build = function() {
  16892. this.heroLocations = this.images.getHeroLocations(this.panos);
  16893. var e = function() {
  16894. 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()
  16895. }
  16896. .bind(this)();
  16897. this.has360Views = u.show360Views.enabled && this.heroLocations.some(function(e) {
  16898. return e.cameraMode === s.PANORAMA && this.panos.get(e.panoId) && !this.panos.get(e.panoId).isAligned()
  16899. }
  16900. .bind(this)) || e,
  16901. null === this.heroImage && R.warn("No hero image defined."),
  16902. this.currentFloor = this.floors.last(),
  16903. this.floors.build(),
  16904. this.colliders = this.floors.reduce(function(e, t) {
  16905. return e.concat(t.collider.children)
  16906. }, []),
  16907. this.panos.forEach(function(e) {
  16908. e.build1(),
  16909. e.on("enter", function() {
  16910. e.floor !== this.currentFloor && this.setFloor(e.floor)
  16911. }
  16912. .bind(this))
  16913. }
  16914. .bind(this))
  16915. let downVec = new THREE.Vector3(0,-1,0)
  16916. this.panos.forEach((pano)=>{
  16917. player.raycaster.set(pano.position, downVec);
  16918. let collider = pano.floor.collider.children
  16919. let n = player.raycaster.intersectObjects(collider , true );//add true
  16920. if(n && n[0]){
  16921. if(n[0].point.y - pano.floorPosition.y > 0.03){
  16922. //console.error(`${pano.id}, 探测高度${n[0].point.y.toPrecision(5)} 原高度 ${pano.floorPosition.y.toPrecision(5)}, 相差 ${(n[0].point.y - pano.floorPosition.y).toPrecision(5)}`)
  16923. pano.originFloorY = pano.floorPosition.y
  16924. pano.floorPosition.y = n[0].point.y
  16925. }
  16926. }
  16927. //是否需要排除一下相差过高的?因为可能探测到的是长椅这样的
  16928. })
  16929. this.panos.forEach(function(e) {
  16930. e.build2()
  16931. }),
  16932. this.floors.forEach(function(e) {
  16933. this.boundingBox.union(e.boundingBox)
  16934. }
  16935. .bind(this)),
  16936. this.size = this.boundingBox.size(),
  16937. this.center = this.boundingBox.center(),
  16938. this.floors.forEach(function(e) {
  16939. R.info("Floor " + e + ": " + e.children.length + " chunks, " + e.panos.length + " panos.")
  16940. }
  16941. .bind(this)),
  16942. this.panos.populate_path_graph(),
  16943. this.skybox = new n(this.boundingBox),
  16944. this.skybox.matrixWorldNeedsUpdate = !0,
  16945. this.add(this.skybox)
  16946. /* setTimeout(function() {
  16947. //this.hotsCount && this.shineHots()
  16948. Hot.beginShineHot()
  16949. }
  16950. .bind(this), 1300), */
  16951. //add-----
  16952. console.log('计算visiblePanos开始,可能需要一段时间')
  16953. for(let i in this.hots){
  16954. this.hots[i].setVisiblePanos(this.hots[i].info.visiblePanos);
  16955. }
  16956. console.log('计算visiblePanos完毕')
  16957. //---------
  16958. return R.debug("Done building model"),
  16959. 0 < f.raycastsDone && (R.warn("raycasts: " + f.raycastsDone),
  16960. R.warn("raycasts skipped: " + f.raycastsSkipped)),
  16961. this.buildRooms(),
  16962. this.labels.associateWithRooms(this.rooms),
  16963. $.when(this)
  16964. }
  16965. ,
  16966. t.prototype.loadLabels = function() {
  16967. this.labels = new b(this);
  16968. var e = $.Deferred();
  16969. window.DATA.showingLabels ? this.showingLabels = true : '';
  16970. if (!this.showingLabels)
  16971. return e.resolve();
  16972. var t = g_Prefix + "data/" + this.sid + "/labels.json";
  16973. return this.labels.load(t, !this.isPublic).done(e.resolve.bind(e)).fail(function() {
  16974. R.warn("Getting labels failed, not displaying labels."),
  16975. e.resolve()
  16976. }),
  16977. e
  16978. }
  16979. ,
  16980. t.prototype.buildRooms = function() {
  16981. this.rooms = new _(this),
  16982. this.rooms.createFromChunks(this.chunks),
  16983. this.rooms.calcRoomBoundaries()
  16984. }
  16985. ,
  16986. t.prototype.updateProjectedPanos = function() {
  16987. this.projectedPano0 && this.projectedPano1 && this.setProjectedPanos(this.projectedPano0, this.projectedPano1, !1)
  16988. }
  16989. ,
  16990. t.prototype.setProjectedPanos = function(t, i, n) {
  16991. null != n || (n = !0),
  16992. n = !!n,
  16993. this.projectedPano0 = t,
  16994. this.projectedPano1 = i,
  16995. this.skybox.material.setProjectedPanos(t, i, n),
  16996. this.chunks.forEach(function(e) {
  16997. e.materialInside.setProjectedPanos(t, i, n)
  16998. })
  16999. }
  17000. ,
  17001. t.prototype.setSide = function(t) {
  17002. this.floors.forEach(function(e) {
  17003. e.collider.material.side = t
  17004. })
  17005. }
  17006. ,
  17007. t.prototype.heroCount = function() {
  17008. return this.heroLocations ? this.heroLocations.length : 0
  17009. }
  17010. ,
  17011. t.prototype.getHeroDescriptorByIndex = function(e=[]) {//改 因增加了二级目录
  17012. if (e[0] < 0)
  17013. return R.warn("Model.getHeroDescriptorByHeroIndex() -> heroIndex is less than 0."),
  17014. null;
  17015. if (this.heroCount() < 1)
  17016. return R.warn("Model.getHeroDescriptorByIndex() -> No hero locations in this model"),
  17017. null;
  17018. var t = this.heroLocations[e[0]];
  17019. if(t.heroLocations && e[1]!=void 0){
  17020. t = t.heroLocations[e[1]];
  17021. }
  17022. return void 0 === t ? (R.warn("Model.getHeroDescriptorByIndex() -> Index " + e + " is not a validindex"),
  17023. null) : t
  17024. }
  17025. ,
  17026. t.prototype.findPanoramicHero = function() {
  17027. for (var e in this.heroLocations)
  17028. if (this.heroLocations[e].cameraMode === s.PANORAMA)
  17029. return this.heroLocations[e];
  17030. return null
  17031. }
  17032. ,
  17033. t.prototype.listImagePanos = function() {
  17034. var i = []
  17035. , n = this;
  17036. return this.images.forEach(function(e) {
  17037. if (e.metadata && e.metadata.scan_id) {
  17038. var t = n.panos.get(e.metadata.scan_id);
  17039. t && (n.supportsTiles || t.isLoaded("high") || i.push(t))
  17040. }
  17041. }),
  17042. i
  17043. }
  17044. ,
  17045. t.prototype.fadePanoMarkers = function(/* e, t */opacity, dur, o = {}) {//改
  17046. if(window.DATA.hideFloorMarker)return
  17047. var currentPano = player.currentPano
  17048. opacity = void 0 == opacity ? _settings.panorama.markerOpacity : opacity //不传opacity代表显示
  17049. var hideWhenFlyOut = () => {
  17050. var shows = [],
  17051. hides = []
  17052. player.model.panos.forEach(pano => {
  17053. hides.push(pano)
  17054. })
  17055. this.panos.fadeMarkerOpacity(0, dur, [{ toOp: 0, member: hides }])
  17056. }
  17057. if (opacity == 0) {
  17058. hideWhenFlyOut()
  17059. } else {
  17060. if (player.mode == 'panorama' && currentPano) {
  17061. var shows = [], hides = []
  17062. player.model.panos.forEach(pano => { //是邻近点就显示否则隐藏
  17063. if (currentPano.neighbourPanos[pano.id]) {
  17064. shows.push(pano)
  17065. } else {
  17066. hides.push(pano)
  17067. }
  17068. })
  17069. this.panos.fadeMarkerOpacity(opacity, dur, [
  17070. { toOp: opacity, member: shows },
  17071. { toOp: 0, member: hides },
  17072. ])
  17073. } else if (player.modeTran.split('-')[1] != 'panorama') {
  17074. //飞出后marker隐藏
  17075. hideWhenFlyOut()
  17076. }
  17077. }
  17078. }
  17079. ,
  17080. t.prototype.setSweepVisibility = function(t) {
  17081. this.panos.forEach(function(e) {
  17082. e.marker && (e.marker.visible = t)
  17083. })
  17084. }
  17085. ,
  17086. t.prototype.outsideAllowed = function() {
  17087. return this.supportedModes[s.DOLLHOUSE] && this.supportedModes[s.FLOORPLAN]
  17088. }
  17089. ,
  17090. O.exports = t
  17091. }
  17092. ).call(this, "/js/model/Model.js")
  17093. }
  17094. , {
  17095. "../constants": 8,
  17096. "../enum/AlignmentType": 17,
  17097. "../enum/RenderOrder": 42,
  17098. "../enum/Viewmode": 51,
  17099. "../exception/BasicException": 55,
  17100. "../label/Label": 90,
  17101. "../loaders/ModelLoader": 105,
  17102. "../loaders/ModelTextureLoader": 106,
  17103. "../loaders/SweepDataLoader": 107,
  17104. "../tag/tag": 123,
  17105. "../tag/tagManager": 124,
  17106. "../objects/BoundingTextureSkybox": 143,
  17107. "../objects/Chunk": 144,
  17108. "../objects/Floor": 146,
  17109. "../objects/Panorama": 148,
  17110. "../objects/Room": 150,
  17111. "../objects/Snapshot": 153,
  17112. "../settings": 166,
  17113. "../shaders": 167,
  17114. "../util/ModelUrls": 177,
  17115. "../util/PanoramaCollection": 178,
  17116. "../util/ajax": 181,
  17117. "../util/common": 185,
  17118. "../util/easing": 186,
  17119. "../util/lerp": 188,
  17120. "../util/logger": 189,
  17121. "../util/math": 190,
  17122. "../util/texture": 194,
  17123. "../util/transitions": 195,
  17124. "./../util/browser": 182,
  17125. "./../util/showcase": 193,
  17126. "./Chunks": 135,
  17127. "./FloorCollection": 136,
  17128. "./ImageCollection": 137,
  17129. "./LabelCollection": 138,
  17130. "./RoomCollection": 141,
  17131. events: 202,
  17132. three: 217,
  17133. //hot: "hot"
  17134. }],
  17135. 140: [function(e, t, i) {
  17136. "use strict";
  17137. function n() {
  17138. this.modelMap = {},
  17139. this.activeModel = null,
  17140. this.modelCount = 0,
  17141. this.tileDownloader = null,
  17142. this.panoRenderer = null
  17143. }
  17144. var r = (e("three"),
  17145. e("../util/common"))
  17146. , o = e("../exception/BasicException")
  17147. , a = e("../enum/ModelManagerEvents")
  17148. , s = e("../enum/PanoRendererEvents")
  17149. , l = e("events").EventEmitter;
  17150. n.prototype.init = function(e, t, i) {
  17151. this.tileDownloader = e,
  17152. this.panoRenderer = t,
  17153. this.qualityManager = i,
  17154. this.bindEvents()
  17155. }
  17156. ,
  17157. n.prototype.bindEvents = function() {
  17158. this.panoRenderer.on(s.TileRenderSuccess, this.onTileRendered.bind(this))
  17159. }
  17160. ,
  17161. n.prototype.onTileRendered = function(e, t, i, n) {}
  17162. ,
  17163. n.prototype.addModel = function(e) {
  17164. this.modelMap[e.sid] = e,
  17165. 0 === this.modelCount && this.activateModel(e.sid),
  17166. this.modelCount++,
  17167. this.emit(a.ModelAdded)
  17168. }
  17169. ,
  17170. n.prototype.getModel = function(e) {
  17171. return this.modelMap[e]
  17172. }
  17173. ,
  17174. n.prototype.activateModel = function(e) {
  17175. var t = this.modelMap[e];
  17176. if (!t)
  17177. throw new o("Tried to activate invalid model!");
  17178. var i = this.activeModel;
  17179. this.activeModel = t,
  17180. this.tileDownloader.setPanoData(t.panos, t.listImagePanos(), t.sid),
  17181. this.tileDownloader.setUrls(t.urls),
  17182. t.panos.forEach(function(e) {
  17183. e.attachToPanoRenderer(this.panoRenderer),
  17184. e.tileDownloader = this.tileDownloader,
  17185. e.qualityManager = this.qualityManager
  17186. }
  17187. .bind(this)),
  17188. this.emit(a.ActiveModelChanged, {
  17189. oldModel: i,
  17190. model: t
  17191. })
  17192. }
  17193. ,
  17194. n.prototype.getActiveModel = function() {
  17195. return this.activeModel
  17196. }
  17197. ,
  17198. r.extend(n, l),
  17199. t.exports = n
  17200. }
  17201. , {
  17202. "../enum/ModelManagerEvents": 33,
  17203. "../enum/PanoRendererEvents": 35,
  17204. "../exception/BasicException": 55,
  17205. "../util/common": 185,
  17206. events: 202,
  17207. three: 217
  17208. }],
  17209. 141: [function(r, l, e) {
  17210. (function(e) {
  17211. "use strict";
  17212. function o() {
  17213. n.call(this)
  17214. }
  17215. var a = r("../objects/Room")
  17216. , t = (r("../settings"),
  17217. r("../util/logger"))
  17218. , i = (r("../util/transitions"),
  17219. r("../util/easing"),
  17220. r("../util/common"))
  17221. , n = r("../util/IndexedCollection")
  17222. , s = r("./Chunks");
  17223. new t(e),
  17224. i.inherit(o, n),
  17225. o.prototype.getIndex = function(e) {
  17226. return e.roomId
  17227. }
  17228. ,
  17229. o.prototype.calcRoomBoundaries = function() {
  17230. this.forEach(function(e) {
  17231. e.calcBoundaries()
  17232. })
  17233. }
  17234. ,
  17235. o.prototype.createFromChunks = function(e) {
  17236. var n = {
  17237. floorId: -1,
  17238. roomId: -1
  17239. }
  17240. , r = {};
  17241. e.forEach(function(e) {
  17242. s.parseIdsFromChunkName(e.name, n);
  17243. var t = r[n.roomId];
  17244. if (!t) {
  17245. var i = o.generateRoomId(n.floorId, n.roomId);
  17246. t = new a(n.floorId,i),
  17247. this.add(t),
  17248. r[n.roomId] = t
  17249. }
  17250. t.addChunk(e)
  17251. }
  17252. .bind(this)),
  17253. this.calcRoomBoundaries()
  17254. }
  17255. ,
  17256. o.generateRoomId = function(e, t) {
  17257. return e + "_" + t
  17258. }
  17259. ,
  17260. l.exports = o
  17261. }
  17262. ).call(this, "/js/model/RoomCollection.js")
  17263. }
  17264. , {
  17265. "../objects/Room": 150,
  17266. "../settings": 166,
  17267. "../util/IndexedCollection": 175,
  17268. "../util/common": 185,
  17269. "../util/easing": 186,
  17270. "../util/logger": 189,
  17271. "../util/transitions": 195,
  17272. "./Chunks": 135
  17273. }],
  17274. 142: [function(e, t, i) {
  17275. "use strict";
  17276. function n(e, t, i) {
  17277. var n = (e = e.clone().expandByScalar(0.01)).size()
  17278. , r = new o.BoxGeometry(n.x,n.y,n.z);
  17279. r.boundingBox = e,
  17280. o.Mesh.call(this, r, t),
  17281. this.position.copy(e.center()),
  17282. this.frustumCulled = !1,
  17283. i && this.add(new o.WireframeHelper(this))
  17284. }
  17285. var o = e("three");
  17286. (n.prototype = Object.create(o.Mesh.prototype)).constructor = n,
  17287. t.exports = n
  17288. }
  17289. , {
  17290. three: 217
  17291. }],
  17292. 143: [function(l, c, e) {
  17293. (function(e) {
  17294. "use strict";
  17295. function t(e) {
  17296. s.time("Computing a nice bounding cubemap");
  17297. var t = new r({
  17298. side: i.BackSide,
  17299. transparent: !0
  17300. });
  17301. t.uniforms.modelAlpha.value = 0,
  17302. t.uniforms.opacity.value = 1 - o.modelAlpha,
  17303. this.renderOrder = a.boundingSkybox,
  17304. n.call(this, e, t),
  17305. s.timeEnd("Computing a nice bounding cubemap")
  17306. }
  17307. var i = l("three")
  17308. , n = (l("../enum/Viewmode"),
  17309. l("../shaders"),
  17310. l("./BoundingMesh"))
  17311. , r = l("../materials/ModelTextureMaterial")
  17312. , o = l("../settings")
  17313. , a = l("../enum/RenderOrder")
  17314. , s = new (l("../util/logger"))(e);
  17315. (t.prototype = Object.create(n.prototype)).constructor = t,
  17316. c.exports = t
  17317. }
  17318. ).call(this, "/js/objects/BoundingTextureSkybox.js")
  17319. }
  17320. , {
  17321. "../enum/RenderOrder": 42,
  17322. "../enum/Viewmode": 51,
  17323. "../materials/ModelTextureMaterial": 118,
  17324. "../settings": 166,
  17325. "../shaders": 167,
  17326. "../util/logger": 189,
  17327. "./BoundingMesh": 142,
  17328. three: 217
  17329. }],
  17330. 144: [function(e, t, i) {
  17331. "use strict";
  17332. function n(e) {
  17333. this.materialInside = new s({
  17334. side: r.DoubleSide
  17335. });
  17336. var t = r.UniformsUtils.clone(o.modelOutside.uniforms);
  17337. this.materialOutside = new r.RawShaderMaterial({
  17338. fragmentShader: o.modelOutside.fragmentShader,
  17339. vertexShader: o.modelOutside.vertexShader,
  17340. uniforms: t,
  17341. side: r.FrontSide,
  17342. name: "chunkOut"
  17343. }),
  17344. r.Mesh.call(this, e.geometry, this.materialInside),
  17345. this.name = e.name || "",
  17346. this.textureName = e.textureName,
  17347. this.meshUrl = e.meshUrl
  17348. }
  17349. var r = e("three")
  17350. , o = e("../shaders")
  17351. , a = e("../enum/Viewmode")
  17352. , s = e("../materials/ModelTextureMaterial");
  17353. (n.prototype = Object.create(r.Mesh.prototype)).setTextureMap = function(e) {
  17354. this.materialInside.uniforms.map.value = e,
  17355. this.materialOutside.uniforms.map.value = e
  17356. }
  17357. ,
  17358. n.prototype.setMode = function(e) {
  17359. var t = e === a.DOLLHOUSE || e === a.FLOORPLAN ? this.materialOutside : this.materialInside;
  17360. t.side = e === a.PANORAMA ? r.DoubleSide : r.FrontSide,
  17361. t.transparent = this.material.transparent,
  17362. t.uniforms.opacity.value = this.material.uniforms.opacity.value;
  17363. this.material = t
  17364. }
  17365. ,
  17366. t.exports = n
  17367. }
  17368. , {
  17369. "../enum/Viewmode": 51,
  17370. "../materials/ModelTextureMaterial": 118,
  17371. "../shaders": 167,
  17372. three: 217
  17373. }],
  17374. 145: [function(e, t, i) {
  17375. "use strict";
  17376. function n(e) {
  17377. this.chunksize = e || 10,
  17378. this.chunks = {},
  17379. this.boundingBoxes = {},
  17380. this.children = [],
  17381. this.offset = new m.Vector3(0,.5,0),
  17382. this.material = new m.MeshBasicMaterial({
  17383. color: 16777215 * Math.random(),
  17384. side: m.DoubleSide
  17385. })
  17386. }
  17387. var m = e("three");
  17388. e("../enum/Viewmode"),
  17389. n.prototype.add = function(e) {
  17390. var t, i, n, r, o, a, s, l, c, h, u = e.attributes;
  17391. u ? (t = u.position.array,
  17392. i = void 0 !== e.index ? e.index.array : void 0) : (t = e.vertices,
  17393. e.faces);
  17394. var d = new m.Vector3;
  17395. if (i)
  17396. for (n = 0,
  17397. r = i.length; n < r; n += 3) {
  17398. var p = 3 * i[n]
  17399. , f = 3 * i[n + 1]
  17400. , g = 3 * i[n + 2];
  17401. o = (t[p] + t[f] + t[g]) / 3,
  17402. a = (t[1 + p] + t[1 + f] + t[1 + g]) / 3,
  17403. s = (t[2 + p] + t[2 + f] + t[2 + g]) / 3,
  17404. c = (l = Math.floor(o / this.chunksize) + "." + Math.floor(a / this.chunksize) + "." + Math.floor(s / this.chunksize))in this.chunks ? (h = this.chunks[l],
  17405. this.boundingBoxes[l]) : (h = this.chunks[l] = [],
  17406. this.boundingBoxes[l] = new m.Box3),
  17407. 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]),
  17408. c.expandByPoint(d.set(t[p], t[1 + p], t[2 + p])),
  17409. c.expandByPoint(d.set(t[f], t[1 + f], t[2 + f])),
  17410. c.expandByPoint(d.set(t[g], t[1 + g], t[2 + g]))
  17411. }
  17412. else
  17413. for (n = 0,
  17414. r = t.length; n < r; n += 9)
  17415. o = (t[n] + t[n + 3] + t[n + 6]) / 3,
  17416. a = (t[n + 1] + t[n + 4] + t[n + 7]) / 3,
  17417. s = (t[n + 2] + t[n + 5] + t[n + 8]) / 3,
  17418. c = (l = Math.floor(o / this.chunksize) + "." + Math.floor(a / this.chunksize) + "." + Math.floor(s / this.chunksize))in this.chunks ? (h = this.chunks[l],
  17419. this.boundingBoxes[l]) : (h = this.chunks[l] = [],
  17420. this.boundingBoxes[l] = new m.Box3),
  17421. 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]),
  17422. c.expandByPoint(d.set(t[n], t[n + 1], t[n + 2])),
  17423. c.expandByPoint(d.set(t[n + 3], t[n + 4], t[n + 5])),
  17424. c.expandByPoint(d.set(t[n + 6], t[n + 7], t[n + 8]))
  17425. }
  17426. ,
  17427. n.prototype.build = function() {
  17428. var e = new m.Object3D;
  17429. for (var t in e.material = this.material,
  17430. this.chunks) {
  17431. var i = this.chunks[t]
  17432. , n = new m.BufferGeometry;
  17433. n.addAttribute("position", new m.BufferAttribute(new Float32Array(i),3)),
  17434. n.boundingBox = this.boundingBoxes[t];
  17435. var r = new m.Mesh(n,this.material);
  17436. r.material.visible = !1,
  17437. e.add(r),
  17438. this.chunks[t] = []
  17439. }
  17440. return e
  17441. }
  17442. ,
  17443. t.exports = n
  17444. }
  17445. , {
  17446. "../enum/Viewmode": 51,
  17447. three: 217
  17448. }],
  17449. 146: [function(e, t, i) {
  17450. "use strict";
  17451. var n = e("three")
  17452. , r = e("../settings")
  17453. , o = e("../util/common")
  17454. , a = e("../util/lerp")
  17455. , s = e("./ChunkedCollider")
  17456. , l = e("../util/transitions")
  17457. , c = e("../util/easing")
  17458. , h = (e("../objects/Panorama"),
  17459. e("../enum/RenderOrder"));
  17460. e("../localization/localize");
  17461. function u(e, t, i) {
  17462. n.Object3D.call(this),
  17463. this.model = e,
  17464. this.floorIndex = t,
  17465. this.lang = r.languageTag,
  17466. this.name = i || "cn" === r.languageTag ? "Floor " + (t + 1) : "第" + (t + 1) + "层",
  17467. this.panos = [],
  17468. this.chunks = [],
  17469. this.colliderBuilder = new s(3),
  17470. this.collider = null,
  17471. this.center = null,
  17472. this.boundingBox = new n.Box3,
  17473. this.size = null,
  17474. this.hidden = !1,
  17475. this.conservativeBoundingBox = new n.Box3,
  17476. this.debugColor = 16777215 * Math.random(),
  17477. this.transition = null
  17478. }
  17479. (u.prototype = Object.create(n.Object3D.prototype)).enter = function(e) {
  17480. this.model.setFloor(this, e)
  17481. }
  17482. ,
  17483. u.prototype.hide = function(e) {
  17484. if (!this.hidden || this.transition) {
  17485. this.chunks.forEach(function(e) {
  17486. e.material.transparent = !0
  17487. }),
  17488. l.cancel(this.transition);
  17489. var t = e ? 0 : r.hideFloorDuration + r.hideFloorDelay
  17490. , i = e ? 0 : r.hideFloorDelay / t;
  17491. this.transition = l.start(a.allUniforms(this.chunks, "opacity", .08), t, function() {
  17492. this.hidden = !0
  17493. }
  17494. .bind(this), i, c.easeInOutQuad)
  17495. }
  17496. }
  17497. ,
  17498. u.prototype.show = function(e) {
  17499. if (this.hidden || this.transition) {
  17500. this.hidden = !1,
  17501. l.cancel(this.transition);
  17502. var t = e ? r.showFloorDuration : r.showFloorDuration + r.showFloorDelay
  17503. , i = e ? 0 : r.showFloorDelay / t;
  17504. this.transition = l.start(a.allUniforms(this.chunks, "opacity", 1), t, function() {
  17505. this.hidden || this.chunks.forEach(function(e) {
  17506. e.material.transparent = !1
  17507. })
  17508. }
  17509. .bind(this), i, c.easeInOutQuad)
  17510. }
  17511. }
  17512. ,
  17513. u.prototype.toggle = function(e, t) {
  17514. (e = void 0 === e ? this.hidden : e) ? this.show(t) : this.hide(t)
  17515. }
  17516. ,
  17517. u.prototype.containsPoint = function(t) {
  17518. return this.collider.children.some(function(e) {
  17519. return e.geometry.boundingBox || e.geometry.computeBoundingBox(),
  17520. e.geometry.boundingBox.containsPoint(t)
  17521. })
  17522. }
  17523. ,
  17524. u.prototype.distanceToPoint = function(i) {
  17525. var n = null
  17526. , r = 1 / 0;
  17527. return this.collider.children.forEach(function(e) {
  17528. e.geometry.boundingBox || e.geometry.computeBoundingBox();
  17529. var t = e.geometry.boundingBox.distanceToPoint(i);
  17530. (!n || t < r) && (r = t,
  17531. n = e)
  17532. }),
  17533. r
  17534. }
  17535. ,
  17536. u.prototype.addChunk = function(e) {
  17537. e.renderOrder = h.ghostFloor,
  17538. this.add(e),
  17539. this.chunks.push(e),
  17540. this.boundingBox.union(e.geometry.boundingBox),
  17541. this.size = this.boundingBox.size(),
  17542. this.colliderBuilder.add(e.geometry)
  17543. }
  17544. ,
  17545. u.prototype.addPano = function(e) {
  17546. this.panos.push(e),
  17547. this.add(e.skyboxMesh),
  17548. e.marker && this.add(e.marker);
  17549. if(e.neighbourUUIDs && e.neighbourUUIDs.length){//add 有相邻点才算入bound 因为拍摄有bug,会出现floorPosition为000,且position位置很偏的点,它们一般都是不可见点。
  17550. var t = new n.Vector3(1,1,1)
  17551. , i = (new n.Box3).setFromCenterAndSize(e.position, t);
  17552. this.boundingBox.union(i)
  17553. }
  17554. }
  17555. ,
  17556. u.prototype.build = function() {
  17557. this.collider = this.colliderBuilder.build(!0),
  17558. this.add(this.collider),
  17559. this.center = this.boundingBox.center(),
  17560. this.conservativeBoundingBox.copy(this.boundingBox),
  17561. this.conservativeBoundingBox.min.y = o.lowerMedian(this.collider.children.map(function(e) {
  17562. return e.geometry.boundingBox.min.y
  17563. }), 5),
  17564. this.conservativeBoundingBox.max.y = o.lowerMedian(this.collider.children.map(function(e) {
  17565. return e.geometry.boundingBox.max.y
  17566. }), 5),
  17567. this.colliderBuilder = null
  17568. }
  17569. ,
  17570. u.prototype.toShortString = function() {
  17571. return o.nth(this.floorIndex + 1)
  17572. }
  17573. ,
  17574. u.prototype.toString = function() {
  17575. return this.name
  17576. }
  17577. ,
  17578. t.exports = u
  17579. }
  17580. , {
  17581. "../enum/RenderOrder": 42,
  17582. "../localization/localize": 108,
  17583. "./strings-cn-CN": 109,
  17584. "../objects/Panorama": 148,
  17585. "../settings": 166,
  17586. "../util/common": 185,
  17587. "../util/easing": 186,
  17588. "../util/lerp": 188,
  17589. "../util/transitions": 195,
  17590. "./ChunkedCollider": 145,
  17591. three: 217
  17592. }],
  17593. 147: [function(e, t, i) {
  17594. "use strict";
  17595. function n(e) {
  17596. this.player = e,
  17597. this.obj3d = null,
  17598. this.UP = new u.Vector3(0,1,0)
  17599. }
  17600. var u = e("three")
  17601. , d = e("../settings");
  17602. n.prototype.prefs = {
  17603. linewidth: 3,
  17604. height: .07,
  17605. opacity: .45,
  17606. endScale: .05
  17607. },
  17608. n.prototype.discard = function() {
  17609. if (this.obj3d) {
  17610. var e = this.obj3d.parent;
  17611. e && e.remove(this.obj3d)
  17612. }
  17613. this.obj3d = null
  17614. }
  17615. ,
  17616. n.prototype.draw = function() {
  17617. if (this.discard(),
  17618. d.showNeighbors) {
  17619. var e = this.player.currentPano.floor;
  17620. this.obj3d = new u.Object3D;
  17621. var t = this.player.model.panos.getNeighbours(this.player.currentPano)
  17622. , i = this.player.currentPano.floorPosition.clone().sub(this.player.model.position);
  17623. i.y += this.prefs.height;
  17624. var n = .1525
  17625. , r = new u.Matrix4;
  17626. for (var o in t)
  17627. if (t[o]) {
  17628. var a = this.player.model.panos.get(o)
  17629. , s = (a.position.clone().sub(this.player.model.position),
  17630. a.position.clone().sub(a.floorPosition))
  17631. , l = a.floorPosition.clone().sub(this.player.model.position);
  17632. l.y += this.prefs.height;
  17633. var c = new u.Geometry;
  17634. 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)),
  17635. 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)),
  17636. r.identity().setPosition(s),
  17637. c.applyMatrix(r),
  17638. c.vertices.push(new u.Vector3(0,-this.prefs.endScale,0)),
  17639. 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)),
  17640. r.lookAt(l, i, this.UP).setPosition(l),
  17641. c.applyMatrix(r),
  17642. c.vertices.push(l, i);
  17643. var h = new u.Line(c,new u.LineBasicMaterial({
  17644. color: a.debugColor.getHex(),
  17645. transparent: !0,
  17646. opacity: this.prefs.opacity,
  17647. depthWrite: !1,
  17648. name: "sLine" + o,
  17649. linewidth: this.prefs.linewidth
  17650. }));
  17651. this.obj3d.add(h)
  17652. }
  17653. e.add(this.obj3d)
  17654. }
  17655. }
  17656. ,
  17657. n.prototype.update = function() {
  17658. d.showNeighbors && this.obj3d && this.obj3d.updateMatrixWorld()
  17659. }
  17660. ,
  17661. t.exports = n
  17662. }
  17663. , {
  17664. "../settings": 166,
  17665. three: 217
  17666. }],
  17667. 148: [function(S, M, e) {
  17668. (function(e) {
  17669. "use strict";
  17670. function r(e, t, i, n) {
  17671. this.model = e,
  17672. this.id = t,
  17673. this.alignmentType = i.alignmentType || c.ALIGNED,
  17674. this.neighbourUUIDs = i.neighbours,
  17675. this.neighbourPanos = null,
  17676. this.floor = null,
  17677. this.floorIndex = i.floor,
  17678. this.failedLoadingAt = 0,
  17679. this.maxLoadRetries = 4,
  17680. this.origin = i.position.clone(),
  17681. this.position = this.alignmentType === c.UNALIGNED ? new s.Vector3(0,-5,0) : i.position.clone(),
  17682. this.quaternion = i.quaternion.clone(),
  17683. this.skyboxMesh = new s.Mesh(E),
  17684. this.skyboxMesh.position.copy(this.position),
  17685. this.skyboxMesh.quaternion.copy(this.quaternion),
  17686. this.skyboxMesh.name = "skybox",
  17687. this.skyboxMesh.visible = !1,
  17688. this.skyboxMesh.updateMatrix(),
  17689. this.skyboxMesh.updateMatrixWorld(),
  17690. this.marker = null,
  17691. this.showFloorMarker = this.showFloorMarker = !window.DATA.hideFloorMarker
  17692. if(this.isAligned() ){
  17693. this.marker = new s.Mesh(_,new s.MeshBasicMaterial({
  17694. map: b,
  17695. side: s.DoubleSide,
  17696. opacity: 0,
  17697. transparent: !0,
  17698. depthWrite: !1
  17699. })),
  17700. this.marker.visible = false //改:先不显示,之后根据opacity显示
  17701. this.marker.renderOrder = l.panoMarker,
  17702. this.marker.name = "marker",
  17703. (this.marker.pano = this).marker.layers.set(v.PANOMARKERS),
  17704. this.marker.updateMatrixWorld()
  17705. if(!window.DATA.hideFloorMarker){//xzw
  17706. let opa = this.marker.material.opacity
  17707. Object.defineProperty(this.marker.material, 'opacity', {
  17708. get: function () {
  17709. return opa
  17710. },
  17711. set: (o)=>{
  17712. opa = o
  17713. //if(o>0)console.log('o>0',this.pano.id)
  17714. convertTool.updateVisible(this.marker, 'hideWhenZeroOpa', o != 0)
  17715. },
  17716. })
  17717. }
  17718. a.colorMarkerOnLoad && this.on("load", function() {
  17719. this.marker.material.color.set(65280)
  17720. })
  17721. }
  17722. this.debugColor = (new s.Color).setHSL(.06 + .53 * Math.random(), .8 + .2 * Math.random(), .5 + .2 * Math.random()),
  17723. this.floorPosition = i.puck ? i.puck.clone() : null,
  17724. this.tiled = n,
  17725. this.tiled ? this.solidSkybox = null : (this.solidSkybox = new s.Texture([null, null, null, null, null, null]),
  17726. this.solidSkybox.flipY = !1,
  17727. a.minimalMemoryMode && (this.solidSkybox.minFilter = s.LinearFilter,
  17728. this.solidSkybox.magFilter = s.LinearFilter,
  17729. this.solidSkybox.generateMipmaps = !1)),
  17730. this.zoomed = !1,
  17731. this.panoRenderer = null,
  17732. this.qualityManager = null,
  17733. this.tileDownloader = null,
  17734. this.tiledPanoRenderTarget = null,
  17735. this.minimumTiledPanoLoaded = !1,
  17736. this.highestPartialTileRenderOpCompleted = 0,
  17737. this.highestFullTileRenderOpCompleted = 0,
  17738. this.shouldRedrawOnBaseLoaded = !1,
  17739. this.lockUntilRenderingComplete = !1,
  17740. a.colorMarkerOnLoad && this.on("load", function() {
  17741. this.marker.material.color.set(65280)
  17742. }),
  17743. (e = new s.TextureLoader).setCrossOrigin(!0);
  17744. var r = e.load("images/texture.jpg");
  17745. if (this.vrMarker = new s.Mesh(new s.OctahedronGeometry(.1,0),new s.MeshLambertMaterial({
  17746. color: 16777215,
  17747. transparent: !0,
  17748. opacity: .75,
  17749. map: r
  17750. })),
  17751. this.vrMarker.boluoType = "vr",
  17752. this.vrMarker.position.z = 1,
  17753. this.vrMarker.enabled = !0,
  17754. this.vrMarker.visible = !1,
  17755. window.vrMarkers = window.vrMarkers || [],
  17756. window.vrMarkers.push(this.vrMarker),
  17757. this.marker && this.marker.add(this.vrMarker),
  17758. a.showAxis && (this.skyboxMesh.add(new s.ArrowHelper(new s.Vector3(0,1,0),new s.Vector3(0,0,0),1,255)),
  17759. this.skyboxMesh.add(new s.ArrowHelper(new s.Vector3(0,0,1),new s.Vector3(0,0,0),1,16711680)),
  17760. this.skyboxMesh.add(new s.ArrowHelper(new s.Vector3(1,0,0),new s.Vector3(0,0,0),1,65280))),
  17761. this.adjustAngleEnable) {
  17762. (i = new s.Quaternion).setFromAxisAngle(new s.Vector3(1,0,0), this.adjustAngleX),
  17763. this.skyboxMesh.quaternion.multiply(i);
  17764. var o = new s.Quaternion;
  17765. o.setFromAxisAngle(new s.Vector3(0,1,0), this.adjustAngleY),
  17766. this.skyboxMesh.quaternion.multiply(o),
  17767. (n = new s.Quaternion).setFromAxisAngle(new s.Vector3(0,0,1), this.adjustAngleZ),
  17768. this.skyboxMesh.quaternion.multiply(n),
  17769. this.skyboxMesh.updateMatrix(),
  17770. this.skyboxMesh.updateMatrixWorld(),
  17771. this.model.updateProjectedPanos()
  17772. }
  17773. }
  17774. var i, t, s = S("three"), n = S("../util/logger"), a = S("../settings"), l = (S("../enum/Viewmode"),
  17775. S("../enum/RenderOrder")), c = S("../enum/AlignmentType"), o = (S("../util/common"),
  17776. S("../util/transitions")), h = S("../util/lerp"), u = S("../util/ajax"), d = S("../util/texture"), p = S("../util/panorama"), f = (S("../enum/TileDownloaderEvents"),
  17777. S("../enum/PanoramaEvents")), g = S("../enum/PanoRendererEvents"), m = S("../enum/PanoSizeClass"), v = S("../enum/RenderLayers"), y = (S("../scene/SceneRenderer"),
  17778. S("../enum/GLCubeFaces"),
  17779. S("../exception/BasicException")), A = S("../tile/TileUtils"), C = S("events").EventEmitter, I = new n(e), E = new s.SphereBufferGeometry(.1), _ = new s.PlaneBufferGeometry(.35,.35,1,1), b = d.load("images/marker.png");
  17780. b.anisotropy = 4; //add
  17781. (r.prototype = Object.create(C.prototype)).enter = (t = null,
  17782. function() {
  17783. this.setZoomed(!1),
  17784. this.emit("enter", {
  17785. oldPano: t,
  17786. newPano: this
  17787. }),
  17788. t = this
  17789. }
  17790. ),
  17791. r.prototype.exit = function() {
  17792. this.tiled ? (this.clearWaitDeferreds(),
  17793. this.minimumTiledPanoLoaded = !1,
  17794. this.tiledPanoRenderTarget = null,
  17795. this.setZoomed(!1),
  17796. this.panoRenderer.deactivateTiledPano(this),
  17797. this.highestPartialTileRenderOpCompleted = 0,
  17798. this.highestFullTileRenderOpCompleted = 0) : (this.solidSkybox.dispose(),
  17799. this.solidSkybox.loaded = !1,
  17800. this.solidSkybox.version = 0),
  17801. this.emit("exit")
  17802. }
  17803. ,
  17804. r.prototype.hoverOn = function(e) {
  17805. this.marker && (o.start(h.property(this.marker.material, "opacity", a[e].markerOpacityOnHover), 250),
  17806. a.navigation.panoScores & a.navigation.mouseDirection && this.addTextSprite("HIT", 12525854))
  17807. }
  17808. ,
  17809. r.prototype.hoverOff = function(e) {
  17810. this.marker && o.start(h.property(this.marker.material, "opacity", a[e].markerOpacity), 250)
  17811. }
  17812. ,
  17813. r.prototype.build1 = function() {
  17814. this.floor = this.floor || this.model.floors.get(this.floorIndex) || (this.model.floors.list.length == 1 ? this.model.floors.list[0] : this.raycastToFindFloor()) || this.model.getFloorAtPoint(this.position), //改
  17815. this.floor.addPano(this)
  17816. this.floorPosition = this.floorPosition || this.raycastFloorPosition(),
  17817. this.neighbourPanos = this.neighbourPanos || this.findNeighourPanos(),
  17818. a.colorMarkerByFloor && this.marker && this.marker.material.color.set(this.floor.debugColor)
  17819. this.neighbourUUIDs = this.neighbourUUIDs || [] //add
  17820. }
  17821. ,
  17822. r.prototype.build2 = function() {
  17823. this.floorPosition = this.floorPosition || this.interpolateFloorPosition(),
  17824. this.height = this.position.distanceTo(this.floorPosition),
  17825. this.placeMarker()
  17826. }
  17827. ,
  17828. r.prototype.interpolateFloorPosition = function() {
  17829. var e = this.model.panos.filter(r.filters.isNeighbourPanoTo(this)).filter(function(e) {
  17830. return !!e.floorPosition
  17831. }).sort(function(e, t) {
  17832. return e.position.distanceTo(this.position) - t.position.distanceTo(this.position)
  17833. }
  17834. .bind(this))
  17835. , t = this.position.clone();
  17836. return 2 <= e.length ? t.y = (e[0].floorPosition.y + e[1].floorPosition.y) / 2 : t.add(a.noMeshFloorPositionOffset),
  17837. t
  17838. }
  17839. ,
  17840. r.prototype.raycastFloorPosition = function() {
  17841. I.warn("Performance warning: Raycasting to find floor position");
  17842. var e = new s.Raycaster(this.position,new s.Vector3(0,-1,0)).intersectObjects(this.model.colliders);
  17843. return e.length ? e[0].point : null
  17844. }
  17845. ,
  17846. 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)],
  17847. function() {
  17848. I.warn("Performance warning: Raycasting to find floor index");
  17849. for (var e = 0; e < i.length; e++) {
  17850. var t = new s.Raycaster(this.position.clone(),i[e].clone()).intersectObjects(this.model.colliders);
  17851. if (t.length)
  17852. return t[0].object.parent.parent
  17853. }
  17854. return null
  17855. }
  17856. ),
  17857. r.prototype.placeMarker = function() {
  17858. this.marker && (this.marker.position.copy(this.floorPosition),
  17859. this.marker.position.y += .1, //经常有marker比地面低,所以多往上调5cm
  17860. this.marker.lookAt(new s.Vector3(0,1,0).add(this.marker.position)))
  17861. }
  17862. ,
  17863. r.prototype.translate = function(e) {
  17864. this.position.add(e),
  17865. this.floorPosition.add(e)
  17866. }
  17867. ,
  17868. r.prototype.findClosestMidtpointPanoTo = function(e) {
  17869. return (new s.Vector3).addVectors(this.position, e.position).divideScalar(2),
  17870. this.model.panos.find([r.filters.notIn([this, e])], [r.sortFunctions.distanceToPoint(point)])
  17871. }
  17872. ,
  17873. r.prototype.attachToPanoRenderer = function(e) {
  17874. this.panoRenderer = e,
  17875. this.panoRenderer.on(g.TileRenderSuccess, this.onTileRendered.bind(this)),
  17876. this.panoRenderer.on(g.PanoRenderComplete, this.onPanoRendered.bind(this)),
  17877. this.panoRenderer.on(g.TileRenderFailure, this.onTileRenderFail.bind(this)),
  17878. this.panoRenderer.on(g.UploadAttemptedForAllTiles, this.onUploadAttemptedForAllTiles.bind(this))
  17879. }
  17880. ;
  17881. var w, T, x = {};
  17882. r.prototype.getWaitDeferred = function(e) {
  17883. var t = x[this.id];
  17884. t || (t = {},
  17885. x[this.id] = t);
  17886. var i = t[e];
  17887. return i || (i = {
  17888. deferred: $.Deferred(),
  17889. active: !1
  17890. },
  17891. t[e] = i),
  17892. i
  17893. }
  17894. ,
  17895. r.prototype.resetWaitDeferred = function(e) {
  17896. var t = this.getWaitDeferred(e);
  17897. t.active = !1,
  17898. t.deferred = $.Deferred()
  17899. }
  17900. ,
  17901. r.prototype.clearWaitDeferreds = function() {
  17902. var e = x[this.id];
  17903. for (var t in e || (e = {},
  17904. x[this.id] = e),
  17905. e)
  17906. if (e.hasOwnProperty(t)) {
  17907. var i = e[t];
  17908. i.active = !1,
  17909. i.deferred = $.Deferred()
  17910. }
  17911. }
  17912. ,
  17913. r.prototype.loadTiledPano = (new s.Vector3,
  17914. w = [],
  17915. T = [],
  17916. function(e, t, i, n, r, o) {
  17917. null != n || (n = !0),
  17918. null != r || (r = !0);
  17919. var a = this.getWaitDeferred(e)
  17920. , s = a.deferred
  17921. , l = null
  17922. , c = null;
  17923. if (i && ("number" == typeof i ? l = i : (l = i.hFov,
  17924. c = i.vFov)),
  17925. !this.isLoaded(e)) {
  17926. if (!a.active) {
  17927. if (a.active = !0,
  17928. i) {
  17929. var h = A.matchingTilesInDirection(this, e, t, l, c);
  17930. w[this.id + ":" + e] = {
  17931. tileCount: 0,
  17932. targetTileCount: h
  17933. },
  17934. I.info("Loading partial pano: " + this.id + " with " + h + " tiles")
  17935. }
  17936. T[this.id] || (T[this.id] = !0,
  17937. this.on(f.LoadComplete, function(e, t) {
  17938. var i = this.getWaitDeferred(e).deferred;
  17939. i && "pending" === i.state() && this.highestPartialTileRenderOpCompleted >= e && (i.resolve(e, t),
  17940. this.resetWaitDeferred(e))
  17941. }
  17942. .bind(this)),
  17943. this.on(f.LoadFailed, function(e) {
  17944. var t = this.getWaitDeferred(e).deferred;
  17945. t && "pending" === t.state() && this.highestPartialTileRenderOpCompleted >= e && (t.reject(e),
  17946. this.resetWaitDeferred(e))
  17947. }
  17948. .bind(this)),
  17949. this.on(f.TileLoaded, function(e, t, i) {
  17950. var n = this.getWaitDeferred(e).deferred;
  17951. if (n && "pending" === n.state()) {
  17952. n.notify(e, t, i);
  17953. var r = w[this.id + ":" + e];
  17954. r && (r.tileCount++,
  17955. r.tileCount === r.targetTileCount && (this.onPanoRendered(this.id, e, i, !0),
  17956. n.resolve(e, i),
  17957. this.resetWaitDeferred(e)))
  17958. }
  17959. }
  17960. .bind(this)))
  17961. }
  17962. this.tileDownloader.clearForceQueue(),
  17963. this.tileDownloader.forceQueueTilesForPano(this, e, t, l, c, o),
  17964. this.tiledPanoRenderTarget = this.panoRenderer.activateTiledPano(this, this.qualityManager.getMaxNavPanoSize(), n),
  17965. this.panoRenderer.renderPanoTiles(this.id, t, r)
  17966. }
  17967. return s.promise()
  17968. }
  17969. ),
  17970. r.prototype.onUploadAttemptedForAllTiles = function(e, t, i) {
  17971. e === this.id && t === this.qualityManager.getPanoSize(m.BASE) && this.shouldRedrawOnBaseLoaded && (this.shouldRedrawOnBaseLoaded = !1,
  17972. this.panoRenderer.resetRenderStatus(this.id, !0, !1),
  17973. this.panoRenderer.renderPanoTiles(this.id, null, !0, !0))
  17974. }
  17975. ,
  17976. r.prototype.onTileRendered = function(e, t, i, n) {
  17977. e === this.id && this.emit(f.TileLoaded, t, i, n)
  17978. }
  17979. ,
  17980. r.prototype.onPanoRendered = function(e, t, i, n) {
  17981. e === this.id && (this.minimumTiledPanoLoaded = !0,
  17982. this.updateSkyboxForZoomLevel(),
  17983. t > this.highestPartialTileRenderOpCompleted && (this.highestPartialTileRenderOpCompleted = t),
  17984. !n && t > this.highestFullTileRenderOpCompleted && (this.highestFullTileRenderOpCompleted = t),
  17985. this.emit("load", t),
  17986. this.model.emit("load", this),
  17987. this.emit(f.LoadComplete, t, i))
  17988. }
  17989. ,
  17990. r.prototype.setZoomed = function(e) {
  17991. this.zoomed = e,
  17992. this.updateSkyboxForZoomLevel()
  17993. }
  17994. ,
  17995. r.prototype.ensureSkyboxReadyForRender = function() {
  17996. this.tiled || (this.solidSkybox.loaded || (this.solidSkybox.needsUpdate = !0),
  17997. this.solidSkybox.loaded = !0)
  17998. }
  17999. ,
  18000. r.prototype.updateSkyboxForZoomLevel = function() {
  18001. this.minimumTiledPanoLoaded && this.model.updateProjectedPanos()
  18002. }
  18003. ,
  18004. r.prototype.getSkyboxTexture = function() {
  18005. return this.tiled ? this.minimumTiledPanoLoaded ? this.zoomed ? this.panoRenderer.zoomRenderTarget.texture : this.tiledPanoRenderTarget.texture : null : this.solidSkybox
  18006. }
  18007. ,
  18008. r.prototype.onTileRenderFail = function(e, t, i) {
  18009. e === this.id && this.emit(f.LoadFailed, t)
  18010. }
  18011. ,
  18012. r.prototype.isLoaded = function(e) {
  18013. if (this.tiled) {
  18014. if (e && "string" == typeof e)
  18015. throw new y("Wrong panoSize given to Panorama.isLoaded(); a tiled pano uses PanoSizeClass");
  18016. return !!this.minimumTiledPanoLoaded && (!e || this.highestPartialTileRenderOpCompleted >= e)
  18017. }
  18018. if (e && "number" == typeof e)
  18019. throw new y("Wrong panoSize given to Panorama.isLoaded(); a non-tiled pano uses high/low.");
  18020. return !!this.solidSkybox.high || e in this.solidSkybox
  18021. }
  18022. ,
  18023. r.prototype.loadCube = function(a) {
  18024. if (this.isLoaded(a))
  18025. return I.info("Skipping load of pano, already loaded"),
  18026. $.when();
  18027. this.emit("loading", a),
  18028. this.model.emit("loading", this);
  18029. var n = p.getCubemapUrls(this.model.urls, this.id, a)
  18030. , e = n.filter(function(e) {
  18031. return !e
  18032. });
  18033. "low" === a && 0 < e.length && (I.info("Pano", this.id, "not available in low res, loading high res right away"),
  18034. a = "high",
  18035. n = p.getCubemapUrls(this.model.urls, this.id, a));
  18036. var t = 0
  18037. , i = [0, 1, 2, 3, 4, 5].map(function(e, t, i) {
  18038. return u.getImage(n[t])
  18039. }
  18040. .bind(this));
  18041. return $.when(i[0], i[1], i[2], i[3], i[4], i[5]).then(function(e, t, i, n, r, o) {
  18042. return this.solidSkybox[a] = [e, t, i, n, r, o],
  18043. "high" !== a && this.solidSkybox.high || (this.solidSkybox.image = this.solidSkybox[a],
  18044. this.solidSkybox.low = null),
  18045. this.solidSkybox.needsUpdate = !0,
  18046. this.emit("load", a),
  18047. this.model.emit("load", this),
  18048. this
  18049. }
  18050. .bind(this), function() {
  18051. I.error("Downloading cubemap for pano", this.id, "failed"),
  18052. this.failedLoadingAt = Date.now()
  18053. }
  18054. .bind(this), function() {
  18055. return $.when(++t, 6)
  18056. })
  18057. }
  18058. ,
  18059. r.raycastsSkipped = 0,
  18060. r.raycastsDone = 0,
  18061. r.prototype.findNeighourPanos = function() {
  18062. return this.model.panos.setNeighbour(this.id, this.id, !1),
  18063. this.model.panos.forEach(function(e) {
  18064. if (e !== this && (!this.model.panos.neighbourMap[this.id] || void 0 === this.model.panos.neighbourMap[this.id][e.id])) {
  18065. var t = this.position.distanceTo(e.position);
  18066. if (t > a.panoramaNeighbourMaxDistance)
  18067. return this.model.panos.setNeighbour(this, e, !1),
  18068. void r.raycastsSkipped++;
  18069. var i = e.position.clone().sub(this.position).normalize()
  18070. , n = new s.Raycaster(this.position,i.clone(),0,t).intersectObjects(this.model.colliders);
  18071. r.raycastsDone++,
  18072. this.model.panos.setNeighbour(this, e, 0 === n.length),
  18073. 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)))
  18074. }
  18075. }
  18076. .bind(this)),
  18077. this.model.panos.neighbourMap[this.id]
  18078. }
  18079. ,
  18080. r.prototype.worldPosition = function() {
  18081. return this.position
  18082. }
  18083. ,
  18084. r.prototype.addTextSprite = function(e, color, parent) {
  18085. this.removeTextSprite();
  18086. var ratio = 16;
  18087. var i = document.createElement("canvas")
  18088. , n = i.getContext("2d");
  18089. i.width = 1024,
  18090. i.height = i.width / ratio;
  18091. n.font = " 30px Arial",
  18092. n.fillStyle = "white";
  18093. var r = n.measureText(e).width;
  18094. n.fillText(e, (i.width - r) / 2, (i.height + 60) / 2);
  18095. var o = new s.Texture(i);
  18096. o.needsUpdate = !0;
  18097. var a = new s.SpriteMaterial({
  18098. map: o,
  18099. color: color || 16428055,
  18100. depthTest:false
  18101. });
  18102. this.text3d = new s.Sprite(a)
  18103. if(parent){
  18104. parent.add(this.text3d)
  18105. }else{
  18106. this.text3d.position.copy(this.skyboxMesh.position)
  18107. this.floor.add(this.text3d)
  18108. }
  18109. var scale = 5
  18110. this.text3d.scale.y = scale/ratio
  18111. this.text3d.scale.x = scale
  18112. }
  18113. ,
  18114. r.prototype.removeTextSprite = function() {
  18115. this.text3d && (this.text3d.parent.remove(this.text3d),
  18116. this.text3d.material.map.dispose(),
  18117. this.text3d = null)
  18118. }
  18119. ,
  18120. r.prototype.isAligned = function() {
  18121. return this.alignmentType === c.ALIGNED
  18122. }
  18123. ,
  18124. r.filters = {
  18125. inDirection: function(t, i, n) {
  18126. return function(e) {
  18127. return e.position.clone().sub(t).normalize().dot(i) > n
  18128. }
  18129. },
  18130. inFloorDirection: function(t, i, n) {
  18131. return function(e) {
  18132. return e.floorPosition.clone().sub(t).normalize().dot(i) > n
  18133. }
  18134. },
  18135. inPanoDirection: function(n, r, o) {
  18136. return o = a.navigation.panoScores ? a.navigation.filterStrictness : o,
  18137. function(e) {
  18138. var t = e.floorPosition.clone().sub(n).normalize()
  18139. , i = e.position.clone().sub(n).normalize();
  18140. return t.dot(r) > o || i.dot(r) > o
  18141. }
  18142. },
  18143. atFloor: function(t) {
  18144. return function(e) {
  18145. return !t || e.floor === t
  18146. }
  18147. },
  18148. not: function(t) {
  18149. return function(e) {
  18150. return e !== t
  18151. }
  18152. },
  18153. notIn: function(t) {
  18154. return function(e) {
  18155. return -1 === t.indexOf(e)
  18156. }
  18157. },
  18158. isLoaded: function() {
  18159. return function(e) {
  18160. return e.isLoaded()
  18161. }
  18162. },
  18163. isNotLoaded: function() {
  18164. return function(e) {
  18165. return !e.isLoaded()
  18166. }
  18167. },
  18168. isCloseEnoughTo: function(t, i) {
  18169. return function(e) {
  18170. return t.distanceTo(e.floorPosition) < i
  18171. }
  18172. },
  18173. hasMinimumHeightDifferenceTo: function(t, i) {
  18174. return function(e) {
  18175. return Math.abs(e.position.y - t.y) > i
  18176. }
  18177. },
  18178. isNotBehindNormal: function(t, i) {
  18179. var n = new s.Vector3;
  18180. return i = i.clone(),
  18181. function(e) {
  18182. return 0 < n.copy(e.position).sub(t).normalize().dot(i)
  18183. }
  18184. },
  18185. isNeighbourPanoTo: function(t) {
  18186. return function(e) {
  18187. return !t || !t.neighbourPanos || !!t.neighbourPanos[e.id]
  18188. }
  18189. },
  18190. isNeighbourOfNeighbourTo: function(n) {
  18191. return function(i) {
  18192. return !!n.neighbourPanos[i.id] || n.neighbourUUIDs.some(function(e) {
  18193. var t = n.model.panos.get(e);
  18194. return !!t && t.neighbourPanos[i.id]
  18195. })
  18196. }
  18197. },
  18198. isNotRecentlyFailed: function(t) {
  18199. return function(e) {
  18200. return Date.now() - e.failedLoadingAt > t
  18201. }
  18202. },
  18203. isOnVisibleFloor: function() {
  18204. return function(e) {
  18205. return !e.floor.hidden
  18206. }
  18207. },
  18208. isPanoAligned: function() {
  18209. return function(e) {
  18210. return e.isAligned()
  18211. }
  18212. }
  18213. },
  18214. r.sortFunctions = {
  18215. distanceToPoint: function(i) {
  18216. return function(e, t) {
  18217. return e.position.distanceTo(i) - t.position.distanceTo(i)
  18218. }
  18219. },
  18220. floorDistanceToPoint: function(i) {
  18221. return function(e, t) {
  18222. return e.floorPosition.distanceTo(i) - t.floorPosition.distanceTo(i)
  18223. }
  18224. },
  18225. choose: function(i) {
  18226. return function(e, t) {
  18227. return i.id === e.id ? -1 : i.id === t.id ? 1 : 0
  18228. }
  18229. }
  18230. },
  18231. r.scoreFunctions = {
  18232. distance: function(t, i) {
  18233. return i = i || a.navigation.distanceFactor,
  18234. function(e) {
  18235. return t ? t.position.distanceTo(e.position) * i : 0
  18236. }
  18237. },
  18238. distanceSquared: function(t, i) {
  18239. return i = i || a.navigation.distanceFactor,
  18240. function(e) {
  18241. return t ? t.position.distanceToSquared(e.position) * i : 0
  18242. }
  18243. },
  18244. direction: function(t, i) {
  18245. return function(e) {
  18246. return e.position.clone().sub(t).normalize().dot(i) * a.navigation.directionFactor
  18247. }
  18248. },
  18249. angle: function(t, i) {
  18250. return function(e) {
  18251. return e.position.clone().sub(t).normalize().angleTo(i) * a.navigation.angleFactor
  18252. }
  18253. },
  18254. inFieldOfView: function(t, i) {
  18255. return function(e) {
  18256. return .75 < e.position.clone().sub(t).normalize().dot(i) ? 10 : -1
  18257. }
  18258. },
  18259. optionality: function(t) {
  18260. return function(e) {
  18261. return e.neighbourUUIDs.filter(function(e) {
  18262. return !(e in t.neighbourUUIDs) && e !== t.id
  18263. }).length * a.navigation.optionalityFactor
  18264. }
  18265. },
  18266. penalizeHeightDifferenceUnder: function(t, i) {
  18267. return function(e) {
  18268. return t.y - e.position.y < i ? -20 : 0
  18269. }
  18270. }
  18271. },
  18272. M.exports = r
  18273. }
  18274. ).call(this, "/js/objects/Panorama.js")
  18275. }
  18276. , {
  18277. "../enum/AlignmentType": 17,
  18278. "../enum/GLCubeFaces": 25,
  18279. "../enum/PanoRendererEvents": 35,
  18280. "../enum/PanoSizeClass": 36,
  18281. "../enum/PanoramaEvents": 37,
  18282. "../enum/RenderLayers": 41,
  18283. "../enum/RenderOrder": 42,
  18284. "../enum/TileDownloaderEvents": 45,
  18285. "../enum/Viewmode": 51,
  18286. "../exception/BasicException": 55,
  18287. "../scene/SceneRenderer": 158,
  18288. "../settings": 166,
  18289. "../tile/TileUtils": 174,
  18290. "../util/ajax": 181,
  18291. "../util/common": 185,
  18292. "../util/lerp": 188,
  18293. "../util/logger": 189,
  18294. "../util/panorama": 191,
  18295. "../util/texture": 194,
  18296. "../util/transitions": 195,
  18297. events: 202,
  18298. three: 217
  18299. }],
  18300. 149: [function(e, t, i) {
  18301. "use strict";
  18302. function n(e) {
  18303. var t = r.UniformsUtils.clone(c.waypoint.uniforms);
  18304. t.map.value = d,
  18305. t.opacity.value = 0,
  18306. t.color.value.set(o.reticuleColor),
  18307. t.showMouseMarker = !window.DATA.hideMouseMarker;
  18308. r.Mesh.call(this, new r.PlaneBufferGeometry(.4,.4,1,1), new r.RawShaderMaterial({
  18309. side: r.DoubleSide,
  18310. depthWrite: !1,
  18311. depthTest: !1,
  18312. transparent: !0,
  18313. vertexShader: c.waypoint.vertexShader,
  18314. fragmentShader: c.waypoint.fragmentShader,
  18315. uniforms: t,
  18316. name: "waypoint",
  18317. opacity: 0,
  18318. visible: t.showMouseMarker
  18319. })),
  18320. this.layers.set(h.RETICULE),
  18321. this.renderOrder = u.reticule,
  18322. this.player = e,
  18323. this.direction = new r.Vector3,
  18324. this.hidden = !0,
  18325. this.mouseLastMoveTime = Date.now()
  18326. }
  18327. var r = e("three")
  18328. , o = e("../settings")
  18329. , a = e("../util/transitions")
  18330. , s = e("../util/texture")
  18331. , l = e("../util/lerp")
  18332. , c = e("../shaders")
  18333. , h = e("../enum/RenderLayers")
  18334. , u = e("../enum/RenderOrder")
  18335. , d = s.load("images/reticule.png");
  18336. d.anisotropy = 4; //各向异性
  18337. (n.prototype = Object.create(r.Mesh.prototype)).move = function(e, t, i) {
  18338. this.hidden = i,
  18339. this.mouseLastMoveTime = Date.now()
  18340. }
  18341. ,
  18342. n.prototype.hide = function() {
  18343. this.hidden || (this.hidden = !0,
  18344. a.start(l.property(this.material.uniforms.opacity, "value", 0), o.reticuleOpacityTransitionTime))
  18345. }
  18346. ,
  18347. n.prototype.show = function() {
  18348. this.hidden = !1,
  18349. this.material.opacity <= 0 && a.start(l.property(this.material.uniforms.opacity, "value", o[this.player.mode].reticuleOpacity), o.reticuleOpacityTransitionTime)
  18350. }
  18351. ,
  18352. n.prototype.update = function() {
  18353. Date.now() - this.mouseLastMoveTime > o.hideReticuleTimeout && !this.hidden && this.hide()
  18354. }
  18355. ,
  18356. n.prototype.updatePosition = function(e, t) {
  18357. if (!this.hidden) {
  18358. if (!t)
  18359. return this.hide();
  18360. var i = t.point
  18361. , n = e.distanceTo(i)
  18362. , r = 1 + .01 * n;
  18363. n < 1 && (r -= 1 - n),
  18364. this.show(),
  18365. this.scale.set(r, r, r),
  18366. this.direction = this.direction.multiplyScalar(.8),
  18367. this.direction.add(t.face.normal.clone().multiplyScalar(.2)),
  18368. this.position.copy(i).add(t.face.normal.clone().multiplyScalar(.01)),
  18369. this.lookAt(this.position.clone().add(this.direction))
  18370. }
  18371. }
  18372. ,
  18373. n.prototype.writeAstag = function() {
  18374. var e = Math.floor(4294967296 * (1 + Math.random())).toString(16) + Math.floor(16 * (1 + Math.random())).toString(16)
  18375. , t = new Date;
  18376. this.tagCount = void 0 === this.tagCount ? 1 : this.tagCount + 1;
  18377. var i = {
  18378. enabled: !0,
  18379. version: "0",
  18380. created: t.toISOString(),
  18381. created_by: "APITest",
  18382. position: this.position.clone(),
  18383. stem: {
  18384. enabled: o.tags.pole.enabled,
  18385. direction: this.direction.multiplyScalar(o.tags.pole.height)
  18386. },
  18387. label: "tag " + this.tagCount,
  18388. description: "Description " + e,
  18389. floor: function(e) {
  18390. if (e.currentFloor) {
  18391. var t = e.floors.indexOf(e.currentFloor);
  18392. return -1 < t ? t : void 0
  18393. }
  18394. }(this.player.model),
  18395. type: "info",
  18396. metadata: {
  18397. preferred_camera: {
  18398. mode: this.player.mode
  18399. }
  18400. }
  18401. };
  18402. console.log("--------------------------"),
  18403. console.log(JSON.stringify(i));
  18404. var n = this.player.model.addtag(e, i).build();
  18405. n && (n.disc && this.player.tagDiscs.push(n.disc),
  18406. n.visible || n.show(o.tags.startup.fadeInDuration))
  18407. }
  18408. ,
  18409. t.exports = n
  18410. }
  18411. , {
  18412. "../enum/RenderLayers": 41,
  18413. "../enum/RenderOrder": 42,
  18414. "../settings": 166,
  18415. "../shaders": 167,
  18416. "../util/lerp": 188,
  18417. "../util/texture": 194,
  18418. "../util/transitions": 195,
  18419. three: 217
  18420. }],
  18421. 150: [function(e, t, i) {
  18422. "use strict";
  18423. function n(e, t) {
  18424. this.chunks = [],
  18425. this.floorId = e,
  18426. this.roomId = t,
  18427. this.position = new l.Vector3
  18428. }
  18429. var l = e("three");
  18430. n.prototype.addChunk = function(e) {
  18431. this.chunks.push(e)
  18432. }
  18433. ,
  18434. n.prototype.calcBoundaries = function() {
  18435. 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++) {
  18436. var a = this.chunks[o].geometry.attributes.position;
  18437. if (a)
  18438. for (var s = 0; s < a.array.length; s += 3)
  18439. e.set(a.array[s], a.array[s + 1], a.array[s + 2]),
  18440. t.add(e),
  18441. 0 === s ? (i.copy(e),
  18442. n.copy(e)) : (i.max(e),
  18443. n.min(e)),
  18444. r++
  18445. }
  18446. 0 < r ? (t.multiplyScalar(1 / r),
  18447. this.average = t) : this.average = null,
  18448. this.boundsMax = i,
  18449. this.boundsMin = n,
  18450. this.center = new l.Vector3,
  18451. this.center.copy(i).sub(n).multiplyScalar(.5).add(n)
  18452. }
  18453. ,
  18454. t.exports = n
  18455. }
  18456. , {
  18457. three: 217
  18458. }],
  18459. 151: [function(o, v, e) {
  18460. (function(e) {
  18461. "use strict";
  18462. function t(e, t, i) {
  18463. this.obj3d = null,
  18464. this.nodes = [],
  18465. this.colorHull = [],
  18466. this.shortPaths = {},
  18467. this.floorHull = null,
  18468. this.cameraHull = null,
  18469. this.floorPathDistance = 0,
  18470. this.floorCurvePoints = null,
  18471. this.floorCurveColors = null,
  18472. this.camCurvePoints = null,
  18473. this.warpDestHeroLoc = null,
  18474. this.warpDestPano = null,
  18475. this.warpPathPoints = null,
  18476. this.warpPathLengths = [0],
  18477. this.warpLength = 0,
  18478. this.closeWarpDistance = 4,
  18479. this.UP = U.UP.clone(),
  18480. this.longestStep = 0,
  18481. this.upcomingTransType = null,
  18482. this.burnsDir = 1,
  18483. this.prevNextDist = 0,
  18484. this.nextI = 0,
  18485. this.activeTransType = null,
  18486. this.lastTransType = null,
  18487. this.bunnyObj = null,
  18488. this.director = e,
  18489. this.player = t,
  18490. this.playerControls = i,
  18491. this.modelManager = t.modelManager,
  18492. this.updateModel(),
  18493. this.updateDefaultsFromModelData(),
  18494. this.bindEvents(),
  18495. this.warping = !1,
  18496. this.waitingToWarp = !1,
  18497. this.warpInterrupted = !1,
  18498. this.warpInterruptionBlackoutStyle = null,
  18499. this.warpInterruptionTravelTime = null
  18500. }
  18501. 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"),
  18502. o("../util/texture")), U = o("../enum/Vectors"), H = (o("../model/ModelManager"),
  18503. new i(e)), g = o("../enum/PlayerEvents"), z = o("../enum/BlackoutStyle"), r = o("../enum/ModelManagerEvents"), m = o("../constants"), I = {
  18504. 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"),
  18505. pathEnd: n.load("images/End.png"),
  18506. 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==")
  18507. };
  18508. t.prototype.setScene = function(e) {
  18509. this.createCpm(e),
  18510. this.createBunnyObj(e)
  18511. }
  18512. ,
  18513. t.prototype.updateModel = function() {
  18514. this.model = this.modelManager.getActiveModel()
  18515. }
  18516. ,
  18517. t.prototype.bindEvents = function() {
  18518. this.modelManager.on(r.ActiveModelChanged, this.updateModel.bind(this))
  18519. }
  18520. ,
  18521. t.prototype.updateDefaultsFromModelData = function() {
  18522. this.model.data
  18523. }
  18524. ,
  18525. t.prototype.pointPathDistance = function(e) {
  18526. for (var t = 0, i = 1; i < e.length; i += 1)
  18527. t += e[i - 1].distanceTo(e[i]);
  18528. return t
  18529. }
  18530. ,
  18531. t.prototype.pointPathLengths = function(e) {
  18532. for (var t = [0], i = 1; i < e.length; i += 1)
  18533. t.push(t[i - 1] + e[i - 1].distanceTo(e[i]));
  18534. return t
  18535. }
  18536. ,
  18537. t.prototype.interpAlongPath = function(e, t, i) {
  18538. var n, r = new P.Vector3, o = t[t.length - 1];
  18539. if (i < 1) {
  18540. n = i * o;
  18541. for (var a = 1; a < t.length; a += 1)
  18542. if (t[a] > n) {
  18543. var s = (n - t[a - 1]) / (t[a] - t[a - 1]);
  18544. return r.copy(e[a]),
  18545. r.sub(e[a - 1]),
  18546. r.multiplyScalar(s),
  18547. r.add(e[a - 1]),
  18548. r
  18549. }
  18550. } else
  18551. r.copy(e[e.length - 1]);
  18552. return r
  18553. }
  18554. ,
  18555. t.prototype.pathHeight = function() {
  18556. return this.player.mode !== O.FLOORPLAN ? D.path.height : D.path.outsideHeight
  18557. }
  18558. ,
  18559. t.prototype.createBunnyObj = function(e) {
  18560. this.bunnyObj || (this.bunnyObj = new P.AxisHelper(.1),
  18561. this.bunnyObj.visible = D.warp.showBunny),
  18562. this.bunnyObj.parent && this.bunnyObj.parent.remove(bunnyObj),
  18563. e.add(this.bunnyObj)
  18564. }
  18565. ,
  18566. t.prototype.createCpm = function(e) {
  18567. if (!this.currentPanoMarker) {
  18568. var t = this.makeWaypointObj(I.pathEnd, "Current");
  18569. t.material.uniforms.opacity.value = 0,
  18570. this.currentPanoMarker = {
  18571. mesh: t,
  18572. placed: !1
  18573. }
  18574. }
  18575. this.currentPanoMarker.mesh.parent && this.currentPanoMarker.mesh.parent.remove(this.currentPanoMarker.mesh),
  18576. this.placeCpm(),
  18577. this.currentPanoMarker.mesh.parent || e.add(this.currentPanoMarker.mesh)
  18578. }
  18579. ,
  18580. t.prototype.placeCpm = function() {
  18581. if (D.path.mapGuides && this.player.currentPano && this.player.currentPano.isAligned()) {
  18582. var e = this.player.currentPano.floor;
  18583. this.currentPanoMarker.mesh.parent !== this.player.currentPano.floor && (this.currentPanoMarker.mesh.parent && this.currentPanoMarker.mesh.parent.remove(this.currentPanoMarker.mesh),
  18584. e.add(this.currentPanoMarker.mesh)),
  18585. this.currentPanoMarker.mesh.position.copy(this.player.currentPano.floorPosition).sub(e.position),
  18586. this.currentPanoMarker.mesh.position.y += this.pathHeight(),
  18587. this.currentPanoMarker.placed = !0
  18588. } else
  18589. this.popOutCpm()
  18590. }
  18591. ,
  18592. t.prototype.fadeInCpm = function(e) {
  18593. 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)
  18594. }
  18595. ,
  18596. t.prototype.fadeOutCpm = function(e) {
  18597. V.start(F.property(this.currentPanoMarker.mesh.material.uniforms.opacity, "value", 0), e)
  18598. }
  18599. ,
  18600. t.prototype.popInCpm = function() {
  18601. D.path.mapGuides && this.currentPanoMarker.placed && this.fadeInCpm(2)
  18602. }
  18603. ,
  18604. t.prototype.popOutCpm = function() {
  18605. this.fadeOutCpm(2)
  18606. }
  18607. ,
  18608. t.prototype.brushPrefs = {
  18609. linewidth: 7,
  18610. strokeWidth: 15,
  18611. cvSegments: 48,
  18612. paveStep: .1,
  18613. paveWidth: .2,
  18614. lookBlendDist: 3,
  18615. maxTurn: P.Math.degToRad(2)
  18616. },
  18617. t.prototype.panoPathDistance = function(e) {
  18618. var t = this.model.panos;
  18619. if (!e || e.length < 2)
  18620. return 0;
  18621. for (var i = [], n = 0; n < e.length; n += 1)
  18622. i.push(t.get(e[n]).floorPosition);
  18623. return this.pointPathDistance(i)
  18624. }
  18625. ,
  18626. t.prototype.loadTileTexture = function(t) {
  18627. var e = n.load(t, function(e) {
  18628. e.wrapS = P.RepeatWrapping,
  18629. e.wrapT = P.RepeatWrapping,
  18630. e.needsUpdate = !0,
  18631. H.debug('path texture "' + t + '" is ready')
  18632. }, function() {
  18633. H.error('path texture "' + t + '" failed')
  18634. });
  18635. return e.mapping = P.UVMapping,
  18636. e
  18637. }
  18638. ,
  18639. t.prototype.buildWarpDestinationDescriptor = function(e, t, i, n, r, o) {
  18640. return new l({
  18641. cameraMode: n,
  18642. position: e,
  18643. quaternion: t,
  18644. panoId: i,
  18645. orthoZoom: o,
  18646. floorVisibility: r,
  18647. thumbUrl: null,
  18648. name: null
  18649. })
  18650. }
  18651. ,
  18652. t.prototype.buildWarpDestinationDescriptorFromHero = function(e) {
  18653. return this.buildWarpDestinationDescriptor(e.position, e.quaternion, this.getHeroId(e), e.cameraMode, e.floorVisibility, e.orthoZoom)
  18654. }
  18655. ,
  18656. t.prototype.setWarpDestination = function(e) {
  18657. this.warpDestHeroLoc = e
  18658. }
  18659. ,
  18660. t.prototype.setWarpDestinationByHeroIndex = function(e) {
  18661. var t = this.getHeroDescriptorByHeroIndex(e);
  18662. return null !== t && (this.setWarpDestination(t),
  18663. !0)
  18664. }
  18665. ,
  18666. t.prototype.setWarpDestinationByPano = function(e, t) {
  18667. return !!this.model.panos.get(e.id) && this.setWarpDestinationByPanoId(e.id, t)
  18668. }
  18669. ,
  18670. t.prototype.setWarpDestinationByPanoId = function(e, t) {
  18671. var i = this.model.panos.get(e);
  18672. if (i) {
  18673. t = t || new P.Quaternion;
  18674. var n = this.buildWarpDestinationDescriptor(i.position, t, i.id, "panorama", [], -1);
  18675. return this.setWarpDestination(n),
  18676. !0
  18677. }
  18678. return !1
  18679. }
  18680. ,
  18681. t.prototype.getHeroDescriptorByHeroIndex = function(e) {
  18682. var t = this.model.heroCount();
  18683. if (null !== this.warpDestHeroLoc && t < 1)
  18684. return H.info("ShowPath.getHeroDescriptorByHeroIndex() -> Only one hero location is available."),
  18685. this.model.getHeroDescriptorByIndex(0);
  18686. var i = this.model.getHeroDescriptorByIndex(e);
  18687. if (i) {
  18688. var n = i.isPano() ? i.panoId : i.cameraMode;
  18689. H.debug('ShowPath.getHeroDescriptorByHeroIndex() -> New brush/warp destination: "' + n + '" out of ' + t + " choices.")
  18690. }
  18691. return i
  18692. }
  18693. ,
  18694. t.prototype.getHeroDescriptorByPano = function(e) {
  18695. return this.model.panos.get(e.id) ? this.getHeroDescriptorByPanoId(e.id) : null
  18696. }
  18697. ,
  18698. t.prototype.getHeroDescriptorByPanoId = function(e) {
  18699. var t = this.getHeroIndexFromPanoId(e);
  18700. return this.getHeroDescriptorByHeroIndex(t)
  18701. }
  18702. ,
  18703. t.prototype.getHeroIndexFromPanoId = function(e) {
  18704. for (var t = 0; t < this.model.heroLocations.length; t++) {
  18705. var i = this.model.heroLocations[t]
  18706. , n = this.getHeroId(i);
  18707. if (n && n === e)
  18708. return t
  18709. }
  18710. return -1
  18711. }
  18712. ,
  18713. t.prototype.getHeroPano = function(e) {
  18714. if (null === e)
  18715. return H.warn("getHeroPano(): no destination"),
  18716. null;
  18717. var t = this.getHeroId(e)
  18718. , i = this.model.panos.get(t);
  18719. return void 0 === i && (i = null,
  18720. "" !== t && H.debug('unable to find pano "' + t + '"')),
  18721. i
  18722. }
  18723. ,
  18724. t.prototype.getHeroId = function(e) {
  18725. return e.panoId
  18726. }
  18727. ,
  18728. t.prototype.setWarpDestPano = function() {
  18729. return this.warpDestPano = this.getHeroPano(this.warpDestHeroLoc),
  18730. this.warpDestPano
  18731. }
  18732. ,
  18733. t.prototype.brushToWarpPano = function(e, t) {
  18734. if (this.discardPathObject(),
  18735. !this.setWarpDestPano())
  18736. return !1;
  18737. if (this.warpDestHeroLoc.cameraMode !== O.PANORAMA && H.warn("Can only brush from pano to pano"),
  18738. !this.warpDestPano)
  18739. return H.info("No brush"),
  18740. !1;
  18741. if (!this.player.currentPano)
  18742. return H.debug("No current pano, visibility undefined"),
  18743. !1;
  18744. if (!this.warpDestPano)
  18745. return H.info("No wPano, visibility undefined"),
  18746. !1;
  18747. if (!this.warpDestPano.isAligned())
  18748. return H.debug("Cannot brush to unaligned pano"),
  18749. !1;
  18750. var i = (e === L.STD || e === L.WALK) && D.path.mapGuides
  18751. , n = !0;
  18752. if (this.player.currentPano.id === this.warpDestPano.id)
  18753. H.debug("Already at destination pano");
  18754. else {
  18755. this.nodes = this.findShortestPath(this.player.currentPano, this.warpDestPano),
  18756. n = void 0 === this.nodes || null === this.nodes || this.nodes.length < 1,
  18757. this.obj3d = new P.Object3D,
  18758. H.debug('Brushing from "' + this.player.currentPano.id + '" to "' + this.warpDestPano.id + '" (' + (this.nodes ? this.nodes.length : 0) + ")"),
  18759. n ? (H.info('No "walkable" route, using fall-back warp style transition'),
  18760. e = t) : (this.setPathHulls(this.nodes),
  18761. this.setFloorCurves(),
  18762. 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)))),
  18763. this.player.currentPano.floor.add(this.obj3d);
  18764. var r = this.player.mode === O.DOLLHOUSE || this.player.mode === O.FLOORPLAN
  18765. , o = e === L.STD;
  18766. if (!n && (i || o)) {
  18767. if (r) {
  18768. var a = this.makeStartMarker(this.floorHull[0], this.floorCurvePoints);
  18769. this.obj3d.add(a)
  18770. }
  18771. var s = this.makeEndMarker(this.floorHull[this.floorHull.length - 1]);
  18772. this.obj3d.add(s)
  18773. }
  18774. this.appearSlow()
  18775. }
  18776. return this.upcomingTransType = e,
  18777. !n
  18778. }
  18779. ,
  18780. t.prototype.findShortestPath = function(e, t) {
  18781. if (!e || !t)
  18782. return null;
  18783. var i = D.warp.walkExtraPanosDistance
  18784. , n = e.id + ":" + t.id + ":" + i;
  18785. if (this.shortPaths.hasOwnProperty(n))
  18786. return this.shortPaths[n] ? this.shortPaths[n].slice() : null;
  18787. var r = t.id + ":" + e.id + ":" + i;
  18788. if (this.shortPaths.hasOwnProperty(r))
  18789. return this.shortPaths[r] ? this.shortPaths[r].slice().reverse() : null;
  18790. var o = this.model.panos.aStarSearch(e, t);
  18791. return this.model.panos.includeNodesNearPath(o, i),
  18792. this.shortPaths[n] = o ? o.slice() : null,
  18793. o
  18794. }
  18795. ,
  18796. t.prototype.makePathHulls = function(e) {
  18797. var t, i, n, r, o, a = 0, s = [], l = [], c = [], h = this.model.panos;
  18798. r = (t = h.get(e[0])).floor.floorIndex;
  18799. for (var u = 0; u < e.length; u += 1)
  18800. (i = (t = h.get(e[u])).floorPosition.clone().sub(this.model.position)).y += this.pathHeight(),
  18801. s.push(i),
  18802. l.push(t.position.clone()),
  18803. n = t.floor.floorIndex,
  18804. c.push(r < n ? D.path.colorUp : n < r ? D.path.colorDown : D.path.color),
  18805. 0 < u && (a < (o = l[u].distanceTo(l[u - 1])) && (a = o));
  18806. return a > this.longestStep && (this.longestStep = a,
  18807. H.debug("path contains " + a + " meter segment")),
  18808. {
  18809. floor: s,
  18810. camera: l,
  18811. color: c
  18812. }
  18813. }
  18814. ,
  18815. t.prototype.makeFloorCurves = function(e, t, i) {
  18816. var n = this.player.mode === O.PANORAMA ? D.path.waypointIndoorRadius : D.path.waypointRadius
  18817. , r = this.pointPathDistance(e) - 2 * n
  18818. , o = e.slice(0)
  18819. , a = o[1].clone().sub(o[0]);
  18820. a.y = 0,
  18821. a.normalize().multiplyScalar(n),
  18822. o[0] = (new P.Vector3).copy(o[0]).add(a),
  18823. (a = o[o.length - 2].clone().sub(o[o.length - 1])).y = 0,
  18824. a.normalize().multiplyScalar(n),
  18825. o[o.length - 1] = (new P.Vector3).copy(o[o.length - 1]).add(a);
  18826. var s = new P.CatmullRomCurve3(o)
  18827. , l = Math.floor(r / i);
  18828. l = 4 * Math.floor(l / 4),
  18829. l = Math.max(4, l);
  18830. for (var c, h, u = s.getSpacedPoints(l), d = [], p = new P.Vector3, f = 0; f < u.length; f += 1) {
  18831. h = 0,
  18832. c = u[f].distanceTo(e[0]);
  18833. for (var g = 1; g < e.length; g += 1)
  18834. p.copy(u[f]).sub(e[g]),
  18835. p.y *= 4,
  18836. p.length() < c && (h = g);
  18837. d.push(t[h])
  18838. }
  18839. return {
  18840. distance: r,
  18841. points: u,
  18842. colors: d
  18843. }
  18844. }
  18845. ,
  18846. t.prototype.makeCameraCurvePoints = function(e, t) {
  18847. var i = this.pointPathDistance(e);
  18848. return new P.CatmullRomCurve3(e).getSpacedPoints(Math.max(2, Math.floor(i / t)))
  18849. }
  18850. ,
  18851. t.prototype.makeCameraCurveTangents = function(e, t) {
  18852. var i = this.pointPathDistance(e)
  18853. , n = new P.CatmullRomCurve3(e)
  18854. , r = Math.max(2, Math.floor(i / t));
  18855. r = r || 5;
  18856. for (var o = [], a = 0; a <= r; a++)
  18857. o.push(n.getTangentAt(a / r));
  18858. return o
  18859. }
  18860. ,
  18861. t.prototype.setPathHulls = function(e) {
  18862. var t = this.makePathHulls(e);
  18863. this.floorHull = t.floor,
  18864. this.cameraHull = t.camera,
  18865. this.colorHull = t.color
  18866. }
  18867. ,
  18868. t.prototype.setFloorCurves = function() {
  18869. var e = this.makeFloorCurves(this.floorHull, this.colorHull, this.brushPrefs.paveStep);
  18870. this.floorPathDistance = e.distance,
  18871. this.floorCurvePoints = e.points,
  18872. this.floorCurveColors = e.colors
  18873. }
  18874. ,
  18875. t.prototype.setCameraCurvePoints = function() {
  18876. this.camCurvePoints = this.makeCameraCurvePoints(this.cameraHull, D.warp.stepFactor * this.brushPrefs.paveStep)
  18877. }
  18878. ,
  18879. t.prototype.chooseWarpPath = function(e) {
  18880. var t, i, n, r = this.playerControls.cameras[O.PANORAMA];
  18881. if (this.player.currentPano === this.warpDestPano || !e)
  18882. return this.warpPathPoints = null,
  18883. this.warpLength = 0,
  18884. !1;
  18885. this.nodes = this.findShortestPath(this.player.currentPano, this.warpDestPano),
  18886. void 0 === this.nodes || null === this.nodes || this.nodes.length < 1 ? (H.debug("warp path to unreachable node"),
  18887. i = (t = this.warpDestPano.position.clone().sub(r.position)).clone().negate(),
  18888. t.multiplyScalar(.15).add(r.position),
  18889. i.multiplyScalar(.15).add(this.warpDestPano.position),
  18890. t.y = r.position.y,
  18891. i.y = this.warpDestPano.position.y,
  18892. n = new P.CubicBezierCurve3(r.position.clone(),t,i,this.warpDestPano.position.clone()),
  18893. this.warpPathPoints = n.getSpacedPoints(this.brushPrefs.cvSegments)) : (H.debug("follow warp path (path distance was " + this.nodes.length + " nodes, " + this.floorPathDistance + ")"),
  18894. this.setCameraCurvePoints(),
  18895. this.warpPathPoints = this.camCurvePoints.slice(0)),
  18896. this.warpLength = 0,
  18897. this.warpPathLengths = [0];
  18898. 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) {
  18899. o.copy(this.warpPathPoints[c - 1]).sub(this.warpPathPoints[c]);
  18900. var h = o.length();
  18901. o.y *= D.warp.climbEffort;
  18902. var u = o.length() / h;
  18903. if (1 < c) {
  18904. o.setY(0).normalize(),
  18905. a.copy(this.warpPathPoints[c - 2]).sub(this.warpPathPoints[c - 1]).setY(0).normalize();
  18906. var d = Math.min(1, o.dot(a))
  18907. , p = 1 + (D.warp.brakeStrength - 1) * (1 - P.Math.smoothstep(d, l, s));
  18908. u = Math.max(p, u)
  18909. }
  18910. this.warpLength += h * u,
  18911. this.warpPathLengths[c] = this.warpLength
  18912. }
  18913. return !0
  18914. }
  18915. ,
  18916. t.prototype.drawPathRibbon = function(e, t) {
  18917. this.bunnyObj.visible = D.warp.showBunny;
  18918. 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) {
  18919. a.copy(e[s]),
  18920. 0 === s ? a.sub(e[s + 1]) : a.sub(e[s - 1]).negate(),
  18921. a.normalize(),
  18922. n.crossVectors(a, U.UP),
  18923. n.multiplyScalar(i);
  18924. var l = (new P.Vector3).copy(e[s]).add(r);
  18925. l.sub(n),
  18926. o.vertices.push(l),
  18927. (l = (new P.Vector3).copy(e[s]).add(r)).add(n),
  18928. o.vertices.push(l)
  18929. }
  18930. var c, h, u, d = 0;
  18931. for (s = 0; s < e.length - 1; s += 1) {
  18932. var p = 2 * s
  18933. , f = d
  18934. , g = d += e[s + 1].distanceTo(e[s])
  18935. , m = t[s]
  18936. , v = t[s + 1];
  18937. (c = new P.Face3(p,1 + p,2 + p)).vertexColors = [new P.Color(m), new P.Color(m), new P.Color(v)],
  18938. o.faces.push(c),
  18939. o.faceVertexUvs[0].push([new P.Vector2(0,f), new P.Vector2(1,f), new P.Vector2(0,g)]),
  18940. (c = new P.Face3(2 + p,1 + p,3 + p)).vertexColors = [new P.Color(v), new P.Color(m), new P.Color(v)],
  18941. o.faces.push(c),
  18942. o.faceVertexUvs[0].push([new P.Vector2(0,g), new P.Vector2(1,f), new P.Vector2(1,g)])
  18943. }
  18944. o.computeFaceNormals(),
  18945. o.computeVertexNormals(),
  18946. h = this.player.mode === O.PANORAMA ? ((u = P.UniformsUtils.clone(C.ribbon.uniforms)).map.value = I.path,
  18947. u.opacity.value = 0,
  18948. u.color.value.set(D.path.color),
  18949. new P.RawShaderMaterial({
  18950. side: P.DoubleSide,
  18951. depthWrite: !1,
  18952. transparent: !0,
  18953. vertexShader: C.ribbon.vertexShader,
  18954. fragmentShader: C.ribbon.fragmentShader,
  18955. uniforms: u,
  18956. name: "ribbonT",
  18957. opacity: 0
  18958. })) : new P.MeshBasicMaterial({
  18959. color: 16777215,
  18960. side: P.DoubleSide,
  18961. name: "ribbonOut",
  18962. vertexColors: P.VertexColors
  18963. });
  18964. var y = new P.Mesh(o,h);
  18965. return y.name = "ribbon",
  18966. this.player.mode === O.PANORAMA && (y.renderOrder = A.ribbon),
  18967. y
  18968. }
  18969. ,
  18970. t.prototype.drawPathPavement = function(e) {
  18971. for (var t, i = new P.Vector3, n = new P.Geometry, r = new P.Vector3, o = 0; o < e.length; o += 1)
  18972. r.copy(e[o]),
  18973. 0 === o ? r.sub(e[o + 1]).negate() : r.sub(e[o - 1]),
  18974. r.normalize(),
  18975. i.crossVectors(r, U.UP),
  18976. i.multiplyScalar(this.brushPrefs.paveWidth),
  18977. (t = (new P.Vector3).copy(e[o])).sub(i),
  18978. n.vertices.push(t),
  18979. n.vertices.push((new P.Vector3).copy(e[o])),
  18980. (t = (new P.Vector3).copy(e[o])).add(i),
  18981. n.vertices.push(t);
  18982. var a, s, l;
  18983. for (o = 0; o < e.length - 1; o += 1)
  18984. a = 3 * o + 1,
  18985. l = .25 + (s = .25 * o),
  18986. n.faces.push(new P.Face3(a - 1,a,3 + a)),
  18987. n.faceVertexUvs[0].push([new P.Vector2(0,s), new P.Vector2(.5,s), new P.Vector2(.5,l)]),
  18988. n.faces.push(new P.Face3(3 + a,2 + a,a - 1)),
  18989. n.faceVertexUvs[0].push([new P.Vector2(.5,l), new P.Vector2(0,l), new P.Vector2(0,s)]),
  18990. n.faces.push(new P.Face3(3 + a,a,1 + a)),
  18991. n.faceVertexUvs[0].push([new P.Vector2(.5,l), new P.Vector2(.5,s), new P.Vector2(1,s)]),
  18992. n.faces.push(new P.Face3(3 + a,1 + a,4 + a)),
  18993. n.faceVertexUvs[0].push([new P.Vector2(.5,l), new P.Vector2(1,s), new P.Vector2(1,l)]);
  18994. var c = this.player.mode === O.PANORAMA ? new P.MeshBasicMaterial({
  18995. color: D.path.color,
  18996. side: P.DoubleSide,
  18997. transparent: !0,
  18998. depthWrite: !1,
  18999. opacity: 0,
  19000. name: "paveT",
  19001. map: I.path
  19002. }) : new P.MeshBasicMaterial({
  19003. color: D.path.color,
  19004. side: P.DoubleSide,
  19005. transparent: !0,
  19006. depthWrite: !1,
  19007. opacity: 1,
  19008. name: "paveO",
  19009. map: I.path
  19010. });
  19011. return new P.Mesh(n,c)
  19012. }
  19013. ,
  19014. t.prototype.hintPrefs = {
  19015. rad: .18,
  19016. width: .0125,
  19017. depth: .0625,
  19018. setBack: -.04,
  19019. markRad: .25,
  19020. markInnerRad: .16
  19021. },
  19022. t.prototype.makeWaypointObj = function(e, t) {
  19023. var i = new P.Geometry
  19024. , n = this.player.mode === O.PANORAMA ? D.path.waypointIndoorRadius : D.path.waypointRadius
  19025. , r = this.pathHeight();
  19026. 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)),
  19027. i.faces.push(new P.Face3(0,1,2), new P.Face3(2,3,0)),
  19028. i.faceVertexUvs[0].push([new P.Vector2(0,0), new P.Vector2(1,0), new P.Vector2(1,1)]),
  19029. i.faceVertexUvs[0].push([new P.Vector2(1,1), new P.Vector2(0,1), new P.Vector2(0,0)]);
  19030. var o = P.UniformsUtils.clone(C.waypoint.uniforms);
  19031. o.map.value = e,
  19032. o.opacity.value = 0,
  19033. o.color.value.set(D.path.color);
  19034. var a = {
  19035. side: P.DoubleSide,
  19036. depthWrite: !1,
  19037. transparent: !0,
  19038. vertexShader: C.waypoint.vertexShader,
  19039. fragmentShader: C.waypoint.fragmentShader,
  19040. uniforms: o,
  19041. name: "waypoint",
  19042. opacity: 0
  19043. };
  19044. this.player.mode !== O.PANORAMA && (a.depthTest = !1,
  19045. a.name = "wayPtOut");
  19046. var s = new P.RawShaderMaterial(a)
  19047. , l = new P.Mesh(i,s);
  19048. return l.name = t,
  19049. l
  19050. }
  19051. ,
  19052. t.prototype.makeStartMarker = function(e, t) {
  19053. var i = (new P.Vector3).copy(t[1]).sub(t[0]);
  19054. i.y = 0,
  19055. i.normalize();
  19056. var n = Math.acos(i.x)
  19057. , r = this.makeWaypointObj(I.pathStart, "Start");
  19058. return r.rotateOnAxis(new P.Vector3(0,1,0), n),
  19059. r.position.copy(e),
  19060. r
  19061. }
  19062. ,
  19063. t.prototype.makeEndMarker = function(e) {
  19064. var t = this.makeWaypointObj(I.pathEnd, "End")
  19065. , i = this.model.panos.get(this.nodes[0]).floor.floorIndex
  19066. , n = this.model.panos.get(this.nodes[this.nodes.length - 1]).floor.floorIndex;
  19067. return i < n ? t.material.uniforms.color.value.set(D.path.colorUp) : n < i && t.material.uniforms.color.value.set(D.path.colorDown),
  19068. t.position.copy(e),
  19069. t
  19070. }
  19071. ,
  19072. t.prototype.pathClean = function(e) {
  19073. if (e) {
  19074. for (var t in e.children)
  19075. this.pathClean(e.children[t]);
  19076. e.geometry && e.geometry.dispose(),
  19077. e.material && e.material.dispose()
  19078. }
  19079. }
  19080. ,
  19081. t.prototype.discardPathObject = function() {
  19082. if (this.obj3d) {
  19083. var e = this.obj3d.parent;
  19084. e && e.remove(this.obj3d),
  19085. this.pathClean(this.obj3d)
  19086. }
  19087. this.obj3d = null,
  19088. this.popInCpm()
  19089. }
  19090. ,
  19091. t.prototype.discardSlow = function() {
  19092. if (this.obj3d) {
  19093. if (this.player.mode !== O.PANORAMA)
  19094. return void this.discardPathObject();
  19095. for (var e, t = 0, i = function() {
  19096. this.discardPathObject()
  19097. }
  19098. .bind(this), n = 0; n < this.obj3d.children.length; n += 1)
  19099. 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]),
  19100. t += 1,
  19101. i = null);
  19102. 0 === t && this.discardPathObject(),
  19103. this.player.mode !== O.PANORAMA && this.fadeInCpm(D.path.fadeInTime - 3)
  19104. }
  19105. }
  19106. ,
  19107. t.prototype.appearSlow = function() {
  19108. var e;
  19109. this.fadeOutCpm(D.path.fadeInTime);
  19110. for (var t = this.player.mode === O.PANORAMA ? D.path.opacity : 1, i = 0; i < this.obj3d.children.length; i += 1)
  19111. 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]))
  19112. }
  19113. ,
  19114. t.prototype.update = function() {
  19115. this.obj3d && this.obj3d.updateMatrixWorld()
  19116. }
  19117. ,
  19118. t.prototype.calcBurnsAmount = function(e) {
  19119. var n = P.Math.degToRad(D.warp.burnsAngle);
  19120. if (this.player.mode !== O.PANORAMA)
  19121. return this.player.mode === O.DOLLHOUSE ? .02 * this.burnsDir : this.burnsDir;
  19122. var t = this.burnsDir * n;
  19123. if (this.upcomingTransType === L.BLACK)
  19124. return t;
  19125. var i = e;
  19126. if (null === i)
  19127. return H.warn("Transition request for non-highlight"),
  19128. t;
  19129. var r = this.getHeroDescriptorByHeroIndex(i);
  19130. if (null === r)
  19131. return t;
  19132. if (!r.isPano())
  19133. return t;
  19134. function o(e) {
  19135. var t = Math.acos(Math.min(1, e.dot(l)))
  19136. , i = (new P.Vector3).crossVectors(l, e);
  19137. return Math.max(c, Math.min(Math.abs(t), n)) * Math.sign(i.y)
  19138. }
  19139. var a = this.getHeroPano(r)
  19140. , s = this.playerControls.cameras[O.PANORAMA]
  19141. , l = U.FORWARD.clone().applyQuaternion(s.quaternion).setY(0).normalize()
  19142. , c = Math.min(P.Math.degToRad(D.warp.minBurnsAngle), n);
  19143. if (a === this.player.currentPano)
  19144. return o(U.FORWARD.clone().applyQuaternion(r.quaternion).setY(0).normalize());
  19145. var h = this.findShortestPath(this.player.currentPano, a);
  19146. if (null == h || h.length < 1)
  19147. return H.debug("Empty path ahead..."),
  19148. t;
  19149. var u = this.makePathHulls(h)
  19150. , d = new P.CatmullRomCurve3(u.camera)
  19151. , p = Math.min(.1, D.warp.lookAheadDist / d.getLength());
  19152. return o(d.getPointAt(p).clone().sub(s.position).setY(0).normalize())
  19153. }
  19154. ,
  19155. t.prototype.waitNextStep = function(e, t, i) {
  19156. var o = null == i ? D.warp.tourStepDelay : i;
  19157. o = o != void 0? o: (this.lastTransType === L.BLACK ? m.tourStepDelaySlideShow : m.tourStepDelayDefault);
  19158. var a = new P.Euler
  19159. , s = new P.Vector3;
  19160. H.debug("Starting wait: " + (void 0 !== t));
  19161. var currentLocation = this.model.getHeroDescriptorByIndex(this.director.currentItem)//this.model.heroLocations[this.director.currentItem[0]]
  19162. var l = currentLocation.dontRot || this.calcBurnsAmount(e)
  19163. , c = function() {
  19164. this.endWarpState(),
  19165. this.player.mode === O.DOLLHOUSE && (this.playerControls.cameras[O.DOLLHOUSE].controls.rotationAcceleration.x = 0),
  19166. t && t()
  19167. }
  19168. .bind(this)
  19169. , n = function(e, t) {
  19170. if (this.warpInterrupted)
  19171. return c(),
  19172. !0;
  19173. var i = t || 1e3 / 60;
  19174. if (D.warp.doBurns && !currentLocation.dontRot )
  19175. if (this.player.mode === O.PANORAMA) {
  19176. var n = this.playerControls.cameras[O.PANORAMA];
  19177. a.setFromQuaternion(n.quaternion, D.warp.eOrder);
  19178. var r = o == 0 ? l : i * l / o;
  19179. r = Math.sign(r) * Math.max(r, 0.0001) //add 如果音频长的话,使旋转可见,否则以为停住了
  19180. a.y += r,
  19181. s.set(0, 0, -1),
  19182. s.applyEuler(a),
  19183. s.add(n.position),
  19184. n.controls.lookAt(s),
  19185. n.controls.lookVector.copy(s),
  19186. n.lookAt(s)
  19187. } else
  19188. this.player.mode === O.DOLLHOUSE ? this.playerControls.controls[O.DOLLHOUSE].rotationAcceleration.x = l : this.playerControls.controls[O.FLOORPLAN].absoluteScale *= .9996
  19189. }
  19190. .bind(this);
  19191. this.startWarpState(),
  19192. V.start(n, o, c, 0, B.easeInOutQuad, "wait");
  19193. }
  19194. ,
  19195. t.prototype.warpToNonPano = function(e) {
  19196. if (this.discardPathObject(),
  19197. this.warpDestHeroLoc.cameraMode === O.DOLLHOUSE || this.warpDestHeroLoc.cameraMode === O.FLOORPLAN) {
  19198. var t = function() {
  19199. e && e()
  19200. }
  19201. .bind(this);
  19202. this.player.flyToNewMode({
  19203. mode: this.warpDestHeroLoc.cameraMode,
  19204. duration: D.warp.outsideTime,
  19205. warpDest: this.warpDestHeroLoc,
  19206. callback: t,
  19207. force: !0
  19208. })
  19209. } else
  19210. H.warn("no warp destination!!!"),
  19211. e && e()
  19212. }
  19213. ,
  19214. t.prototype._resetWarpShaderParams = function(e) {
  19215. this.player.mode === O.PANORAMA && (void 0 !== e.material.uniforms.blackout && (e.material.uniforms.blackout.value = 0),
  19216. void 0 !== e.material.uniforms.modelAlpha && (e.material.uniforms.modelAlpha.value = 0))
  19217. }
  19218. ,
  19219. t.prototype._clearWarpShading = function() {
  19220. for (var e = this.model.chunks, t = 0; t < e.length; t += 1)
  19221. this._resetWarpShaderParams(e[t]),
  19222. e[t].visible = !0;
  19223. this._resetWarpShaderParams(this.model.skybox)
  19224. }
  19225. ,
  19226. t.prototype._warpStopFlying = function() {
  19227. this.activeTransType = null,
  19228. this.placeCpm()
  19229. }
  19230. ,
  19231. t.prototype._wrapupTravelOnlyBits = function() {
  19232. this._warpStopFlying(),
  19233. this.warpPathPoints && (this.player.currentPano.exit(),
  19234. this.warpDestPano.enter(),
  19235. this.player.currentPano = this.warpDestPano),
  19236. this.player.spider.draw(),
  19237. this.placeCpm()
  19238. }
  19239. ,
  19240. t.prototype._wrapupTravel = function(e) {
  19241. this._wrapupTravelOnlyBits(),
  19242. this.warpCameraAim(e)
  19243. }
  19244. ,
  19245. t.prototype._wrapupWarpShading = function(e) {
  19246. this._clearWarpShading(),
  19247. this._wrapupTravel(e)
  19248. }
  19249. ,
  19250. t.prototype.wrapupWarpShadingOnly = function(e, t) {
  19251. t !== z.END && this._clearWarpShading(),
  19252. this._wrapupTravelOnlyBits(),
  19253. this.upcomingTransType = null,
  19254. e && e()
  19255. }
  19256. ,
  19257. t.prototype._warpCameraAim = function(e, t) {
  19258. var i = this.warpDestHeroLoc.quaternion
  19259. , n = this.playerControls.cameras[O.PANORAMA]
  19260. , r = new P.Vector3(0,0,1).applyQuaternion(i).normalize()
  19261. , o = new P.Vector3(0,0,1).applyQuaternion(n.quaternion).normalize().dot(r)
  19262. , a = P.Math.radToDeg(Math.acos(o))
  19263. , s = new P.Euler(0,0,0,D.warp.eOrder).setFromQuaternion(i, D.warp.eOrder)
  19264. , l = (new P.Euler).setFromQuaternion(n.quaternion, D.warp.eOrder)
  19265. , c = new P.Euler(s.x - l.x,s.y - l.y,s.z - l.z,D.warp.eOrder);
  19266. c.y = N.constrainedTurn(c.y),
  19267. this.burnsDir = Math.sign(c.y);
  19268. var h = new P.Euler(0,0,0,D.warp.eOrder)
  19269. , u = new P.Vector3
  19270. , d = function(e, t) {
  19271. return !!this.warpInterrupted || (h.x = l.x + e * c.x,
  19272. h.y = l.y + e * c.y,
  19273. h.z = l.z + e * c.z,
  19274. u.set(0, 0, -1),
  19275. u.applyEuler(h),
  19276. u.add(n.position),
  19277. n.controls.lookAt(u),
  19278. n.controls.lookVector.copy(u),
  19279. void n.lookAt(u))
  19280. }
  19281. .bind(this);
  19282. /* return a > D.warp.minRotation ? (V.start(d, e, t, 0, B[D.warp.movementEasing])
  19283. , (this.warpDestHeroLoc.zoom != this.player.zoomLevel) && //add 原地转向最终方位时
  19284. this.player.smoothZoomFovTo(null, this.warpDestHeroLoc.zoom , e)
  19285. )
  19286. : (H.info("Aim angle only is " + a.toPrecision(3) + " degrees, skipping explicit re-aim"),
  19287. void (t && t())) */
  19288. (this.warpDestHeroLoc.zoom != this.player.zoomLevel) && //add 原地转向最终方位时
  19289. this.player.smoothZoomFovTo(null, this.warpDestHeroLoc.zoom , e)
  19290. return a > D.warp.minRotation ? V.start(d, e, t, 0, B[D.warp.movementEasing])
  19291. : (/* H.info("Aim angle only is " + a.toPrecision(3) + " degrees, skipping explicit re-aim") ,*/
  19292. void (t && t()))
  19293. }
  19294. ,
  19295. t.prototype._warpBendAim = function(e, t, i, n) {
  19296. var r = n || 0
  19297. , o = this.playerControls.cameras[O.PANORAMA]
  19298. , a = new P.Euler(0,0,0,D.warp.eOrder).setFromQuaternion(this.warpDestHeroLoc.quaternion, D.warp.eOrder)
  19299. , s = (new P.Euler).setFromQuaternion(o.quaternion, D.warp.eOrder)
  19300. , l = new P.Euler(a.x - s.x,a.y - s.y,a.z - s.z,D.warp.eOrder);
  19301. l.y = N.constrainedTurn(l.y);
  19302. var c = Math.min(P.Math.degToRad(D.warp.softBendTilt), Math.abs(l.x));
  19303. l.x = c * Math.sign(l.x),
  19304. c = Math.min(P.Math.degToRad(Math.max(0, D.warp.softBendAngle)), c),
  19305. this.burnsDir = Math.sign(l.y),
  19306. c *= Math.sign(l.y),
  19307. l.y = c;
  19308. var h = new P.Euler(0,0,0,D.warp.eOrder)
  19309. , u = new P.Vector3
  19310. , d = function(e, t) {
  19311. if (e < .5)
  19312. h.x = s.x + e * l.x,
  19313. h.y = s.y + e * l.y,
  19314. h.z = s.z + e * l.z;
  19315. else {
  19316. var i = (1 - e) * D.warp.softBendEnd;
  19317. h.x = a.x - i * l.x,
  19318. h.y = a.y - i * l.y,
  19319. h.z = a.z - i * l.z
  19320. }
  19321. u.set(0, 0, -1),
  19322. u.applyEuler(h),
  19323. u.add(o.position),
  19324. o.controls.lookAt(u),
  19325. o.controls.lookVector.copy(u),
  19326. o.lookAt(u)
  19327. }
  19328. .bind(this);
  19329. if(window.DATA.momentTourBlackNewType){
  19330. d(1)
  19331. }else return V.start(d, t, i, r, B[D.warp.movementEasing])
  19332. }
  19333. ,
  19334. t.prototype._warpStepCameraAim = function(e, t, i) {
  19335. var n = this.playerControls.cameras[O.PANORAMA]
  19336. , r = new P.Euler(0,0,0,D.warp.eOrder).setFromQuaternion(this.warpDestHeroLoc.quaternion, D.warp.eOrder)
  19337. , o = (new P.Euler).setFromQuaternion(n.quaternion, D.warp.eOrder)
  19338. , a = new P.Euler(r.x - o.x,r.y - o.y,r.z - o.z,D.warp.eOrder);
  19339. a.y = N.constrainedTurn(a.y),
  19340. this.burnsDir = Math.sign(a.y);
  19341. var s = new P.Euler(0,0,0,D.warp.eOrder)
  19342. , l = new P.Vector3
  19343. , c = function(e, t) {
  19344. e < .5 ? s.copy(o) : s.copy(r),
  19345. l.set(0, 0, -1),
  19346. l.applyEuler(s),
  19347. l.add(n.position),
  19348. n.controls.lookAt(l),
  19349. n.controls.lookVector.copy(l),
  19350. n.lookAt(l)
  19351. }
  19352. .bind(this);
  19353. return V.start(c, t, i, 0, B[D.warp.movementEasing])
  19354. }
  19355. ,
  19356. t.prototype.setBurnsDir = function() {
  19357. var e = this.playerControls.cameras[O.PANORAMA]
  19358. , t = new P.Euler(0,0,0,D.warp.eOrder).setFromQuaternion(this.warpDestHeroLoc.quaternion, D.warp.eOrder)
  19359. , i = (new P.Euler).setFromQuaternion(e.quaternion, D.warp.eOrder)
  19360. , n = new P.Euler(t.x - i.x,t.y - i.y,t.z - i.z,D.warp.eOrder);
  19361. n.y = N.constrainedTurn(n.y),
  19362. this.burnsDir = Math.sign(n.y)
  19363. }
  19364. ,
  19365. t.prototype.stepWarpPath = function(firstPos, e ) {
  19366. var i = this.playerControls.cameras[O.PANORAMA];
  19367. var n = this.warpPathPoints ? this.warpPathPoints[0] : firstPos
  19368. if (!n){
  19369. return i.position.copy(this.warpDestPano.position),
  19370. !0;
  19371. }
  19372. /* if (!this.warpPathPoints)
  19373. return i.position.copy(this.warpDestPano.position),
  19374. !0;
  19375. var n = this.warpPathPoints[0] */
  19376. var r = this.warpDestPano.position;
  19377. if (null !== this.nodes && this.cameraHull && this.cameraHull.length > 1) {
  19378. var o = new P.Vector3;
  19379. 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),
  19380. i.position.copy(o)
  19381. } else
  19382. e < .5 ? i.position.copy(n) : i.position.copy(r)
  19383. }
  19384. ,
  19385. t.prototype.interruptAndFastForward = function(e, t) {
  19386. this.warping && (this.warpInterrupted = !0,
  19387. this.warpInterruptionBlackoutStyle = e,
  19388. this.warpInterruptionTravelTime = t,
  19389. null !== this.warpInterruptionBlackoutStyle && void 0 !== this.warpInterruptionBlackoutStyle || (this.warpInterruptionBlackoutStyle = z.MIDDLE),
  19390. null !== this.warpInterruptionTravelTime && void 0 !== this.warpInterruptionTravelTime || (this.warpInterruptionTravelTime = D.minWarpTime))
  19391. }
  19392. ,
  19393. t.prototype.warpCameraAim = function(e) {
  19394. var t = D.warp.minWarpTime;
  19395. if (this.upcomingTransType === L.BLACK)
  19396. t = D.warp.teleportTime;
  19397. else {
  19398. var i = this.playerControls.cameras[O.PANORAMA]
  19399. , n = new P.Euler(0,0,0,D.warp.eOrder).setFromQuaternion(this.warpDestHeroLoc.quaternion, D.warp.eOrder)
  19400. , r = (new P.Euler).setFromQuaternion(i.quaternion, D.warp.eOrder)
  19401. , o = new P.Euler(n.x - r.x,n.y - r.y,n.z - r.z,D.warp.eOrder);
  19402. o.y = N.constrainedTurn(o.y);
  19403. var a = 1e3 * Math.abs(o.y) / P.Math.degToRad(D.warp.maxAimPerSec);
  19404. t = Math.max(t, a)
  19405. }
  19406. var s = function() {
  19407. this._warpStopFlying(),
  19408. this.discardSlow(),
  19409. e && e()
  19410. }
  19411. .bind(this);
  19412. this._warpCameraAim(t, s)
  19413. }
  19414. ,
  19415. t.prototype.warpCommonParameters = function(e, t, i, n) {
  19416. this.model.skybox.material.uniforms.blackout.value = n;
  19417. var r = F.uniform(this.model.skybox, "progress", 1)
  19418. , o = F.allUniforms(this.model.chunks, "progress", 1)
  19419. , a = !1
  19420. , s = function() {
  19421. if (this.warpInterrupted)
  19422. return a = !0
  19423. }
  19424. .bind(this)
  19425. , l = function(e, t) {
  19426. return i && a ? !(this.model.skybox.material.uniforms.progress.value = 0) : void r(e, t)
  19427. }
  19428. .bind(this)
  19429. , c = function(e, t) {
  19430. return i && a ? (o(0),
  19431. !0) : void o(e, t)
  19432. }
  19433. .bind(this);
  19434. V.start(s, e, null, t, null, "safeHaltWatch"),
  19435. V.start(l, e, null, t, B[D.warp.blendEasing], "skyboxProgress"),
  19436. V.start(c, e, null, t, B[D.warp.blendEasing], "chunkProgress")
  19437. }
  19438. ,
  19439. t.prototype.warpTravel_STD = function(e) {
  19440. 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),
  19441. 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;
  19442. t += this.warpLength * D.warp.timePerMeter,
  19443. .01 < D.warp.flySpeed && (t = 1e3 * this.warpLength / D.warp.flySpeed);
  19444. function n(e) {
  19445. var t = i;
  19446. return P.Math.smoothstep(e, 0, t) * (1 - P.Math.smoothstep(e, 1 - t, 1))
  19447. }
  19448. var y = !1
  19449. , r = this.warpDestHeroLoc.quaternion
  19450. , o = new P.Vector3(0,0,-1).applyQuaternion(r).normalize()
  19451. , A = this.warpPathPoints[this.warpPathPoints.length - 1].clone().sub(this.warpPathPoints[this.warpPathPoints.length - 2]).normalize()
  19452. , a = A.dot(o)
  19453. , C = P.Math.radToDeg(Math.acos(a))
  19454. , s = function() {
  19455. return m.lookAt(g, l, U.UP),
  19456. u.setFromRotationMatrix(m, D.warp.eOrder),
  19457. p.setFromQuaternion(h.quaternion, D.warp.eOrder),
  19458. v.set(u.x - p.x, u.y - p.y, u.z - p.z, D.warp.eOrder),
  19459. N.constrainedTurn(v.y)
  19460. }
  19461. .bind(this)
  19462. , I = function(e, t) {
  19463. if (this.warpInterrupted)
  19464. return y = !0
  19465. }
  19466. .bind(this)
  19467. , E = function(e, t) {
  19468. return y || !this.warpPathPoints ? (k.blur(0),
  19469. !0) : void k.blur(e)
  19470. }
  19471. .bind(this)
  19472. , _ = F.allUniforms(this.model.chunks, "modelAlpha", 1)
  19473. , b = function(e, t) {
  19474. return y || !this.warpPathPoints ? (_(0),
  19475. !0) : void _(e, t)
  19476. }
  19477. .bind(this)
  19478. , w = function(e, t) {
  19479. if (!this.warpPathPoints)
  19480. return h.position.copy(this.warpDestPano.position),
  19481. !0;
  19482. if (y)
  19483. return !0;
  19484. var i = this.interpAlongPath(this.warpPathPoints, this.warpPathLengths, e);
  19485. h.position.copy(i),
  19486. g = this.interpAlongPath(this.warpPathPoints, this.warpPathLengths, .99 * e)
  19487. }
  19488. .bind(this)
  19489. , T = function(e, t) {
  19490. return this.warpPathPoints ? !!y || void (l = this.interpAlongPath(this.warpPathPoints, this.warpPathLengths, Math.min(e + c, 1))) : (H.debug("Lost bunny."),
  19491. !0)
  19492. }
  19493. .bind(this)
  19494. , x = function(e, t) {
  19495. if (y)
  19496. return H.debug(">>>> Walkthrough interupted at t=" + e),
  19497. !0;
  19498. if (!this.warpPathPoints)
  19499. return !0;
  19500. var i = this.warpLength * e
  19501. , n = P.Math.smoothstep(i, 0, this.brushPrefs.lookBlendDist)
  19502. , r = P.Math.smoothstep(i, this.warpLength - this.brushPrefs.lookBlendDist, this.warpLength);
  19503. D.warp.matchCam && (n *= 1 - r),
  19504. m.lookAt(g, l, U.UP),
  19505. u.setFromRotationMatrix(m, D.warp.eOrder),
  19506. p.setFromQuaternion(h.quaternion, D.warp.eOrder),
  19507. v.set(u.x - p.x, u.y - p.y, u.z - p.z, D.warp.eOrder),
  19508. v.y = N.constrainedTurn(v.y),
  19509. u.x = p.x + n * v.x,
  19510. u.y = p.y + n * v.y,
  19511. u.z = p.z + n * v.z,
  19512. v.set(u.x - f.x, u.y - f.y, u.z - f.z, D.warp.eOrder),
  19513. v.y = N.constrainedTurn(v.y);
  19514. var o = P.Math.degToRad(D.warp.maxTurnPerSec) * t / 1e3;
  19515. v.y = Math.sign(v.y) * Math.min(o, Math.abs(v.y)),
  19516. f.x = f.x + v.x * D.warp.turnFriction,
  19517. f.y = f.y + v.y * D.warp.turnFriction,
  19518. f.z = f.z + v.z * D.warp.turnFriction,
  19519. f.x = Math.max(P.Math.degToRad(D.warp.minDownAngle), f.x);
  19520. var a = l.clone().sub(g).normalize();
  19521. if (C < D.warp.maxAimRotation && 0 < r) {
  19522. var s = 1 - r;
  19523. a.x = a.x * s + r * A.x,
  19524. a.y = a.y * s + r * A.y,
  19525. a.z = a.z * s + r * A.z,
  19526. a.normalize()
  19527. }
  19528. this.bunnyObj.position.copy(h.position).add(a),
  19529. d.set(0, 0, -1).applyEuler(f).normalize(),
  19530. d.multiplyScalar(8),
  19531. d.add(h.position),
  19532. 1 - c < e && D.warp.matchCam || (h.controls.lookAt(d),
  19533. h.controls.lookVector.copy(d),
  19534. h.lookAt(d))
  19535. }
  19536. .bind(this)
  19537. , S = function() {
  19538. y ? (this.discardSlow(),
  19539. this.upcomingTransType = L.BLACK,
  19540. this.warpTravel_BLACK(-.5, this.warpInterruptionTravelTime, z.BEGINNING, e)) : this._wrapupWarpShading(e)
  19541. }
  19542. .bind(this);
  19543. T(0);
  19544. var M = D.warp.motionLeadTime + 1e3 * Math.abs(s()) / P.Math.degToRad(D.warp.maxTurnPerSec)
  19545. , R = M / (t += M);
  19546. this.warpCommonParameters(t, R, !0, z.NONE),
  19547. V.start(I, t, null, 0, null, "_haltWatcher"),
  19548. 0 < D.warp.blur && (k.blurStrength = D.warp.blur,
  19549. V.start(E, t, null, R, n, "blurring")),
  19550. V.start(b, t, null, R, n, "modelAlpha"),
  19551. V.start(w, t, null, R, B[D.warp.blendEasing], "followPath"),
  19552. V.start(T, t, null, R, B[D.warp.blendEasing], "goBunny"),
  19553. V.start(x, t, S, 0, B[D.warp.blendEasing], "lookAtBunny")
  19554. }
  19555. ,
  19556. t.prototype.warpTravel_BLACK = function(e, t, i, n) {
  19557. var r = e || 0;
  19558. null != t || (t = D.warp.teleportTime)
  19559. //add
  19560. var done = ()=>{
  19561. Hot.updateVisibles([this.player.currentPano]) //更新热点显示
  19562. this.player.transitionPos({type:"beforeFlytopano", pano:this.player.currentPano, dur:100})//add
  19563. }
  19564. if(window.DATA.momentTourBlackNewType){
  19565. player.sceneRenderer.effects.fastTranMaskPass.start(player.sceneRenderer)
  19566. var camera = this.playerControls.cameras['panorama'];
  19567. var end = this.warpDestHeroLoc.position
  19568. camera.position.copy(end)
  19569. setTimeout(()=>{
  19570. player.sceneRenderer.effects.fastTranMaskPass.stop()
  19571. this.wrapupWarpShadingOnly(n, i);
  19572. done()
  19573. },t)
  19574. }else{
  19575. var o = function() {
  19576. this.wrapupWarpShadingOnly(n, i);
  19577. done()
  19578. }
  19579. .bind(this);
  19580. var firstPos = this.player.position.clone()//add
  19581. V.start(this.stepWarpPath.bind(this, firstPos), t, o, r, B[D.warp.blendEasing], "stepMotion")
  19582. }
  19583. this.warpCommonParameters(t, r, !1, i)
  19584. this.model.chunks.concat(this.model.skybox).forEach(function(e) {// 改
  19585. if(window.DATA.momentTourBlackNewType){
  19586. e.material.uniforms.blackout.value = 5//i 改
  19587. //e.material.defines.newBlack = ''
  19588. //e.material.needsUpdate = true
  19589. }else{
  19590. e.material.uniforms.blackout.value = i
  19591. }
  19592. }),
  19593. this._warpBendAim(null, t, null, r);
  19594. /* this.warpCommonParameters(t, r, !1, i)
  19595. this.model.chunks.forEach(function(e) {
  19596. e.material.uniforms.blackout.value = i
  19597. }),
  19598. this._warpBendAim(null, t, null, r);
  19599. //add
  19600. var done = ()=>{
  19601. Hot.updateVisibles([this.player.currentPano]) //更新热点显示
  19602. this.player.transitionPos({type:"beforeFlytopano", pano:this.player.currentPano, dur:100})//add
  19603. }
  19604. var o = function() {
  19605. this.wrapupWarpShadingOnly(n, i)
  19606. done()
  19607. }
  19608. .bind(this);
  19609. var firstPos = this.player.position.clone()//add
  19610. V.start(this.stepWarpPath.bind(this, firstPos), t, o, r, B[D.warp.blendEasing], "stepMotion")
  19611. */
  19612. }
  19613. ,
  19614. t.prototype.flightStepWalk = (a = new P.Vector3,
  19615. s = new P.Vector3,
  19616. function(e, t, i) {
  19617. if (this.warpInterrupted)
  19618. i && i();
  19619. else if (this.activeTransType !== L.WALK)
  19620. this._clearWarpShading(),
  19621. this._warpStopFlying(),
  19622. this.player.spider.draw(),
  19623. this.placeCpm(),
  19624. i && i();
  19625. else if (this.player.currentPano !== e) {
  19626. var n = {
  19627. pano: e,
  19628. lookAtPoint: t,
  19629. duration: null,
  19630. maxDistanceOverride: D.warp.walkMaxDist,
  19631. skipWarpingCheck: !1,
  19632. constantMoveSpeed: !0
  19633. };
  19634. if(e == this.warpDestPano){//到达终点前,放大到终点的zoom
  19635. n.zoomLevel = this.warpDestHeroLoc.zoom
  19636. }
  19637. n.duration = function(e, t) {
  19638. var i = Math.min(this.player.position.distanceTo(e.position), D.transition.flytimeMaxDistanceThreshold) * D.transition.flytimeDistanceMultiplier + D.transition.flyTime;
  19639. s.copy(U.FORWARD),
  19640. this.player.getDirection(s),
  19641. a.copy(t).sub(e.position).normalize();
  19642. var n = a.dot(s)
  19643. , r = Math.acos(n)
  19644. , o = r / i;
  19645. .001 < o && (i *= o / .001, //-----这是什么????
  19646. r < 1 && (i *= 1.2))
  19647. return i / DATA.tourWalkSpeed * 100
  19648. }
  19649. .call(this, e, t),
  19650. this.player.nonInterruptingFlyToPano(n, i)
  19651. } else
  19652. i && i()
  19653. }
  19654. ),
  19655. t.prototype.makeWalkFlightFunc = function(e, t, i) {
  19656. return this.flightStepWalk.bind(this, e, t, i)
  19657. }
  19658. ,
  19659. t.prototype.warpTravel_WALK = (f = [],
  19660. function(e) {
  19661. for (var t = this.player.model.panos, i = null, n = !1, r = f.length = 0; r < this.nodes.length; r++) {
  19662. var o = this.nodes[r]
  19663. , a = t.get(o);
  19664. this.nodes.length,
  19665. n = i && a.position.distanceTo(i.position) < D.warp.walkMinDist,
  19666. i && n || (f.push(o),
  19667. i = a)
  19668. }
  19669. n && 1 < this.nodes.length && (f[f.length - 1] = this.nodes[this.nodes.length - 1]);
  19670. var s = f.length
  19671. , l = t.get(f[s - 1])
  19672. , c = new Array(s + 1);
  19673. c[c.length - 1] = function() {
  19674. e && e()
  19675. }
  19676. .bind(this);
  19677. for (var h = s - 1, u = c.length - 1; 0 < u; u -= 1) {
  19678. var d = f[h];
  19679. l = t.get(d);
  19680. var p = new P.Vector3;
  19681. this.getLookAtForWalkingTourNode(f, h, p),
  19682. c[u - 1] = this.makeWalkFlightFunc(l, p, c[u]),
  19683. h--
  19684. }
  19685. c[0]()
  19686. }
  19687. ),
  19688. t.prototype.getLookAtForWalkingTourNode = (c = new P.Vector3,
  19689. h = new P.Vector3,
  19690. u = new P.Vector3,
  19691. d = new P.Vector3,
  19692. p = new P.Vector3,
  19693. function(e, t, i) {
  19694. var n = e.length;
  19695. if (n <= t)
  19696. return !1;
  19697. var r = 1
  19698. , o = 1;
  19699. h.set(0, 0, 0),
  19700. p.set(0, 0, 0);
  19701. for (var a = null, s = t; s < t + 3 && !(n <= s); s++) {
  19702. if (a = this.player.model.panos.get(e[s]),
  19703. this.getOrientationForWalkingTourNode(e, s, u),
  19704. s === t && c.copy(u),
  19705. d.copy(u),
  19706. t < s) {
  19707. var l = d.dot(c) < .65;
  19708. r *= l ? .2 : .75,
  19709. o *= l ? .2 : .4
  19710. }
  19711. u.multiplyScalar(r),
  19712. h.add(u),
  19713. p.lerp(a.position, o)
  19714. }
  19715. return h.normalize(),
  19716. i.copy(p),
  19717. i.add(h),
  19718. !0
  19719. }
  19720. ),
  19721. t.prototype.getOrientationForWalkingTourNode = function(e, t, i) {
  19722. var n = e.length;
  19723. if (n <= t)
  19724. return !1;
  19725. if (t === n - 1)
  19726. i.copy(U.FORWARD).applyQuaternion(this.warpDestHeroLoc.quaternion);
  19727. else {
  19728. var r = this.player.model.panos.get(e[t])
  19729. , o = this.player.model.panos.get(e[t + 1]);
  19730. i.copy(o.position).sub(r.position)
  19731. }
  19732. return i.normalize(),
  19733. !0
  19734. }
  19735. ,
  19736. t.prototype.warpCameraTravel = function(e, t, i, n) {
  19737. if (this.activeTransType = this.upcomingTransType,
  19738. this.lastTransType = this.activeTransType,
  19739. this.upcomingTransType = null,
  19740. e)
  19741. this.activeTransType === L.BLACK ? this.warpTravel_BLACK(null, i, t, n) : this.activeTransType === L.WALK ? this.warpTravel_WALK(function() {
  19742. this._clearWarpShading(),
  19743. this._warpStopFlying(),
  19744. this.player.spider.draw(),
  19745. this.placeCpm(),
  19746. n && n()
  19747. }
  19748. .bind(this)) : this.warpTravel_STD(n);
  19749. else {
  19750. var r = function() {
  19751. this._wrapupTravel(n)
  19752. }
  19753. .bind(this)
  19754. , o = {
  19755. pano: this.warpDestPano,
  19756. lookAtPoint: null,
  19757. duration: null,
  19758. maxDistanceOverride: null,
  19759. skipWarpingCheck: !1
  19760. };
  19761. this.player.flyToPano(o, r)
  19762. }
  19763. }
  19764. ,
  19765. t.prototype.startWarpState = function() {
  19766. this.warping = !0,
  19767. this.warpInterrupted = !1,
  19768. this.warpInterruptionBlackoutStyle = null,
  19769. this.warpInterruptionTravelTime = null
  19770. }
  19771. ,
  19772. t.prototype.endWarpState = function() {
  19773. this.warping = !1
  19774. }
  19775. ,
  19776. t.prototype.warpToPano = function(e, t, i, n) {
  19777. if (this.warping)
  19778. H.warn("Cannot warp when already warping");
  19779. else {
  19780. if (this.upcomingTransType = e,
  19781. this.activeTransType = null,
  19782. !this.setWarpDestPano())
  19783. return this.upcomingTransType = null,
  19784. void this.warpToNonPano(n);
  19785. if (this.player.mode !== O.PANORAMA)
  19786. return this.upcomingTransType = null,
  19787. this.discardSlow(),
  19788. void this.player.flyToNewMode({
  19789. mode: O.PANORAMA,
  19790. pano: this.warpDestPano,
  19791. duration: D.warp.outsideTime,
  19792. warpDest: this.warpDestHeroLoc,
  19793. callback: n,
  19794. force: !0
  19795. });
  19796. if (!this.warpDestPano)
  19797. return H.warn("no warp destination, callback dropped"),
  19798. void (this.upcomingTransType = null);
  19799. 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)
  19800. , o = this.chooseWarpPath(r);
  19801. if (o && this.upcomingTransType !== L.WALK) {
  19802. var a = function() {
  19803. this.waitingToWarp = !1,
  19804. this.warpToPano(e, t, i, n)
  19805. }
  19806. .bind(this);
  19807. if (this.player.checkAndWaitForPanoLoad(this.warpDestPano, "high", "low", this.player.basePanoSize, a))
  19808. return void (this.waitingToWarp = !0)
  19809. }
  19810. this.player.currentPano || (H.warn("Arrived at a very strange spot!"),
  19811. this.player.currentPano = this.warpDestPano,
  19812. this.placeCpm(),
  19813. this.fadeOutCpm(D.path.fadeOutTime),
  19814. this.player.spider.draw()),
  19815. H.debug("Warping to pano ", this.warpDestPano.position),
  19816. this.upcomingTransType !== L.WALK && this.player.emit(g.PanoChosen, this.player.currentPano, this.warpDestPano),
  19817. this.startWarpState();
  19818. var s = function() {
  19819. this.endWarpState(),
  19820. n && n()
  19821. }
  19822. .bind(this);
  19823. o ? this.warpCameraTravel(r, t, i, s) : this.warpCameraAim(s)
  19824. }
  19825. }
  19826. ,
  19827. v.exports = t
  19828. }
  19829. ).call(this, "/js/objects/ShowPath.js")
  19830. }
  19831. , {
  19832. "../constants": 8,
  19833. "../effects": 16,
  19834. "../enum/BlackoutStyle": 18,
  19835. "../enum/ModelManagerEvents": 33,
  19836. "../enum/PlayerEvents": 40,
  19837. "../enum/RenderOrder": 42,
  19838. "../enum/Vectors": 50,
  19839. "../enum/Viewmode": 51,
  19840. "../enum/WarpStyle": 52,
  19841. "../gui/gui": 65,
  19842. "../model/ModelManager": 140,
  19843. "../objects/Snapshot": 153,
  19844. "../settings": 166,
  19845. "../shaders": 167,
  19846. "../util/easing": 186,
  19847. "../util/lerp": 188,
  19848. "../util/logger": 189,
  19849. "../util/math": 190,
  19850. "../util/texture": 194,
  19851. "../util/transitions": 195,
  19852. three: 217
  19853. }],
  19854. 152: [function(e, t, i) {
  19855. "use strict";
  19856. function n() {
  19857. var e = new r.SphereBufferGeometry(a.skyboxRadius,20,5)
  19858. , t = new r.RawShaderMaterial({
  19859. fragmentShader: o.skysphere.fragmentShader,
  19860. vertexShader: o.skysphere.vertexShader,
  19861. uniforms: r.UniformsUtils.clone(o.skysphere.uniforms),
  19862. side: r.BackSide,
  19863. name: "skysphere"
  19864. });
  19865. t.uniforms.radius.value = e.parameters.radius,
  19866. r.Mesh.call(this, e, t)
  19867. }
  19868. var r = e("three")
  19869. , o = e("../shaders")
  19870. , a = e("../settings");
  19871. (n.prototype = Object.create(r.Mesh.prototype)).constructor = n,
  19872. t.exports = n
  19873. }
  19874. , {
  19875. "../settings": 166,
  19876. "../shaders": 167,
  19877. three: 217
  19878. }],
  19879. 153: [function(r, o, e) {
  19880. (function(e) {
  19881. "use strict";
  19882. function t(e) {
  19883. n.call(this, e),
  19884. this.sid = e.sid,
  19885. this.panoId = e.panoId,
  19886. this.orthoZoom = e.orthoZoom,
  19887. this.floorVisibility = e.floorVisibility,
  19888. this.thumbUrl = e.thumbUrl,
  19889. this.name = e.name,
  19890. this.zoom = e.zoom
  19891. }
  19892. var i = (r("three"),
  19893. r("../util/logger"))
  19894. , n = (r("../settings"),
  19895. r("../enum/Viewmode"),
  19896. r("../util/common"),
  19897. r("../util/transitions"),
  19898. r("../util/lerp"),
  19899. r("../util/ajax"),
  19900. r("../util/texture"),
  19901. r("./View"));
  19902. r("events").EventEmitter,
  19903. new i(e),
  19904. (t.prototype = Object.create(n.prototype)).isPano = function() {
  19905. return this.panoId && "" !== this.panoId && this.panoId != "outside"
  19906. }
  19907. ,
  19908. o.exports = t
  19909. }
  19910. ).call(this, "/js/objects/Snapshot.js")
  19911. }
  19912. , {
  19913. "../enum/Viewmode": 51,
  19914. "../settings": 166,
  19915. "../util/ajax": 181,
  19916. "../util/common": 185,
  19917. "../util/lerp": 188,
  19918. "../util/logger": 189,
  19919. "../util/texture": 194,
  19920. "../util/transitions": 195,
  19921. "./View": 154,
  19922. events: 202,
  19923. three: 217
  19924. }],
  19925. 154: [function(o, a, e) {
  19926. (function(e) {
  19927. "use strict";
  19928. function t(e) {
  19929. e = e || {},
  19930. this.position = new i.Vector3,
  19931. this.quaternion = new i.Quaternion,
  19932. this.update(e)
  19933. }
  19934. var i = o("three")
  19935. , n = o("../util/logger")
  19936. , r = (o("../settings"),
  19937. o("../enum/Viewmode"),
  19938. o("../util/common"),
  19939. o("../util/transitions"),
  19940. o("../util/lerp"),
  19941. o("../util/ajax"),
  19942. o("../util/texture"),
  19943. o("events").EventEmitter);
  19944. new n(e),
  19945. (t.prototype = Object.create(r.prototype)).isValid = function() {
  19946. return !!this.cameraMode
  19947. }
  19948. ,
  19949. t.prototype.update = function(e) {
  19950. return this.cameraMode = e.cameraMode || this.cameraMode,
  19951. this.pano = e.pano || this.pano,
  19952. e.position && this.position.copy(e.position),
  19953. e.quaternion && this.quaternion.copy(e.quaternion),
  19954. this
  19955. }
  19956. ,
  19957. a.exports = t
  19958. }
  19959. ).call(this, "/js/objects/View.js")
  19960. }
  19961. , {
  19962. "../enum/Viewmode": 51,
  19963. "../settings": 166,
  19964. "../util/ajax": 181,
  19965. "../util/common": 185,
  19966. "../util/lerp": 188,
  19967. "../util/logger": 189,
  19968. "../util/texture": 194,
  19969. "../util/transitions": 195,
  19970. events: 202,
  19971. three: 217
  19972. }],
  19973. 155: [function(J, ee, e) {
  19974. (function(e) {
  19975. "use strict";
  19976. function t(e) {
  19977. this.currentPano = null,
  19978. this.nextPano = null,
  19979. this.camera = null,
  19980. this.paused = !1,
  19981. this.flying = !1,
  19982. this.sceneIntersectionPlane = null,
  19983. this.target = new B.Vector3,
  19984. this.mouse = new B.Vector3(1.1,1.1,.5),
  19985. this.mouseAtMouseDown = new B.Vector2,
  19986. this.mouseCouldBeClickToMove = !1,
  19987. this.mouseLastMoveTime = Date.now(),
  19988. this.mouseDown = !1,
  19989. this.mouseDownTimer = null,
  19990. this.couldBeLongTap = !1,
  19991. this.containsMouse = !0,
  19992. this.isTouchEvent = !1,
  19993. this.isPanoHover = !1,
  19994. this.reticule = new n(this),
  19995. this.panoMarkers = [],
  19996. this.spider = new s(this),
  19997. this.quaternion = new B.Quaternion,
  19998. this.position = new B.Vector3(15,10,15),
  19999. this.previousState = null,
  20000. this.lastInsideView = new o,
  20001. this.last360View = new o,
  20002. this.raycaster = new B.Raycaster,
  20003. this.intersect = null,
  20004. this.lastChangeTime = Date.now(),
  20005. this.history = new h,
  20006. this.cameraControls = null,
  20007. this.path = null,
  20008. this.model = null,
  20009. this.domElement = null,
  20010. this.cachedPanoCandidates = null,
  20011. this.basePanoSize = 0,
  20012. this.standardPanoSize = 0,
  20013. this.highPanoSize = 0,
  20014. this.ultraHighPanoSize = 0,
  20015. this.zoomLevel = 1,
  20016. this.zooming = 0,
  20017. this.zoomSpeed = .5,
  20018. this.scrollZoomSpeed = .06,
  20019. this.zoomSpeedAdjust = .05,
  20020. this.defaultZoomIncrement = .2,
  20021. this.baseFov = k.insideFOV,
  20022. this.zoomFov = this.baseFov,
  20023. this.zoomEnabled = !0,
  20024. this.preRenderingEnabled = !1,
  20025. this.setupCustomProperties(e),
  20026. this.zoomStats = new v,
  20027. this.modeTran = ''//'dollhouse-panorama'
  20028. this.currentCursor = '';
  20029. window.player = this
  20030. }
  20031. var B = J("three")
  20032. , i = J("./util/logger")
  20033. , n = J("./objects/Reticule")
  20034. , a = J("./objects/Panorama")
  20035. , r = J("./objects/ShowPath")
  20036. , o = J("./objects/View")
  20037. , s = (J("./objects/Snapshot"),
  20038. J("./objects/NSpider"))
  20039. , V = J("./enum/Viewmode")
  20040. , T = (J("./enum/TagStates"),
  20041. J("./enum/Vectors"))
  20042. , l = J("./enum/Keys")
  20043. , k = (J("./enum/AlignmentType"),
  20044. J("./settings"))
  20045. , x = J("./util/common")
  20046. , U = (J("./util/browser"),
  20047. J("./util/math"))
  20048. , H = J("./util/lerp")
  20049. , z = J("./util/easing")
  20050. , G = J("./util/transitions")
  20051. , c = J("events").EventEmitter
  20052. , h = (J("./shaders"),
  20053. J("./util/history"))
  20054. , S = (J("./util/camera"),
  20055. J("./model/ModelManager"),
  20056. J("./enum/PathDiscardMode"))
  20057. , M = J("./enum/PathDisplayMode")
  20058. , W = J("./enum/PlayerEvents")
  20059. , u = J("./enum/ControlEvents")
  20060. , d = J("./enum/ModelManagerEvents")
  20061. , R = J("./enum/WarpStyle")
  20062. , P = J("./enum/BlackoutStyle")
  20063. , p = J("./exception/BasicException")
  20064. , f = J("./enum/PanoSizeClass")
  20065. , g = (J("./tile/TileDownloader"),
  20066. J("./tile/TilePrioritizer"))
  20067. , m = (J("./enum/PanoramaEvents"),
  20068. J("./enum/ZoomEvents"))
  20069. , v = J("./util/ZoomStats")
  20070. , y = J("./constants")
  20071. , j = J("./util/common")
  20072. , A = J("./util/cameraLight")
  20073. //, C = J("hot")
  20074. , Y = new i(e)
  20075. , q = Object.freeze({
  20076. FlyToPano: G.getUniqueId(),
  20077. FlyToNewMode: G.getUniqueId(),
  20078. FlyToSameMode: G.getUniqueId(),
  20079. FlyToViewFloor: G.getUniqueId(),
  20080. LookTransition: G.getUniqueId(),
  20081. ZoomTransition: G.getUniqueId()
  20082. });
  20083. function I(e) {
  20084. for (var t = e.split(","), i = t[0].match(/:(.*?);/)[1], n = atob(t[1]), r = n.length, o = new Uint8Array(r); r--; )
  20085. o[r] = n.charCodeAt(r);
  20086. return new Blob([o],{
  20087. type: i
  20088. })
  20089. }
  20090. (t.prototype = Object.create(c.prototype)).init = function(e) {
  20091. this.modelManager = e.modelManager,
  20092. this.tileDownloader = e.tileDownloader,
  20093. this.panoRenderer = e.panoRenderer,
  20094. this.qualityManager = e.qualityManager,
  20095. this.domElement = e.container,
  20096. this.camera = e.camera,
  20097. this.tagManager = e.tagManager,
  20098. this.cameraControls = e.controls,
  20099. this.path = new r(e.director,this,e.controls),
  20100. this.basePanoSize = this.qualityManager.getPanoSize(f.BASE),
  20101. this.standardPanoSize = this.qualityManager.getPanoSize(f.STANDARD),
  20102. this.highPanoSize = this.qualityManager.getPanoSize(f.HIGH),
  20103. this.ultraHighPanoSize = this.qualityManager.getPanoSize(f.ULTRAHIGH),
  20104. this.tileDownloader.processPriorityQueue = !1,
  20105. this.tileDownloader.tilePrioritizer = new g(this.qualityManager,this.basePanoSize,this.standardPanoSize,this.highPanoSize,this.ultraHighPanoSize),
  20106. this.bindEvents(e.container),
  20107. this.updateModel()
  20108. //add
  20109. this.raycaster.linePrecision = 0.1
  20110. }
  20111. ,
  20112. t.prototype.screenShot = function(i) {
  20113. if (!this.flying && !this.flyingToTag) {
  20114. var n = this.sceneRenderer;
  20115. n.updateScreenSize(i)
  20116. this.model.panos.forEach(e=>{
  20117. if(e.marker){
  20118. e.marker.forceHide = e.marker.visible
  20119. e.marker.visible = !1;
  20120. }
  20121. })
  20122. /* for (var e in this.model.hots)
  20123. this.model.hots[e].mesh.visible = !1; */
  20124. player.model.hotGroup.visible = false
  20125. this.reticule.visible = !1,
  20126. this.reticule.forceUnvisible = !0,
  20127. this.path.currentPanoMarker.mesh.visible = !1,
  20128. setTimeout(function() {
  20129. n.renderer.clear(!0, !0, !0),
  20130. n.renderer.render(n.scene, n.camera);
  20131. var e = n.renderer.domElement.toDataURL(i.type, .9);
  20132. i.f && i.f(e)
  20133. n.updateScreenSize({
  20134. resize: !0
  20135. })
  20136. this.reticule.visible = !0
  20137. player.model.hotGroup.visible = true
  20138. this.model.panos.forEach(e=>{
  20139. e.marker && (e.marker.visible = e.marker.forceHide);
  20140. })
  20141. this.path.currentPanoMarker.mesh.visible = !0,
  20142. n.renderer.render(n.scene, n.camera)
  20143. }
  20144. .bind(this), 30)
  20145. }
  20146. }
  20147. ;
  20148. var E, _, b, w, O, L, D, N, F, X, Z, K, Q = J("scaleImg");
  20149. t.prototype.getWrapShot = function() {
  20150. var i = this.getSnapAngleInfo()
  20151. , n = ",{\r\t" + i
  20152. , r = arguments[0];
  20153. this.screenShot({
  20154. width: g_snapShotWidth,
  20155. height: g_snapShotHeight,
  20156. type: "image/jpeg",
  20157. f: function(e) {
  20158. if (r && r.__callback)
  20159. return r.__callback(e, i);
  20160. var t = new Image;
  20161. t.src = e,
  20162. t.onload = function() {
  20163. var e = function(r, i) {
  20164. function n(e, t) {
  20165. var i = o || r
  20166. , n = document.createElement("canvas");
  20167. n.width = i.width,
  20168. n.height = i.height,
  20169. n.getContext("2d").drawImage(i, 0, 0, i.width, i.height),
  20170. o = Q(e, n, t)
  20171. }
  20172. function e() {
  20173. var e = o || r
  20174. , t = I(e.src);
  20175. i.maxWeight && t.size > i.maxWeight && (n(i.maxWeight / t.size, "jpeg"),
  20176. t = I(e.src)),
  20177. (o = o || new Image).base64Src = e.src,
  20178. o.src = window.URL.createObjectURL(t)
  20179. }
  20180. var o, t = Math.max(r.width, r.height);
  20181. return "png" != i.toType && ("jpeg" == i.oldType ? (t > i.maxSize && n(i.maxSize / t, "jpeg"),
  20182. e()) : "png" == i.oldType && i.maxWeight && i.weight > i.maxWeight && (n(t > i.maxSize ? i.maxSize / t : 1, "jpeg"),
  20183. e())),
  20184. o || r
  20185. }(this, {
  20186. maxSize: g_snapShotWidth,
  20187. oldType: "jpeg"
  20188. });
  20189. e.src.replace(function(e) {
  20190. return "image/" + (e = e.toLowerCase().replace(/jpg/i, "jpeg")).match(/png|jpeg|bmp|gif/)[0]
  20191. }("image/jpeg"), "image/octet-stream");
  20192. var t = "snap" + (new Date).getTime();
  20193. !function(e, t) {
  20194. var i = document.createElementNS("http://www.w3.org/1999/xhtml", "a");
  20195. i.href = e,
  20196. i.download = t;
  20197. var n = document.createEvent("MouseEvents");
  20198. n.initMouseEvent("click", !0, !1, window, 0, 0, 0, 0, 0, !1, !1, !1, !1, 0, null),
  20199. i.dispatchEvent(n)
  20200. }(e.src, t + ".jpg"),
  20201. n += ',\r\t"thumbnail_signed_src":"' + t + '.jpg",',
  20202. n += '\r\t"sid":"' + t + '",',
  20203. n += '\r\t"name":"' + t + '"\r}',
  20204. logData(n)
  20205. }
  20206. }
  20207. })
  20208. }
  20209. /* ,
  20210. t.prototype.getSnapAngleInfo = function() {
  20211. var e = {}
  20212. , t = '"metadata":{'
  20213. , i = this.camera.quaternion.clone();
  20214. switch (this.mode) {
  20215. case "panorama":
  20216. e.scan_id = this.currentPano.id,
  20217. t += '"scan_id":"' + this.currentPano.id + '",';
  20218. break;
  20219. case "floorplan":
  20220. e.camera_mode = 1,
  20221. (i = (new B.Quaternion).setFromAxisAngle(new B.Vector3(0,1,0), B.Math.degToRad(90))).multiply(this.camera.quaternion),
  20222. t += '"camera_mode":1,',
  20223. t += '"ortho_zoom":' + U.toPrecision(this.cameraControls.activeControl.currentScale, 4) + ",";
  20224. break;
  20225. case "dollhouse":
  20226. e.camera_mode = 2,
  20227. t += '"camera_mode":2,'
  20228. }
  20229. var n = new B.Quaternion(i.x,i.y,i.z,i.w);
  20230. return n.multiply(new B.Quaternion(Math.sqrt(2) / 2,Math.sqrt(2) / 2,0,0).conjugate()),
  20231. n.x *= -1,
  20232. n.w *= -1,
  20233. e.camera_position = U.toPrecision(this.camera.position.toArray(), 4),
  20234. e.camera_quaternion = U.toPrecision(n.toArray(), 4),
  20235. e.zoom = this.zoomLevel,
  20236. t += '"camera_position":[' + e.camera_position + '],"camera_quaternion":[' + e.camera_quaternion + '], "zoom":' + e.zoom + "}"
  20237. }
  20238. , */
  20239. t.prototype.getSnapAngleInfo = function(){
  20240. var info = {};
  20241. var str = '"metadata":{';
  20242. var q = this.camera.quaternion.clone();
  20243. switch (this.mode) {
  20244. case "panorama":
  20245. info.scan_id = this.currentPano.id;
  20246. str += ('"scan_id":"'+this.currentPano.id+'",');
  20247. break;
  20248. case "floorplan":
  20249. info.camera_mode = 1;
  20250. q = (new B.Quaternion).setFromAxisAngle(new B.Vector3(0,1,0), B.Math.degToRad(90))
  20251. q.multiply(this.camera.quaternion);
  20252. str += ('"camera_mode":1,');
  20253. //str += ('"ortho_zoom":'+m.toPrecision(this.cameraControls.activeControl.currentScale * $("#player").height() / $("#player").width() * D.workshopApsect * 16, 4)+",");
  20254. str += ('"ortho_zoom":'+ U.toPrecision(this.cameraControls.activeControl.currentScale, 4 )+",");
  20255. break;
  20256. case "dollhouse":
  20257. info.camera_mode = 2;
  20258. str += ('"camera_mode":2,');
  20259. break;
  20260. }
  20261. info.camera_position = U.toPrecision(this.camera.position.toArray(),4);
  20262. //console.log(info.camera_position)
  20263. info.camera_quaternion = U.toPrecision(q.toArray(),4);
  20264. /* if(window.screenSta === 'tour'){ // fyz 导览截屏需要做额外的 fyz 对相机截屏的角度进行校对
  20265. var out = new B.Quaternion(q.x, q.y, q.z, q.w)
  20266. out.multiply(new B.Quaternion(Math.sqrt(2) / 2, Math.sqrt(2) / 2, 0, 0).conjugate())
  20267. out.x *= -1;
  20268. out.w *= -1;
  20269. info.camera_quaternion = U.toPrecision(out.toArray(),4);
  20270. }else{
  20271. info.camera_quaternion = U.toPrecision(q.toArray(),4);;
  20272. } */
  20273. info.zoom = this.zoomLevel;
  20274. //console.log(info.camera_quaternion)
  20275. // str += ( '"camera_position":['+ info.camera_position + '],"camera_quaternion":['+info.camera_quaternion+"]}");
  20276. // fyz 扩展编辑页面, 加上导览点缩放值
  20277. str += ( '"camera_position":['+ info.camera_position + '],"camera_quaternion":['+info.camera_quaternion+'], "zoom":' + info.zoom + '}');
  20278. console.log(str)
  20279. return str;
  20280. }
  20281. //------end
  20282. ,
  20283. t.prototype.setupCustomProperties = function(e) {
  20284. var i = e || V.PANORAMA;
  20285. Object.defineProperty(this, "mode", {
  20286. get: function() {
  20287. return i
  20288. },
  20289. set: function(e) {
  20290. var t = i;
  20291. i = e,
  20292. this.onModeUpdated(t, i)
  20293. }
  20294. })
  20295. }
  20296. ,
  20297. t.prototype.isInMode = function() {
  20298. for (var e = 0; e < arguments.length; e++)
  20299. if (this.mode === arguments[e])
  20300. return !0;
  20301. return !1
  20302. }
  20303. ,
  20304. t.prototype.isOutsideMode = function(e) {
  20305. return (e = e || this.mode) === V.DOLLHOUSE || e === V.FLOORPLAN
  20306. }
  20307. ,
  20308. t.prototype.is360View = function(e, t) {
  20309. return e === V.PANORAMA && t && !t.isAligned()
  20310. }
  20311. ,
  20312. t.prototype.setScene = function(e) {
  20313. this.sceneIntersectionPlane = e.plane,
  20314. this.path.setScene(e),
  20315. this.moveReticuleToScene(e)
  20316. }
  20317. ,
  20318. t.prototype.moveReticuleToScene = function(e) {
  20319. this.reticule.parent && this.reticule.parent.remove(this.reticule),
  20320. e.add(this.reticule)
  20321. }
  20322. ,
  20323. t.prototype.updateModel = function() {
  20324. function n(e) {
  20325. var t = this.cameraControls.cameras[V.DOLLHOUSE]
  20326. , i = this.cameraControls.controls[V.DOLLHOUSE]
  20327. , n = t.position.y + (e - i.target.y)
  20328. , r = k.showFloorDuration + k.showFloorDelay;
  20329. G.start(H.property(i.target, "y", e), r, null, k.flydown.movementDelay, z[k.flydown.movementEasing], null, q.FlyToViewFloor),
  20330. G.start(H.property(t.position, "y", n), r, null, k.flydown.movementDelay, z[k.flydown.movementEasing], null, q.FlyToViewFloor)
  20331. }
  20332. this.model = this.modelManager.getActiveModel(),
  20333. this.model.on("floor.changed", function(e, t, i) {
  20334. this.mode === V.DOLLHOUSE && e !== i && n.call(this, e.center.y)
  20335. }
  20336. .bind(this)),
  20337. this.model.on("allfloors.toggled", function(e, t) {
  20338. if (this.mode === V.DOLLHOUSE) {
  20339. var i = e ? this.model.center.y : i = t.center.y;
  20340. n.call(this, i)
  20341. }
  20342. }
  20343. .bind(this)),
  20344. this.on(W.PanoChosen, this.model.setProjectedPanos.bind(this.model));
  20345. var t = this;
  20346. this.model.panos.list.forEach(function(e) {
  20347. e.vrMarker.addEventListener("click", function() {
  20348. t.flyToPano({
  20349. pano: e
  20350. })
  20351. })
  20352. })
  20353. }
  20354. ,
  20355. t.prototype.updateModelDependentData = function() {
  20356. this.cameraControls.setModelForControls(this.model),
  20357. this.getPanoMarkersFromModel(this.model)
  20358. }
  20359. ,
  20360. t.prototype.onModelChanged = function() {
  20361. this.updateModel(),
  20362. this.updateModelDependentData()
  20363. }
  20364. ,
  20365. t.prototype.getPanoMarkersFromModel = function(e) {
  20366. this.panoMarkers = e.panos.list.reduce(function(e, t) {
  20367. return t.marker ? e.concat(t.marker) : e
  20368. }, [])
  20369. }
  20370. ,
  20371. t.prototype.handleControlMove = function(e) {
  20372. this.emit(W.Move, e)
  20373. }
  20374. ,
  20375. t.prototype.handleControlInputStart = function(e) {
  20376. this.emit(W.InputStart, e)
  20377. }
  20378. ,
  20379. t.prototype.onModeUpdated = function(e, t) {
  20380. this.cameraControls.activateControls(t),
  20381. this.emit(W.ModeChanged, e, t)
  20382. }
  20383. ,
  20384. t.prototype.isWarping = function() {
  20385. return this.path.warping
  20386. }
  20387. ,
  20388. t.prototype.isWaitingToWarp = function() {
  20389. return this.path.waitingToWarp
  20390. }
  20391. ,
  20392. t.prototype.getLabelScaleFactor = function() {
  20393. if (this.isOutsideMode()) {
  20394. return Math.sqrt(this.cameraControls.controls[V.FLOORPLAN].currentScale / 10)
  20395. }
  20396. return .5
  20397. }
  20398. ,
  20399. t.prototype.bindEvents = function(e) {
  20400. e !== document && e.setAttribute("tabindex", -1),
  20401. e.addEventListener("mousedown", this.onMouseDown.bind(this)),
  20402. e.addEventListener("mousemove", this.onMouseMove.bind(this)),
  20403. e.addEventListener("mouseover", this.onMouseOver.bind(this)),
  20404. e.addEventListener("mouseout", this.onMouseOut.bind(this)),
  20405. e.addEventListener("mouseup", this.onMouseUp.bind(this)),
  20406. this.modelManager.on(d.ActiveModelChanged, this.onModelChanged.bind(this)),
  20407. e.addEventListener("touchstart", this.onTouchStart.bind(this)),
  20408. e.addEventListener("touchmove", this.onTouchMove.bind(this)),
  20409. e.addEventListener("touchend", this.onTouchEnd.bind(this)),
  20410. e.addEventListener("pointerdown", this.onPointerDown.bind(this)),
  20411. e.addEventListener("pointermove", this.onPointerMove.bind(this)),
  20412. e.addEventListener("pointerup", this.onPointerUp.bind(this)),
  20413. document.addEventListener("pointerup", ()=>{//add
  20414. window.transformControls && transformControls.onPointerUp()
  20415. }),
  20416. e.addEventListener("pointerout", this.onPointerOut.bind(this)),
  20417. e.addEventListener("pointercancel", this.onPointerCancel.bind(this)),
  20418. document.addEventListener("keydown", this.onKeyDown.bind(this)),
  20419. this.cameraControls.on(u.Move, this.handleControlMove.bind(this)),
  20420. this.cameraControls.on(u.InputStart, this.handleControlInputStart.bind(this)),
  20421. this.cameraControls.on(u.Pinch, this.handleControlPinch.bind(this)),
  20422. this.cameraControls.on(u.Scroll, this.handleControlScroll.bind(this)),
  20423. window.addEventListener("snapshotBegin", this.getWrapShot.bind(this)),
  20424. //window.addEventListener("tourAudioEnded", this.changeMusic.bind(this)),
  20425. window.getSeft && getSeft(this)
  20426. }
  20427. ,
  20428. t.prototype.onMouseDown = function(e) {
  20429. e.currentTarget !== document && e.currentTarget.focus(),
  20430. 0 === e.button && (this.handleInputStart.call(this, e.clientX, e.clientY, !1),
  20431. this.updateIntersect())
  20432. }
  20433. ,
  20434. t.prototype.onMouseMove = function(e) {
  20435. this.isTouchEvent = !1,
  20436. this.handleInputMove.call(this, e.clientX, e.clientY, !1)
  20437. }
  20438. ,
  20439. t.prototype.onMouseOver = function(e) {
  20440. this.containsMouse = !0,
  20441. !this.mouseDown || 0 !== e.which && 0 !== e.buttons || (this.mouseDown = !1)
  20442. }
  20443. ,
  20444. t.prototype.onMouseOut = function(e) {
  20445. this.containsMouse = !1
  20446. }
  20447. ,
  20448. t.prototype.onMouseUp = function(e) {
  20449. this.handleInputEnd.call(this, e.clientX, e.clientY, !1)
  20450. }
  20451. ,
  20452. t.prototype.onTouchStart = function(e) {
  20453. if (e.currentTarget !== document && e.currentTarget.focus(),
  20454. !this.mouseDown) {
  20455. this.couldBeLongTap = !0;
  20456. var t = x.average(e.changedTouches, "clientX")
  20457. , i = x.average(e.changedTouches, "clientY");
  20458. this.handleInputStart.call(this, t, i, !0),
  20459. this.mouseDownTimer = setTimeout(function() {
  20460. this.updateIntersect(),
  20461. this.handleInputEnd.call(this, t, i, !0)
  20462. }
  20463. .bind(this), k.input.longTapThreshold)
  20464. }
  20465. }
  20466. ,
  20467. t.prototype.onTouchMove = function(e) {
  20468. var t = x.average(e.changedTouches, "clientX")
  20469. , i = x.average(e.changedTouches, "clientY");
  20470. this.handleInputMove.call(this, t, i, !0)
  20471. }
  20472. ,
  20473. t.prototype.onTouchEnd = function(e) {
  20474. if (clearTimeout(this.mouseDownTimer),
  20475. this.mouseDown) {
  20476. this.couldBeLongTap = !1,
  20477. this.updateIntersect();
  20478. var t = x.average(e.changedTouches, "clientX")
  20479. , i = x.average(e.changedTouches, "clientY");
  20480. this.handleInputEnd.call(this, t, i, !0)
  20481. }
  20482. }
  20483. ,
  20484. t.prototype.onPointerDown = function(e) {
  20485. return e.currentTarget !== document && e.currentTarget.focus(),
  20486. this.mouseDown || "mouse" === e.pointerType ? this.onMouseDown(e) : (this.couldBeLongTap = !0,
  20487. this.handleInputStart.call(this, e.clientX, e.clientY, !0),
  20488. void (this.mouseDownTimer = setTimeout(function() {
  20489. this.updateIntersect(),
  20490. this.handleInputEnd.call(this, e.clientX, e.clientY, !0)
  20491. }
  20492. .bind(this), k.input.longTapThreshold)))
  20493. }
  20494. ,
  20495. t.prototype.onPointerMove = function(e) {
  20496. "mouse" !== e.pointerType ? this.handleInputMove.call(this, e.clientX, e.clientY, !0) : this.onMouseMove(e)
  20497. }
  20498. ,
  20499. t.prototype.onPointerUp = function(e) {
  20500. return this.mouseDown && "mouse" !== e.pointerType ? (clearTimeout(this.mouseDownTimer),
  20501. this.couldBeLongTap = !1,
  20502. this.updateIntersect(),
  20503. void this.handleInputEnd.call(this, e.clientX, e.clientY, !0)) : this.onMouseUp(e)
  20504. }
  20505. ,
  20506. t.prototype.onPointerOut = function(e) {
  20507. this.mouseDown = !1
  20508. }
  20509. ,
  20510. t.prototype.onPointerCancel = function(e) {
  20511. this.mouseDown = !1
  20512. }
  20513. ,
  20514. t.prototype.onKeyDown = function(e) {
  20515. var t = function() {
  20516. this.cameraControls.activeControl && this.cameraControls.activeControl.emit(u.Move, "key")
  20517. }
  20518. .bind(this)
  20519. , i = e.which;
  20520. switch (i) {
  20521. case l.F:
  20522. t(),
  20523. this.changeFloor(-1);
  20524. break;
  20525. case l.R:
  20526. t(),
  20527. this.changeFloor(1)
  20528. }
  20529. if (this.mode === V.PANORAMA)
  20530. switch (i) {
  20531. case l.UPARROW:
  20532. case l.W:
  20533. this.flyLocalDirection(T.FORWARD.clone());
  20534. break;
  20535. case l.DOWNARROW:
  20536. case l.S:
  20537. this.flyLocalDirection(T.BACK.clone());
  20538. break;
  20539. case l.A:
  20540. this.flyLocalDirection(T.LEFT.clone());
  20541. break;
  20542. case l.D:
  20543. this.flyLocalDirection(T.RIGHT.clone())
  20544. }
  20545. }
  20546. ,
  20547. t.prototype.handleScrollPinchZoom = function(e) {
  20548. var t = e
  20549. , i = this.zoomLevel;
  20550. this.zoomBy(t),
  20551. this.currentPano && this.zoomStats.addZoomAction(i, this.zoomLevel, this.currentPano.id)
  20552. }
  20553. ,
  20554. t.prototype.handleControlPinch = function(e) {
  20555. k.zoom.enabled ? this.handleScrollPinchZoom(1 - e) : this.flyLocalDirection(new B.Vector3(0,0,e).normalize())
  20556. }
  20557. ,
  20558. t.prototype.handleControlScroll = function(e) {
  20559. k.zoom.enabled ? (0 < e ? e = 1 + this.scrollZoomSpeed : e < 0 && (e = 1 - this.scrollZoomSpeed),
  20560. 0 !== e && this.handleScrollPinchZoom(e)) : this.flyLocalDirection(new B.Vector3(0,0,-e).normalize())
  20561. }
  20562. ,
  20563. t.prototype.handleInputStart = function(e, t, i) {
  20564. var n = this.handelPadding(e, t);
  20565. e = n.x,
  20566. t = n.y,
  20567. this.isTouchEvent = i,
  20568. U.convertScreenPositionToNDC(e, t, this.mouse),
  20569. U.convertScreenPositionToNDC(e, t, this.mouseAtMouseDown),
  20570. this.mouseCouldBeClickToMove = !0,
  20571. this.mouseDown = !0
  20572. //this.mouseCouldBeClickToMove && window.Hotpoint && (new Hotpoint).state(this, C)
  20573. this.mouseCouldBeClickToMove && editTool.hotpoint.addHot()
  20574. window.transformControls && transformControls.onPointerDown()
  20575. }
  20576. ,
  20577. t.prototype.handelPadding = function(e, t) {
  20578. return this.pad || (this.pad = {
  20579. x: dom.getOffset("left", $("#player")[0]),
  20580. y: dom.getOffset("top", $("#player")[0])
  20581. }),
  20582. {
  20583. x: e - this.pad.x,
  20584. y: t - this.pad.y
  20585. }
  20586. }
  20587. ,
  20588. t.prototype.handleInputMove = function(e, t, i) {
  20589. var n = this.handelPadding(e, t);
  20590. e = n.x,
  20591. t = n.y,
  20592. this.isTouchEvent = i,
  20593. U.convertScreenPositionToNDC(e, t, this.mouse);
  20594. var moveToleranceNDC = (window.transformControls && transformControls.visible) ? 0.0000001 : k.input.moveToleranceNDC
  20595. this.mouseAtMouseDown.distanceTo(this.mouse) > moveToleranceNDC && (this.mouseCouldBeClickToMove = !1,
  20596. this.couldBeLongTap = !1,
  20597. clearTimeout(this.mouseDownTimer)),
  20598. this.mouseLastMoveTime = Date.now(),
  20599. this.reticule.move(e, t, i)
  20600. window.transformControls && transformControls.onPointerMove()
  20601. }
  20602. ,
  20603. t.prototype.handleInputEnd = function(e, t, i) {
  20604. if (this.isTouchEvent = i,
  20605. this.mouseDown = !1,
  20606. this.cameraControls.controls[V.PANORAMA].emit("interaction.direct"),
  20607. !i && this.couldBeLongTap)
  20608. return !0;
  20609. if (this.handleLongTap())
  20610. return !0;
  20611. window.transformControls && transformControls.onPointerUp()
  20612. if (this.mouseCouldBeClickToMove) {
  20613. if (this.flying)
  20614. return this.path.activeTransType === R.WALK && this.emit(W.WarpInterruptedWithFlyTo, this.path.activeTransType),
  20615. !0;
  20616. //add----
  20617. if (this.checkHotClick())
  20618. return !0;
  20619. if (window.VisiSet && VisiSet.setPanoVisible) {//正在设置漫游可行
  20620. this.intersect && this.intersect.object.visible && VisiSet.dealPanoVisible(this.intersect.object.name);
  20621. return;
  20622. }
  20623. if (window.VisiSet && VisiSet.setTagVisible ) {
  20624. VisiSet.tagVsetting && this.intersect && this.intersect.object.visible && VisiSet.dealTagVisible(VisiSet.tagVsetting, this.intersect.object.name);
  20625. return;
  20626. }
  20627. if (window.VisiSet && VisiSet.setPanoLog ) {
  20628. this.intersect && this.intersect.object.visible && VisiSet.dealPanoLogClick( this.intersect.object);
  20629. return;
  20630. }
  20631. if (window.VisiSet && VisiSet.setRoute) {
  20632. this.intersect && this.intersect.object.visible && VisiSet.dealRouteClick(this.intersect.object);
  20633. return;
  20634. }
  20635. if(this.hoveringPlane){
  20636. this.clickOverlay(this.hoveringPlane)
  20637. return;
  20638. }
  20639. if(window.EditOverlay && EditOverlay.objCursorType == "overlay"){
  20640. return EditOverlay.addPlane({intersect:this.intersect});
  20641. }
  20642. /* if(objects.mainDesign && objects.mainDesign.editing && objects.mainDesign.handleClickEnd(this)){//许钟文加
  20643. if(objects.mainDesign.editType == "wallDesign" && this.mode == "panorama") return !0;
  20644. else if(objects.mainDesign.editType == "addOverlay")return !0;
  20645. } */
  20646. //----------
  20647. if(this.intersect){// for cad add door etc.
  20648. let result = {}
  20649. this.emit('getIntersect', this.intersect, (state)=>{//consume
  20650. result.consume = true
  20651. })
  20652. if(result.consume)return; //有效使用了,就return
  20653. }
  20654. if (this.cameraControls.activeControl && this.cameraControls.activeControl.emit(u.Move, this.isTouchEvent ? "touch" : "mouse"),
  20655. this.history.invalidate(),
  20656. this.intersect)
  20657. return this.flyToPanoClosestToMouse();
  20658. if (this.mode === V.PANORAMA) {
  20659. var n = this.closestPanoInDirection(this.getMouseDirection());
  20660. return n ? this.flyToPano({
  20661. pano: n
  20662. }) : this.bump(this.getMouseDirection())
  20663. }
  20664. }
  20665. //this.intersect && this.closestPano && this.closestPano.hoverOff(this.mode)
  20666. }
  20667. ,
  20668. t.prototype.handleLongTap = function() {
  20669. if (this.couldBeLongTap && (!this.isPanoHover || this.mode !== V.PANORAMA))
  20670. return this.cameraControls.activeControl && this.cameraControls.activeControl.emit(u.LongTap, "touch"),
  20671. !0
  20672. }
  20673. ,
  20674. t.prototype.checktagClick = function() {
  20675. if (this.tagManager.intersectTag) {
  20676. var e = this.isTouchEvent
  20677. , t = this.tagManager.clickedOnTag(e, this);
  20678. return e || t || G.cancelById(q.LookTransition),
  20679. !0
  20680. }
  20681. if (this.tagManager.activeTag)
  20682. return this.tagManager.dismissActiveTag(),
  20683. !1
  20684. }
  20685. ,
  20686. t.prototype.rankedtagInDirection = function(e, t) {
  20687. return this.tagManager.rankedtagInDirection(e, this.position, this.camera, t)
  20688. }
  20689. ,
  20690. t.prototype.start = function(e) {
  20691. $(".toolLeft").removeClass("unable");
  20692. $(".toolTop").removeClass("unable");
  20693. //-------------------
  20694. window.initTransformCtl(B)
  20695. //this.model.loadOverlays()
  20696. //window.EditOverlay && window.EditOverlay.init(B);
  20697. window.VisiSet && VisiSet.init()
  20698. //-------------------
  20699. var t = e.mode
  20700. , i = e.pano
  20701. , n = e.position
  20702. , r = e.quaternion
  20703. , o = e.tag
  20704. , a = e.quickstart
  20705. , s = $.Deferred();
  20706. this.updateModelDependentData(),
  20707. this.updateFromControls(),
  20708. this.findDefaultViews();
  20709. var l = this.is360View(t, i);
  20710. return !this.model.outsideAllowed() || l || a ? this.startInside(i, n, r, o, s) : this.startOutside(e, s),
  20711. s.done(function(e) {
  20712. this.emit(W.Ready, l, e, o)
  20713. }
  20714. .bind(this)),
  20715. s.promise()
  20716. }
  20717. ,
  20718. t.prototype.startOutside = function(e, t) {
  20719. var i = e.mode
  20720. , n = e.pano
  20721. , r = e.position
  20722. , o = e.quaternion
  20723. , a = e.zoom
  20724. , s = e.floorVisibility
  20725. , l = e.tag;
  20726. this.emit(W.StartOutside, k[i].transitionTime),
  20727. this.isOutsideMode(i) ? (this.model.warpDestFloors(s, !0),
  20728. G.cancelById(q.FlyToViewFloor),
  20729. i === V.FLOORPLAN ? this.floorplanMode(r, o, a) : this.dollhouseMode(r, o),
  20730. t.resolve(!1)) : this.startInsideWithFlyin(n, r, o, l, t)
  20731. }
  20732. ,
  20733. t.prototype.startInside = function(e, t, i, n, r) {
  20734. r = r || $.Deferred();
  20735. var o = (this.currentPano = e) && !e.isAligned();
  20736. window.bus.dispatchEvent({type:'playerAndModelReady'})
  20737. this.ready = true
  20738. if (t = o ? e.position : t || e.position,
  20739. i = i || e.quaternion,
  20740. e) {
  20741. var a = this.startInside.bind(this, e, t, i, n, r);
  20742. if (this.checkAndWaitForPanoLoad(e, "high", "low", this.basePanoSize, a))
  20743. return
  20744. }
  20745. //add
  20746. this.transitionPos({type:"beforeFlytopano", pano:this.currentPano, dur:0})
  20747. //this.updateHotVisible()
  20748. //EditOverlay.updatePano()
  20749. editTool.hotpoint.updatePano()
  20750. Hot.updateVisibles([this.currentPano])
  20751. return this.mode = V.PANORAMA,
  20752. e.floor.enter(this.mode),
  20753. this.emit(W.PanoChosen, this.currentPano, this.currentPano),
  20754. this.switchCameraMode(this.mode, i),
  20755. this.emit(W.StartInside, o),
  20756. r.resolve(!0),
  20757. r
  20758. }
  20759. ,
  20760. t.prototype.startInsideWithFlyin = function(i, e, n, t, r) {
  20761. if (r = r || $.Deferred(),
  20762. this.dollhouseMode(),
  20763. !i)
  20764. return Y.warn("Player.startInsideWithFlyin() -> targetPano is invalid."),
  20765. r.resolve(!1),
  20766. r;
  20767. e = e || i.position;
  20768. var o = n || this.cameraControls.activeControl.camera.quaternion
  20769. , a = i.position;
  20770. return this.fitDollhouse(a, e, o),
  20771. setTimeout(function(e) {
  20772. this.cameraControls.activeControl && (this.cameraControls.activeControl.maxDistance = e);
  20773. var t = {
  20774. mode: V.PANORAMA,
  20775. pano: i,
  20776. quaternion: n,
  20777. callback: function() {
  20778. this.emit(W.FlyinFinished),
  20779. r.resolve(!0)
  20780. }
  20781. .bind(this)
  20782. };
  20783. this.flyToNewMode(t)
  20784. }
  20785. .bind(this, this.cameraControls.activeControl.maxDistance), k.startupFlyinDelay),
  20786. r
  20787. }
  20788. ,
  20789. t.prototype.checkAndWaitForPanoLoad = (Z = {},
  20790. K = {},
  20791. function(t, e, i, n, r, o, a, s, l, c) {
  20792. if (function() {
  20793. for (var e in Z)
  20794. if (Z.hasOwnProperty(e) && Z[e] && performance.now() - K[e] < 5e3)
  20795. return !0;
  20796. return !1
  20797. }())
  20798. return !0;
  20799. var h = function(e, t, i) {
  20800. j.delayOneFrame(function() {
  20801. Z[e] = !1,
  20802. r && r(t, i)
  20803. }
  20804. .bind(this))
  20805. }
  20806. .bind(this, t.id)
  20807. , u = function(e, t) {
  20808. j.delayOneFrame(function() {
  20809. Z[e] = !1,
  20810. o && o(t)
  20811. }
  20812. .bind(this))
  20813. }
  20814. .bind(this, t.id);
  20815. try {
  20816. return null != s || (s = !0),
  20817. 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),
  20818. Z[t.id] && (K[t.id] = performance.now()),
  20819. Z[t.id]
  20820. } catch (e) {
  20821. throw Z[t.id] = !1,
  20822. K[t.id] = performance.now() - 5e3,
  20823. e
  20824. }
  20825. }
  20826. ),
  20827. t.prototype.checkAndWaitForWholePanoLoad = function(e, t, i, n, r) {
  20828. if (!e)
  20829. throw new p("Player.checkAndWaitForWholePanoLoad() -> Cannot load texture for null pano.");
  20830. return r && this.model.waitForLoad(e, function() {
  20831. return e.isLoaded(i)
  20832. }),
  20833. !e.isLoaded(t) && (e.loadCube(t).done(n),
  20834. !0)
  20835. }
  20836. ,
  20837. t.prototype.checkAndWaitForTiledPanoLoad = (X = new B.Vector3,
  20838. function(e, t, i, n, r, o, a, s) {
  20839. if (!e)
  20840. throw new p("Player.checkAndWaitForTiledPanoLoad() -> Cannot load texture for null pano.");
  20841. return X.copy(T.FORWARD),
  20842. this.getDirection(X),
  20843. !e.isLoaded(t) && (o && this.model.waitForLoad(e, function() {
  20844. return e.isLoaded(t)
  20845. }),
  20846. e.loadTiledPano(t, X, null, a, s).done(function(e, t) {
  20847. i && i(e, t)
  20848. }
  20849. .bind(this)).fail(function(e) {
  20850. n && n(e)
  20851. }
  20852. .bind(this)).progress(function(e, t, i) {
  20853. r && r(e, t, i)
  20854. }
  20855. .bind(this)),
  20856. !0)
  20857. }
  20858. ),
  20859. t.prototype.switchCameraMode = function(mode, quaternion, target, position, {currentScale, fitBoundSize}={}) {
  20860. var control = this.cameraControls.controls[mode]
  20861. , camera = control.camera;
  20862. if(mode == V.PANORAMA){
  20863. camera.position.copy(this.currentPano.position);
  20864. var r = quaternion ? T.FORWARD.clone().applyQuaternion(quaternion) : this.getDirection().setY(0).normalize();
  20865. control.lookAt(r.add(camera.position));
  20866. }else{
  20867. if (target) {
  20868. control.target.copy(target)
  20869. }
  20870. if (position) {
  20871. camera.position.copy(position)
  20872. }
  20873. if(mode == V.DOLLHOUSE){
  20874. var o = this.position.clone();
  20875. 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),
  20876. camera.position.copy(o),
  20877. control.target.copy(this.target.clone().setY(this.model.center.y));
  20878. //for多楼层 且 让模型刚好适应屏幕
  20879. /* var box = this.model.boundingBox.clone();
  20880. box.applyMatrix4(this.camera.matrixWorld);//将 boundingbox、也就是模型, 转换到当前相机朝向
  20881. var boxSize = box.size() //其中boxSize.x是模型在当前相机视角下的横向宽度,当飞出后,该宽度要刚好占满窗口宽度
  20882. var fov = A.getHFOVFromVFOV(k.insideFOV, camera.aspect, 1); //获得在当前窗口的横向的fov
  20883. var distance = Math.abs(boxSize.x) / 2 / Math.tan(THREE.Math.degToRad(fov / 2))//根据上面获得的参数得到target到相机的距离
  20884. console.log(boxSize.x,distance, boxSize.length() / 2)
  20885. distance += boxSize.length() / 2 //由于此时模型从中心向相机的部分由于近大远小仍超出屏幕,所以将target放在靠近模型靠近相机的这一端,故而再加上box的对角线长度的一半, 虽然本该加上Math.sqrt(boxSize.z*boxSize.z +boxSize.y+boxSize.y)/2,但是这样模型显得比较满
  20886. if(this.mode === V.PANORAMA){
  20887. control.target.copy(this.model.center);
  20888. var vec = this.getDirection().negate().setY(1).normalize()//获得朝向
  20889. }else{
  20890. control.target.copy(this.target.clone().setY(this.model.center.y))
  20891. var vec = T.DOWN.clone().applyQuaternion(this.quaternion).setY(1).normalize()
  20892. }
  20893. vec.multiplyScalar(distance )
  20894. camera.position.copy(control.target.clone().add(vec)) */
  20895. }if(mode == V.FLOORPLAN){
  20896. if(!target){
  20897. control.target.copy(this.model.center).setY(0)
  20898. }
  20899. if(!position){
  20900. camera.position.copy(control.target).setY(k.floorplan.cameraHeight),
  20901. control.rotateToView(this.model.size, this.getDirection())
  20902. }
  20903. if(currentScale){
  20904. control.currentScale = control.absoluteScale = currentScale
  20905. }else if (fitBoundSize) {
  20906. control.zoomToContain(fitBoundSize)
  20907. }else{
  20908. control.zoomToContain(this.model.size)
  20909. }
  20910. }
  20911. }
  20912. control.update(0)
  20913. }
  20914. ,
  20915. t.prototype.update = (new B.Vector3,
  20916. N = {},
  20917. F = [],
  20918. function(e) {
  20919. this.updatePersistentZooming(e),
  20920. this.updateFromControls(e),
  20921. this.getCurrentNodePanos(F)
  20922. if(this.hasChanged(N)){
  20923. this.lastChangeTime = Date.now(),
  20924. !this.mouseDown && this.containsMouse && this.updateIntersect()
  20925. this.emit(W.ViewChanged, N)
  20926. //add:
  20927. if(N.cameraChanged){
  20928. Hot.updateHots()
  20929. this.mode == "panorama" && window.cad && cad.setSign({ x: this.position.x, y: this.position.z },this.cameraControls.controls.panorama.lon);
  20930. }
  20931. }
  20932. this.model.supportsTiles && (this.updateTileDownloader(F),
  20933. this.updatePanoRenderer(F)),
  20934. this.updatePreRendering(F),
  20935. this.reticule.update(),
  20936. this.path.update(),
  20937. this.spider.update(),
  20938. this.cachedPanoCandidates && k.navigation.panoScores && this.model.panos.showPanoScores(this.cachedPanoCandidates),
  20939. this.updateControlLocks(),
  20940. this.model.supportsTiles && this.updateZoomPano()
  20941. }
  20942. ),
  20943. t.prototype.updatePersistentZooming = function(e) {
  20944. 1 === this.zooming ? this.zoomBy(1 + this.zoomSpeed * e) : -1 === this.zooming && this.zoomBy(1 - this.zoomSpeed * e)
  20945. }
  20946. ,
  20947. t.prototype.updateControlLocks = function() {
  20948. this.currentPano && this.model.supportsTiles && (this.cameraControls.controls[V.PANORAMA].locked = !this.currentPano.highestFullTileRenderOpCompleted && this.currentPano.lockUntilRenderingComplete)
  20949. }
  20950. ,
  20951. t.prototype.updatePanoRenderer = (D = new B.Vector3,
  20952. function(e) {
  20953. var t = this.nextPano || this.currentPano;
  20954. this.panoRenderer.hasQueuedTiles() && t && (D.copy(T.FORWARD),
  20955. this.getDirection(D),
  20956. this.panoRenderer.updateDirection(D))
  20957. }
  20958. ),
  20959. t.prototype.cleanupInactivePanos = (O = [],
  20960. L = [],
  20961. function() {
  20962. O.length = 0,
  20963. O.push(this.currentPano),
  20964. this.nextPano && O.push(this.nextPano);
  20965. for (var e = L.length = 0; e < this.panoRenderer.activePanos.length; e++)
  20966. L.push(this.panoRenderer.activePanos[e]);
  20967. for (var t = 0; t < L.length; t++) {
  20968. for (var i = L[t], n = !0, r = 0; r < O.length; r++)
  20969. i.id === O[r].id && (n = !1);
  20970. n && i.exit()
  20971. }
  20972. }
  20973. ),
  20974. t.prototype.updatePreRendering = (w = {},
  20975. function(e) {
  20976. if (1 === k.tiling.preRenderTourPanos && this.preRenderingEnabled) {
  20977. var t = this.nextPano || this.currentPano;
  20978. if (t && e && 1 < e.length) {
  20979. var i = e.findIndex(function(e) {
  20980. if (e.id === t.id)
  20981. return !0
  20982. });
  20983. if (0 <= i && i + 1 < e.length) {
  20984. var n = e[i + 1];
  20985. n.isLoaded(this.basePanoSize) || w[n.id] || (window.setTimeout(function(e) {
  20986. this.checkAndWaitForPanoLoad(e, "high", "low", this.basePanoSize, null, null, null, !1, !1, !1),
  20987. window.setTimeout(function(e) {
  20988. w[e.id] = !1
  20989. }
  20990. .bind(this, e), k.tiling.panoPreRenderRepeatDelay)
  20991. }
  20992. .bind(this, n), k.tiling.panoPreRenderDelay),
  20993. w[n.id] = !0)
  20994. }
  20995. }
  20996. }
  20997. }
  20998. ),
  20999. t.prototype.enablePreRendering = function() {
  21000. this.preRenderingEnabled = !0
  21001. }
  21002. ,
  21003. t.prototype.disablePreRendering = function() {
  21004. this.preRenderingEnabled = !1,
  21005. this.cleanupInactivePanos()
  21006. }
  21007. ,
  21008. t.prototype.updateTileDownloader = (b = new B.Vector3,
  21009. function(e) {
  21010. var t = this.nextPano || this.currentPano;
  21011. t && (b.copy(T.FORWARD),
  21012. this.getDirection(b),
  21013. this.tileDownloader.tilePrioritizer.updateCriteria(t, this.position, b, 0 < e.length ? e : null),
  21014. this.tileDownloader.processPriorityQueue = !0)
  21015. }
  21016. ),
  21017. t.prototype.updateFromControls = function(e) {
  21018. null != e || (e = 0),
  21019. this.cameraControls.activeControl && (this.cameraControls.activeControl.update(e),
  21020. this.quaternion.copy(this.cameraControls.activeControl.camera.quaternion),
  21021. this.position.copy(this.cameraControls.activeControl.camera.position),
  21022. this.target.copy(this.cameraControls.activeControl.target),
  21023. this.cameraControls.activeControl.camera.updateProjectionMatrix(),
  21024. this.camera.projectionMatrix.copy(this.cameraControls.activeControl.camera.projectionMatrix)),
  21025. this.camera.position.copy(this.position),
  21026. this.camera.quaternion.copy(this.quaternion),
  21027. this.camera.updateMatrix(),
  21028. this.camera.updateMatrixWorld()
  21029. }
  21030. ,
  21031. t.prototype.hasChanged = function(e) {
  21032. if (!this.previousState){
  21033. e.cameraChanged = true
  21034. return this.previousState = {
  21035. allFloorsVisible: this.model.allFloorsVisible,
  21036. position: this.position.clone(),
  21037. quaternion: this.quaternion.clone(),
  21038. mouse: this.mouse.clone(),
  21039. labelScaleFactor: this.getLabelScaleFactor(),
  21040. currentFloor: this.model.currentFloor,
  21041. projectionMatrix: this.camera.projectionMatrix.clone(),
  21042. worldMatrix: this.camera.matrixWorld.clone(),
  21043. mode: this.mode,
  21044. modelPosition: this.model.position.clone(),
  21045. modelCenter: this.model.center.clone(),
  21046. zoomLevel: this.zoomLevel
  21047. },
  21048. !0;
  21049. }
  21050. //许钟文改 分成相机是否改变cameraChanged 和其他
  21051. var a = this.position.equals(this.previousState.position) && this.quaternion.equals(this.previousState.quaternion)&& this.camera.matrixWorld.equals(this.previousState.worldMatrix) && this.camera.projectionMatrix.equals(this.previousState.projectionMatrix) && this.mode === this.previousState.mode && this.zoomLevel === this.previousState.zoomLevel && this.model.center.equals(this.previousState.modelCenter) && this.model.position.equals(this.previousState.modelPosition)
  21052. var t = a && this.mouse.equals(this.previousState.mouse) && this.model.allFloorsVisible === this.previousState.allFloorsVisible /* && this.getLabelScaleFactor() === this.previousState.labelScaleFactor */ && this.model.currentFloor === this.previousState.currentFloor && null === this.nextPano ;
  21053. e.cameraChanged = !a;
  21054. //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;
  21055. return e.allFloorsVisible = this.model.allFloorsVisible !== this.previousState.allFloorsVisible,
  21056. e.moved = !this.position.equals(this.previousState.position),
  21057. e.rotated = !this.quaternion.equals(this.previousState.quaternion),
  21058. e.mouseMoved = !this.mouse.equals(this.previousState.mouse),
  21059. e.labelScaleFactor = this.getLabelScaleFactor() !== this.previousState.labelScaleFactor,
  21060. e.floorChanged = this.model.currentFloor !== this.previousState.currentFloor,
  21061. e.cameraProjectionChanged = !this.camera.projectionMatrix.equals(this.previousState.projectionMatrix),
  21062. e.cameraWorldMatrixChanged = !this.camera.matrixWorld.equals(this.previousState.worldMatrix),
  21063. e.modeChanged = this.mode !== this.previousState.mode,
  21064. e.modelPositionChanged = !this.model.position.equals(this.previousState.modelPosition),
  21065. e.modelCenterChanged = !this.model.center.equals(this.previousState.modelCenter),
  21066. e.nextPanoActive = null !== this.nextPano,
  21067. e.zoomLevel = this.zoomLevel !== this.previousState.zoomLevel,
  21068. this.previousState.allFloorsVisible = this.model.allFloorsVisible,
  21069. this.previousState.position.copy(this.position),
  21070. this.previousState.quaternion.copy(this.quaternion),
  21071. this.previousState.mouse.copy(this.mouse),
  21072. this.previousState.labelScaleFactor = this.getLabelScaleFactor(),
  21073. this.previousState.currentFloor = this.model.currentFloor,
  21074. this.previousState.projectionMatrix.copy(this.camera.projectionMatrix),
  21075. this.previousState.worldMatrix.copy(this.camera.matrixWorld),
  21076. this.previousState.mode = this.mode,
  21077. this.previousState.modelPosition.copy(this.model.position),
  21078. this.previousState.modelCenter.copy(this.model.center),
  21079. this.previousState.zoomLevel = this.zoomLevel,
  21080. !t
  21081. }
  21082. ,
  21083. t.prototype.updateIntersect = function() {
  21084. var e = this.flying || this.isWarping()
  21085. , t = this.isOutsideMode() && this.cameraControls.controls[this.mode].isEngaged()
  21086. , i = G.getById(q.LookTransition);
  21087. e || t || this.isTouchEvent || i.length && i[0].running;
  21088. {//clear:
  21089. //if(this.intersectHot) this.intersectHot.hideTitle()
  21090. if(this.intersectHot) this.intersectHot.setHoverState(false)
  21091. this.intersectHot = null
  21092. //$("#player").css("cursor", "")
  21093. CursorDeal.remove('hoverFootIcon' )
  21094. CursorDeal.remove('hoverRouteLine' )
  21095. CursorDeal.remove('hoverHot' )
  21096. $(".toolRight .spotList ul li").removeClass("active")
  21097. }
  21098. var deal = ()=>{
  21099. if(this.intersect && this.intersect.object.visible ){
  21100. if("hotSprite" == this.intersect.object.type){
  21101. this.intersectHot = this.intersect.object
  21102. while(!(this.intersectHot instanceof Hot)){
  21103. this.intersectHot = this.intersectHot.parent
  21104. }
  21105. $(`.toolRight .spotList ul li[data-spid=${this.intersectHot.sid}]`).addClass("active")
  21106. this.intersectHot.setHoverState(true)
  21107. }
  21108. }
  21109. }
  21110. if (window.VisiSet && (VisiSet.setPanoVisible || VisiSet.setTagVisible || VisiSet.setPanoLog || VisiSet.setRoute )) {
  21111. let meshes = this.model.hotGroup.children.slice()
  21112. if(VisiSet.routeInfo?.operation == 'removeLink'){
  21113. meshes.push(...VisiSet.meshGroup.children.filter(e=>e.name.includes('routeLine:')))
  21114. }else{
  21115. meshes.push(...VisiSet.footIcons)
  21116. }
  21117. this.intersect = this.getMouseIntersect(null, meshes );
  21118. deal()
  21119. if(this.intersect){
  21120. if(VisiSet.routeInfo?.operation == 'removeLink'){
  21121. CursorDeal.add('hoverRouteLine' )
  21122. }else{
  21123. CursorDeal.add('hoverFootIcon' ) //$("#player").css("cursor", "pointer");
  21124. }
  21125. }
  21126. if(this.intersectHot){
  21127. this.intersect = null
  21128. }
  21129. return
  21130. }else if (g_HotStatus) {//加热点
  21131. this.intersect = this.getMouseIntersect(null, this.model.colliders.concat(this.model.skybox));
  21132. if(this.intersect){
  21133. //$("#player").css("cursor", "cell")
  21134. CursorDeal.remove('noIntersect' )
  21135. }else{
  21136. //$("#player").css("cursor", "not-allowed")
  21137. CursorDeal.add('noIntersect' )
  21138. }
  21139. return;
  21140. }else{
  21141. if(this.model.hotGroup){
  21142. if(editTool.atPanel == 'hotpoint'){
  21143. var hots = this.model.hotGroup.children
  21144. }else{
  21145. var hots = this.model.hotGroup.children.filter(e=> e.info.actionType.examine || e.info.actionType.fastTran || e.info.actionType.openHot || e.info.actionType.playAndPause)
  21146. }
  21147. let colliders = this.model.floors.reduce(function(e, t) {
  21148. return t.hidden ? e : e.concat(t.collider.children)
  21149. }, this.mode === 'panorama' ? this.panoMarkers : []);
  21150. this.intersect = this.getMouseIntersect(null, hots.concat(colliders));
  21151. if(this.intersect){
  21152. deal()
  21153. this.intersectHot && CursorDeal.add('hoverHot' ) //$("#player").css("cursor", "pointer");
  21154. if(this.intersect){
  21155. deal()
  21156. let intersect = this.intersect
  21157. if(this.intersectHot){
  21158. this.intersect = null
  21159. $("#player").css("cursor", "pointer");
  21160. }else{
  21161. if(intersect.object.parent.parent.hidden ){//楼层已隐藏
  21162. this.intersect = null
  21163. }
  21164. }
  21165. }
  21166. }
  21167. }else{
  21168. this.intersect = this.getMouseIntersect()
  21169. }
  21170. }
  21171. this.intersect && this.updateClosestPano(this.intersect),
  21172. this.closestPano || this.closestPanoInDirection(this.getMouseDirection()) ? (this.reticule.updatePosition(this.position, this.intersect),
  21173. k.navigation.panoScores && !k.navigation.mouseDirection && this.closestPanoInDirection(this.getDirection())) : this.reticule.hide()
  21174. }
  21175. ,
  21176. t.prototype.checkHotClick = function() {
  21177. if (this.intersectHot){
  21178. if (window.VisiSet && VisiSet.setTagVisible ) {
  21179. VisiSet.SetOneTagVisible(this.intersectHot); //设置这个热点的可见性
  21180. return;
  21181. }else if(editTool.atPanel == 'hotpoint'){
  21182. let f = ()=>{editTool.hotpoint.editHot(this.intersectHot)}
  21183. if(editTool.hotpoint.editSpot && this.intersectHot != editTool.hotpoint.editSpot){
  21184. editTool.hotpoint.unsaveWarn(f)
  21185. }else{
  21186. f()
  21187. }
  21188. }else{
  21189. if(this.intersectHot.texType == "video" && this.intersectHot.info.actionType.playAndPause){
  21190. this.intersectHot.switchPlay(!!this.intersectHot.pausedByUser)
  21191. }
  21192. this.intersectHot.examine()
  21193. }
  21194. return !0
  21195. }
  21196. }
  21197. ,
  21198. t.prototype.getMouseDirection = function(e) {
  21199. e = e || this.mouse;
  21200. var t = new B.Vector3(e.x,e.y,-1).unproject(this.camera);
  21201. return new B.Vector3(e.x,e.y,1).unproject(this.camera).sub(t).normalize()
  21202. }
  21203. ,
  21204. /* t.prototype.hoverOverlay = function(mesh){
  21205. if(!mesh){
  21206. this.hoveringPlane = null;
  21207. $("#player").css("cursor",this.currentCursor || "" );
  21208. }else{
  21209. var overlay = mesh.parent;
  21210. $("#player").css("cursor","pointer");
  21211. this.hoveringPlane = overlay;
  21212. return true;
  21213. }
  21214. }, */
  21215. t.prototype.clickOverlay = function(overlay){
  21216. if(this.openOverlay && !overlay)return;
  21217. var plane = overlay.plane;
  21218. if(overlay.texType == "video"){
  21219. overlay.switchPlay(!!overlay.pausedByUser)
  21220. }
  21221. if(window.EditOverlay && EditOverlay.editing){
  21222. if(EditOverlay.editPlane && overlay != EditOverlay.editPlane){
  21223. var sure = confirm("是否保存当前展览?")
  21224. if(sure){
  21225. $("#overlayProp button.submit").click()
  21226. }else{
  21227. EditOverlay.closeOverlayPanel('cancel')
  21228. }
  21229. }
  21230. EditOverlay.beginEdit(overlay);
  21231. return;
  21232. }
  21233. },
  21234. t.prototype.getMouseIntersect = function(e, t1) {
  21235. e = e || this.mouse.clone()
  21236. var t = t1 || this.model.floors.reduce(function(e, t) {
  21237. return t.hidden ? e : e.concat(t.collider.children)
  21238. }, this.mode === V.PANORAMA ? this.panoMarkers : []),
  21239. t = t.slice(0)
  21240. i = new B.Vector3(e.x,e.y,-1).unproject(this.camera);
  21241. this.raycaster.set(i, this.getMouseDirection(e));
  21242. var n = this.raycaster.intersectObjects(t , true );//add true
  21243. var o = n[0];
  21244. if(o){
  21245. o.face && (o.normal = o.face.normal.applyQuaternion(o.object.quaternion),
  21246. this.position.clone().sub(o.point).dot(o.normal) < 0 && o.normal.negate(),
  21247. this.currentPano ? o.onFloor = o.point.y < this.position.y - .5 * this.currentPano.height : o.onFloor = o.point.y < this.position.y - .5,
  21248. o.horizontal = .8 < o.normal.y);
  21249. return o
  21250. }
  21251. }
  21252. ,
  21253. t.prototype.updateClosestPano = function(e) {
  21254. var t = [a.filters.isPanoAligned()];
  21255. if (this.mode === V.PANORAMA) {
  21256. if (!this.currentPano)
  21257. return;
  21258. t.push(a.filters.not(this.currentPano)),
  21259. t.push(a.filters.isNeighbourPanoTo(this.currentPano)),
  21260. t.push(a.filters.inFloorDirection(this.currentPano.floorPosition, this.getDirection(), .25)),
  21261. t.push(a.filters.isCloseEnoughTo(e.point, k.panoFloorClickRadius)),
  21262. t.push(a.filters.isNotBehindNormal(e.point, e.normal))
  21263. } else{
  21264. t.push(a.filters.isOnVisibleFloor()),
  21265. t.push(this.checkHasNeighbor)//add
  21266. this.mode !== V.FLOORPLAN && t.push(a.filters.inDirection(this.position, this.getDirection(), .25));
  21267. }
  21268. var i = this.model.panos.find(t, [a.sortFunctions.floorDistanceToPoint(e.point)]);
  21269. i !== this.closestPano ? (i && (this.isPanoHover = !0),
  21270. this.emit(W.ClosestPanoChanging, this.closestPano, i, this.mode),
  21271. this.closestPano = i,
  21272. this.closestPano && this.mode == 'panorama'? (CursorDeal.add('hoverPano' )/*, this.reticule.visible = false */)
  21273. : (CursorDeal.remove('hoverPano' )/*, this.reticule.visible = true */)
  21274. ) : this.isPanoHover = !1
  21275. }
  21276. ,
  21277. t.prototype.dollhouseMode = function(e, t) {
  21278. this.emit(W.ModeChanging, this.mode, V.DOLLHOUSE),
  21279. this.mode = V.DOLLHOUSE,
  21280. this.cameraControls.controls[V.DOLLHOUSE].reset();
  21281. var i = new B.Vector3(this.model.center.x,0,this.model.center.z)
  21282. , n = new B.Vector3(15,10,15);
  21283. if (e && t) {
  21284. var r = T.FORWARD.clone().applyQuaternion(t)
  21285. , o = this.model.center.clone().sub(e).dot(r);
  21286. 0 < o ? (i = r.clone().multiplyScalar(o).add(e),
  21287. n.copy(e)) : Y.warn("Tried to initiate dollhouse mode that wasn't looking at the model", e, t)
  21288. }
  21289. this.cameraControls.controls[V.DOLLHOUSE].resetRanges(0, !0),
  21290. this.cameraControls.controls[V.DOLLHOUSE].target.copy(i),
  21291. this.cameraControls.cameras[V.DOLLHOUSE].position.copy(n),
  21292. this.updateFromControls(),
  21293. this.model.alpha = 1,
  21294. this.model.skybox.material.uniforms.opacity.value = 0
  21295. }
  21296. ,
  21297. t.prototype.insideMode = function(e, t) {
  21298. var i = $.Deferred()
  21299. , n = t || null;
  21300. if (this.mode !== V.PANORAMA && this.mode !== V.TRANSITIONING) {
  21301. var r = [a.filters.isPanoAligned()];
  21302. this.model.currentFloor && r.push(a.filters.atFloor(this.model.currentFloor)),
  21303. e = e || this.currentPano || this.model.panos.find(r, [a.sortFunctions.distanceToPoint(this.cameraControls.activeControl.target)]),
  21304. this.flyToNewMode({
  21305. mode: V.PANORAMA,
  21306. pano: e,
  21307. callback: n
  21308. }).done(i.resolve.bind(i)).fail(i.reject.bind(i))
  21309. } else {
  21310. var o = this.mode === V.PANORAMA ? "Already in panorama mode" : "Cannot change mode during mode transition";
  21311. i.reject(o)
  21312. }
  21313. return i.promise()
  21314. }
  21315. ,
  21316. t.prototype.fitDollhouse = function(e, t, i) {
  21317. var maxY = this.model.boundingBox.max.y;//add
  21318. var n = T.FORWARD.clone().applyQuaternion(i);
  21319. i = n.clone().add(e);
  21320. this.cameraControls.activeControl.target.copy(i),
  21321. this.cameraControls.activeControl.camera.position.set(0, maxY * 2.4, 0).add(e).add(n.multiplyScalar(-10))
  21322. }
  21323. ,
  21324. t.prototype.floorplanMode = function(e, t, i) {
  21325. this.mode = V.FLOORPLAN;
  21326. var n = this.cameraControls.controls[V.FLOORPLAN];
  21327. n.reset();
  21328. var r = e || this.model.center;
  21329. if (n.target.copy(r).setY(0),
  21330. n.camera.position.copy(r).setY(k.floorplan.cameraHeight),
  21331. i ? (n.currentScale = i / ($("#player").width() / $("#player").height()),
  21332. n.absoluteScale = n.currentScale) : n.zoomToContain(this.model.size),
  21333. t) {
  21334. var o = T.LEFT.clone().applyQuaternion(t);
  21335. n.rotateLeft(-Math.atan2(o.x, o.z))
  21336. } else
  21337. n.rotateToView(this.model.size, this.getDirection());
  21338. n.update(0)
  21339. }
  21340. ,
  21341. t.prototype.nonInterruptingFlyToPano = function(e, t) {
  21342. return e.skipWarpingCheck = !0,
  21343. this.flyToPano(e, t)
  21344. }
  21345. ,
  21346. t.prototype.updateMarkerVisi = function() {//加
  21347. if(this.mode != "panorama")return;
  21348. this.model.panos.list.forEach((pano)=>{
  21349. if(!pano.marker)return;
  21350. pano.marker.material.visible = !!pano.neighbourPanos[this.currentPano.id];
  21351. })
  21352. }
  21353. ,
  21354. /* t.prototype.updateHotVisible = function(pano){
  21355. if (window.VisiSet && (VisiSet.setPanoVisible || VisiSet.setPanoLog))return
  21356. var hots = this.model.hots;
  21357. pano = pano || this.currentPano;
  21358. for (var index in hots){
  21359. var visible;
  21360. if(this.mode != "panorama"){
  21361. visible = true;
  21362. }else{
  21363. //hots[index].mesh.material.depthTest = false;
  21364. visible = !hots[index].visiblePanos || hots[index].visiblePanos.indexOf(pano.id) > -1
  21365. }
  21366. hots[index].mesh.visible = visible;
  21367. }
  21368. }
  21369. */
  21370. t.prototype.flyToPano = function(e, t) {
  21371. var i, n = e.pano, aim = e.lookAtPoint, aimQua = e.quaternion,//ADD
  21372. o = e.duration, a = e.aimDuration, s = e.maxDistanceOverride,
  21373. l = e.skipWarpingCheck, c = e.constantMoveSpeed, h = null, u = null
  21374. if (aim){
  21375. var m = (new B.Matrix4).lookAt(n.position, aim, T.UP)
  21376. aimQua = (new B.Quaternion).setFromRotationMatrix(m)
  21377. }
  21378. else aimQua = aimQua
  21379. var zoomLevel = e.zoomLevel || 1 //add
  21380. if(this.flying) return t && t(e)
  21381. if (window.specialScene && specialScene.special().specifySpot && specialScene.special().specifySpot(n),
  21382. this.isWarping() && !l && (this.path.activeTransType === R.BLACK || this.path.activeTransType === R.STD))
  21383. return Y.warn("Player.flyToPano() -> Cannot fly when warping"),
  21384. t && t(),
  21385. !1;
  21386. this.updateLastView()
  21387. if (this.mode !== V.PANORAMA)
  21388. return void this.flyToNewMode({
  21389. mode: V.PANORAMA,
  21390. pano: n,
  21391. duration: o,
  21392. quaternion: aimQua,
  21393. callback: t
  21394. });
  21395. if (!n || (h = x.deepExtend(e), u = function() {
  21396. j.delayOneFrame(function() {
  21397. this.flyToPano(h, t)
  21398. }.bind(this))
  21399. }.bind(this),
  21400. !this.checkAndWaitForPanoLoad(n, "high", "low", this.basePanoSize, u))) {
  21401. var d = function(e) {
  21402. t && t(e)
  21403. }
  21404. .bind(this);
  21405. this.currentPano || (this.currentPano = n,
  21406. this.path.placeCpm(),
  21407. this.path.fadeOutCpm(k.path.fadeOutTime),
  21408. this.spider.draw());
  21409. var p = o;
  21410. if ("number" != typeof o) {
  21411. var f = s || k.transition.flytimeMaxDistanceThreshold;
  21412. p = Math.min(this.currentPano.position.distanceTo(n.position), f) * k.transition.flytimeDistanceMultiplier + k.transition.flyTime
  21413. }
  21414. if (.01 < k.transition.flySpeed && (p = 1e3 * this.currentPano.position.distanceTo(n.position) / k.transition.flySpeed),
  21415. zoomLevel !== this.zoomLevel)
  21416. switch (k.zoom.transitionStyle) {
  21417. case 1:
  21418. this.smoothZoomFovTo(null, zoomLevel, zoomLevel == 1 ? p / 2 : p); //改
  21419. break;
  21420. case 2:
  21421. return h = x.deepExtend(e),
  21422. u = this.flyToPano.bind(this, h, t),
  21423. void this.smoothZoomFovTo(null, zoomLevel, k.zoom.restoreTime * (this.zoomLevel - 1), u)
  21424. }
  21425. if (aimQua) {
  21426. G.cancelById(q.LookTransition),
  21427. p *= k.transition.aimSlowFactor;
  21428. var g = this.cameraControls.activeControl.camera.quaternion.clone()
  21429. , y = g.clone()
  21430. , A = new B.Vector3;
  21431. if (n === this.currentPano) {
  21432. var C = T.FORWARD.clone().applyQuaternion(g)
  21433. , I = T.FORWARD.clone().applyQuaternion(aimQua)
  21434. , E = C.angleTo(I);
  21435. return null != a || (a = 1 * Math.sqrt(E) / k.tags.navigate.rotateSpeedFactor * 1e3),
  21436. void G.start(function(e) {
  21437. y.copy(g),
  21438. H.quaternion(y, aimQua)(e),
  21439. A.copy(T.FORWARD).applyQuaternion(y).add(this.cameraControls.activeControl.camera.position),
  21440. this.cameraControls.activeControl.lookAt(A)
  21441. }
  21442. .bind(this), a, d, 0, z[k.transition.movementEasing], null, q.LookTransition)
  21443. }
  21444. }
  21445. if (n === this.currentPano )
  21446. return void d();
  21447. this.flying = !0;
  21448. var _ = this.position.clone()
  21449. , b = this.currentPano;
  21450. Y.debug("Flying to pano ", n.position);
  21451. this.emit(W.PanoChosen, this.currentPano, n);
  21452. this.emit(W.FlyingStarted, n.position, _, n, b);
  21453. this.transitionPos({type:"beforeFlytopano", pano:n, dur:p})//add
  21454. Hot.updateVisibles([this.currentPano, n],'every')
  21455. aimQua && G.start(function(e) {
  21456. y.copy(g),
  21457. H.quaternion(y, aimQua)(e),
  21458. A.copy(T.FORWARD).applyQuaternion(y).add(this.cameraControls.activeControl.camera.position),
  21459. this.cameraControls.activeControl.lookAt(A)
  21460. }
  21461. .bind(this), p, null, 0, z[k.transition.movementEasing], null, q.LookTransition);
  21462. var w = c ? null : z[k.transition.movementEasing];
  21463. this.nextPano = n;
  21464. G.start(H.uniform(this.model.skybox, "progress", 1), p, null, 0, z[k.transition.blendEasing], "skyFly", q.FlyToPano),
  21465. G.start(H.allUniforms(this.model.chunks, "progress", 1), p, null, 0, z[k.transition.blendEasing], "chunkFly", q.FlyToPano),
  21466. G.start(H.vector(this.cameraControls.cameras[V.PANORAMA].position, n.position), p, function(e) {
  21467. this.flying = !1,
  21468. this.currentPano !== n && this.currentPano.exit(),
  21469. n.enter(),
  21470. this.currentPano = n,
  21471. this.nextPano = null,
  21472. this.path.placeCpm(),
  21473. this.path.fadeOutCpm(k.path.fadeOutTime),
  21474. this.spider.draw(),
  21475. this.emit(W.FlyingEnded, n.position, _, n, b),
  21476. this.updateMarkerVisi();//add
  21477. d(e)
  21478. if(this.mode == "panorama" ){
  21479. //EditOverlay.updatePano()
  21480. editTool.hotpoint.updatePano()
  21481. Hot.updateVisibles([this.currentPano])
  21482. this.model.fadePanoMarkers()//add
  21483. }
  21484. }
  21485. .bind(this), 0, w, "camFly", q.FlyToPano)
  21486. }
  21487. }
  21488. ,
  21489. t.prototype.blackToPano = function(o={}) {//add 瞬间过渡
  21490. if(this.flying || this.isWarping() )return;
  21491. let pano = o.pano || this.model.panos.index[o.panoId]
  21492. if(this.mode != 'panorama'){
  21493. return this.flyToNewMode({
  21494. mode : 'panorama',
  21495. pano,
  21496. quaternion: o.quaternion
  21497. })
  21498. }
  21499. let oldPos = this.position.clone();
  21500. let oldPano = this.currentPano
  21501. this.path.warpDestPano = pano
  21502. var retry = ()=>{
  21503. this.waitingToWarp = !1,
  21504. this.blackToPano(o)
  21505. }
  21506. if (this.checkAndWaitForPanoLoad(pano, "high", "low", this.basePanoSize, retry))
  21507. return void (this.waitingToWarp = !0)
  21508. this.emit("pano.chosen", oldPano, pano)
  21509. console.log('blackToPano')
  21510. this.flying = true
  21511. this.nextPano = pano //提前加载高清图片
  21512. this.path.warpDestHeroLoc = {
  21513. panoId : o.panoId,
  21514. position: pano.position,
  21515. quaternion: o.quaternion || this.quaternion.clone()
  21516. }
  21517. this.path.warpTravel_BLACK(null, 1500,1, ()=>{
  21518. pano != this.currentPano && this.currentPano.exit()
  21519. pano.enter()
  21520. this.currentPano = pano
  21521. this.emit("flying.ended", pano.position, oldPos, pano, oldPano)
  21522. this.flying = false
  21523. this.nextPano = null
  21524. this.updateMarkerVisi();//add
  21525. console.log('blackToPano end')
  21526. } )
  21527. }
  21528. window._transitionPosId = 9999
  21529. t.prototype.transitionPos = function(o={}) {//渐变overlay和热点的位置
  21530. G.cancelById(_transitionPosId)
  21531. var begin = function(object, pos, qua, scale){
  21532. if(pos){
  21533. if(!same(object.position, pos, 0.01)){
  21534. G.start(H.vector(object.position, pos), o.dur, (e)=>{
  21535. },0, z[k.transition.movementEasing], "transitionPos", _transitionPosId)
  21536. }
  21537. if(qua && !same(object.quaternion, qua, 1e-6)){
  21538. G.start(H.quaternion(object.quaternion, qua), o.dur, (e)=>{
  21539. },0, z[k.transition.movementEasing], "transitionPos", _transitionPosId)
  21540. }
  21541. if(scale && !same(object.scale, scale, 0.001)){
  21542. G.start(H.vector(object.scale, scale), o.dur, (e)=>{
  21543. },0, z[k.transition.movementEasing], "transitionPos", _transitionPosId)
  21544. }
  21545. }
  21546. }
  21547. var same = function(vec1, vec2, diff){
  21548. var s = Math.abs(vec1.x-vec2.x) < diff && Math.abs(vec1.y-vec2.y) < diff && Math.abs(vec1.z-vec2.z) < diff
  21549. if(s && vec1.w) s = Math.abs(vec1.w-vec2.w) < diff
  21550. return s
  21551. }
  21552. var sid = o.pano != void 0 ? o.pano.id : "outside";
  21553. /* this.model.hotGroup.children.forEach(overlay=>{
  21554. var panoData = overlay.transformAtPanos[sid]
  21555. var useCustom = !panoData
  21556. //if(overlay.usingTransformData || !useCustom){
  21557. var pos = useCustom ? overlay.posCustom : panoData.pos;
  21558. var qua = useCustom ? overlay.quaCustom : panoData.qua;
  21559. var scale = useCustom ? overlay.getScaleBySize(overlay.widthCustom, overlay.heightCustom) :
  21560. overlay.getScaleBySize(panoData.width , panoData.height)
  21561. scale = new THREE.Vector3(scale.x, scale.y, overlay.scale.z)
  21562. begin(overlay, pos, qua, scale )
  21563. //}
  21564. overlay.usingTransformData = !useCustom
  21565. }) */
  21566. for(let i in this.model.hots){//是否判断visible?
  21567. var hot = this.model.hots[i];
  21568. var panoData = hot.info.transformAtPanos[sid];
  21569. var useCustom = !panoData
  21570. //if(hot.usingTransformData || !useCustom){
  21571. var pos = useCustom ? hot.info.position : panoData.pos;
  21572. var qua = hot.isSprite ? null : (useCustom ? hot.info.quaternion : panoData.qua);
  21573. var scale = useCustom ? hot.info.scale : panoData.scale;
  21574. begin(hot, pos , qua, scale )
  21575. //}
  21576. //hot.usingTransformData = !useCustom;
  21577. }
  21578. }
  21579. window._tranOutsideFocus = 4399
  21580. t.prototype.focusPoint = function(o={}){//当在外时,聚焦相机到这一点
  21581. //console.log("focusPoint")
  21582. if(this.mode == "floorplan"){
  21583. var modelSize = o.modelSize || new THREE.Vector3(8,8,8);//可视范围
  21584. var control = player.cameraControls.controls.floorplan;
  21585. var absoluteScale = control.getDefaultAbsoluteScale(modelSize)
  21586. var currentScale = control.absoluteScale;
  21587. var currentTarget = control.target.clone()
  21588. G.cancelById(window._tranOutsideFocus, true);
  21589. G.start(function(progress){
  21590. control.absoluteScale = absoluteScale*progress + currentScale*(1-progress);
  21591. control.target = o.aim.clone().multiplyScalar(progress).add(currentTarget.clone().multiplyScalar(1-progress))
  21592. control.camera.position.copy(control.target.clone().add(control.offset)) //维持角度
  21593. }.bind(this) , o.dur || 600, null/* cancelFuc */, 0, z[k.transition.movementEasing], "outsideFocus", window._tranOutsideFocus, null/* cancelFuc */);
  21594. }else if(player.mode == "dollhouse"){
  21595. var control = player.cameraControls.controls.dollhouse;
  21596. var radius = o.radius || 8;
  21597. var currentTarget = control.target.clone()
  21598. var dir = control.offset.clone().normalize()
  21599. var currentRadius = control.offset.length();
  21600. G.cancelById(window._tranOutsideFocus, true);
  21601. G.start(function(progress){
  21602. control.target = o.aim.clone().multiplyScalar(progress).add(currentTarget.clone().multiplyScalar(1-progress))
  21603. let radius_ = radius*progress+currentRadius*(1-progress)
  21604. control.camera.position.copy(control.target.clone().add(dir.clone().multiplyScalar(radius_)))
  21605. }.bind(this) , o.dur || 600, null/* cancelFuc */, 0, z[k.transition.movementEasing], "outsideFocus", window._tranOutsideFocus, null/* cancelFuc */);
  21606. }else if(this.mode == 'panorama'){
  21607. this.flyToPano({
  21608. lookAtPoint: o.aim.clone() ,
  21609. pano: this.currentPano,
  21610. aimDuration: o.dur || 600
  21611. })
  21612. }
  21613. }
  21614. t.prototype.fastForwardActivePanoFlight = function(e) {
  21615. e = e || k.transition.fastForwardFactor / 10 * 4 + 1,
  21616. G.adjustSpeed(q.FlyToPano, e),
  21617. G.adjustSpeed(q.LookTransition, e)
  21618. }
  21619. ,
  21620. t.prototype.flyToPanoClosestToMouse = function() {
  21621. if (50 < Date.now() - this.mouseLastMoveTime && (this.intersect = this.getMouseIntersect(),
  21622. this.intersect && this.updateClosestPano(this.intersect)),
  21623. this.closestPano)
  21624. return this.flyToPano({
  21625. pano: this.closestPano
  21626. });
  21627. var e = this.getMouseDirection();
  21628. this.flyDirection(e) || this.flyToPano({
  21629. pano: this.currentPano
  21630. })
  21631. }
  21632. ,
  21633. t.prototype.flyLocalDirection = function(e) {
  21634. var t = this.getDirection(e)
  21635. , i = 1 === e.z ? .4 : .75
  21636. , n = 1 === Math.abs(e.x);
  21637. return this.flyDirection(t, i, n)
  21638. }
  21639. ,
  21640. t.prototype.flyDirection = function(e, t, i) {
  21641. Hot.closePopup();//xzw add
  21642. var n = $.Deferred();
  21643. this.history.invalidate();
  21644. var r = this.closestPanoInDirection(e, t, i);
  21645. return r ? this.flyToPano({
  21646. pano: r
  21647. }, n.resolve.bind(n, !0)) : (this.bump(e),
  21648. n.resolve(!1)),
  21649. n.promise()
  21650. }
  21651. ,
  21652. t.prototype.closestPanoInDirection = function(e, t, i) {
  21653. return this.rankedPanoInDirection(0, e, t, i)
  21654. }
  21655. ,
  21656. t.prototype.rankedPanoInDirection = (_ = {
  21657. pano: null,
  21658. candidates: []
  21659. },
  21660. function(e, t, i, n) {
  21661. e = e || 0,
  21662. i = void 0 !== i ? i : .75;
  21663. var r = n ? "angle" : "direction";
  21664. return this.model.panos.findRankedByScore(e,
  21665. [a.filters.isPanoAligned(),
  21666. a.filters.not(this.currentPano),
  21667. a.filters.isNeighbourPanoTo(this.currentPano),
  21668. a.filters.inPanoDirection(this.position, t, i)
  21669. ],
  21670. [a.scoreFunctions.distanceSquared(this.currentPano), a.scoreFunctions[r](this.position, t)], _),
  21671. this.cachedPanoCandidates = _.candidates,
  21672. _.pano
  21673. }
  21674. ),
  21675. t.prototype.bump = function(e) {
  21676. if (this.mode === V.PANORAMA && !this.flying && !this.isWarping()) {
  21677. var t, i, n, r = k.transition, o = (r.flytimeMaxDistanceThreshold * r.flytimeDistanceMultiplier + r.flyTime) / 8, a = this.camera.getWorldDirection().dot(e);
  21678. if (.5 < Math.abs(a))
  21679. t = function() {
  21680. G.start(H.property(this.cameraControls.cameras[V.PANORAMA], "zoom", 0 < a ? 1.04 : .96), o, i, 0, z.easeInOutSine, "bumpZStart")
  21681. }
  21682. .bind(this),
  21683. i = function() {
  21684. G.start(H.property(this.cameraControls.cameras[V.PANORAMA], "zoom", 1), 5 * o, n, 0, z.easeInOutSine, "bumpZRelax")
  21685. }
  21686. .bind(this);
  21687. else {
  21688. var s = this.camera.position.clone()
  21689. , l = e.clone();
  21690. this.raycaster.set(s, l);
  21691. var c = this.model.floors.reduce(function(e, t) {
  21692. return e.concat(t.collider.children)
  21693. }, [])
  21694. , h = this.raycaster.intersectObjects(c)
  21695. , u = 0 < h.length ? h[0].distance / 25 : .04
  21696. , d = s.clone().add(l.multiplyScalar(u));
  21697. t = function() {
  21698. G.start(H.vector(this.cameraControls.cameras[V.PANORAMA].position, d), o, i, 0, z.easeInOutSine, "bumpTStart")
  21699. }
  21700. .bind(this),
  21701. i = function() {
  21702. G.start(H.vector(this.cameraControls.cameras[V.PANORAMA].position, s), 5 * o, n, 0, z.easeInOutSine, "bumpTRelax")
  21703. }
  21704. .bind(this)
  21705. }
  21706. n = function() {
  21707. this.flying = !1
  21708. }
  21709. .bind(this),
  21710. this.flying = !0,
  21711. t()
  21712. }
  21713. }
  21714. ,
  21715. t.prototype.changeFloor = function(e) {
  21716. if (!this.is360View(this.mode, this.currentPano))
  21717. if (this.mode === V.PANORAMA) {
  21718. var t = this.history.reversePano(e);
  21719. t && t.isAligned() ? this.flyToPano({
  21720. pano: t
  21721. }) : this.changeFloorByScore(e)
  21722. } else
  21723. this.model.setFloor(this.model.nextFloor(e) || this.model.currentFloor)
  21724. }
  21725. ,
  21726. t.prototype.changeFloorByScore = (E = {
  21727. pano: null,
  21728. candidates: []
  21729. },
  21730. function(e) {
  21731. var t = this.model.nextFloor(e);
  21732. 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),
  21733. void (E.pano ? (this.cachedPanoCandidates = E.candidates,
  21734. this.history.push(e, this.currentPano),
  21735. this.flyToPano({
  21736. pano: E.pano
  21737. })) : Y.warn("No pano found on selected floor, not moving there."))) : void Y.debug("player.changeFloor(" + e + "): no such floor")
  21738. }
  21739. ),
  21740. t.prototype.gotoFloor = function(e) {
  21741. var t = e - this.model.currentFloor.floorIndex;
  21742. this.changeFloor(t)
  21743. }
  21744. ,
  21745. t.prototype.getDirection = function(e) {
  21746. return (e = e || (new B.Vector3).copy(T.FORWARD)).applyQuaternion(this.camera.quaternion)
  21747. }
  21748. ,
  21749. t.prototype.flyToSameMode = function(e, t, i, n, r) {
  21750. if (r = r || $.Deferred(),
  21751. this.mode === V.TRANSITIONING)
  21752. return Y.warn("should not be transitioning here"),
  21753. n && n(!1),
  21754. r.reject().promise();
  21755. var o = i || !1
  21756. , a = i ? i.position : this.position
  21757. , s = this.position.clone()
  21758. , l = this.currentPano;
  21759. if (Y.debug("New pose in mode " + this.mode),
  21760. !e || (retryCallback = function() {
  21761. j.delayOneFrame(function() {
  21762. this.flyToSameMode(e, t, i, n, r)
  21763. }
  21764. .bind(this))
  21765. }
  21766. .bind(this),
  21767. !this.checkAndWaitForPanoLoad(e, "high", "low", this.basePanoSize, retryCallback))) {
  21768. var c = function() {
  21769. this.emit(W.FlyingEnded, a, s, e, l),
  21770. n && n(!0)
  21771. }
  21772. .bind(this)
  21773. , h = k[this.mode]
  21774. , u = void 0 !== t ? t : h.transitionTime
  21775. , d = new B.Vector3
  21776. , p = new B.Vector3;
  21777. if (this.emit(W.FlyingStarted, a, s, e, l),
  21778. this.mode === V.PANORAMA)
  21779. Y.warn("we should not be here for panorama views");
  21780. else if (this.mode === V.DOLLHOUSE)
  21781. if (o) {
  21782. var f = new B.Vector3(0,1,0);
  21783. this.cameraControls.controls[V.DOLLHOUSE].resetRanges(1, !0),
  21784. this.model.warpDestFloors(i.floorVisibility),
  21785. p.copy(i.position);
  21786. var g = new B.Vector3(0,0,-1).applyQuaternion(i.quaternion)
  21787. , m = new B.Raycaster(p.clone(),g.clone(),0,1 / 0).intersectObjects(this.model.colliders)
  21788. , v = 3;
  21789. m.length ? (d.copy(m[0].point),
  21790. v = .75 * p.distanceTo(d)) : (d.copy(g).multiplyScalar(3).add(p),
  21791. Y.debug("Tried to restore dollhouse mode that did not intersect...", i.position, i.quaternion));
  21792. var y = (new B.Matrix4).lookAt(p, d, f)
  21793. , A = (new B.Euler).setFromRotationMatrix(y, k.warp.eOrder)
  21794. , C = d.distanceTo(p)
  21795. , I = (new B.Matrix4).lookAt(this.cameraControls.cameras[V.DOLLHOUSE].position, this.cameraControls.controls[V.DOLLHOUSE].target, f)
  21796. , E = (new B.Euler).setFromRotationMatrix(I, k.warp.eOrder)
  21797. , _ = this.cameraControls.cameras[V.DOLLHOUSE].position.distanceTo(this.cameraControls.controls[V.DOLLHOUSE].target);
  21798. this.cameraControls.controls[V.DOLLHOUSE].resetRanges(Math.min(_, v), !0);
  21799. var b = new B.Euler(A.x - E.x,A.y - E.y,A.z - E.z,k.warp.eOrder);
  21800. b.y = b.y > Math.PI ? b.y -= 2 * Math.PI : b.y < -Math.PI ? b.y += 2 * Math.PI : b.y,
  21801. this.path.burnsDir = Math.sign(b.y);
  21802. var w = new B.Euler(0,0,0,k.warp.eOrder)
  21803. , T = new B.Vector3;
  21804. G.start(H.vector(this.cameraControls.controls[V.DOLLHOUSE].target, d), u, null, k.flydown.movementDelay, z[k.flydown.movementEasing], null, q.FlyToSameMode),
  21805. G.start(function(e, t) {
  21806. w.x = E.x + e * b.x,
  21807. w.y = E.y + e * b.y,
  21808. w.z = E.z + e * b.z;
  21809. var i = _ + e * (C - _);
  21810. T.set(0, 0, i).applyEuler(w).add(this.cameraControls.controls[V.DOLLHOUSE].target),
  21811. this.cameraControls.cameras[V.DOLLHOUSE].position.copy(T).add(this.model.position)
  21812. }
  21813. .bind(this), u, null, k.flydown.movementDelay, z[k.flydown.movementEasing], null, q.FlyToSameMode),
  21814. G.start(function(e, t) {
  21815. this.cameraControls.controls[V.DOLLHOUSE].update(),
  21816. this.quaternion.copy(this.cameraControls.cameras[V.DOLLHOUSE].quaternion),
  21817. this.position.copy(this.cameraControls.cameras[V.DOLLHOUSE].position)
  21818. }
  21819. .bind(this), u, null, k.flydown.movementDelay, z[k.flydown.movementEasing], null, q.FlyToSameMode)
  21820. } else
  21821. Y.warn("invalid warp destination in flyToSameMode()? ignore it then");
  21822. else if (this.path.placeCpm(),
  21823. this.path.fadeInCpm(k.path.fadeInTime),
  21824. i) {
  21825. this.model.warpDestFloors(i.floorVisibility);
  21826. var x = this.cameraControls.cameras[V.FLOORPLAN]
  21827. , S = this.cameraControls.controls[V.FLOORPLAN]
  21828. , M = S.target.clone()
  21829. , R = i.position.clone().sub(M)
  21830. , P = x.position.clone().sub(S.target).length()
  21831. , O = new B.Vector3(-1,0,0).applyQuaternion(i.quaternion).normalize()
  21832. , L = Math.atan2(S.offset.x, S.offset.z)
  21833. , D = Math.atan2(O.x, O.z)
  21834. , N = S.absoluteScale
  21835. , F = U.convertWorkshopOrthoZoom(i.orthoZoom);
  21836. G.start(function(e, t) {
  21837. S.target.copy(R).multiplyScalar(e).add(M);
  21838. var i = L + (D - L) * e;
  21839. S.offset.x = P * Math.sin(i),
  21840. S.offset.z = P * Math.cos(i),
  21841. x.position.copy(S.target).add(S.offset),
  21842. S.absoluteScale = N + e * (F - N),
  21843. S.update(),
  21844. this.quaternion.copy(x.quaternion),
  21845. this.position.copy(x.position),
  21846. this.target.copy(S.target),
  21847. this.camera.projectionMatrix.copy(x.projectionMatrix)
  21848. }
  21849. .bind(this), u, null, 0, z[k.flydown.movementEasing], null, q.FlyToSameMode)
  21850. } else
  21851. Y.info("flyToSameMode() funny floorplan view? skipping");
  21852. return G.setTimeout(function(e) {
  21853. this.mode = e,
  21854. c(),
  21855. r.resolve(!0)
  21856. }
  21857. .bind(this, this.mode), u, q.FlyToSameMode),
  21858. this.mode = V.TRANSITIONING,
  21859. r.promise()
  21860. }
  21861. }
  21862. ,
  21863. t.prototype.flyToNewMode = function(e, t) {
  21864. Hot.closePopup();//xzw add
  21865. var i = (e = e || {}).mode
  21866. , n = e.pano
  21867. , r = e.duration
  21868. , o = e.warpDest
  21869. , a = e.callback
  21870. , s = e.force
  21871. , l = e.quaternion;
  21872. if (t = t || $.Deferred(),
  21873. this.isWarping())
  21874. return Y.warn("Player.flyToNewMode() -> Cannot fly when warping"),
  21875. a && a(!1),
  21876. t.reject("Cannot change mode during tour transition").promise();
  21877. if (this.mode === V.TRANSITIONING)
  21878. return a && a(!1),
  21879. t.reject("Cannot change mode during mode transition").promise();
  21880. if (i === this.mode)
  21881. return s ? (this.flyToSameMode(n, r, o, a).done(t.resolve.bind(t)).fail(t.reject.bind(t)),
  21882. t.promise()) : (a && a(!1),
  21883. t.reject("Already in " + i + " mode").promise());
  21884. var c = o || !1;
  21885. Y.debug("Switching mode to " + i);
  21886. var h = function() {
  21887. j.delayOneFrame(function() {
  21888. this.flyToNewMode(e, t)
  21889. }
  21890. .bind(this))
  21891. }
  21892. .bind(this);
  21893. if (n && this.checkAndWaitForPanoLoad(n, "low", "low", this.basePanoSize, h))
  21894. return t.promise();
  21895. if (!this.model.meshTexturesLoaded && this.isOutsideMode(i)){
  21896. return Y.info("Waiting for model textures to be loaded before going out to dollhouse"),
  21897. this.model.waitForLoad(this.model, function() {
  21898. return this.model.meshTexturesLoaded
  21899. }
  21900. .bind(this)),
  21901. this.model.loadMeshTextures().done(h),
  21902. t.promise();
  21903. }
  21904. this.history.invalidate()
  21905. this.updateLastView();
  21906. var u = this.mode
  21907. , d = this.cameraControls.cameras[i];
  21908. e = x.deepExtend({}, k[i], k[u + "-" + i]);
  21909. var p = void 0 !== r ? r : e.transitionTime;
  21910. this.emit(W.ModeChanging, u, i, n, p)
  21911. n && (this.currentPano = n)
  21912. //----------改----------
  21913. let target,position,currentScale,fitBoundSize
  21914. if(editTool.hotpoint.editSpot){//focus
  21915. target = editTool.hotpoint.editSpot.position.clone()
  21916. let bound = editTool.hotpoint.editSpot.info.modelBound?.bound
  21917. if(bound){
  21918. bound = new THREE.Box3().copy(bound).applyMatrix4(editTool.hotpoint.editSpot.children[0].matrixWorld)
  21919. fitBoundSize = bound.size()
  21920. }else{
  21921. fitBoundSize = new THREE.Vector3(5,5,5)
  21922. }
  21923. }
  21924. this.switchCameraMode(i, l, target, position, {currentScale, fitBoundSize})
  21925. //----------------------
  21926. G.cancelById(q.LookTransition);
  21927. var f = (new B.Vector3).copy(this.position);
  21928. this.modeTran = this.mode + "-" + i;
  21929. /* if(editTool.atPanel == "screen"){
  21930. if(this.mode == "panorama") $(".confirmSnap").addClass("unable")
  21931. else if(i == "panorama") $(".confirmSnap").removeClass("unable")
  21932. } */
  21933. if(i == "panorama"){
  21934. this.transitionPos({type:"beforeFlyIn", pano:n, dur:p})//add
  21935. }else{
  21936. this.transitionPos({type:"beforeFlyOut", dur:p/2})//add
  21937. }
  21938. window.bus.dispatchEvent({type:'playerAndModelReady'})
  21939. this.ready = true
  21940. if (i === V.PANORAMA)
  21941. this.emit(W.PanoChosen, n, n),
  21942. setTimeout(function() {
  21943. n.floor.enter(i)
  21944. }
  21945. .bind(this), p / 2),
  21946. this.path.fadeOutCpm(k.path.fadeOutTime);
  21947. else if (i === V.DOLLHOUSE) {
  21948. if (c && (this.model.stayPut = !0),
  21949. o ? (this.cameraControls.controls[V.DOLLHOUSE].resetRanges(1, !0),
  21950. this.model.warpDestFloors(o.floorVisibility)) : this.model.toggleAllFloors(!0),
  21951. this.path.placeCpm(),
  21952. this.path.fadeInCpm(k.path.fadeInTime),
  21953. c) {
  21954. var g = new B.Vector3(this.model.center.x,0,this.model.center.z);
  21955. f.set(15, 10, 15);
  21956. var m = new B.Vector3(0,0,-1).applyQuaternion(o.quaternion)
  21957. , v = new B.Raycaster(o.position.clone(),m.clone(),0,1 / 0).intersectObjects([this.sceneIntersectionPlane]);
  21958. v.length ? (g.copy(v[0].point),
  21959. f.copy(o.position),
  21960. 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),
  21961. this.cameraControls.controls[V.DOLLHOUSE].resetRanges(3, !0)),
  21962. this.cameraControls.controls[V.DOLLHOUSE].target.copy(g),
  21963. f.add(this.model.position),
  21964. d.position.copy(f),
  21965. this.cameraControls.controls[V.DOLLHOUSE].update()
  21966. }
  21967. } else if (this.path.placeCpm(),
  21968. this.path.fadeInCpm(k.path.fadeInTime),
  21969. o) {
  21970. this.model.warpDestFloors(o.floorVisibility);
  21971. var y = this.cameraControls.cameras[V.FLOORPLAN]
  21972. , A = this.cameraControls.controls[V.FLOORPLAN]
  21973. , C = y.position.clone().sub(A.target)
  21974. , I = new B.Vector3(-1,0,0).applyQuaternion(o.quaternion).normalize()
  21975. , E = Math.atan2(I.x, I.z);
  21976. A.target.copy(o.position);
  21977. var _ = C.length();
  21978. A.offset.x = _ * Math.sin(E),
  21979. A.offset.y = 0,
  21980. A.offset.z = _ * Math.cos(E),
  21981. y.position.copy(A.target).add(A.offset),
  21982. A.target.clone().sub(d.position),
  21983. d.quaternion.copy(o.quaternion),
  21984. A.currentScale = U.convertWorkshopOrthoZoom(o.orthoZoom),
  21985. A.absoluteScale = A.currentScale,
  21986. A.update()
  21987. } else
  21988. this.model.currentFloor.enter(i);
  21989. var b = this.currentPano
  21990. , w = this.position.clone();
  21991. return this.emit(W.FlyingStarted, f, w, n, this.currentPano),
  21992. this.flying = !0,
  21993. this.isOutsideMode(i) && this.is360View(u, b) ? (c || i !== V.DOLLHOUSE || (d.position.set(15, 10, 15),
  21994. d.controls.target.set(this.model.center.x, 0, this.model.center.z),
  21995. d.controls.update()),
  21996. e.blackoutStyle = P.FADEIN,
  21997. p = k.show360Views.transitionTime,
  21998. this.fade360View(p, d, e)) : this.isOutsideMode(u) && this.is360View(i, n) ? (c && this.switchCameraMode(i, c.quaternion),
  21999. this.mode = i,
  22000. this.path && this.path.popOutCpm(),
  22001. e.blackoutStyle = P.END,
  22002. p = k.show360Views.transitionTime,
  22003. this.fade360View(p, d, e)) : (G.start(H.property(this.model, "alpha", e.modelAlpha, null), p * e.modelAlphaLength, null, e.modelAlphaDelay, null, q.FlyToNewMode),
  22004. G.start(H.vector(this.position, d.position), p, null, k.flydown.movementDelay, z[k.flydown.movementEasing], null, q.FlyToNewMode),
  22005. G.start(H.quaternion(this.quaternion, d.quaternion), p * e.rotationDuration, null, e.rotationDelay, z[k.flydown.rotationEasing], null, q.FlyToNewMode),
  22006. G.start(H.matrix4(this.camera.projectionMatrix, d.projectionMatrix), p * e.cameraMatrixDuration, null, e.cameraMatrixDelay, e.cameraMatrixEase, null, q.FlyToNewMode),
  22007. G.start(H.uniform(this.model.skybox, "opacity", e.skyboxOpacity), p * e.skyboxOpacityLength, null, e.skyboxOpacityDelay, null, q.FlyToNewMode),
  22008. G.start(H.property(this.reticule.material.uniforms.opacity, "value", 0), p, null, q.FlyToNewMode)),
  22009. G.setTimeout(function() {
  22010. this.flying = !1,
  22011. u === V.PANORAMA && i !== V.PANORAMA ? this.currentPano.exit() : u !== V.PANORAMA && i === V.PANORAMA && (this.currentPano !== b && b.exit(),
  22012. this.currentPano.enter(),
  22013. this.path.placeCpm(),
  22014. this.path.fadeOutCpm(k.path.fadeOutTime),
  22015. this.spider.draw()),
  22016. u === V.DOLLHOUSE && this.cameraControls.controls[V.DOLLHOUSE].resetRanges(),
  22017. this.mode = i,
  22018. this.emit(W.FlyingEnded, f, w, this.currentPano, b)
  22019. if (this.afterCModeFuc) {
  22020. //手动加的函数
  22021. var cf = this.afterCModeFuc;
  22022. this.afterCModeFuc = null;//因为可能在执行afterCModeFuc时需要再添加afterCModeFuc所以要置空的话提前
  22023. cf();
  22024. }
  22025. this.updateMarkerVisi();//add
  22026. //(this.mode == u.PANORAMA) && this.updateHotVisible()//add
  22027. if(this.mode == V.PANORAMA){
  22028. //EditOverlay.updatePano()
  22029. editTool.hotpoint.updatePano()
  22030. this.model.fadePanoMarkers()
  22031. Hot.updateVisibles([this.currentPano])
  22032. }else{
  22033. Hot.updateVisibles(true)
  22034. this.model.hotGroup.children.forEach(overlay=>{
  22035. if(overlay.animateInfo){
  22036. GifTexDeal.start(overlay.animation)
  22037. }
  22038. })
  22039. }
  22040. c && u !== V.PANORAMA && i === V.PANORAMA ? this.startWarp(M.Retain, S.Retain, R.BLACK, null, null, a) : (a && a(),
  22041. t.resolve())
  22042. }
  22043. .bind(this), p, q.FlyToNewMode),
  22044. this.mode = V.TRANSITIONING,
  22045. //EditOverlay.updatePano(),//add
  22046. editTool.hotpoint.updatePano(),//add
  22047. //u == "panorama" && this.updateHotVisible(),
  22048. t.promise()
  22049. }
  22050. ,
  22051. t.prototype.fade360View = function(e, t, i) {
  22052. this.tagManager.hideShowTagsForBlackoutStyle(i.blackoutStyle, e),
  22053. $(this.domElement).fadeOut(.5 * e, function() {
  22054. this.model.skybox.material.uniforms.opacity.value = i.skyboxOpacity,
  22055. this.model.alpha = i.modelAlpha,
  22056. this.position.copy(t.position),
  22057. this.quaternion.copy(t.quaternion),
  22058. this.camera.projectionMatrix.copy(t.projectionMatrix),
  22059. $(this.domElement).fadeIn(.5 * e)
  22060. }
  22061. .bind(this))
  22062. }
  22063. ,
  22064. t.prototype.findDefaultViews = function() {
  22065. this.findDefaultView(this.lastInsideView, !0),
  22066. this.findDefaultView(this.last360View, !1)
  22067. }
  22068. ,
  22069. t.prototype.findDefaultView = function(e, i) {
  22070. var t, n = this.model.heroLocations, r = this.model.panos, o = n.findIndex(function(e) {
  22071. if (e.cameraMode !== V.PANORAMA)
  22072. return !1;
  22073. var t = r.get(e.panoId);
  22074. return t && t.isAligned() === i
  22075. });
  22076. 0 <= o ? (t = r.get(n[o].panoId),
  22077. e.update({
  22078. cameraMode: V.PANORAMA,
  22079. pano: t,
  22080. position: n[o].position,
  22081. quaternion: n[o].quaternion
  22082. })) : 0 <= (o = r.list.findIndex(function(e) {
  22083. return e.isAligned() === i
  22084. })) ? (t = r.list[o],
  22085. e.update({
  22086. cameraMode: V.PANORAMA,
  22087. pano: t,
  22088. position: t.position
  22089. })) : Y.warn("There are no", i ? "inside" : "360º", "views in this model")
  22090. }
  22091. ,
  22092. t.prototype.updateLastView = function() {
  22093. this.mode === V.PANORAMA && (this.currentPano.isAligned() ? this.lastInsideView : this.last360View).update({
  22094. pano: this.currentPano,
  22095. position: this.position,
  22096. quaternion: this.quaternion
  22097. })
  22098. }
  22099. ,
  22100. t.prototype.goToLastView = function(e, t) {
  22101. var i = $.Deferred()
  22102. , n = i.resolve.bind(i)
  22103. , r = i.reject.bind(i)
  22104. , o = e ? this.lastInsideView : this.last360View;
  22105. return this.isInMode(V.PANORAMA) && this.currentPano.isAligned() !== e && this.updateLastView(),
  22106. this.isInMode(V.PANORAMA) ? (this.path && this.path.popOutCpm(),
  22107. this.fadeToView(e, o, k.show360Views.transitionTime, t).done(n).fail(r)) : this.isOutsideMode() && this.flyToNewMode({
  22108. mode: o.cameraMode,
  22109. pano: o.pano,
  22110. quaternion: o.quaternion,
  22111. callback: t
  22112. }).done(n).fail(r),
  22113. i.promise()
  22114. }
  22115. ,
  22116. t.prototype.fadeToView = function(e, t, i, n) {
  22117. var r = $.Deferred()
  22118. , o = r.resolve.bind(r)
  22119. , a = r.reject.bind(r);
  22120. if (!t.isValid() || t.cameraMode === V.PANORAMA && !t.pano)
  22121. return Y.warn("Tried to fade to an illegal view", t.cameraMode),
  22122. a("Cannot go to illegal view"),
  22123. r.promise();
  22124. var s = (k[t.cameraMode],
  22125. function() {
  22126. $(this.domElement).fadeIn(.5 * i),
  22127. n && n(),
  22128. o()
  22129. }
  22130. .bind(this))
  22131. , l = e ? P.FADEIN : P.END;
  22132. return this.tagManager.hideShowTagsForBlackoutStyle(l, i),
  22133. $(this.domElement).fadeOut(.5 * i, function() {
  22134. this.model.fadePanoMarkers(e ? k.panorama.markerOpacity : 0),
  22135. t.cameraMode === V.PANORAMA ? this.flyToPano({
  22136. pano: t.pano,
  22137. lookAtPoint: T.FORWARD.clone().applyQuaternion(t.quaternion).add(t.pano.position),
  22138. duration: 0
  22139. }, s) : this.flyToNewMode({
  22140. mode: t.cameraMode,
  22141. quaternion: t.quaternion,
  22142. duration: 0,
  22143. callback: s
  22144. })
  22145. }
  22146. .bind(this)),
  22147. r.promise()
  22148. }
  22149. ,
  22150. t.prototype.startWarp = function(e, t, i, n, r, o) {
  22151. if (this.cameraControls.activeControl && (this.cameraControls.activeControl.enabled = !1),
  22152. this.flying)
  22153. return Y.warn("Player.startWarp() -> Cannot warp when flying"),
  22154. o && o(),
  22155. !1;
  22156. null != e || (e = M.Show),
  22157. this.history.invalidate(),
  22158. e !== M.Retain ? this.path.brushToWarpPano(i, R.BLACK) || (i = R.BLACK) : i = this.path.upcomingTransType;
  22159. var a = this.path.warpDestPano && !this.path.warpDestPano.isAligned();
  22160. return this.emit(W.WarpStarted, a, i, n, r),
  22161. n = n || P.MIDDLE,
  22162. this.path.warpToPano(i, n, r, function() {
  22163. t === S.Slow ? this.path.discardSlow() : t === S.Standard && this.path.discardPathObject(),
  22164. this.emit(W.WarpEnded, i),
  22165. this.cameraControls.activeControl && (this.cameraControls.activeControl.enabled = !0),
  22166. o && o()
  22167. }
  22168. .bind(this)),
  22169. e === M.Hide && this.path.discardPathObject(),
  22170. !0
  22171. }
  22172. ,
  22173. t.prototype.warpToPanoById = function(e, t, i, n, r, o, a, s) {
  22174. return this.path.setWarpDestinationByPanoId(e, t) ? this.startWarp(i, n, r, o, a, s) : (Y.warn("Player.warpToPanoById() -> Could not setWarpDestinationByPanoId()"),
  22175. s && s(),
  22176. !1)
  22177. }
  22178. ,
  22179. t.prototype.warpToPanoByHeroIndex = function(e, t, i, n, r, o, a) {
  22180. return this.path.setWarpDestinationByHeroIndex(e) ? this.startWarp(t, i, n, r, o, a) : (Y.warn("Player.warpToPanoByHeroIndex() -> Could not setWarpDestinationByHeroIndex()"),
  22181. a && a(),
  22182. !1)
  22183. }
  22184. ,
  22185. t.prototype.warpToPano = function(e, t, i, n, r, o, a, s) {
  22186. return this.warpToPanoById(e.id, t, i, n, r, o, a, s)
  22187. }
  22188. ,
  22189. t.prototype.warpToNonPanoByHeroIndex = function(e, t) {
  22190. return this.path.setWarpDestinationByHeroIndex(e) ? (this.path.warpToNonPano(t),
  22191. !0) : (Y.warn("Player.warpToNonPanoByHeroIndex() -> Could not setWarpDestinationByHeroIndex()"),
  22192. t && t(),
  22193. !1)
  22194. }
  22195. ,
  22196. t.prototype.aimTourCamera = function(e, t, i, n) {
  22197. return Y.debug("player.aimTourCamera(" + e + ") calling warpToPanoByHeroIndex(" + e + ")"),
  22198. this.warpToPanoByHeroIndex(e, t, i, null, null, null, n)
  22199. }
  22200. ,
  22201. t.prototype.showPathToHeroLocation = function(e) {
  22202. this.path.setWarpDestinationByHeroIndex(e) && this.path.brushToWarpPano(R.STD, R.BLACK)
  22203. }
  22204. ,
  22205. t.prototype.tourInterlude = function(e, t) {
  22206. this.history.invalidate(),
  22207. this.path.discardSlow();
  22208. var defaultRotTime = DATA.tourRotTime * 1000
  22209. var timeEachItem = 2e3 / (DATA.tourWalkSpeed + DATA.tourBlackSpeed) * 200 //预估时间假设每个item飞的时间(如果距离远就少了)
  22210. var currentLocation = this.model.getHeroDescriptorByIndex(this.director.currentItem)
  22211. var currentLocation0 = this.model.heroLocations[this.director.currentItem[0]]
  22212. var rotTime
  22213. if(currentLocation.rotTime == void 0 || currentLocation.rotTime == ''){
  22214. var restChildCount = currentLocation0.heroLocations ? (currentLocation0.heroLocations.length-this.director.currentItem[1]-1) : 0
  22215. var hasMusic = currentLocation0.musicInfo && currentLocation0.musicInfo.music
  22216. if(hasMusic){
  22217. var audioObj = SoundManager.list.find(e=>e.name == 'tour')
  22218. var current = audioObj.audio.currentTime * 1e3 // || 0 //g_tourAudio ? 1e3 * g_tourAudio.currentTime : 0
  22219. rotTime = currentLocation0.musicInfo.time - current
  22220. if(restChildCount){//如果当前folder中还有剩下的item,平分一下时间
  22221. rotTime = (rotTime-timeEachItem*restChildCount) / (restChildCount+1);
  22222. }
  22223. }else{
  22224. rotTime = defaultRotTime
  22225. }
  22226. rotTime = Math.max(0, rotTime)
  22227. console.log("rotTime "+rotTime +" at item "+this.director.currentItem + (hasMusic ? (",musicCurrentTime:"+current+'音乐总长:'+currentLocation0.musicInfo.time) : ''))
  22228. }else{
  22229. rotTime = currentLocation.rotTime * 1000
  22230. console.log("rotTime "+rotTime +" at item "+this.director.currentItem)
  22231. }
  22232. this.path.waitNextStep(e, function() {//等待音乐播放一段时间再下一步,此时镜头会缓慢旋转
  22233. t && t()
  22234. }
  22235. .bind(this), rotTime)
  22236. }
  22237. ,
  22238. t.prototype.stopInterlude = function() {
  22239. this.interruptAndFastForward(null, 0)
  22240. }
  22241. ,
  22242. t.prototype.interruptAndFastForward = function(e, t) {
  22243. this.isWarping() && this.emit(W.WarpInterrupted, this.path.activeTransType, e, t),
  22244. this.flying && this.emit(W.FlyingInterrupted),
  22245. this.path.interruptAndFastForward(e, t)
  22246. }
  22247. ,
  22248. t.prototype.setSize = function(e, t) {
  22249. var i = e / t;
  22250. this.baseFov = A.clampVFOV(k.insideFOV, k.insideFOVMax, e, t);
  22251. var n = A.getHFOVFromVFOV(k.insideFOV, e, t);
  22252. for (var r in n > k.insideFOVMax ? this.baseFov = A.getVFOVFromHFOV(k.insideFOVMax, e, t) : this.baseFov = k.insideFOV,
  22253. this.cameraControls.cameras) {
  22254. var o = this.cameraControls.cameras[r];
  22255. o.fov = this.baseFov * (1 / this.zoomLevel),
  22256. o.updateAspect(i)
  22257. }
  22258. }
  22259. ,
  22260. t.prototype.toJSON = function() {
  22261. var e = {};
  22262. return this.cameraControls.activeControl && ((e = this.cameraControls.activeControl.toJSON()).camera_mode = V.toInt(this.mode),
  22263. this.isOutsideMode() ? this.model.allFloorsVisible ? e.floor_visibility = [] : e.floor_visibility = this.model.floors.list.map(function(e) {
  22264. return e.hidden ? 0 : 1
  22265. }) : V.PANORAMA && (e.scan_id = this.currentPano.id)),
  22266. e
  22267. }
  22268. ,
  22269. t.prototype.getCurrentNodePanos = function(e) {
  22270. if (this.model.panos.map, e.length = 0, this.path.nodes)
  22271. for (var t = 0; t < this.path.nodes.length; t++) {
  22272. var i = this.path.nodes[t];
  22273. e.push(this.model.panos.get(i))
  22274. }
  22275. }
  22276. ,
  22277. t.prototype.zoomIncrementally = function(e) {
  22278. var t = this.zoomLevel;
  22279. this.zoomTo(this.zoomLevel + e),
  22280. t !== this.zoomLevel && this.currentPano && this.zoomStats.addZoomAction(t, this.zoomLevel, this.currentPano.id)
  22281. }
  22282. ,
  22283. t.prototype.zoomInIncrementally = function(e) {
  22284. e = e || this.defaultZoomIncrement,
  22285. this.zoomIncrementally(e)
  22286. }
  22287. ,
  22288. t.prototype.zoomOutIncrementally = function(e) {
  22289. e = e || -this.defaultZoomIncrement,
  22290. this.zoomIncrementally(e)
  22291. }
  22292. ,
  22293. t.prototype.zoomBy = function(e) {
  22294. this.zoomTo(this.zoomLevel * e)
  22295. }
  22296. ,
  22297. t.prototype.zoomIn = function() {
  22298. this.zoomBy(1 + this.zoomSpeed)
  22299. }
  22300. ,
  22301. t.prototype.zoomOut = function() {
  22302. this.zoomBy(1 - this.zoomSpeed)
  22303. }
  22304. ,
  22305. t.prototype.zoomTo = function(e, t) {
  22306. if ((t || k.zoom.enabled && this.mode === V.PANORAMA && this.zoomEnabled) && (e < k.zoom.min && (e = k.zoom.min),
  22307. e > k.zoom.max && (e = k.zoom.max),
  22308. e > this.zoomLevel ? (this.emit(m.ZoomIn),
  22309. e === k.zoom.max && this.emit(m.ZoomMax)) : e < this.zoomLevel && (this.emit(m.ZoomOut),
  22310. e === k.zoom.min && this.emit(m.ZoomMin)),
  22311. this.cameraControls.activeControl)) {
  22312. var i = this.cameraControls.activeControl.camera;
  22313. this.zoomLevel = e,
  22314. i.fov = this.baseFov * (1 / this.zoomLevel),
  22315. i.updateProjectionMatrix(),
  22316. this.zoomFov = i.fov
  22317. }
  22318. }
  22319. ,
  22320. t.prototype.increaseZoomSpeed = function() {
  22321. this.zoomSpeed = this.clampZoomSpeed(this.zoomSpeed + this.zoomSpeedAdjust)
  22322. }
  22323. ,
  22324. t.prototype.decreaseZoomSpeed = function() {
  22325. this.zoomSpeed = this.clampZoomSpeed(this.zoomSpeed - this.zoomSpeedAdjust)
  22326. }
  22327. ,
  22328. t.prototype.clampZoomSpeed = function(e) {
  22329. return e < 0 ? 0 : e
  22330. }
  22331. ,
  22332. t.prototype.activatePersistentZooming = function(e) {
  22333. this.zooming = e ? 1 : -1
  22334. }
  22335. ,
  22336. t.prototype.deactivatePersistentZooming = function() {
  22337. this.zooming = 0
  22338. }
  22339. ,
  22340. t.prototype.zoomDefault = function() {
  22341. this.zoomTo(1, !0)
  22342. }
  22343. window.fovTranId = 333;//add
  22344. t.prototype.smoothZoomToDefault = function(e, t) {
  22345. G.cancelById(window.fovTranId)
  22346. var i, n = this.zoomLevel, r = function(e) {
  22347. 1 < e && (e = 1),
  22348. i = n * (1 - e) + e,
  22349. this.zoomTo(i, !0)
  22350. }
  22351. .bind(this), o = function() {
  22352. this.zoomDefault(),
  22353. t && window.setTimeout(t, 50)
  22354. }
  22355. .bind(this);
  22356. G.start(r, e, o, null, 0, z[k.transition.blendEasing], null, window.fovTranId)
  22357. }
  22358. ,
  22359. t.prototype.smoothZoomFovTo = function (fov, zoomLevel, dur, callback) {//add
  22360. G.cancelById(window.fovTranId)
  22361. var i,
  22362. n = this.zoomLevel,
  22363. aimLevel = zoomLevel || this.baseFov / fov
  22364. if (n == aimLevel) return
  22365. var fun = function (e) {
  22366. e > 1 && (e = 1), (i = n * (1 - e) + e * aimLevel), this.zoomTo(i, !0)
  22367. }.bind(this)
  22368. G.start(fun, dur, callback, null, 0, z[k.transition.easeInCubic], null, window.fovTranId)
  22369. }
  22370. ,
  22371. t.prototype.updateZoomPano = function() {
  22372. if (!this.panoRenderer.zoomPanoRenderingDisabled && this.mode === V.PANORAMA) {
  22373. var e = this.currentPano;
  22374. if (e) {
  22375. var t = this.zoomLevel > k.zoom.activationThreshold
  22376. , i = (this.flying && this.nextPano && this.nextPano !== this.currentPano || this.isWarping(),
  22377. t);
  22378. this.tileDownloader.tilePrioritizer.setZoomingActive(i),
  22379. this.panoRenderer.setZoomingActive(i, e, !0);
  22380. var n = function(e, t) {
  22381. this.panoRenderer.resetRenderStatus(e.id, !1, !0, this.qualityManager.getMaxNavPanoSize()),
  22382. this.panoRenderer.clearAllQueuedUploadsForPano(e.id),
  22383. this.panoRenderer.renderPanoTiles(e.id, null, !1, !1),
  22384. e.setZoomed(t)
  22385. }
  22386. .bind(this);
  22387. i && !e.zoomed ? (n(e, !0),
  22388. this.panoRenderer.enableUltraHighQualityMode(function() {
  22389. this.qualityManager.useUltraHighResolutionPanos && !k.zoom.overridemax && (k.zoom.max = y.ultraHighQualityMaxZoom),
  22390. i && n(e, !0)
  22391. }
  22392. .bind(this))) : !t && e.zoomed && n(e, !1)
  22393. }
  22394. }
  22395. },
  22396. //--------
  22397. t.prototype.flyToMode = function(mode, f1){ //飞到某个模式后再执行f1函数
  22398. var f2;
  22399. if (this.mode == mode) {
  22400. f1 && f1()
  22401. } else {
  22402. f2 = f1;
  22403. if (this.mode == "transitioning" && this.modeTran.split('-')[1] != mode) {//正飞向其他模式,就要先飞完再飞进来然后执行
  22404. this.afterCModeFuc = function() {
  22405. this.afterCModeFuc = f2
  22406. this.flyToNewMode({mode:mode, pano: mode == "panorama" && this.currentPano });
  22407. }.bind(this)
  22408. } else {
  22409. this.afterCModeFuc = f2;//飞入后执行
  22410. try{ //在场景刚开始加载 control还没建好时这句可能会报错所以用try。 不用callback而用 afterCModeFuc也是这个原因,因为会有别的函数可以飞入然后执行它
  22411. this.flyToNewMode({mode:mode, pano: mode == "panorama" && this.currentPano});
  22412. }catch(e){}
  22413. }
  22414. }
  22415. }
  22416. ,
  22417. t.prototype.checkHasNeighbor = function(pano){//add
  22418. for(var i in pano.neighbourPanos ){
  22419. if(i == pano.id)continue;
  22420. if(pano.neighbourPanos[i]){
  22421. return true;
  22422. }
  22423. }
  22424. }
  22425. ,
  22426. ee.exports = t
  22427. }
  22428. ).call(this, "/js/player.js")
  22429. }
  22430. , {
  22431. "./constants": 8,
  22432. "./enum/AlignmentType": 17,
  22433. "./enum/BlackoutStyle": 18,
  22434. "./enum/ControlEvents": 21,
  22435. "./enum/Keys": 30,
  22436. "./enum/ModelManagerEvents": 33,
  22437. "./enum/PanoSizeClass": 36,
  22438. "./enum/PanoramaEvents": 37,
  22439. "./enum/PathDiscardMode": 38,
  22440. "./enum/PathDisplayMode": 39,
  22441. "./enum/PlayerEvents": 40,
  22442. "./enum/TagStates": 44,
  22443. "./enum/Vectors": 50,
  22444. "./enum/Viewmode": 51,
  22445. "./enum/WarpStyle": 52,
  22446. "./enum/ZoomEvents": 53,
  22447. "./exception/BasicException": 55,
  22448. "./model/ModelManager": 140,
  22449. "./objects/NSpider": 147,
  22450. "./objects/Panorama": 148,
  22451. "./objects/Reticule": 149,
  22452. "./objects/ShowPath": 151,
  22453. "./objects/Snapshot": 153,
  22454. "./objects/View": 154,
  22455. "./settings": 166,
  22456. "./shaders": 167,
  22457. "./tile/TileDownloader": 171,
  22458. "./tile/TilePrioritizer": 172,
  22459. "./util/ZoomStats": 179,
  22460. "./util/browser": 182,
  22461. "./util/camera": 183,
  22462. "./util/cameraLight": 184,
  22463. "./util/common": 185,
  22464. "./util/easing": 186,
  22465. "./util/history": 187,
  22466. "./util/lerp": 188,
  22467. "./util/logger": 189,
  22468. "./util/math": 190,
  22469. "./util/transitions": 195,
  22470. // hot: "hot",
  22471. scaleImg: "scaleImg",
  22472. events: 202,
  22473. three: 217
  22474. }],
  22475. scaleImg: [function(e, t) {
  22476. var i = t;
  22477. (function() {
  22478. function e(e, t, i, n) {
  22479. function r() {
  22480. (U = "object" == typeof i ? i : t.src || n ? s : document.createElement("canvas")).width = d,
  22481. U.height = p,
  22482. H = U.getContext("2d")
  22483. }
  22484. function o(e) {
  22485. if (e) {
  22486. var t, i = H.getImageData(0, 0, d, p), n = i.data;
  22487. for (t = 0; t < ie; t += 4)
  22488. n[t] = e[t] * ne | 0,
  22489. n[t + 1] = e[t + 1] * ne | 0,
  22490. n[t + 2] = e[t + 2] * ne | 0,
  22491. n[t + 3] = e[t + 3] * ne | 0;
  22492. return delete e,
  22493. i
  22494. }
  22495. return H.getImageData(0, 0, d, p)
  22496. }
  22497. function a(e, t, i, n, r) {
  22498. return .5 * (n - t + (2 * t - 5 * i + 4 * n - r + (3 * (i - n) + r - t) * e) * e) * e + i
  22499. }
  22500. var s, l;
  22501. if (t || (t = e.input,
  22502. i = e.output,
  22503. n = e.inputRemovable,
  22504. e.scale && (e = e.scale)),
  22505. t.src)
  22506. if (s = document.createElement("canvas"),
  22507. null != t.naturalWidth)
  22508. s.width = t.naturalWidth,
  22509. s.height = t.naturalHeight;
  22510. else if (null != t.runtimeStyle) {
  22511. var c = t.runtimeStyle
  22512. , h = c.width
  22513. , u = c.height;
  22514. c.width = "auto",
  22515. c.height = "auto",
  22516. s.width = t.width,
  22517. s.height = t.height,
  22518. c.width = h,
  22519. c.height = u
  22520. } else {
  22521. h = t.width,
  22522. u = t.height;
  22523. t.removeAttribute && (t.removeAttribute("width"),
  22524. t.removeAttribute("height")),
  22525. s.width = t.width,
  22526. s.height = t.height,
  22527. t.width = h,
  22528. t.height = u
  22529. }
  22530. else
  22531. s = t;
  22532. l = s.getContext("2d"),
  22533. t.src && l.drawImage(t, 0, 0);
  22534. var d, p, f = s.width, g = s.height, m = l.getImageData(0, 0, f, g).data;
  22535. if (!f || !g)
  22536. return !1;
  22537. (t.src || n) && s.clearRect(0, 0, f, g),
  22538. p = "object" == typeof e ? e.width ? (d = e.width + .5 | 0,
  22539. e.height + .5 | 0) : (d = f * e.scaleX + .5 | 0,
  22540. g * e.scaleY + .5 | 0) : (d = e * f + .5 | 0,
  22541. e * g + .5 | 0);
  22542. 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;
  22543. if (1 < re || 1 < oe)
  22544. for (r(),
  22545. G = (z = o()).data,
  22546. C = 0; C < p; C++)
  22547. for (V = (y = C / oe) - (w = 0 | y),
  22548. j = w * $,
  22549. W = w < 1 ? j : j - $,
  22550. w < g - 2 ? (Y = j + $,
  22551. q = (2 + w) * $) : Y = q = g - 2 < w ? j : j + $,
  22552. A = 0; A < d; A++,
  22553. te += 4)
  22554. Z = (b = 0 | (v = A / re)) << 2,
  22555. b < f - 2 ? (K = Z + 4,
  22556. Q = Z + 8) : K = Q = f - 2 < b ? Z : Z + 4,
  22557. 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,
  22558. ++Z,
  22559. ++K,
  22560. ++Q,
  22561. 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,
  22562. ++Z,
  22563. ++K,
  22564. ++Q,
  22565. 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,
  22566. ++Z,
  22567. ++K,
  22568. ++Q,
  22569. 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,
  22570. G[te] = 0 <= D ? D < 256 ? D : 255 : 0,
  22571. G[te + 1] = 0 <= F ? F < 256 ? F : 255 : 0,
  22572. G[te + 2] = 0 <= B ? B < 256 ? B : 255 : 0,
  22573. G[te + 3] = 0 <= N ? N < 256 ? N : 255 : 0;
  22574. else {
  22575. if (le.Float32Array)
  22576. L = new Float32Array(ie);
  22577. else
  22578. for (L = [],
  22579. te = 0; te < ie; ++te)
  22580. L[te] = 0;
  22581. for (y = 0; y < g; y++)
  22582. for (I = (_ = 0 | (C = y * oe)) * J,
  22583. (O = !!((_ - (C + oe | 0)) * (g - 1 - y)) << 1) && (M = 1 + _ - C,
  22584. R = C + oe - _ - 1),
  22585. v = 0; v < f; v++,
  22586. ee += 4)
  22587. switch (A = v * re,
  22588. E = 0 | A,
  22589. te = I + (E << 2),
  22590. P = !!((E - (A + re | 0)) * (f - 1 - v)),
  22591. P && (x = 1 + E - A,
  22592. S = A + re - E - 1),
  22593. D = m[ee],
  22594. F = m[ee + 1],
  22595. B = m[ee + 2],
  22596. N = m[ee + 3],
  22597. P + O) {
  22598. case 0:
  22599. L[te] += D * ae,
  22600. L[te + 1] += F * ae,
  22601. L[te + 2] += B * ae,
  22602. L[te + 3] += N * ae;
  22603. break;
  22604. case 1:
  22605. T = x * oe,
  22606. L[te] += D * T,
  22607. L[te + 1] += F * T,
  22608. L[te + 2] += B * T,
  22609. L[te + 3] += N * T,
  22610. T = S * oe,
  22611. L[te + 4] += D * T,
  22612. L[te + 5] += F * T,
  22613. L[te + 6] += B * T,
  22614. L[te + 7] += N * T;
  22615. break;
  22616. case 2:
  22617. T = re * M,
  22618. L[te] += D * T,
  22619. L[te + 1] += F * T,
  22620. L[te + 2] += B * T,
  22621. L[te + 3] += N * T,
  22622. T = re * R,
  22623. L[te += J] += D * T,
  22624. L[te + 1] += F * T,
  22625. L[te + 2] += B * T,
  22626. L[te + 3] += N * T;
  22627. break;
  22628. default:
  22629. T = x * M,
  22630. L[te] += D * T,
  22631. L[te + 1] += F * T,
  22632. L[te + 2] += B * T,
  22633. L[te + 3] += N * T,
  22634. T = S * M,
  22635. L[te + 4] += D * T,
  22636. L[te + 5] += F * T,
  22637. L[te + 6] += B * T,
  22638. L[te + 7] += N * T,
  22639. T = x * R,
  22640. L[te += J] += D * T,
  22641. L[te + 1] += F * T,
  22642. L[te + 2] += B * T,
  22643. L[te + 3] += N * T,
  22644. T = S * R,
  22645. L[te + 4] += D * T,
  22646. L[te + 5] += F * T,
  22647. L[te + 6] += B * T,
  22648. L[te + 7] += N * T
  22649. }
  22650. delete m,
  22651. r(),
  22652. z = o(L)
  22653. }
  22654. if (H.putImageData(z, 0, 0),
  22655. "string" == typeof i) {
  22656. var se;
  22657. if ("png" === i || "jpeg" === i)
  22658. return (se = n && t.src ? t : new Image).width = d,
  22659. se.height = p,
  22660. se.src = U.toDataURL("image/" + i, .85),
  22661. se;
  22662. if ("png-src" === i || "jpeg-src" === i)
  22663. return U.toDataURL("image/" + i.split("-")[0], .85)
  22664. }
  22665. return U
  22666. }
  22667. var le = this;
  22668. "undefined" != typeof exports ? ("undefined" != typeof module && module.exports && (exports = module.exports = e),
  22669. exports.scale = e) : c = e
  22670. }
  22671. ).call(this),
  22672. i.exports = c
  22673. }
  22674. , {}],
  22675. 156: [function(i, n, e) {
  22676. (function(e) {
  22677. "use strict";
  22678. function t(e, t) {
  22679. this.model = e,
  22680. this.panos = e.panos,
  22681. this.player = t,
  22682. this.imagePanos = this.listImagePanos(),
  22683. this.retryMinimumTime = 1e4
  22684. }
  22685. var r = (i("three"),
  22686. i("./enum/Viewmode"))
  22687. , o = (i("./settings"),
  22688. i("./objects/Panorama"))
  22689. , a = new (i("./util/logger"))(e);
  22690. t.prototype.start = function() {
  22691. this.loadNextPano(function(e) {
  22692. e ? this.start() : (a.debug("No suitable pano loaded, waiting a little while before looking again"),
  22693. setTimeout(function() {
  22694. this.start()
  22695. }
  22696. .bind(this), 1e3))
  22697. }
  22698. .bind(this))
  22699. }
  22700. ,
  22701. t.prototype.validLoadTarget = function(e) {
  22702. return e && !e.isLoaded("high") && Date.now() - e.failedLoadingAt > this.retryMinimumTime
  22703. }
  22704. ,
  22705. t.prototype.listImagePanos = function() {
  22706. var i = []
  22707. , n = this;
  22708. return this.model.images.forEach(function(e) {
  22709. if (e.metadata && e.metadata.scan_id) {
  22710. var t = n.model.panos.get(e.metadata.scan_id);
  22711. t && !t.isLoaded("high") && i.push(t)
  22712. }
  22713. }),
  22714. i
  22715. }
  22716. ,
  22717. t.prototype.nextNotLoadedImage = function() {
  22718. for (; 0 < this.imagePanos.length; ) {
  22719. var e = this.imagePanos[0];
  22720. if (!e.isLoaded("high"))
  22721. return e;
  22722. this.imagePanos.shift()
  22723. }
  22724. return null
  22725. }
  22726. ,
  22727. t.prototype.loadNextPano = function(e) {
  22728. var t, i, n = this.model.waitQueue.filter(function(e) {
  22729. return e.object instanceof o
  22730. });
  22731. 0 < n.length ? (t = n[0].object,
  22732. a.debug("Overrode pano selection: Flying to an unloaded pano " + t.id)) : this.validLoadTarget(this.player.currentPano) ? (t = this.player.currentPano,
  22733. a.debug("Overrode pano selection: Currently at an unloaded pano " + t.id)) : this.validLoadTarget(this.player.closestPano) ? (t = this.player.closestPano,
  22734. a.debug("Overrode pano selection: Hovering over an unloaded pano " + t.id)) : this.validLoadTarget(this.nextNotLoadedImage()) ? (i = "high",
  22735. t = this.imagePanos[0],
  22736. 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),
  22737. t ? (i = i || t.isLoaded("low") ? "high" : "low",
  22738. a.debug("Preloading " + i + "-res pano " + t.id),
  22739. t.loadCube(i).done(e).fail(function() {
  22740. a.warn("Failed preloading pano", t.id, ", marking it as failed and forgetting it for a while"),
  22741. e()
  22742. })) : e && e(null)
  22743. }
  22744. ,
  22745. n.exports = t
  22746. }
  22747. ).call(this, "/js/preloaders.js")
  22748. }
  22749. , {
  22750. "./enum/Viewmode": 51,
  22751. "./objects/Panorama": 148,
  22752. "./settings": 166,
  22753. "./util/logger": 189,
  22754. three: 217
  22755. }],
  22756. 157: [function(a, s, e) {
  22757. (function(e) {
  22758. "use strict";
  22759. function t(e, t, i, n, r) {
  22760. this.qualityManager = e,
  22761. this.scene = t,
  22762. this.camera = i,
  22763. this.container = r,
  22764. this.controls = n,
  22765. this.controls.enabled = !0,
  22766. this.controls.locked = !0,
  22767. this.quickstartCamera = n.camera,
  22768. this.quickstartCamera.fov = d.clampVFOV(o.insideFOV, o.insideFOVMax, $("#player").width(), $("#player").height()),
  22769. this.skybox = null
  22770. }
  22771. var i = a("three")
  22772. , n = a("../util/logger")
  22773. , o = a("../constants")
  22774. , h = (a("../util/transitions"),
  22775. a("../util/lerp"),
  22776. a("../util/easing"),
  22777. a("../enum/Vectors"))
  22778. , u = a("../enum/PanoSizeClass")
  22779. , r = (a("../materials/ModelTextureMaterial"),
  22780. a("../materials/CubemapMaterial"))
  22781. , d = (a("../cameras/PanoramaCamera"),
  22782. a("../controls/PanoramaControls"),
  22783. a("../tile/TileUtils"),
  22784. a("../util/camera"),
  22785. a("../util/cameraLight"))
  22786. , p = (a("../util/browser"),
  22787. a("../settings"),
  22788. a("../gui/helpManager"),
  22789. new n(e));
  22790. t.prototype.load = function(e) {
  22791. e.pano.shouldRedrawOnBaseLoaded = !0;
  22792. var t, i, n = this, r = h.FORWARD.clone().applyQuaternion(e.quaternion), o = r.clone().negate();
  22793. this.controls.lookAt(r.add(this.quickstartCamera.position));
  22794. var a = this.qualityManager.getPanoSize(u.BASE)
  22795. , s = this.qualityManager.getPanoSize(u.STANDARD);
  22796. if (e.pano.tiled) {
  22797. p.warn("Loading startPano, TILED", e.pano.id);
  22798. var l = d.getHFOVForCamera(this.quickstartCamera, $("#player").width(), $("#player").height())
  22799. , c = this.quickstartCamera.fov;
  22800. p.warn("Quickstart loading tiles in frustum: [horizontal FOV: " + l + ", vertical FOV: " + c + "]"),
  22801. t = e.pano.loadTiledPano(s, r, {
  22802. hFov: l,
  22803. vFov: c
  22804. }, !1, !1, !0),
  22805. i = e.pano.loadTiledPano(a, o, null, !1, !1, !0)
  22806. } else
  22807. p.warn("Loading startPano", e.pano.id),
  22808. t = e.pano.loadCube("high");
  22809. return $.when(t).then(function() {
  22810. n.init(e.pano, e.quaternion),
  22811. e.pano.tiled ? i.done(function() {
  22812. e.pano.lockUntilRenderingComplete = !1,
  22813. this.controls.locked = !1
  22814. }
  22815. .bind(this)) : this.controls.locked = !1
  22816. }
  22817. .bind(this))
  22818. }
  22819. ,
  22820. t.prototype.init = function(e, t) {
  22821. p.info("Quickstart done loading, adding scene objects"),
  22822. e.lockUntilRenderingComplete = !0,
  22823. this.skybox = new i.Mesh(new i.CubeGeometry(1,1,1),new r({
  22824. side: i.BackSide
  22825. })),
  22826. this.skybox.material.uniforms.map.value = e.getSkyboxTexture(),
  22827. this.skybox.quaternion.copy(e.quaternion),
  22828. this.scene.add(this.skybox),
  22829. $(this.container).show()
  22830. }
  22831. ,
  22832. t.prototype.update = function(e) {
  22833. this.controls.update(e),
  22834. this.camera.copy(this.quickstartCamera)
  22835. }
  22836. ,
  22837. t.prototype.setSize = function(e, t) {
  22838. this.quickstartCamera.updateAspect(e / t)
  22839. }
  22840. ,
  22841. t.prototype.destroy = function() {
  22842. this.scene.remove(this.skybox)
  22843. }
  22844. ,
  22845. s.exports = t
  22846. }
  22847. ).call(this, "/js/scene/QuickstartManager.js")
  22848. }
  22849. , {
  22850. "../cameras/PanoramaCamera": 7,
  22851. "../constants": 8,
  22852. "../controls/PanoramaControls": 13,
  22853. "../enum/PanoSizeClass": 36,
  22854. "../enum/Vectors": 50,
  22855. "../gui/helpManager": 68,
  22856. "../materials/CubemapMaterial": 117,
  22857. "../materials/ModelTextureMaterial": 118,
  22858. "../settings": 166,
  22859. "../tile/TileUtils": 174,
  22860. "../util/browser": 182,
  22861. "../util/camera": 183,
  22862. "../util/cameraLight": 184,
  22863. "../util/easing": 186,
  22864. "../util/lerp": 188,
  22865. "../util/logger": 189,
  22866. "../util/transitions": 195,
  22867. three: 217
  22868. }],
  22869. 158: [function(e, t, i) {
  22870. "use strict";
  22871. function h(e, t, i) {
  22872. this.scene = e,
  22873. this.camera = t,
  22874. this.renderer = null,
  22875. this.effects = i,
  22876. this.animateCallback = null,
  22877. this.composer = null,
  22878. this.qualityManager = null,
  22879. e.renderWidth = 0,
  22880. e.renderHeight = 0,
  22881. this.updateClock = new M.Clock,
  22882. this.components = [],
  22883. this.updateListeners = [],
  22884. this.resizeListeners = [],
  22885. this.forceUpdateSize = !1,
  22886. this.started = !1,
  22887. this.textures = {},
  22888. this.suspendedObjects = []
  22889. }
  22890. 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;
  22891. window.requestAnimationFrame = window.requestAnimationFrame || window.webkitRequestAnimationFrame,
  22892. (h.prototype = Object.create(p.prototype)).addComponent = function(e) {
  22893. this.components.push(e),
  22894. e.update && this.updateListeners.push(e),
  22895. e.setSize && (this.resizeListeners.push(e),
  22896. this.forceUpdateSize = !0)
  22897. }
  22898. ,
  22899. h.prototype.removeComponent = function(t) {
  22900. function e(e) {
  22901. return e !== t
  22902. }
  22903. this.components = this.components.filter(e),
  22904. this.updateListeners = this.updateListeners.filter(e),
  22905. this.resizeListeners = this.resizeListeners.filter(e)
  22906. }
  22907. ,
  22908. h.prototype.start = function(e) {
  22909. if (this.started)
  22910. throw new l("Can't start SceneRenderer, already started");
  22911. this.createContext(e),
  22912. //u.isMobile() && this.boluoVrInit(),
  22913. this.initComposer(),
  22914. this.started = !0,
  22915. (b = b.bind(this))()
  22916. }
  22917. ,
  22918. h.prototype.createContext = function(e) {
  22919. try {
  22920. this.renderer = new M.WebGLRenderer({antialias: !u.isMobile()}),
  22921. this.renderer.autoClear = !0,
  22922. this.renderer.setPixelRatio(window.devicePixelRatio ? window.devicePixelRatio : 1),
  22923. this.renderer.setSize($("#player").width(), $("#player").height(), !1),
  22924. this.emit(r.ContextCreated)
  22925. } catch (e) {
  22926. throw new c("Unable to create a WebGL rendering context")
  22927. }
  22928. d.profiling.enabled && this.overrideTextures(),
  22929. e.appendChild(this.renderer.domElement)
  22930. }
  22931. ,
  22932. h.prototype.overrideTextures = function() {
  22933. var d = this.renderer.context
  22934. , t = 0
  22935. , i = d.createTexture;
  22936. d.createTexture = function() {
  22937. var e = i.call(d);
  22938. return e.id = t++,
  22939. this.textures[e.id] = e
  22940. }
  22941. .bind(this);
  22942. var p = d.texImage2D;
  22943. d.texImage2D = function(e, t, i, n, r, o, a, s, l) {
  22944. var c, h = this.getTextureTypeFromTarget(d, e);
  22945. c = h === f.TextureCube ? d.getParameter(d.TEXTURE_BINDING_CUBE_MAP) : d.getParameter(d.TEXTURE_BINDING_2D),
  22946. void 0 !== a ? p.call(d, e, t, i, n, r, o, a, s, l) : (a = n,
  22947. s = r,
  22948. n = (l = o).naturalWidth,
  22949. r = l.naturalHeight,
  22950. p.call(d, e, t, i, a, s, l));
  22951. var u = this.textures[c.id];
  22952. u.width = h === f.TextureCube ? 6 * n : n,
  22953. u.height = r
  22954. }
  22955. .bind(this);
  22956. var n = d.deleteTexture;
  22957. d.deleteTexture = function(e) {
  22958. delete this.textures[e.id],
  22959. n.call(d, e)
  22960. }
  22961. .bind(this)
  22962. }
  22963. ,
  22964. h.prototype.updateTextureMemory = (n = null,
  22965. function() {
  22966. var e = 0;
  22967. for (var t in this.textures) {
  22968. var i = this.textures[t];
  22969. i.width && i.height && (e += i.width * i.height * 4)
  22970. }
  22971. e !== n && this.emit(r.MemoryUsageUpdated, e),
  22972. n = e
  22973. }
  22974. ),
  22975. h.prototype.getTextureTypeFromTarget = function(e, t) {
  22976. switch (t) {
  22977. case e.TEXTURE_CUBE_MAP_POSITIVE_X:
  22978. case e.TEXTURE_CUBE_MAP_NEGATIVE_X:
  22979. case e.TEXTURE_CUBE_MAP_POSITIVE_Y:
  22980. case e.TEXTURE_CUBE_MAP_NEGATIVE_Y:
  22981. case e.TEXTURE_CUBE_MAP_POSITIVE_Z:
  22982. case e.TEXTURE_CUBE_MAP_NEGATIVE_Z:
  22983. return f.TextureCube;
  22984. case e.TEXTURE_2D:
  22985. return f.Texture2D;
  22986. default:
  22987. return null
  22988. }
  22989. }
  22990. ,
  22991. h.prototype.initComposer = function() {
  22992. this.composer = new M.EffectComposer(this.renderer),
  22993. this.composer.addPass(new M.RenderPass(this.scene,this.camera)),
  22994. /* this.composer.addPass(this.effects.hblurPass),
  22995. this.composer.addPass(this.effects.vblurPass) */
  22996. this.composer.addPass(this.effects.fastTranMaskPass)//add
  22997. }
  22998. ,
  22999. h.prototype.setSize = function(e, t, i) {
  23000. this.renderWidth = e,
  23001. this.renderHeight = t,
  23002. this.effects.aspect = e / t,
  23003. this.renderer.setSize(e, t, !1, i),
  23004. this.composer.setSize(e, t);
  23005. for (var n = 0; n < this.resizeListeners.length; n++)
  23006. this.resizeListeners[n].setSize(e, t)
  23007. }
  23008. ,
  23009. h.prototype.render = function() {
  23010. this.effects.fastTranMaskPass.enabled ? this.composer.render() : this.renderer.render(this.scene, this.camera)
  23011. }
  23012. ,
  23013. h.prototype.boluoVrInit = function() {
  23014. console.log("boluoVrInit"),
  23015. this.isHuawei5X = u.detectHUAWEI5X(),
  23016. this.oldRenderer = this.renderer,
  23017. this.newRenderer = new this.vrRenderer(this.renderer,this,this.camera),
  23018. window.panoCamera = this.camera;
  23019. var i = this;
  23020. window._vrEnabled = !1,
  23021. Object.defineProperty(window, "vrEnabled", {
  23022. get: function() {
  23023. return window._vrEnabled
  23024. },
  23025. set: function(e) {
  23026. (e = !!e) ? (i.renderer = i.newRenderer,
  23027. window.vrMarkers.forEach(function(e) {
  23028. e.visible = !0
  23029. })) : (i.renderer = i.oldRenderer,
  23030. window.vrMarkers.forEach(function(e) {
  23031. e.visible = !1
  23032. })),
  23033. i.cursor.visible = e,
  23034. i.setSize($("#player").width(), $("#player").height()),
  23035. window._vrEnabled = e,
  23036. setTimeout(function() {
  23037. console.log(player.cameraControls.activeControl.camera.fov)
  23038. }, 500)
  23039. }
  23040. }),
  23041. this.createCursor(.5, !1, 1, 16777215, 0);
  23042. var e = {
  23043. setSize: function(e, t) {
  23044. i.camera.aspect = e / t
  23045. }
  23046. };
  23047. this.resizeListeners.push(e),
  23048. this.vrLoadingInit()
  23049. }
  23050. ,
  23051. h.prototype.vrLoadingInit = function() {
  23052. var e = new (e = function(camera) {
  23053. var t = this
  23054. , e = new M.RingGeometry(1.3,1.5,32,32,0,1.2 * Math.PI)
  23055. , i = new M.MeshBasicMaterial({
  23056. color: 4967932,
  23057. side: M.DoubleSide
  23058. })
  23059. , n = new M.Mesh(e,i);
  23060. (this.mesh = n).position.z = -2,
  23061. n.scale.set(.08, .08, .08),
  23062. n.visible = !1,
  23063. //window.player.camera.add(n),
  23064. camera.add(n),
  23065. t.enabled = !1,
  23066. this.update = function(e) {
  23067. 1 == t.enabled && (n.rotation.z += 15 * e)
  23068. }
  23069. }
  23070. )(this.camera);
  23071. window.Loading = e,
  23072. this.updateListeners.push(e)
  23073. }
  23074. ,
  23075. h.prototype.createCursor = function(e, t, i, n, r) {
  23076. var o, a = new M.SpriteMaterial({
  23077. opacity: i,
  23078. color: n,
  23079. transparent: t,
  23080. map: this.boluoGetTexture("images/cursor.png"),
  23081. needsUpdate: !0,
  23082. side: M.DoubleSide
  23083. });
  23084. a.map.offset = new M.Vector2(1 / 17 * r,0),
  23085. a.map.repeat = new M.Vector2(1 / 17,1),
  23086. a.depthTest = !1,
  23087. a.blending = M.AdditiveBlending,
  23088. (o = new M.Sprite(a)).scale.set(.3, .3, .3),
  23089. o.position.z = -2,
  23090. o.visible = !1,
  23091. o.name = "cursor",
  23092. this.camera.add(o),
  23093. this.scene.add(this.camera),
  23094. this.cursor = o;
  23095. var s = new this.CursorAnimation(this.scene,o,this.camera);
  23096. this.cursor.triggerTargetEvent = s.triggerTargetEvent,
  23097. this.updateListeners.push(s)
  23098. }
  23099. ,
  23100. h.prototype.CursorAnimation = function(e, t, o) {
  23101. this.cursor = t,
  23102. this.raycaster = new M.Raycaster,
  23103. this.targetEventObj = {},
  23104. this.type = 1,
  23105. this.tweenFlag = !0;
  23106. var s = this;
  23107. this.target = o,
  23108. console.log(o.uuid),
  23109. this.euler = new M.Euler,
  23110. this.q0 = new M.Quaternion,
  23111. this.q1 = new M.Quaternion(-Math.sqrt(.5),0,0,Math.sqrt(.5)),
  23112. this.zee = new M.Vector3(0,0,1),
  23113. this.alpha = -1e3,
  23114. this.beta = -1e3,
  23115. this.gamma = -1e3,
  23116. this.orient = M.Math.degToRad(window.orientation || 0),
  23117. window.addEventListener("orientationchange", function() {
  23118. s.orient = M.Math.degToRad(window.orientation || 0)
  23119. }),
  23120. window.addEventListener("deviceorientation", function(e) {
  23121. var t = M.Math.degToRad(e.alpha)
  23122. , i = M.Math.degToRad(e.beta)
  23123. , n = M.Math.degToRad(e.gamma);
  23124. if (this.isHuawei5X ? (-1e3 === s.alpha && (s.alpha = t),
  23125. -1e3 === s.beta && (s.beta = i),
  23126. -1e3 === s.gamma && (s.gamma = n),
  23127. .06 < Math.abs(t - s.alpha) && (s.alpha = t),
  23128. .006 < Math.abs(i - s.beta) && (s.beta = i),
  23129. .006 < Math.abs(n - s.gamma) && (s.gamma = n)) : (s.alpha = t,
  23130. s.beta = i,
  23131. s.gamma = n),
  23132. h.vrDebug) {
  23133. $("#info-device-orientation").css("display", "block");
  23134. var r = "";
  23135. r += "alpha=(" + s.alpha + ")<BR/>",
  23136. r += "beta=(" + s.beta + ")<BR/>",
  23137. r += "gamma=" + s.gamma + "<BR/>",
  23138. document.getElementById("info-device-orientation").innerHTML = r
  23139. }
  23140. }),
  23141. this.setObjectQuaternion = function(e, t, i, n, r) {
  23142. s.euler.set(i, t, -n, "YXZ"),
  23143. e.setFromEuler(s.euler),
  23144. e.multiply(s.q1),
  23145. e.multiply(s.q0.setFromAxisAngle(s.zee, -r)),
  23146. o.updateMatrixWorld()
  23147. }
  23148. ,
  23149. parent !== window && window.addEventListener("message", function(e) {
  23150. var t, i, n, r, o = JSON.parse(e.data), a = -1 !== window.navigator.userAgent.indexOf("KIW-TL00H");
  23151. o && o.alpha && o.beta && o.gamma && (t = a,
  23152. i = M.Math.degToRad(o.alpha),
  23153. n = M.Math.degToRad(o.beta),
  23154. r = M.Math.degToRad(o.gamma),
  23155. t ? (-1e3 === s.alpha && (s.alpha = i),
  23156. -1e3 === s.beta && (s.beta = n),
  23157. -1e3 === s.gamma && (s.gamma = r),
  23158. .06 < Math.abs(i - s.alpha) && (s.alpha = i),
  23159. .006 < Math.abs(n - s.beta) && (s.beta = n),
  23160. .006 < Math.abs(r - s.gamma) && (s.gamma = r)) : (s.alpha = i,
  23161. s.beta = n,
  23162. s.gamma = r))
  23163. }),
  23164. this.update = function(e) {
  23165. TWEEN.update(),
  23166. window.vrEnabled && (this.setObjectQuaternion(this.target.quaternion, this.alpha, this.beta, this.gamma, this.orient),
  23167. this.triggerTargetEvent())
  23168. }
  23169. ,
  23170. this.triggerTargetEvent = function() {
  23171. var e = this.choseObj()
  23172. , t = e ? e.object : void 0;
  23173. (this.targetEventObj.currentObj = t) !== this.targetEventObj.lastObj && (t && this.autoCursorPosition(e),
  23174. 1 === this.type ? (this.cursorAnimate && this.cursorAnimate.stop(),
  23175. t && t.enabled && this.startAnimate(function() {
  23176. this.clickCallback(t)
  23177. }
  23178. .bind(this))) : this.type,
  23179. this.targetEventObj.lastObj = t)
  23180. }
  23181. ,
  23182. this.choseObj = function() {
  23183. this.raycaster.setFromCamera({
  23184. x: 0,
  23185. y: 0
  23186. }, o);
  23187. var e = (this.raycaster.ray,
  23188. window.vrMarkers)
  23189. , t = this.raycaster.intersectObjects(e);
  23190. if (0 < t.length)
  23191. return t[0]
  23192. }
  23193. ,
  23194. this.clickCallback = function(e) {
  23195. this.runTHREEAction(e, "onclick")
  23196. }
  23197. ,
  23198. this.runTHREEAction = function(e, t) {
  23199. switch (t) {
  23200. case "onclick":
  23201. e._listeners && e._listeners.click && e._listeners.click.forEach(function(e) {
  23202. e()
  23203. });
  23204. break;
  23205. case "onhover":
  23206. e._listeners && e._listeners.hover && e._listeners.hover.forEach(function(e) {
  23207. e()
  23208. });
  23209. break;
  23210. case "onout":
  23211. e._listeners && e._listeners.out && e._listeners.out.forEach(function(e) {
  23212. e()
  23213. })
  23214. }
  23215. }
  23216. ,
  23217. this.startAnimate = function(e) {
  23218. this.tweenFlag && this.initAnimation(e)
  23219. }
  23220. ,
  23221. this.initAnimation = function(e) {
  23222. var t = this
  23223. , i = this.cursor.material.map.offset;
  23224. t.tweenFlag = !1,
  23225. this.cursorAnimate = new TWEEN.Tween(i).to({
  23226. x: 1
  23227. }, 1e3).onStart(function() {
  23228. t.tweenFlag = !1
  23229. }).onStop(function() {
  23230. t.tweenFlag = !0,
  23231. this.x = 0,
  23232. i.x = 0
  23233. }).onUpdate(function() {}).onComplete(function() {
  23234. e(),
  23235. i.x = 0,
  23236. setTimeout(function() {
  23237. t.tweenFlag = !0
  23238. }, 1500)
  23239. }),
  23240. this.cursorAnimate.easing(function(e) {
  23241. return Math.floor(17 * e) / 17
  23242. }),
  23243. this.cursorAnimate.start()
  23244. }
  23245. ,
  23246. this.autoCursorPosition = function(e) {
  23247. this.cursor.scale.set(.3, .3, .3)
  23248. }
  23249. }
  23250. ,
  23251. h.prototype.vrRenderer = function(a, i, e) {
  23252. var s = new i.vrCamera(e);
  23253. s.bananaAspect = .8,
  23254. this.width,
  23255. this.height;
  23256. i = this;
  23257. this.setSize = function(e, t) {
  23258. a.setSize.call(this, e, t),
  23259. i.width = e,
  23260. i.height = t
  23261. }
  23262. ,
  23263. this.render = function(e, t, i, n) {
  23264. var r, o;
  23265. if (window.cameraQua = t.quaternion.clone(),
  23266. t.__RESS__SKIP__STEREO__)
  23267. return a.render(e, t, i, n);
  23268. if ("PerspectiveCamera" === t.type)
  23269. r = s.cameraL,
  23270. o = s.cameraR,
  23271. e.updateMatrixWorld(),
  23272. null === t.parent && t.updateMatrixWorld(),
  23273. s.vrCameraUpdate(t);
  23274. else {
  23275. if ("OrthographicCamera" !== t.type)
  23276. return DEBUG && console.error("Unsupported renderer: ", t.type);
  23277. r = o = t
  23278. }
  23279. a.setScissorTest(!0),
  23280. a.setScissor(0, 0, this.width / 2, this.height),
  23281. a.setViewport(0, 0, this.width / 2, this.height),
  23282. a.render.call(this, e, r, i, n),
  23283. a.setScissor(this.width / 2, 0, this.width / 2, this.height),
  23284. a.setViewport(this.width / 2, 0, this.width / 2, this.height),
  23285. a.render.call(this, e, o, i, n),
  23286. a.setScissorTest(!1)
  23287. }
  23288. ,
  23289. this.__proto__ = {
  23290. __proto__: a
  23291. }
  23292. }
  23293. ,
  23294. h.prototype.vrCamera = function(e) {
  23295. this.type = "StereoCamera",
  23296. this._aspect = 1,
  23297. this._overlap = .064,
  23298. this.cameraL = new M.PerspectiveCamera,
  23299. this.cameraL.layers.enable(1),
  23300. this.cameraL.matrixAutoUpdate = !1,
  23301. this.cameraR = new M.PerspectiveCamera,
  23302. this.cameraR.layers.enable(2),
  23303. this.cameraR.matrixAutoUpdate = !1,
  23304. this.eyeRight = new M.Matrix4,
  23305. this.eyeLeft = new M.Matrix4,
  23306. this.vrCameraNeedsUpdate = !0,
  23307. window.vrCameraL = this.cameraL,
  23308. Object.defineProperty(this, "bananaAspect", {
  23309. get: function() {
  23310. return this._aspect
  23311. },
  23312. set: function(e) {
  23313. this._aspect !== e && (this.vrCameraNeedsUpdate = !0),
  23314. this._aspect = e
  23315. }
  23316. }),
  23317. Object.defineProperty(this, "overlap", {
  23318. get: function() {
  23319. return this._overlap
  23320. },
  23321. set: function(e) {
  23322. this._overlap !== e && (this.vrCameraNeedsUpdate = !0),
  23323. this._overlap = e
  23324. }
  23325. }),
  23326. this.vrCameraUpdate = function(e) {
  23327. if (this.vrCameraNeedsUpdate = !0,
  23328. this.vrCameraNeedsUpdate = this.vrCameraNeedsUpdate || this.bananaFov !== e.fov || this.bananaReal_aspect !== e.aspect * this.bananaAspect || this.bananaNear !== e.near || this.bananaFar !== e.far,
  23329. this.vrCameraNeedsUpdate) {
  23330. this.vrCameraNeedsUpdate = !1,
  23331. console.debug("vrCameraUpdate"),
  23332. this.bananaFocus = e.focus,
  23333. this.bananaFov = e.fov,
  23334. this.bananaReal_aspect = e.aspect * this.bananaAspect,
  23335. this.bananaNear = e.near,
  23336. this.bananaFar = e.far,
  23337. console.debug(e.aspect),
  23338. this.bananaFocus = 10;
  23339. 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);
  23340. this.eyeLeft.elements[12] = -r,
  23341. this.eyeRight.elements[12] = r,
  23342. t = -a * this.bananaReal_aspect + o,
  23343. i = a * this.bananaReal_aspect + o,
  23344. n.elements[0] = 2 * this.bananaNear / (i - t),
  23345. n.elements[8] = (i + t) / (i - t),
  23346. this.cameraL.projectionMatrix.copy(n),
  23347. t = -a * this.bananaReal_aspect - o,
  23348. i = a * this.bananaReal_aspect - o,
  23349. n.elements[0] = 2 * this.bananaNear / (i - t),
  23350. n.elements[8] = (i + t) / (i - t),
  23351. this.cameraR.projectionMatrix.copy(n)
  23352. }
  23353. this.cameraL.matrixWorld.copy(e.matrixWorld).multiply(this.eyeLeft),
  23354. this.cameraR.matrixWorld.copy(e.matrixWorld).multiply(this.eyeRight)
  23355. }
  23356. }
  23357. ,
  23358. h.prototype.boluoGetTexture = function(e) {
  23359. var t = new M.TextureLoader;
  23360. return t.crossOrigin = "anonymous",
  23361. t.load(e)
  23362. }
  23363. ,
  23364. h.prototype.updateScreenSize = function(e) {
  23365. var t, i, n, r = !1;
  23366. e && !e.resize && null != e.width && null != e.height ? (i = e.width,
  23367. n = e.height,
  23368. r = !0,
  23369. t = 1) : (i = $("#player").width(),
  23370. n = $("#player").height(),
  23371. e && e.resize && (o = this.renderWidth,
  23372. a = this.renderHeight),
  23373. i === o && n === a && !this.forceUpdateSize || (o = i,
  23374. a = n,
  23375. r = !0,
  23376. t = window.devicePixelRatio)),
  23377. r && (this.setSize(i, n, t),
  23378. this.forceUpdateSize = !1)
  23379. }
  23380. ,
  23381. h.prototype.updateComponents = function() {
  23382. for (var e = Math.min(1, this.updateClock.getDelta()), t = 0; t < this.updateListeners.length; t++)
  23383. this.updateListeners[t].update(e)
  23384. }
  23385. ,
  23386. h.prototype.suspend = function() {
  23387. this.started = !1,
  23388. this.suspendedObjects = this.scene.children.map(function(e) {
  23389. return this.scene.remove(e),
  23390. e
  23391. }
  23392. .bind(this)),
  23393. this.render()
  23394. }
  23395. ,
  23396. h.prototype.resume = function() {
  23397. this.suspendedObjects.forEach(function(e) {
  23398. this.scene.add(e)
  23399. }
  23400. .bind(this)),
  23401. this.suspendedObjects = [],
  23402. this.started = !0,
  23403. b()
  23404. }
  23405. ;
  23406. var g, m, v, y, A, C, I, P, O, L, D, N, F, E, _, b = function() {
  23407. this.started && (window.requestAnimationFrame(b),
  23408. this.updateScreenSize(),
  23409. this.updateComponents(),
  23410. this.updateTextureMemory(),
  23411. this.render(),
  23412. this.emit(r.AfterRender))
  23413. };
  23414. h.prototype.getImageData = (E = document.createElement("canvas"),
  23415. _ = E.getContext("2d"),
  23416. function(e, t, i) {
  23417. return E.width === t && E.height === i || (E.width = t,
  23418. E.height = i),
  23419. _.drawImage(e, 0, 0, t, i),
  23420. _.getImageData(0, 0, t, i)
  23421. }
  23422. ),
  23423. h.prototype.initSizedTexture2D = function(e, t, i) {
  23424. var n = this.renderer
  23425. , r = n.context
  23426. , o = n.state
  23427. , a = new M.Texture(null);
  23428. !(a.flipY = !1) !== i && (i = !1),
  23429. a.generateMipmaps = i;
  23430. var s = n.paramThreeToGL(a.format)
  23431. , l = n.paramThreeToGL(a.type)
  23432. , c = n.properties.get(a)
  23433. , h = r.createTexture();
  23434. o.bindTexture(r.TEXTURE_2D, h),
  23435. r.pixelStorei(r.UNPACK_FLIP_Y_WEBGL, a.flipY),
  23436. r.texImage2D(r.TEXTURE_2D, 0, s, e, e, 0, s, l, null),
  23437. a.wrapS = t,
  23438. a.wrapT = t;
  23439. var u = n.paramThreeToGL(t);
  23440. return r.texParameteri(r.TEXTURE_2D, r.TEXTURE_WRAP_S, u),
  23441. r.texParameteri(r.TEXTURE_2D, r.TEXTURE_WRAP_T, u),
  23442. i ? (a.magFilter = M.LinearFilter,
  23443. a.minFilter = M.LinearMipMapLinearFilter,
  23444. r.texParameteri(r.TEXTURE_2D, r.TEXTURE_MAG_FILTER, r.LINEAR),
  23445. r.texParameteri(r.TEXTURE_2D, r.TEXTURE_MIN_FILTER, r.LINEAR_MIPMAP_NEAREST),
  23446. r.generateMipmap(r.TEXTURE_2D)) : (a.magFilter = M.LinearFilter,
  23447. a.minFilter = M.LinearFilter,
  23448. r.texParameteri(r.TEXTURE_2D, r.TEXTURE_MAG_FILTER, r.LINEAR),
  23449. r.texParameteri(r.TEXTURE_2D, r.TEXTURE_MIN_FILTER, r.LINEAR)),
  23450. o.bindTexture(r.TEXTURE_2D, null),
  23451. c.__webglTexture = h,
  23452. a
  23453. }
  23454. ,
  23455. h.prototype.initSizedCubeMap = function(e, t) {
  23456. var i = this.renderer
  23457. , n = i.context
  23458. , r = i.state
  23459. , o = new M.CubeTexture([null, null, null, null, null, null]);
  23460. o.flipY = !1,
  23461. o.generateMipmaps = t;
  23462. var a = i.paramThreeToGL(o.format)
  23463. , s = i.paramThreeToGL(o.type)
  23464. , l = i.properties.get(o)
  23465. , c = n.createTexture();
  23466. r.bindTexture(n.TEXTURE_CUBE_MAP, c),
  23467. n.pixelStorei(n.UNPACK_FLIP_Y_WEBGL, o.flipY);
  23468. for (var h = 0; h < 6; h++)
  23469. n.texImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X + h, 0, a, e, e, 0, a, s, null);
  23470. return t ? (o.magFilter = M.LinearFilter,
  23471. o.minFilter = M.LinearMipMapLinearFilter,
  23472. n.texParameteri(n.TEXTURE_CUBE_MAP, n.TEXTURE_MAG_FILTER, n.LINEAR),
  23473. n.texParameteri(n.TEXTURE_CUBE_MAP, n.TEXTURE_MIN_FILTER, n.LINEAR_MIPMAP_LINEAR),
  23474. n.texParameteri(n.TEXTURE_CUBE_MAP, n.GENERATE_MIPMAP, n.TRUE),
  23475. n.generateMipmap(n.TEXTURE_CUBE_MAP)) : (o.magFilter = M.LinearFilter,
  23476. o.minFilter = M.LinearFilter,
  23477. n.texParameteri(n.TEXTURE_CUBE_MAP, n.TEXTURE_MAG_FILTER, n.LINEAR),
  23478. n.texParameteri(n.TEXTURE_CUBE_MAP, n.TEXTURE_MIN_FILTER, n.LINEAR)),
  23479. r.bindTexture(n.TEXTURE_CUBE_MAP, null),
  23480. l.__image__webglTextureCube = c,
  23481. o
  23482. }
  23483. ,
  23484. h.prototype.deallocateCubeTexture = function(e) {
  23485. var t = this.renderer
  23486. , i = t.context
  23487. , n = t.properties.get(e);
  23488. i.deleteTexture(n.__image__webglTextureCube)
  23489. }
  23490. ,
  23491. h.prototype.uploadTexture2D = function(e, t, i, n, r, o) {
  23492. var a = this.renderer
  23493. , s = a.context
  23494. , l = a.state
  23495. , c = a.properties.get(t);
  23496. l.bindTexture(s.TEXTURE_2D, c.__webglTexture),
  23497. s.pixelStorei(s.UNPACK_FLIP_Y_WEBGL, t.flipY),
  23498. s.pixelStorei(s.UNPACK_PREMULTIPLY_ALPHA_WEBGL, t.premultiplyAlpha),
  23499. s.pixelStorei(s.UNPACK_ALIGNMENT, t.unpackAlignment),
  23500. s.texParameteri(s.TEXTURE_2D, s.TEXTURE_WRAP_S, a.paramThreeToGL(t.wrapS)),
  23501. s.texParameteri(s.TEXTURE_2D, s.TEXTURE_WRAP_T, a.paramThreeToGL(t.wrapT)),
  23502. s.texParameteri(s.TEXTURE_2D, s.TEXTURE_MAG_FILTER, a.paramThreeToGL(t.magFilter)),
  23503. s.texParameteri(s.TEXTURE_2D, s.TEXTURE_MIN_FILTER, a.paramThreeToGL(t.minFilter)),
  23504. s.texSubImage2D(s.TEXTURE_2D, 0, i, n, s.RGBA, s.UNSIGNED_BYTE, e),
  23505. t.generateMipmaps && s.generateMipmap(s.TEXTURE_2D),
  23506. l.bindTexture(s.TEXTURE_2D, null)
  23507. }
  23508. ,
  23509. h.prototype.uploadTexture3D = function(e, t, i, n, r, o, a) {
  23510. var s = this.renderer
  23511. , l = s.context
  23512. , c = s.state
  23513. , h = s.properties.get(t);
  23514. c.bindTexture(l.TEXTURE_CUBE_MAP, h.__image__webglTextureCube),
  23515. l.pixelStorei(l.UNPACK_FLIP_Y_WEBGL, t.flipY),
  23516. l.texSubImage2D(r, 0, i, n, l.RGBA, l.UNSIGNED_BYTE, e),
  23517. t.generateMipmaps && l.generateMipmap(l.TEXTURE_CUBE_MAP),
  23518. c.bindTexture(l.TEXTURE_CUBE_MAP, null)
  23519. }
  23520. ,
  23521. h.prototype.rebuildMipMaps2D = function(e) {
  23522. var t = this.renderer
  23523. , i = t.context
  23524. , n = t.state;
  23525. t.properties.get(e),
  23526. i.generateMipmap(i.TEXTURE_2D),
  23527. n.bindTexture(i.TEXTURE_2D, null)
  23528. }
  23529. ,
  23530. h.prototype.rebuildMipMaps3D = function(e) {
  23531. var t = this.renderer
  23532. , i = t.context
  23533. , n = t.state
  23534. , r = t.properties.get(e);
  23535. n.bindTexture(i.TEXTURE_CUBE_MAP, r.__image__webglTextureCube),
  23536. i.generateMipmap(i.TEXTURE_CUBE_MAP),
  23537. n.bindTexture(i.TEXTURE_CUBE_MAP, null)
  23538. }
  23539. ,
  23540. h.prototype.renderToCubeMap = (P = !1,
  23541. F = N = D = L = O = null,
  23542. function(e, t, i, n, r, o, a, s, l, c, h, u, d, p, f, g) {
  23543. this.renderer.context,
  23544. P || ((L = new M.OrthographicCamera(-.5,.5,.5,-.5,-200,200)).position.z = 150,
  23545. (O = new M.Scene).add(L),
  23546. D = new M.ShaderMaterial({
  23547. uniforms: {
  23548. tDiffuse: {
  23549. type: "t",
  23550. value: null
  23551. },
  23552. alpha: {
  23553. type: "f",
  23554. value: 1
  23555. }
  23556. },
  23557. vertexShader: R.basicTextured.vertexShader,
  23558. fragmentShader: R.basicTextured.fragmentShader,
  23559. depthWrite: !1,
  23560. depthTest: !1,
  23561. side: M.DoubleSide
  23562. }),
  23563. N = new M.PlaneBufferGeometry(1,1),
  23564. (F = new M.Mesh(N,D)).position.z = 0,
  23565. O.add(F),
  23566. P = !0);
  23567. var m = N.getAttribute("uv");
  23568. m.setDynamic(!0),
  23569. m.needsUpdate = !0;
  23570. var v = m.array
  23571. , y = r / i
  23572. , A = o / n
  23573. , C = a / i
  23574. , I = s / n;
  23575. v[0] = y,
  23576. v[1] = A + I,
  23577. v[2] = y + C,
  23578. v[3] = A + I,
  23579. v[4] = y,
  23580. v[5] = A,
  23581. v[6] = y + C,
  23582. v[7] = A;
  23583. var E = N.getAttribute("position");
  23584. E.setDynamic(!0),
  23585. E.needsUpdate = !0;
  23586. var _ = E.array
  23587. , b = l / t.width - .5
  23588. , w = c / t.height - .5
  23589. , T = h / t.width
  23590. , x = u / t.height;
  23591. _[0] = b,
  23592. _[1] = w + x,
  23593. _[3] = b + T,
  23594. _[4] = w + x,
  23595. _[6] = b,
  23596. _[7] = w,
  23597. _[9] = b + T,
  23598. _[10] = w,
  23599. this.renderer.properties.get(e),
  23600. D.uniforms.tDiffuse.value = e,
  23601. D.blending = p || M.NoBlending,
  23602. D.transparent = !!f,
  23603. null != g || (g = 1),
  23604. D.uniforms.alpha.value = g,
  23605. D.needUpdate = !0,
  23606. t.activeCubeFace = d,
  23607. t.viewport.set(0, 0, t.width, t.height);
  23608. var S = this.renderer.autoClear;
  23609. this.renderer.autoClear = !1,
  23610. this.renderer.render(O, L, t, !1),
  23611. this.renderer.autoClear = S
  23612. }
  23613. ),
  23614. h.prototype.copyCubeMap = (g = !1,
  23615. C = A = y = v = m = null,
  23616. I = new M.Euler,
  23617. new M.Vector3,
  23618. function(e, t, i, n, r, o, a, s, l) {
  23619. this.renderer,
  23620. g || ((v = new M.OrthographicCamera(-1,1,1,-1,0,200)).position.set(0, 0, 0),
  23621. (m = new M.Scene).add(v),
  23622. y = new M.ShaderMaterial({
  23623. uniforms: {
  23624. tDiffuse: {
  23625. type: "t",
  23626. value: null
  23627. },
  23628. alpha: {
  23629. type: "f",
  23630. value: 1
  23631. }
  23632. },
  23633. vertexShader: R.copyCubeMap.vertexShader,
  23634. fragmentShader: R.copyCubeMap.fragmentShader,
  23635. depthWrite: !1,
  23636. depthTest: !1,
  23637. side: M.DoubleSide
  23638. }),
  23639. A = new M.BoxGeometry(2,2,2),
  23640. C = new M.Mesh(A,y),
  23641. m.add(C),
  23642. g = !0);
  23643. for (var c = 0; c < 6; c++)
  23644. h.getCubeOrientationForCubeFace(c, I),
  23645. C.rotation.copy(I),
  23646. C.matrixWorldNeedsUpdate = !0,
  23647. C.updateMatrixWorld(),
  23648. y.uniforms.tDiffuse.value = e,
  23649. y.blending = a || M.NoBlending,
  23650. y.transparent = !!s,
  23651. null != l || (l = 1),
  23652. y.uniforms.alpha.value = l,
  23653. y.needUpdate = !0,
  23654. t.activeCubeFace = c,
  23655. t.viewport.set(0, 0, r, o),
  23656. this.renderer.render(m, v, t, !1)
  23657. }
  23658. ),
  23659. h.getLookAtForCubeFace = function(e, t) {
  23660. switch (e) {
  23661. case s.GL_TEXTURE_CUBE_MAP_POSITIVE_X:
  23662. t.set(1, 0, 0);
  23663. break;
  23664. case s.GL_TEXTURE_CUBE_MAP_NEGATIVE_X:
  23665. t.set(-1, 0, 0);
  23666. break;
  23667. case s.GL_TEXTURE_CUBE_MAP_POSITIVE_Y:
  23668. t.set(0, 1, 0);
  23669. break;
  23670. case s.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y:
  23671. t.set(0, -1, 0);
  23672. break;
  23673. case s.GL_TEXTURE_CUBE_MAP_POSITIVE_Z:
  23674. t.set(0, 0, 1);
  23675. break;
  23676. case s.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z:
  23677. t.set(0, 0, -1)
  23678. }
  23679. }
  23680. ,
  23681. h.getCubeOrientationForCubeFace = function(e, t) {
  23682. switch (e) {
  23683. case s.GL_TEXTURE_CUBE_MAP_POSITIVE_X:
  23684. t.set(0, -Math.PI / 2, 0);
  23685. break;
  23686. case s.GL_TEXTURE_CUBE_MAP_NEGATIVE_X:
  23687. t.set(0, Math.PI / 2, 0);
  23688. break;
  23689. case s.GL_TEXTURE_CUBE_MAP_POSITIVE_Y:
  23690. t.set(Math.PI / 2, Math.PI, 0);
  23691. break;
  23692. case s.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y:
  23693. t.set(-Math.PI / 2, Math.PI, 0);
  23694. break;
  23695. case s.GL_TEXTURE_CUBE_MAP_POSITIVE_Z:
  23696. t.set(0, -Math.PI, 0);
  23697. break;
  23698. case s.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z:
  23699. t.set(0, 0, 0)
  23700. }
  23701. }
  23702. ,
  23703. t.exports = h
  23704. }
  23705. , {
  23706. "../enum/GLCubeFaces": 25,
  23707. "../enum/GLTextureType": 26,
  23708. "../enum/SceneRendererEvents": 43,
  23709. "../exception/BasicException": 55,
  23710. "../exception/RendererCreationException": 57,
  23711. "../settings": 166,
  23712. "../shaders": 167,
  23713. "../util/browser": 182,
  23714. events: 202,
  23715. three: 217
  23716. }],
  23717. 159: [function(e, t, i) {
  23718. "use strict";
  23719. function n(e) {
  23720. this.messenger = new a(e),
  23721. this.clientKey = null
  23722. }
  23723. var o = e("../util/ajax")
  23724. , r = e("./PostMessageType")
  23725. , a = e("./postmessage")
  23726. , s = e("./VersionInfo")
  23727. , l = e("events").EventEmitter
  23728. , c = window.location.origin + "/api/v1/user/";
  23729. (n.prototype = Object.create(l.prototype)).bindEvents = function() {
  23730. this.messenger.on(r.ACTION, this.onMessageReceived.bind(this))
  23731. }
  23732. ,
  23733. n.prototype.waitForConnection = function() {
  23734. return new Promise(function(t, i) {
  23735. this.messenger.on(r.CONNECT, function(e) {
  23736. this.onConnectionReceived(e).then(t.bind(this, e.sdkVersion), i.bind())
  23737. }
  23738. .bind(this))
  23739. }
  23740. .bind(this))
  23741. }
  23742. ,
  23743. n.prototype.onConnectionReceived = function(i) {
  23744. return this.messenger.setTarget(i.source, i.origin),
  23745. this.verifyConnection(i).then(function(e, t) {
  23746. this.messenger.send({
  23747. type: r.ACCEPT,
  23748. toId: i.fromId,
  23749. warning: t
  23750. }),
  23751. this.clientKey = e,
  23752. this.messenger.removeAllListeners(r.CONNECT),
  23753. this.bindEvents()
  23754. }
  23755. .bind(this), function(e) {
  23756. this.messenger.send({
  23757. type: r.REJECT,
  23758. toId: i.fromId,
  23759. reason: e
  23760. }),
  23761. this.messenger.setTarget()
  23762. }
  23763. .bind(this))
  23764. }
  23765. ,
  23766. n.prototype.verifyConnection = function(r) {
  23767. return new Promise(function(e, t) {
  23768. var i;
  23769. if (s.isDeprecated(r.sdkVersion))
  23770. i = "这个版本正在被弃用";
  23771. else if (!s.isSupported(r.sdkVersion))
  23772. return t("不支持此版本的SDK");
  23773. var n = {
  23774. cache: !1,
  23775. headers: {
  23776. "X-port-Application-Key": r.applicationKey,
  23777. "X-port-Referrer": r.origin
  23778. }
  23779. };
  23780. o.get(c, n).done(e.bind(this, r.applicationKey, i)).fail(t.bind(this, "key/referrer mismatch"))
  23781. }
  23782. )
  23783. }
  23784. ,
  23785. n.prototype.onMessageReceived = function(t) {
  23786. if (this.validateClientApplicationKey(t.applicationKey)) {
  23787. var i = this;
  23788. t.onDone = function(e) {
  23789. e.toId = t.fromId,
  23790. e.uid = t.uid,
  23791. e.type = r.RESPONSE,
  23792. i.messenger.send(e)
  23793. }
  23794. ,
  23795. this.emit(r.ACTION, t)
  23796. }
  23797. }
  23798. ,
  23799. n.prototype.validateClientApplicationKey = function(e) {
  23800. return this.clientKey === e
  23801. }
  23802. ,
  23803. n.prototype.sendEvent = function(e, t) {
  23804. this.messenger.send({
  23805. type: r.EVENT,
  23806. eventType: e,
  23807. eventData: t
  23808. })
  23809. }
  23810. ,
  23811. t.exports = n
  23812. }
  23813. , {
  23814. "../util/ajax": 181,
  23815. "./PostMessageType": 160,
  23816. "./VersionInfo": 163,
  23817. "./postmessage": 165,
  23818. events: 202
  23819. }],
  23820. 160: [function(e, t, i) {
  23821. "use strict";
  23822. t.exports = Object.freeze({
  23823. CONNECT: "postmessage.connect",
  23824. ACCEPT: "postmessage.accept",
  23825. REJECT: "postmessage.reject",
  23826. ACTION: "postmessage.action",
  23827. RESPONSE: "postmessage.response",
  23828. EVENT: "postmessage.event"
  23829. })
  23830. }
  23831. , {}],
  23832. 161: [function(e, t, i) {
  23833. "use strict";
  23834. t.exports = Object.freeze({
  23835. MOVE: "sdk.move",
  23836. ENTER_PANO: "sdk.enterpano",
  23837. MODEL_LOADED: "sdk.modelloaded"
  23838. })
  23839. }
  23840. , {}],
  23841. 162: [function(e, t, i) {
  23842. "use strict";
  23843. t.exports = Object.freeze({
  23844. FLY: "transition.fly",
  23845. FADEOUT: "transition.fade",
  23846. INSTANT: "transition.instant"
  23847. })
  23848. }
  23849. , {}],
  23850. 163: [function(e, t, i) {
  23851. "use strict";
  23852. t.exports = {
  23853. current: "1.0",
  23854. supported: ["1.0"],
  23855. deprecated: [],
  23856. isSupported: function(e) {
  23857. return -1 !== this.supported.indexOf(e)
  23858. },
  23859. isDeprecated: function(e) {
  23860. return -1 !== this.deprecated.indexOf(e)
  23861. },
  23862. isValid: function(e) {
  23863. return this.isSupported(e) || this.isDeprecated(e)
  23864. }
  23865. }
  23866. }
  23867. , {}],
  23868. 164: [function(q, X, e) {
  23869. (function(e) {
  23870. "use strict";
  23871. function r(e, t, i) {
  23872. e = e && e.toLowerCase().trim();
  23873. var n = new C.UP.clone
  23874. , r = Math.PI / 3
  23875. , o = Math.PI / 2;
  23876. switch (e) {
  23877. case "left":
  23878. i.copy(t),
  23879. i.applyAxisAngle(n, o);
  23880. break;
  23881. case "right":
  23882. i.copy(t),
  23883. i.applyAxisAngle(n, -o);
  23884. break;
  23885. case "forwardleft":
  23886. i.copy(t),
  23887. i.applyAxisAngle(n, r);
  23888. break;
  23889. case "forwardright":
  23890. i.copy(t),
  23891. i.applyAxisAngle(n, -r);
  23892. break;
  23893. case "forward":
  23894. default:
  23895. i.copy(t)
  23896. }
  23897. return i
  23898. }
  23899. function o(e, t) {
  23900. if (e) {
  23901. var i = {
  23902. pano: e,
  23903. lookAtPoint: null,
  23904. duration: null,
  23905. maxDistanceOverride: null,
  23906. skipWarpingCheck: !1
  23907. };
  23908. this.player.flyToPano(i, function() {
  23909. t && t({
  23910. success: !0,
  23911. message: "Transition complete."
  23912. })
  23913. })
  23914. } else
  23915. M.warn("Showcase -> clickPanoObject: Unable to find pano."),
  23916. t && t({
  23917. success: !1,
  23918. error: "Unable to find pano."
  23919. })
  23920. }
  23921. function a(e, t) {
  23922. t.copy(C.FORWARD),
  23923. e.getDirection(t)
  23924. }
  23925. function c(i) {
  23926. return {
  23927. panos: i.panos.list.map(function(e) {
  23928. var t = y.getCubemapUrls(i.urls, e.id, "high")[A.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z];
  23929. return {
  23930. uuid: e.id,
  23931. aligned: e.alignmentType === g.ALIGNED,
  23932. neighbourUUIDs: e.neighbourUUIDs.slice(),
  23933. position: function(e) {
  23934. return e.alignmentType !== g.ALIGNED ? null : {
  23935. x: e.position.x,
  23936. y: e.position.y,
  23937. z: e.position.z
  23938. }
  23939. }(e),
  23940. rotation: function(e) {
  23941. var t = (new h.Euler).setFromQuaternion(e.quaternion, "YXZ");
  23942. return {
  23943. x: h.Math.radToDeg(t._x),
  23944. y: h.Math.radToDeg(t._y),
  23945. z: h.Math.radToDeg(t._z)
  23946. }
  23947. }(e),
  23948. thumbnail: t
  23949. }
  23950. })
  23951. }
  23952. }
  23953. 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"),
  23954. q("../enum/PlayerEvents")), b = q("../sdk/SdkEvents"), w = (C = q("../enum/Vectors"),
  23955. q("../enum/ControlEvents")), T = q("../enum/RenderLayers"), x = (q("../constants"),
  23956. q("../settings")), S = q("../lib/jpeg_encoder"), M = new n(e), R = (N.active = !1,
  23957. N.angle = 0,
  23958. N.angleTravelled = 0,
  23959. N.playerDirection = new h.Vector3,
  23960. N.lastFacingDirection = new h.Vector3,
  23961. N.onDone = null,
  23962. N.player = null,
  23963. N.start = function(e, t, i, n) {
  23964. N.active = !0,
  23965. e && t && (t = 0),
  23966. N.angle = e || t,
  23967. N.xAngle = e,
  23968. N.yAngle = t,
  23969. N.angleTravelled = 0,
  23970. N.playerDirection.copy(i.mode === I.FLOORPLAN ? C.UP : C.FORWARD),
  23971. i.getDirection(N.playerDirection),
  23972. N.lastFacingDirection.copy(N.playerDirection),
  23973. N.projectVectors(),
  23974. N.onDone = n,
  23975. N.player = i,
  23976. N()
  23977. }
  23978. ,
  23979. N.projectVectors = function() {
  23980. N.xAngle && (N.playerDirection.projectOnPlane(C.UP),
  23981. N.lastFacingDirection.projectOnPlane(C.UP))
  23982. }
  23983. ,
  23984. N), P = (i = new h.Vector3,
  23985. function(e) {
  23986. e ? (i.copy(e.position),
  23987. i.add(e.discPosition),
  23988. s.projectPositionToCanvas(i, this.player.camera, i),
  23989. this.click(i.x, i.y)) : M.warn("Showcase -> clicktagObject: Unable to find tag.")
  23990. }
  23991. ), O = (l = new h.Vector3,
  23992. function(e) {
  23993. var t = this.player.getDirection();
  23994. l.copy(t);
  23995. var i = l.y;
  23996. l.y = 0,
  23997. l.normalize();
  23998. var n = h.Math.radToDeg(l.angleTo(t)) * (i < 0 ? -1 : 1);
  23999. if (this.player.mode !== I.DOLLHOUSE && this.player.mode !== I.PANORAMA)
  24000. return 0 !== e && M.warn("Cannot rotate in y direction when in " + this.player.mode + " mode"),
  24001. 0;
  24002. this.player.mode === I.DOLLHOUSE && (n = -n);
  24003. var r = function() {
  24004. return this.player.mode === I.PANORAMA ? x.insideLookLimitUp : this.player.mode === I.DOLLHOUSE ? 90 - h.Math.radToDeg(x.dollhouseDefault.minPolarAngle) : null
  24005. }
  24006. .call(this) - .1
  24007. , o = function() {
  24008. return this.player.mode === I.PANORAMA ? x.insideLookLimitDown : this.player.mode === I.DOLLHOUSE ? 90 - h.Math.radToDeg(x.dollhouseDefault.maxPolarAngle) : null
  24009. }
  24010. .call(this) + .1
  24011. , a = n + e;
  24012. r < a ? a = r : a < o && (a = o);
  24013. var s = a - n;
  24014. return 0 < e && s < .01 && (s = 0),
  24015. e < 0 && -.01 < s && (s = 0),
  24016. s
  24017. }
  24018. ), L = (t = new h.Euler,
  24019. function(e) {
  24020. return t.setFromQuaternion(e.quaternion, "YXZ"),
  24021. {
  24022. position: {
  24023. x: e.position.x,
  24024. y: e.position.y,
  24025. z: e.position.z
  24026. },
  24027. rotation: {
  24028. x: h.Math.radToDeg(t.x),
  24029. y: h.Math.radToDeg(t.y),
  24030. z: 0
  24031. },
  24032. pano: e.currentPano ? e.currentPano.id : null,
  24033. mode: e.mode
  24034. }
  24035. }
  24036. ), D = null;
  24037. function N() {
  24038. N.playerDirection.copy(N.player.mode === I.FLOORPLAN ? C.UP : C.FORWARD),
  24039. N.player.getDirection(N.playerDirection),
  24040. N.projectVectors();
  24041. var e = N.playerDirection.angleTo(N.lastFacingDirection);
  24042. (N.angleTravelled += Math.abs(e)) >= Math.abs(N.angle) ? (N.active = !1,
  24043. N.onDone && (0,
  24044. N.onDone)()) : (N.lastFacingDirection.copy(N.playerDirection),
  24045. window.setTimeout(N, 4))
  24046. }
  24047. X.exports = {
  24048. init: function(e, t, i, n, r) {
  24049. Y.init(e, t, i, r),
  24050. D = new Promise(function(e, t) {
  24051. i.on(_.Ready, function() {
  24052. e()
  24053. })
  24054. }
  24055. .bind(this));
  24056. var o = new u(window)
  24057. , a = o.waitForConnection();
  24058. a.then(function(e) {
  24059. o.on(f.ACTION, Y.onMessageReceive.bind(Y))
  24060. });
  24061. var s, l = (s = Date.now(),
  24062. function() {
  24063. if (!(Date.now() - s < 100)) {
  24064. var e = L(i);
  24065. o.sendEvent(b.MOVE, {
  24066. state: e
  24067. }),
  24068. s = Date.now()
  24069. }
  24070. }
  24071. );
  24072. i.on(_.Move, l),
  24073. i.on(_.ViewChanged, l),
  24074. n.on(p.ActiveModelChanged, function(e) {
  24075. function t(e) {
  24076. var t, i = e.newPano.id;
  24077. e.oldPano && (t = e.oldPano.id),
  24078. i !== t && o.sendEvent(b.ENTER_PANO, {
  24079. oldPano: t,
  24080. newPano: i
  24081. })
  24082. }
  24083. var i = e.model
  24084. , n = e.oldModel;
  24085. Y.model = i,
  24086. a.then(function() {
  24087. o.sendEvent(b.MODEL_LOADED, {
  24088. metadata: c(i)
  24089. })
  24090. }),
  24091. n && n.panos.forEach(function(e) {
  24092. e.removeEventListener("enter", t)
  24093. }),
  24094. i.panos.forEach(function(e) {
  24095. e.on("enter", t)
  24096. })
  24097. })
  24098. }
  24099. };
  24100. var F, B, V, k, U, H, z, G, W, j, Y = {
  24101. director: null,
  24102. player: null,
  24103. controls: null,
  24104. sceneRenderer: null,
  24105. model: null,
  24106. init: function(e, t, i, n) {
  24107. this.director = e,
  24108. this.player = i,
  24109. this.controls = t,
  24110. this.sceneRenderer = n
  24111. },
  24112. handleToObject: {},
  24113. objectToHandle: {},
  24114. handleCount: 0,
  24115. onMessageReceive: function(e) {
  24116. if (e) {
  24117. var t = e.targetFunction
  24118. , i = e.params
  24119. , n = e.onDone;
  24120. t && this[t] && this[t](i, n)
  24121. }
  24122. },
  24123. waitForInit: function(e, t) {
  24124. D.then(t.bind({
  24125. success: !0,
  24126. message: "Init complete."
  24127. }))
  24128. },
  24129. moveToPano: (W = new h.Euler(0,0,0,"YXZ"),
  24130. j = new h.Quaternion,
  24131. function(e, t) {
  24132. var i = e.pano
  24133. , n = e.rotation
  24134. , r = e.transition;
  24135. if (!this.model)
  24136. return t({
  24137. success: !1,
  24138. error: "The model has not been loaded yet"
  24139. });
  24140. var o = this.model.panos.get(i);
  24141. if (!o)
  24142. return t({
  24143. success: !1,
  24144. error: i + " does not exist in this model"
  24145. });
  24146. if (!n)
  24147. return t({
  24148. sucess: !1,
  24149. erorr: n + " is not a valid rotation"
  24150. });
  24151. W.set(h.Math.degToRad(n.x || 0), h.Math.degToRad(n.y || 0), h.Math.degToRad(n.z || 0), "YXZ"),
  24152. console.log(n.z);
  24153. var a = {
  24154. success: !0,
  24155. message: i
  24156. };
  24157. if (r === v.FADEOUT)
  24158. j.setFromEuler(W),
  24159. this.player.warpToPano(o, j, null, null, E.BLACK, null, null, t.bind(this, a));
  24160. else {
  24161. var s, l;
  24162. r === v.INSTANT && (l = s = 0);
  24163. var c = C.FORWARD.clone().applyEuler(W).add(o.position);
  24164. this.player.flyToPano({
  24165. pano: o,
  24166. lookAtPoint: c,
  24167. duration: s,
  24168. aimDuration: l
  24169. }, t.bind(this, a))
  24170. }
  24171. }
  24172. ),
  24173. moveInDirection: function(e, t) {
  24174. var i = e.direction;
  24175. return void 0 === m[i] ? (M.warn("Showcase -> moveInDirection: Cannot move in invalid direction."),
  24176. void (t && t({
  24177. success: !1,
  24178. error: "Invalid direction."
  24179. }))) : void this.player.flyLocalDirection(C[i].clone()).then(function(e) {
  24180. t(e ? {
  24181. success: !0,
  24182. message: "moved " + i
  24183. } : {
  24184. success: !1,
  24185. error: "Cannot move in direction: " + i
  24186. })
  24187. })
  24188. },
  24189. getPose: function(e, t) {
  24190. return this.player.camera.position,
  24191. (new h.Euler).setFromQuaternion(this.player.camera.quaternion, "YXZ"),
  24192. t({
  24193. success: !0,
  24194. message: L(this.player)
  24195. })
  24196. },
  24197. takeScreenShot: (z = new h.PerspectiveCamera,
  24198. G = new h.WebGLRenderTarget,
  24199. function(e, t) {
  24200. if (!e.resolution)
  24201. return t({
  24202. success: !1,
  24203. error: "An invalid resolution was specified"
  24204. });
  24205. if (-1 === e.resolution.width || -1 === e.resolution.height) {
  24206. var i = this.sceneRenderer.renderer.getSize();
  24207. e.resolution.width = i.width,
  24208. e.resolution.height = i.height
  24209. }
  24210. z.layers.set(T.DEFAULT),
  24211. e.visibleObjects && (e.visibleObjects.showtags && z.layers.enable(T.TAG),
  24212. e.visibleObjects.showPucks && z.layers.enable(T.PANOMARKERS),
  24213. e.visibleObjects.showReticule && z.layers.enable(T.RETICULE));
  24214. var n = e.resolution.width
  24215. , r = e.resolution.height
  24216. , o = n / r;
  24217. z.position.copy(this.sceneRenderer.camera.position),
  24218. z.quaternion.copy(this.sceneRenderer.camera.quaternion),
  24219. z.projectionMatrix.copy(this.player.camera.projectionMatrix),
  24220. z.projectionMatrix.elements[0] = this.player.camera.projectionMatrix.elements[5] / o,
  24221. G.setSize(n, r),
  24222. this.sceneRenderer.renderer.render(this.sceneRenderer.scene, z, G);
  24223. var a = new Uint8Array(n * r * 4);
  24224. this.sceneRenderer.renderer.readRenderTargetPixels(G, 0, 0, n, r, a);
  24225. var s = S.encode({
  24226. data: a,
  24227. width: n,
  24228. height: r,
  24229. heading: 180,
  24230. pitch: 0
  24231. }, {
  24232. quality: 75,
  24233. flipY: !0
  24234. });
  24235. t({
  24236. success: !0,
  24237. message: "data:image/jpg;base64," + d.uint8ToBase64(s.data)
  24238. })
  24239. }
  24240. ),
  24241. findRankedPano: (U = new h.Vector3,
  24242. H = new h.Vector3,
  24243. function(e, t) {
  24244. a(this.player, H),
  24245. r(t, H, U);
  24246. var i = this.player.rankedPanoInDirection(e, U);
  24247. if (i) {
  24248. var n = this.objectToHandle[i.id];
  24249. return n || (this.objectToHandle[i.id] = n = this.handleCount++,
  24250. this.handleToObject[n] = i),
  24251. n
  24252. }
  24253. return M.warn("Showcase -> findRankedPano: Unable to find nearby pano."),
  24254. -1
  24255. }
  24256. ),
  24257. findRankedtag: (V = new h.Vector3,
  24258. k = new h.Vector3,
  24259. function(e, t) {
  24260. a(this.player, k),
  24261. r(t, k, V);
  24262. var i = this.player.rankedtagInDirection(e, V);
  24263. if (i) {
  24264. var n = this.objectToHandle[i.sid];
  24265. return n || (this.objectToHandle[i.sid] = n = this.handleCount++,
  24266. this.handleToObject[n] = i),
  24267. n
  24268. }
  24269. return M.warn("Showcase -> findRankedtag: Unable to find nearby tag."),
  24270. -1
  24271. }
  24272. ),
  24273. clickNearesttag: function(e) {
  24274. this.clickRankedtag(0, e)
  24275. },
  24276. clickRankedtag: function(e, t) {
  24277. var i = function(e, t) {
  24278. var i = this.findRankedtag(e, t);
  24279. return 0 <= i ? this.handleToObject[i] : (M.warn("Showcase -> findRankedtagObject: Unable to find nearby tag."),
  24280. null)
  24281. }
  24282. .call(this, e, t);
  24283. i && P.call(this, i)
  24284. },
  24285. clickNearestPano: function(e, t) {
  24286. this.clickRankedPano(0, e, t)
  24287. },
  24288. clickRankedPano: function(e, t, i) {
  24289. var n = function(e, t) {
  24290. var i = this.findRankedPano(e, t);
  24291. return 0 <= i ? this.handleToObject[i] : (M.warn("Showcase -> findRankedPanoObject: Unable to find nearby pano."),
  24292. null)
  24293. }
  24294. .call(this, e, t);
  24295. n ? o.call(this, n, i) : i(null)
  24296. },
  24297. clickPano: function(e, t) {
  24298. var i = this.handleTable[e];
  24299. i ? o.call(this, i, t) : t(null)
  24300. },
  24301. rotateDirection: function(e, t) {
  24302. var i = e.direction
  24303. , n = e.angle;
  24304. if (!R.active) {
  24305. var r = 0
  24306. , o = 0
  24307. , a = 0
  24308. , s = 0;
  24309. if (!n || isNaN(n))
  24310. return M.warn("Showcase -> rotateDirection: Invalid rotation angle."),
  24311. void (t && t({
  24312. success: !1,
  24313. error: "Invalid rotation angle."
  24314. }));
  24315. if (this.player.mode === I.TRANSITIONING)
  24316. return M.warn("Automation -> rotateDirection: Cannot rotate while transitioning"),
  24317. void (t && t({
  24318. success: !1,
  24319. error: "Cannot rotate while transitioning"
  24320. }));
  24321. if (i === m.RIGHT || i === m.LEFT)
  24322. i === m.RIGHT && (n = -n),
  24323. r = 0 < n ? -1 : 1,
  24324. a = n;
  24325. else {
  24326. if (i !== m.UP && i !== m.DOWN)
  24327. return M.warn("Showcase -> rotateDirection: Invalid direction for rotation: " + i),
  24328. void (t && t({
  24329. success: !1,
  24330. error: "Invalid direction for rotation."
  24331. }));
  24332. if (this.player.mode === I.FLOORPLAN)
  24333. return M.warn("Showcase -> rotateDirection: Cannot rotate " + i + " in floorplan mode"),
  24334. void (t && t({
  24335. success: !1,
  24336. error: "Cannot rotate " + i + " in floorplan mode"
  24337. }));
  24338. if (i === m.DOWN && (n = -n),
  24339. 0 === (n = O.call(this, n)))
  24340. return M.warn("Showcase -> rotateDirection: Already at maximum rotation in direction: " + i),
  24341. void (t && t({
  24342. success: !1,
  24343. error: "Already at maximum rotation in direction: " + i
  24344. }));
  24345. o = 0 < n ? 1 : -1,
  24346. s = n
  24347. }
  24348. var l = n;
  24349. n = h.Math.degToRad(n),
  24350. a = h.Math.degToRad(a),
  24351. s = h.Math.degToRad(s);
  24352. var c = this.controls.activeControl;
  24353. c.startRotating(r, o),
  24354. R.start(a, s, this.player, function() {
  24355. c.stopRotating(!0),
  24356. t && t({
  24357. success: !0,
  24358. message: "Rotated " + l.toFixed(2) + "° in direction: " + e.direction
  24359. })
  24360. })
  24361. }
  24362. },
  24363. rotate: (F = new h.Vector3,
  24364. B = new h.Vector3,
  24365. function(e, t) {
  24366. var i = e.xAngle
  24367. , n = e.yAngle;
  24368. if (!R.active) {
  24369. if (i = i || 0,
  24370. n = n || 0,
  24371. isNaN(i) || isNaN(n))
  24372. return M.warn("Showcase -> rotate: Invalid rotation angle."),
  24373. void (t && t({
  24374. success: !1,
  24375. error: "Invalid rotation angle."
  24376. }));
  24377. if (this.player.mode === I.TRANSITIONING)
  24378. return M.warn("Automation -> rotate: Cannot rotate while transitioning"),
  24379. void (t && t({
  24380. success: !1,
  24381. error: "Cannot rotate while transitioning"
  24382. }));
  24383. Math.abs(i) < .01 && (i = 0),
  24384. Math.abs(n) < .01 && (n = 0);
  24385. var r = n;
  24386. n = O.call(this, n);
  24387. var o = 0 < r ? "UP" : "DOWN";
  24388. if (!(i = -i) && r && !n)
  24389. return M.warn("Showcase -> rotate: Already at maximum rotation in direction: " + o),
  24390. void (t && t({
  24391. success: !1,
  24392. error: "Already at maximum rotation in direction: " + o
  24393. }));
  24394. n < r && M.warn("Showcase -> rotate: Reached maximum rotation in direction: " + o);
  24395. var a = n;
  24396. n = h.Math.degToRad(n),
  24397. i = h.Math.degToRad(i),
  24398. F.copy(this.player.mode === I.FLOORPLAN ? C.UP : C.FORWARD),
  24399. this.player.getDirection(F),
  24400. B.copy(F).applyAxisAngle(C.UP, i),
  24401. B.applyAxisAngle(C.RIGHT, n);
  24402. var s = (F.angleTo(B),
  24403. 0 < i ? -1 : i < 0 ? 1 : 0)
  24404. , l = 0 < n ? 1 : n < 0 ? -1 : 0;
  24405. Math.abs(i) > Math.abs(n) ? l *= Math.abs(n / i) : Math.abs(n) > Math.abs(i) && (s *= Math.abs(i / n));
  24406. var c = this.controls.activeControl;
  24407. c.startRotating(s, l),
  24408. R.start(i, n, this.player, function() {
  24409. c.stopRotating(!0),
  24410. t && t({
  24411. success: !0,
  24412. message: "Rotated " + e.xAngle.toFixed(2) + "° horizontally, " + a.toFixed(2) + "° vertically"
  24413. })
  24414. })
  24415. }
  24416. }
  24417. ),
  24418. panCamera: function(e, i) {
  24419. function t(e) {
  24420. switch (r.removeAllListeners(w.AutoPanComplete),
  24421. r.removeAllListeners(w.AutoPanInterrupt),
  24422. r.removeAllListeners(w.AutoPanClamped),
  24423. e) {
  24424. case w.AutoPanInterrupt:
  24425. i({
  24426. success: !0,
  24427. message: "Camera panning interrupted."
  24428. });
  24429. break;
  24430. case w.AutoPanClamped:
  24431. if (r.autoPanPosition.x !== n.x || r.autoPanPosition.z !== n.z) {
  24432. if (Math.abs(this.player.position.x - r.autoPanPosition.x) < .01 && Math.abs(this.player.position.z - r.autoPanPosition.z) < .01)
  24433. return void i({
  24434. success: !1,
  24435. error: "Already at edge of current model bounds."
  24436. });
  24437. var t = "The view point is outside the bounds for the current model. ";
  24438. t += "The view point was clamped to " + o(r.target.x, r.target.z),
  24439. console.warn(t)
  24440. }
  24441. case w.AutoPanComplete:
  24442. i({
  24443. success: !0,
  24444. message: "Panned camera to position " + o(r.autoPanPosition.x, r.autoPanPosition.z)
  24445. })
  24446. }
  24447. }
  24448. if (this.player.mode !== I.DOLLHOUSE && this.player.mode !== I.FLOORPLAN)
  24449. return i({
  24450. success: !1,
  24451. error: "Camera panning is not available in the current mode: " + this.player.mode
  24452. });
  24453. var n = e.position
  24454. , r = this.player.control;
  24455. r.setAutoPanPosition(n.x, n.z),
  24456. r.autoPan = !0;
  24457. var o = function(e, t) {
  24458. return "(" + e.toFixed(2) + ", " + t.toFixed(2) + ")"
  24459. };
  24460. r.on(w.AutoPanComplete, t.bind(this, w.AutoPanComplete)),
  24461. r.on(w.AutoPanInterrupt, t.bind(this, w.AutoPanInterrupt)),
  24462. r.on(w.AutoPanClamped, t.bind(this, w.AutoPanClamped))
  24463. },
  24464. click: function(e, t) {
  24465. var i = e.x
  24466. , n = e.y;
  24467. !0 === e.percentage && (i = i / 100 * $("#player").width(),
  24468. n = n / 100 * $("#player").height()),
  24469. this.player.handleInputStart(i, n),
  24470. this.player.updateIntersect(),
  24471. this.player.handleInputEnd(i, n)
  24472. },
  24473. mouseOver: function(e, t) {
  24474. var i = e.x
  24475. , n = e.y;
  24476. !0 === e.percentage && (i = i / 100 * $("#player").width(),
  24477. n = n / 100 * $("#player").height()),
  24478. this.player.handleInputMove(i, n),
  24479. this.player.updateIntersect()
  24480. },
  24481. moveToMode: function(e, t) {
  24482. function i(e) {
  24483. t(e ? {
  24484. success: !1,
  24485. error: "Failed to load new mode: " + e
  24486. } : {
  24487. success: !0,
  24488. message: "Moved to new mode: " + n
  24489. })
  24490. }
  24491. var n = e.mode;
  24492. n === I.PANORAMA || n === I.DOLLHOUSE || n === I.FLOORPLAN ? this.director.changeMode(n).then(function() {
  24493. i()
  24494. }, function(e) {
  24495. i(e)
  24496. }) : t({
  24497. success: !1,
  24498. error: "Invalid mode selection"
  24499. })
  24500. }
  24501. }
  24502. }
  24503. ).call(this, "/js/sdk/automation.js")
  24504. }
  24505. , {
  24506. "../constants": 8,
  24507. "../enum/AlignmentType": 17,
  24508. "../enum/ControlEvents": 21,
  24509. "../enum/Direction": 22,
  24510. "../enum/GLCubeFaces": 25,
  24511. "../enum/Keys": 30,
  24512. "../enum/ModelManagerEvents": 33,
  24513. "../enum/PlayerEvents": 40,
  24514. "../enum/RenderLayers": 41,
  24515. "../enum/Vectors": 50,
  24516. "../enum/Viewmode": 51,
  24517. "../enum/WarpStyle": 52,
  24518. "../lib/jpeg_encoder": 94,
  24519. "../sdk/SdkEvents": 161,
  24520. "../settings": 166,
  24521. "../util/common": 185,
  24522. "../util/logger": 189,
  24523. "../util/math": 190,
  24524. "../util/panorama": 191,
  24525. "./ApiHost": 159,
  24526. "./PostMessageType": 160,
  24527. "./TransitionStyles": 162,
  24528. three: 217
  24529. }],
  24530. 165: [function(e, t, i) {
  24531. "use strict";
  24532. function n(e) {
  24533. this.sourceWindow = e,
  24534. this.targetWindow = null,
  24535. this.targetOrigin = null,
  24536. this.id = Math.floor(1e5 * Math.random()),
  24537. this.bindEvents()
  24538. }
  24539. var r = e("./PostMessageType")
  24540. , o = e("events").EventEmitter;
  24541. (n.prototype = Object.create(o.prototype)).bindEvents = function() {
  24542. this.sourceWindow.addEventListener("message", this.onPostmessageReceived.bind(this))
  24543. }
  24544. ,
  24545. n.prototype.setTarget = function(e, t) {
  24546. this.targetWindow = e,
  24547. this.targetOrigin = t
  24548. }
  24549. ,
  24550. n.prototype.onPostmessageReceived = function(e) {
  24551. var t = e.origin || e.originalEvent.origin
  24552. , i = e.source;
  24553. switch (e.data.type) {
  24554. case r.CONNECT:
  24555. break;
  24556. case r.RESPONSE:
  24557. if (this.id !== e.data.toId)
  24558. return;
  24559. default:
  24560. if (!this.validateMessageOrigin(t))
  24561. return
  24562. }
  24563. var n = e.data;
  24564. n.source = i,
  24565. n.origin = t,
  24566. n.timestamp = Date.now(),
  24567. this.emit(e.data.type, n)
  24568. }
  24569. ,
  24570. n.prototype.validateMessageOrigin = function(e) {
  24571. return "*" === this.targetOrigin || e === this.targetOrigin
  24572. }
  24573. ,
  24574. n.prototype.send = function(e) {
  24575. this.targetWindow && this.targetOrigin && (e.fromId = this.id,
  24576. this.targetWindow.postMessage(e, this.targetOrigin))
  24577. }
  24578. ,
  24579. t.exports = n
  24580. }
  24581. , {
  24582. "./PostMessageType": 160,
  24583. events: 202
  24584. }],
  24585. 166: [function(e, t, i) {
  24586. "use strict";
  24587. var n = e("three")
  24588. , r = e("./util/browser")
  24589. , o = e("./enum/Viewmode")
  24590. , a = e("./enum/VROption")
  24591. , s = e("./enum/Colors")
  24592. , l = e("./enum/WarpStyle")
  24593. , c = e("./util/easing")
  24594. , h = e("./util/common")
  24595. , u = e("./util/showcase")
  24596. , d = e("./constants")
  24597. , p = {
  24598. debug: !1,
  24599. version: "2.25.6-0-gd87e5b1",
  24600. languageTag: r.valueFromHash("lang", null),
  24601. pageTitle: "四维虚拟漫游",
  24602. authorizationHeader: u.getAuthorizationHeader(),
  24603. autoplay: r.valueFromHash("play", !1) || !r.inIframe(),
  24604. logLevel: r.valueFromHash("log", 2),
  24605. skyboxRadius: 2500,
  24606. modelBoundsPadding: 5,
  24607. showNeighbors: !1,
  24608. brand: r.valueFromHash("brand", !0),
  24609. showHighlights: r.valueFromHash("hhl", !0) && r.valueFromHash("hr", 1),
  24610. startHighlights: r.valueFromHash("hl", -1),
  24611. specialEdition: r.valueFromHash("bn", 0),
  24612. useWheel: r.valueFromHash("wh", !0),
  24613. crossOrigin: "anonymous",
  24614. fancierTransition: !1,
  24615. wireframe: !1,
  24616. skyboxWireframe: !1,
  24617. modelAlpha: 1,
  24618. highlightPanoSelection: !1,
  24619. showSweeps: !0,
  24620. showSkyboxes: !1,
  24621. showMesh: !0,
  24622. showFloors: !1,
  24623. showFloorDuration: 300,
  24624. showFloorDelay: 300,
  24625. hideFloorDuration: 300,
  24626. hideFloorDelay: 0,
  24627. reticuleOpacityTransitionTime: 250,
  24628. reticuleColor: window.DATA.mouseMarkerColor || s.newBlue,
  24629. markerOpacityTransitionTime: 500,
  24630. guiAnimationSpeed: 250,
  24631. highlightAnimationDuration: 500,
  24632. modelComponentLoadSpinnerDelay: 150,
  24633. captureErrors: !1,
  24634. maxMobileTextures: 6,
  24635. minimalMemoryMode: r.valueFromHash("m3", r.isMobile()),
  24636. startupFlyinDelay: 3e3,
  24637. dollhouseDefault: {
  24638. minDistance: 1,//15, //编辑页面给近一些
  24639. maxDistance: 50,
  24640. minPolarAngle: n.Math.degToRad(10),
  24641. maxPolarAngle: n.Math.degToRad(90)
  24642. },
  24643. hideReticuleTimeout: 1e3,
  24644. analytics: {
  24645. inactivityThreshold: 30,
  24646. sessionTrackingRate: .15,
  24647. maxTrackedErrors: 20,
  24648. sessionDurationPingFrequency: 10,
  24649. sessionDurationTimeout: 15
  24650. },
  24651. flydown: {
  24652. movementEasing: "easeInOutQuad",
  24653. movementDelay: .001,
  24654. rotationEasing: "easeInOutQuad",
  24655. rotationDelay: .5,
  24656. modelTextureDelay: .75,
  24657. skyboxDelay: .75
  24658. },
  24659. transition: {
  24660. flySpeed: .001,
  24661. flyTime: 750,
  24662. flytimeMaxDistanceThreshold: 5,
  24663. flytimeDistanceMultiplier: 150,
  24664. aimTime: 1500,
  24665. aimSlowFactor: 1.5,
  24666. blur: .8,
  24667. movementEasing: "easeInOutQuad",
  24668. blendEasing: "easeInOutQuad",
  24669. fastForwardFactor: 4
  24670. },
  24671. show360Views: {
  24672. enabled: !0,
  24673. transitionTime: 1e3
  24674. },
  24675. quickstart: {
  24676. enabled: 1 === r.valueFromHash("qust", 0) || 1 === r.valueFromHash("qs", 0),
  24677. animation: 1400,
  24678. showTextDelay: 500,
  24679. fadeOutDelay: 3e3,
  24680. fovChange: 10
  24681. },
  24682. appConfig: {
  24683. webvr_version: null,
  24684. segment_key: null,
  24685. embedly_key: null,
  24686. branch_key: null,
  24687. keen_write_key: null,
  24688. keen_project_id: null
  24689. },
  24690. vr: {
  24691. enabled: !0,
  24692. allowWebVR: !1,
  24693. option: r.valueFromHash("vr", a.CONTEXTUAL)
  24694. },
  24695. share: {
  24696. enabled: !r.valueFromHash("mls", 0) && r.valueFromHash("brand", !0)
  24697. },
  24698. input: {
  24699. longTapThreshold: 200,
  24700. moveToleranceNDC: 0.01,//.08,
  24701. touchMoveThreshold: 25
  24702. },
  24703. help: {
  24704. modalStayDuration: 600
  24705. },
  24706. immersive: {
  24707. timeToShowAgain: 1250,
  24708. uiStayDuration: 600
  24709. },
  24710. tourInteraction: {
  24711. disabled: "0" === r.valueFromHash("tourcta", null),
  24712. showPauseButton: 1e3,
  24713. showModal: 1500,
  24714. allowNextClick: 200,
  24715. largeModal: "1" === r.valueFromHash("tourcta", null),
  24716. smallModal: "2" === r.valueFromHash("tourcta", null)
  24717. },
  24718. labels: {
  24719. enabled: !1,
  24720. hideUntilStart: !0,
  24721. fadeInDuration: 250,
  24722. fadeInDelay: 250,
  24723. fadeOutDuration: 250,
  24724. fadeOutDelay: 0,
  24725. zoomHideThreshhold: {
  24726. mobile: r.isSmallScreen() ? .45 : .6,
  24727. desktop: 2
  24728. },
  24729. zoomTruncateThreshhold: {
  24730. mobile: r.isSmallScreen() ? .35 : .45,
  24731. desktop: .85
  24732. },
  24733. minLengthForTruncate: 16,
  24734. truncateLength: 12,
  24735. truncateSuffix: "..."
  24736. },
  24737. tags: {
  24738. enabled: r.valueFromHash("mt", 1),
  24739. startup: {
  24740. hideUntilStart: !0,
  24741. fadeInDuration: 500,
  24742. fadeInDelay: 100
  24743. },
  24744. visibility: {
  24745. anyDistance: !0,
  24746. visibleDistance: 8,
  24747. cameraClearance: .1,
  24748. alphaTestLevel: .05,
  24749. hideViaFloor: !0,
  24750. hideOffScreenDisc: !1,
  24751. hideOffScreenObject: !1
  24752. },
  24753. disc: {
  24754. opacity: 1,
  24755. disabledOpacity: .5,
  24756. scale: {
  24757. nearBound: 1.5,
  24758. farBound: 4.8,
  24759. linkFarBound: !1,
  24760. linkPercent: 40,
  24761. maxSize: 80,
  24762. minSize: 40,
  24763. baseViewportSize: 800,
  24764. responsiveness: 100
  24765. }
  24766. },
  24767. pole: {
  24768. enabled: !0,
  24769. height: .5,
  24770. width: 2,
  24771. opacity: .5,
  24772. color: "white"
  24773. },
  24774. navigate: {
  24775. nearestPano: !0,
  24776. lineOfSight: !0,
  24777. reactivate: !0,
  24778. aimAt: "disc",
  24779. tiltTolerance: 25,
  24780. rotateSpeedFactor: .6
  24781. }
  24782. },
  24783. path: {
  24784. color: window.DATA.floorMarkerColor || s.newBlue,
  24785. colorUp: s._desat(s.newBlue, .5),
  24786. colorDown: s._darken(s.newBlue, .35),
  24787. opacity: .5,
  24788. style: "ribbon",
  24789. height: .025,
  24790. ribbonWidth: .24,
  24791. outsideHeight: .5,
  24792. waypointRadius: .5,
  24793. waypointIndoorRadius: .24,
  24794. waypointPulse: 1e3,
  24795. typ: l.BLACK,
  24796. meshFree: r.valueFromHash("mf", 1),
  24797. mapGuides: r.valueFromHash("guides", !0),
  24798. fadeInTime: 400,
  24799. fadeOutTime: 300
  24800. },
  24801. warp: {
  24802. nearPanoDist: .1,
  24803. matchCam: !1,
  24804. blur: .33,
  24805. fastTime: 1500,
  24806. teleportTime: 1500,//瞬间过渡的时间
  24807. flytimeDistanceMultiplier:150,//add
  24808. flyTime:750,//add
  24809. outsideTime: 2e3,
  24810. lookAheadMax: .3,
  24811. lookAheadDist: 2.5,
  24812. softPushDist: .37,
  24813. softPushEnd: .3,
  24814. softBendAngle: 8,
  24815. softBendTilt: 4,
  24816. softBendEnd: .3,
  24817. doBurns: !0,
  24818. burnsAngle: 8,
  24819. minBurnsAngle: 35,
  24820. minDownAngle: -35,
  24821. maxTurnPerSec: 280,
  24822. maxAimPerSec: 35,
  24823. minRotation: 12,
  24824. maxAimRotation: 33.2,
  24825. turnFriction: .2,
  24826. flySpeed: .01,
  24827. minWarpTime: 1200,
  24828. warpInterruptionRedirectTime: 500,
  24829. tourStepDelay: r.valueFromHash("st", 0),
  24830. walkDelay: 0,
  24831. walkMaxDist: 50,
  24832. walkMinDist: .8,
  24833. walkSlideShowThreshhold: 3e3,
  24834. walkExtraPanosDistance: .4,
  24835. timePerMeter: 1200,
  24836. motionLeadTime: 5e3,
  24837. movementEasing: "easeInOutQuad",
  24838. blendEasing: "easeInOutQuad",
  24839. showBunny: !1,
  24840. loop: r.valueFromHash("lp", !1),
  24841. auto: r.valueFromHash("ts", -1),
  24842. eOrder: "YXZ",
  24843. stepFactor: .25,
  24844. brakeStrength: 2,
  24845. minBrakeAngle: .1,
  24846. maxBrakeAngle: 1.8,
  24847. climbEffort: 4
  24848. },
  24849. rotationFriction: .05,
  24850. rotationAccelerationInside: 4.5,
  24851. rotationAccelerationOutside: .15,
  24852. rotationAfterMoveMultiplier: 40,
  24853. rotationAfterMoveHistoryCount: 5,
  24854. panFriction: .09,
  24855. panAccelerationOutside: 60,
  24856. onload: r.valueFromHash("onload", o.PANORAMA),
  24857. zoomNearLimit: .1,
  24858. zoomFarLimit: 50,
  24859. navigation: {
  24860. panoScores: !1,
  24861. mouseDirection: !0,
  24862. filterStrictness: .75,
  24863. angleFactor: -30,
  24864. directionFactor: 10,
  24865. distanceFactor: -1,
  24866. optionalityFactor: 3
  24867. },
  24868. sdkInit: !1,
  24869. secretPanelWord: [38, 38, 40, 40, 37, 39, 37, 39, 66, 65],
  24870. console: r.valueFromHash("console", !1),
  24871. noMeshFloorPositionOffset: new n.Vector3(0,-1.2,0),
  24872. panoramaNeighbourMaxDistance: 5,
  24873. panoFloorClickRadius: .35,
  24874. showScreenshotLocations: !1,
  24875. showAxis: !1,
  24876. showNeighbourRaycasts: !1,
  24877. colorMarkerOnLoad: !1,
  24878. colorMarkerByFloor: !1,
  24879. tiling: {
  24880. panoPreRenderRepeatDelay: 2500,
  24881. panoPreRenderDelay: 500,
  24882. preRenderTourPanos: r.valueFromHash("tileprerender", 0),
  24883. tilingFlagNames: ["usetiles", "tiles"],
  24884. maxNavPanoQuality: r.valueFromHash("maxtileq", null),
  24885. maxZoomPanoQuality: r.valueFromHash("maxztileq", null),
  24886. overlayStyle: r.valueFromHash("tileoverlay", 0),
  24887. uploadIntervalDelay: r.valueFromHash("tileupdelay", 10),
  24888. initialIntervalDelay: r.valueFromHash("itiledelay", 0),
  24889. maxNonBaseUploadsPerFrame: r.valueFromHash("maxnbtpf", 2),
  24890. maxBaseUploadsPerFrame: r.valueFromHash("maxbtpf", 6),
  24891. customCompression: r.valueFromHash("tilecustcomp", 0),
  24892. mobileHighQualityOverride: 1,
  24893. allowUltraHighResolution: !0
  24894. },
  24895. zoom: {
  24896. enabled: !0,
  24897. forceOff: r.valueFromHash("nozoom", 0),
  24898. overridemax: r.valueFromHash("maxzoom", null),
  24899. overridemin: r.valueFromHash("minzoom", null),
  24900. max: d.highQualityMaxZoom,
  24901. min: 1,
  24902. transitionStyle: r.valueFromHash("zoomtrans", 1),
  24903. activationThreshold: 1.1,
  24904. restoreTime: 500
  24905. },
  24906. profiling: {
  24907. enabled: r.valueFromHash("mem", !1)
  24908. }
  24909. };
  24910. (p = h.deepExtend(p, d, {
  24911. insideFOV: r.valueFromHash("fov", d.insideFOV),
  24912. insideFOVMax: r.valueFromHash("fovmax", d.insideFOVMax),
  24913. panorama: {
  24914. transitionTime: 1e3,
  24915. modelAlpha: 0,
  24916. modelAlphaDelay: p.flydown.modelTextureDelay,
  24917. modelAlphaLength: 1,
  24918. skyboxOpacity: 1,
  24919. skyboxOpacityDelay: p.flydown.skyboxDelay,
  24920. skyboxOpacityLength: .9,
  24921. fovLength: 1,
  24922. fovDelay: 0,
  24923. cameraMatrixDuration: .8,
  24924. cameraMatrixDelay: 0,
  24925. cameraMatrixEase: c.easeInCubic,
  24926. reticuleOpacity: 1,
  24927. markerOpacity: .3,
  24928. markerOpacityOnHover: 1
  24929. },
  24930. dollhouse: {
  24931. transitionTime: 1e3,
  24932. modelAlpha: 1,
  24933. modelAlphaDelay: 0,
  24934. modelAlphaLength: 1 - p.flydown.modelTextureDelay,
  24935. skyboxOpacity: 0,
  24936. skyboxOpacityDelay: 0,
  24937. skyboxOpacityLength: 1 - p.flydown.skyboxDelay,
  24938. fovLength: 1,
  24939. fovDelay: 0,
  24940. cameraMatrixDuration: .8,
  24941. cameraMatrixDelay: .3,
  24942. cameraMatrixEase: c.easeInCubic,
  24943. reticuleOpacity: 1,
  24944. markerOpacity: 0,
  24945. markerOpacityOnHover: 0
  24946. },
  24947. floorplan: {
  24948. transitionTime: 1e3,
  24949. modelAlpha: 1,
  24950. modelAlphaDelay: 0,
  24951. modelAlphaLength: 1 - p.flydown.modelTextureDelay,
  24952. skyboxOpacity: 0,
  24953. skyboxOpacityDelay: 0,
  24954. skyboxOpacityLength: 1 - p.flydown.skyboxDelay,
  24955. fovLength: 1,
  24956. fovDelay: 0,
  24957. cameraMatrixDuration: .5,
  24958. cameraMatrixDelay: 0,
  24959. cameraMatrixEase: c.easeOutCubic,
  24960. reticuleOpacity: 1,
  24961. markerOpacity: 0,
  24962. markerOpacityOnHover: 0,
  24963. cameraHeight: 50
  24964. },
  24965. transitioning: {
  24966. reticuleOpacity: 0,
  24967. markerOpacity: .3,
  24968. markerOpacityOnHover: 1
  24969. },
  24970. "floorplan-dollhouse": {
  24971. rotationDelay: 0,
  24972. rotationDuration: 1
  24973. },
  24974. "floorplan-panorama": {
  24975. rotationDelay: .5,
  24976. rotationDuration: 1
  24977. },
  24978. "dollhouse-panorama": {
  24979. rotationDelay: .5,
  24980. rotationDuration: 1
  24981. },
  24982. "dollhouse-floorplan": {
  24983. rotationDelay: 0,
  24984. rotationDuration: 1,
  24985. cameraMatrixDuration: 1.05,
  24986. cameraMatrixDelay: .5
  24987. },
  24988. "panorama-dollhouse": {
  24989. rotationDelay: 0,
  24990. rotationDuration: .5
  24991. },
  24992. "panorama-floorplan": {
  24993. transitionTime: 1500,
  24994. rotationDelay: 0,
  24995. rotationDuration: .5
  24996. }
  24997. })).path.meshFree && (p.path.typ = l.WALK),
  24998. p.zoom.max = p.zoom.overridemax || p.zoom.max,
  24999. p.zoom.min = p.zoom.overridemin || p.zoom.min,
  25000. window._settings = t.exports = p
  25001. }
  25002. , {
  25003. "./constants": 8,
  25004. "./enum/Colors": 19,
  25005. "./enum/VROption": 47,
  25006. "./enum/Viewmode": 51,
  25007. "./enum/WarpStyle": 52,
  25008. "./util/browser": 182,
  25009. "./util/common": 185,
  25010. "./util/easing": 186,
  25011. "./util/showcase": 193,
  25012. three: 217
  25013. }],
  25014. 167: [function(e, t, i) {
  25015. "use strict";
  25016. var n = e("three")
  25017. , r = e("./settings")
  25018. , 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"
  25019. , a = "precision highp float;\nprecision highp int;\n\nuniform mat4 viewMatrix;\nuniform vec3 cameraPosition;\n";
  25020. t.exports = {
  25021. basicTextured: {
  25022. uniforms: {
  25023. tDiffuse: {
  25024. type: "t",
  25025. value: null
  25026. },
  25027. alpha: {
  25028. type: "f",
  25029. value: 1
  25030. }
  25031. },
  25032. vertexShader: "varying vec2 vUv;\nvoid main() {\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n}",
  25033. 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}"
  25034. },
  25035. copyCubeMap: {
  25036. uniforms: {
  25037. tDiffuse: {
  25038. type: "t",
  25039. value: null
  25040. },
  25041. alpha: {
  25042. type: "f",
  25043. value: 1
  25044. }
  25045. },
  25046. 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}",
  25047. 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}"
  25048. },
  25049. cube: {
  25050. uniforms: {
  25051. map: {
  25052. type: "t",
  25053. value: null
  25054. },
  25055. opacity: {
  25056. type: "f",
  25057. value: 1
  25058. }
  25059. },
  25060. vertexShader: o + "varying vec3 vWorldPosition;\n\nvoid main() {\n vWorldPosition = position;\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}\n",
  25061. 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"
  25062. },
  25063. model: {
  25064. uniforms: {
  25065. map: {
  25066. type: "t",
  25067. value: null
  25068. },
  25069. modelAlpha: {
  25070. type: "f",
  25071. value: r.modelAlpha
  25072. },
  25073. opacity: {
  25074. type: "f",
  25075. value: 1
  25076. },
  25077. progress: {
  25078. type: "f",
  25079. value: 0
  25080. },
  25081. blackout: {
  25082. type: "i",
  25083. value: 0
  25084. },
  25085. pano0Map: {
  25086. type: "t",
  25087. value: null
  25088. },
  25089. pano0Position: {
  25090. type: "v3",
  25091. value: new n.Vector3
  25092. },
  25093. pano0Matrix: {
  25094. type: "m4",
  25095. value: new n.Matrix4
  25096. },
  25097. pano1Map: {
  25098. type: "t",
  25099. value: null
  25100. },
  25101. pano1Position: {
  25102. type: "v3",
  25103. value: new n.Vector3
  25104. },
  25105. pano1Matrix: {
  25106. type: "m4",
  25107. value: new n.Matrix4
  25108. }
  25109. },
  25110. /* 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",
  25111. 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"
  25112. */
  25113. vertexShader: o + `uniform vec3 pano0Position;
  25114. uniform mat4 pano0Matrix;\n\nuniform vec3 pano1Position;\n
  25115. uniform mat4 pano1Matrix;\n\nvarying vec2 vUv;\n
  25116. varying vec3 vWorldPosition0;
  25117. varying vec3 vWorldPosition1;
  25118. uniform int blackout;
  25119. void main() {
  25120. vUv = uv;
  25121. vec4 worldPosition = modelMatrix * vec4(position, 1.0);
  25122. vec3 positionLocalToPanoCenter0 = worldPosition.xyz - pano0Position;
  25123. vWorldPosition0 = (vec4(positionLocalToPanoCenter0, 1.0) * pano0Matrix).xyz;
  25124. vWorldPosition0.x *= -1.0;
  25125. vec3 positionLocalToPanoCenter1 = worldPosition.xyz - pano1Position;
  25126. vWorldPosition1 = (vec4(positionLocalToPanoCenter1, 1.0) * pano1Matrix).xyz;
  25127. vWorldPosition1.x *= -1.0;
  25128. gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );
  25129. }`,
  25130. fragmentShader: a + `uniform sampler2D map;\nuniform float modelAlpha;\nuniform float opacity;\n
  25131. uniform float progress;\nuniform int blackout;\n\nuniform vec3 pano0Position;\nuniform samplerCube pano0Map;\n\nuniform vec3 pano1Position;\nuniform samplerCube pano1Map;\n\nvarying vec2 vUv;\nvarying vec3 vWorldPosition0;\nvarying vec3 vWorldPosition1;\n\n
  25132. void main() {
  25133. const vec4 BLACK = vec4(0.0, 0.0, 0.0, 1.0);
  25134. const vec4 GREY = vec4(0.5, 0.5, 0.5, 1.0);
  25135. vec4 colorFromPanos;
  25136. if (blackout == 5){//add for TransitionPass
  25137. colorFromPanos = textureCube( pano1Map, vWorldPosition1.xyz) ;
  25138. }else{
  25139. vec4 colorFromPano0 = textureCube( pano0Map, vWorldPosition0.xyz);
  25140. vec4 colorFromPano1 = textureCube( pano1Map, vWorldPosition1.xyz);
  25141. if (blackout == 0) {colorFromPanos = mix(colorFromPano0, colorFromPano1, progress);}
  25142. else if (blackout == 1) {
  25143. colorFromPanos = mix(colorFromPano0, BLACK, min(1.0, progress*2.0));
  25144. colorFromPanos = mix(colorFromPanos, colorFromPano1, max(0.0, progress * 2.0 - 1.0));
  25145. }
  25146. else if (blackout == 2) {colorFromPanos = mix(colorFromPano0, BLACK, progress);}
  25147. else if (blackout == 3) {colorFromPanos = mix(BLACK, colorFromPano1, max(0.0, progress * 2.0 - 1.0));}
  25148. }
  25149. vec4 colorFromTexture = texture2D( map, vUv );
  25150. colorFromPanos = mix(colorFromPanos, colorFromTexture, modelAlpha);
  25151. float whiteness = 1.0 - smoothstep(0.1, 0.2, opacity);
  25152. colorFromPanos = mix(colorFromPanos, GREY, whiteness);
  25153. gl_FragColor = vec4(colorFromPanos.rgb, opacity);
  25154. }`
  25155. },
  25156. hot: {
  25157. uniforms: {
  25158. color: {
  25159. type: "c",
  25160. value: new n.Color(16720384)
  25161. },
  25162. opac: {
  25163. type: "f",
  25164. value: 0
  25165. },
  25166. texture1: {
  25167. type: "t",
  25168. value: null
  25169. },
  25170. texture2: {
  25171. type: "t",
  25172. value: null
  25173. }
  25174. },
  25175. vertexShader: "varying vec2 vUv;\n\nvoid main() {\n\n vUv = uv ;\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\n}\n",
  25176. 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"
  25177. },
  25178. modelOutside: {
  25179. uniforms: {
  25180. map: {
  25181. type: "t",
  25182. value: null
  25183. },
  25184. opacity: {
  25185. type: "f",
  25186. value: 1
  25187. }
  25188. },
  25189. vertexShader: o + "varying vec2 vUv;\n\nvoid main() {\n\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\n}\n",
  25190. 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"
  25191. },
  25192. ribbon: {
  25193. uniforms: {
  25194. map: {
  25195. type: "t",
  25196. value: null
  25197. },
  25198. opacity: {
  25199. type: "f",
  25200. value: 1
  25201. },
  25202. color: {
  25203. type: "c",
  25204. value: new n.Color(r.path.color)
  25205. }
  25206. },
  25207. 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",
  25208. 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"
  25209. },
  25210. waypoint: {
  25211. uniforms: {
  25212. map: {
  25213. type: "t",
  25214. value: null
  25215. },
  25216. opacity: {
  25217. type: "f",
  25218. value: 1
  25219. },
  25220. pulse: {
  25221. type: "f",
  25222. value: 1
  25223. },
  25224. nearFade: {
  25225. type: "v2",
  25226. value: new n.Vector2(2 * r.insideNear,2 * r.path.waypointIndoorRadius)
  25227. },
  25228. color: {
  25229. type: "c",
  25230. value: new n.Color(r.reticuleColor)
  25231. }
  25232. },
  25233. 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",
  25234. 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"
  25235. },
  25236. modelDebug: {
  25237. uniforms: {
  25238. map: {
  25239. type: "t",
  25240. value: null
  25241. },
  25242. modelAlpha: {
  25243. type: "f",
  25244. value: r.modelAlpha
  25245. },
  25246. depthmapRatio: {
  25247. type: "f",
  25248. value: 0
  25249. },
  25250. opacity: {
  25251. type: "f",
  25252. value: 1
  25253. },
  25254. progress: {
  25255. type: "f",
  25256. value: 0
  25257. },
  25258. considerOcclusion: {
  25259. type: "i",
  25260. value: r.fancierTransition
  25261. },
  25262. highlightPanoSelection: {
  25263. type: "i",
  25264. value: 0
  25265. },
  25266. useThirdPano: {
  25267. type: "i",
  25268. value: r.useThirdPano
  25269. },
  25270. pano0Map: {
  25271. type: "t",
  25272. value: null
  25273. },
  25274. pano0Depth: {
  25275. type: "t",
  25276. value: null
  25277. },
  25278. pano0Position: {
  25279. type: "v3",
  25280. value: new n.Vector3
  25281. },
  25282. pano0Matrix: {
  25283. type: "m4",
  25284. value: new n.Matrix4
  25285. },
  25286. pano0Weight: {
  25287. type: "f",
  25288. value: r.transition.pano0Weight
  25289. },
  25290. pano1Map: {
  25291. type: "t",
  25292. value: null
  25293. },
  25294. pano1Depth: {
  25295. type: "t",
  25296. value: null
  25297. },
  25298. pano1Position: {
  25299. type: "v3",
  25300. value: new n.Vector3
  25301. },
  25302. pano1Matrix: {
  25303. type: "m4",
  25304. value: new n.Matrix4
  25305. },
  25306. pano1Weight: {
  25307. type: "f",
  25308. value: r.transition.pano1Weight
  25309. },
  25310. pano2Map: {
  25311. type: "t",
  25312. value: null
  25313. },
  25314. pano2Depth: {
  25315. type: "t",
  25316. value: null
  25317. },
  25318. pano2Position: {
  25319. type: "v3",
  25320. value: new n.Vector3
  25321. },
  25322. pano2Matrix: {
  25323. type: "m4",
  25324. value: new n.Matrix4
  25325. },
  25326. pano2Weight: {
  25327. type: "f",
  25328. value: r.transition.pano2Weight
  25329. }
  25330. },
  25331. 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",
  25332. 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"
  25333. },
  25334. customDepth: {
  25335. uniforms: {
  25336. panoPosition: {
  25337. type: "v3",
  25338. value: new n.Vector3
  25339. }
  25340. },
  25341. 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",
  25342. 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"
  25343. },
  25344. skysphere: {
  25345. uniforms: {
  25346. radius: {
  25347. type: "f",
  25348. value: 0
  25349. }
  25350. },
  25351. 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",
  25352. 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"
  25353. },
  25354. tagDisc: {
  25355. uniforms: {
  25356. opacity: {
  25357. type: "f",
  25358. value: 0
  25359. },
  25360. color: {
  25361. type: "c",
  25362. value: new n.Color
  25363. },
  25364. bg: {
  25365. type: "t",
  25366. value: null
  25367. },
  25368. mask: {
  25369. type: "t",
  25370. value: null
  25371. }
  25372. },
  25373. vertexShader: o + "varying vec2 vUv;\nvoid main() {\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n}",
  25374. 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"
  25375. }
  25376. }
  25377. window.shaders = t.exports;
  25378. }
  25379. , {
  25380. "./settings": 166,
  25381. three: 217
  25382. }],
  25383. 168: [function(E, _, e) {
  25384. (function(e) {
  25385. "use strict";
  25386. var t = E("three")
  25387. , i = (E("url"),
  25388. E("./util/ajax"))
  25389. , n = E("./settings")
  25390. , r = E("./util/logger")
  25391. , o = E("./util/math")
  25392. , a = E("./util/showcase")
  25393. , s = E("./objects/Panorama")
  25394. , l = new r(e)
  25395. , c = E("./model/Model")
  25396. , h = E("./shaders")
  25397. , u = E("./util/transitions")
  25398. , d = E("./objects/Chunk")
  25399. , p = E("./objects/Reticule")
  25400. , f = E("./objects/Skybox")
  25401. , g = E("./objects/Floor")
  25402. , m = E("./cameras/DollhouseCamera")
  25403. , v = E("./cameras/FloorplanCamera")
  25404. , y = E("./cameras/PanoramaCamera")
  25405. , A = E("./controls/DollhouseControls")
  25406. , C = E("./controls/FloorplanControls")
  25407. , I = E("./controls/PanoramaControls");
  25408. t.ImageUtils.crossOrigin = n.crossOrigin,
  25409. _.exports = {
  25410. shaders: h,
  25411. transitions: u,
  25412. Model: c,
  25413. Chunk: d,
  25414. Floor: g,
  25415. Skybox: f,
  25416. Reticule: p,
  25417. Panorama: s,
  25418. DollhouseCamera: m,
  25419. FloorplanCamera: v,
  25420. PanoramaCamera: y,
  25421. DollhouseControls: A,
  25422. FloorplanControls: C,
  25423. PanoramaControls: I,
  25424. getModel: function(e) {
  25425. if (!e.url)
  25426. throw 'getModel(): missing parameter "url"';
  25427. e.autoload = void 0 === e.autoload || e.autoload;
  25428. var t = a.parseSidUrl(e.url);
  25429. e.urlBase = t.urlBase,
  25430. e.urlModel = /* 'data/1081/', */ t.urlModel,
  25431. e.urlFiles = t.urlFiles;
  25432. var i = this._getPlatformError();
  25433. return i ? $.Deferred().reject(i).promise() : (this.options = e,
  25434. this._loadModel().then(this._buildModel.bind(this)))
  25435. },
  25436. _getPlatformError: function() {
  25437. 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"
  25438. },
  25439. _loadModel: function() {
  25440. return i.get(this.options.urlModel, {
  25441. responseType: "json",
  25442. prefetchFrom: "model",
  25443. auth: a.getAuthorizationHeader()
  25444. }).then(null, function() {
  25445. return l.warn("Model loading failed at initial metadata load"),
  25446. "loading-failed"
  25447. })
  25448. },
  25449. _buildModel: function(e) {
  25450. e = a.normalizeModeldata(e, o);
  25451. var t = new c(this.options,e);
  25452. return this.options.autoload ? t.load(!0) : $.when(t)
  25453. }
  25454. }
  25455. }
  25456. ).call(this, "/js/showcase.js")
  25457. }
  25458. , {
  25459. "./cameras/DollhouseCamera": 5,
  25460. "./cameras/FloorplanCamera": 6,
  25461. "./cameras/PanoramaCamera": 7,
  25462. "./controls/DollhouseControls": 10,
  25463. "./controls/FloorplanControls": 11,
  25464. "./controls/PanoramaControls": 13,
  25465. "./model/Model": 139,
  25466. "./objects/Chunk": 144,
  25467. "./objects/Floor": 146,
  25468. "./objects/Panorama": 148,
  25469. "./objects/Reticule": 149,
  25470. "./objects/Skybox": 152,
  25471. "./settings": 166,
  25472. "./shaders": 167,
  25473. "./util/ajax": 181,
  25474. "./util/logger": 189,
  25475. "./util/math": 190,
  25476. "./util/showcase": 193,
  25477. "./util/transitions": 195,
  25478. three: 217,
  25479. url: 208
  25480. }],
  25481. 169: [function(e, t, i) {
  25482. "use strict";
  25483. function l(e) {
  25484. var t = {
  25485. renderTarget: null,
  25486. inUse: !1,
  25487. size: -1,
  25488. pano: null
  25489. };
  25490. return t.inUse = !0,
  25491. t.size = e,
  25492. function(e) {
  25493. O.push(e)
  25494. }(t),
  25495. t
  25496. }
  25497. function c(e) {
  25498. for (var t = 0; t < O.length; t++) {
  25499. var i = O[t];
  25500. if (i.renderTarget === e)
  25501. return !(i.inUse = !1)
  25502. }
  25503. return !1
  25504. }
  25505. function n() {
  25506. this.tileDirectory = {},
  25507. this.activeRenderTargetDescriptors = {},
  25508. this.activePanos = [],
  25509. this.panoLODDescriptors = {},
  25510. this.panoDescriptors = {},
  25511. this.tileTrees = {},
  25512. this.sceneRenderer = null,
  25513. this.tileDownloader = null,
  25514. this.forceQueue = [],
  25515. this.uploadQueues = {},
  25516. this.uploadInterval = null,
  25517. this.uploadIntervalCancelled = !1,
  25518. this.usingTileOverlay = !1,
  25519. this.overlayTilesLoaded = !1,
  25520. this.overlayTileBase = null,
  25521. this.overlayTilesBasic = {},
  25522. this.overlayTilesEnhanced = {},
  25523. this.zoomRenderTarget = null,
  25524. this.zoomPano = null,
  25525. this.zoomingActive = !1,
  25526. this.zoomPanoId = null,
  25527. this.zoomPanoRenderingDisabled = !1,
  25528. this.direction = new _.Vector3,
  25529. this.initTime = -1,
  25530. this.maxBaseUploadsPerFrame = R,
  25531. this.maxNonBaseUploadsPerFrame = M
  25532. }
  25533. 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"),
  25534. e("../enum/PanoRendererEvents")), f = e("../enum/SceneRendererEvents"), g = e("../enum/TileDownloaderEvents"), m = e("../enum/Vectors"), v = (e("../enum/GLCubeFaces"),
  25535. e("../objects/Panorama"),
  25536. e("./TileTree")), y = (e("./TileDownloader"),
  25537. e("./TilePrioritizer")), A = e("./TileUtils"), C = (p = e("../enum/PanoSizeClass"),
  25538. e("../util/browser"),
  25539. 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 = {
  25540. Base: 0,
  25541. Remaining: 1
  25542. }, O = [];
  25543. function L(e) {
  25544. var t = e.shift();
  25545. return t.uploadQueued = !1,
  25546. t
  25547. }
  25548. (n.prototype = Object.create(w.prototype)).init = function(e, t, i) {
  25549. this.sceneRenderer = e,
  25550. this.tileDownloader = t,
  25551. this.qualityManager = i,
  25552. this.bindEvents(),
  25553. this.sceneRenderer.on(f.ContextCreated, this.loadOverlayTiles.bind(this)),
  25554. this.initTime = performance.now()
  25555. }
  25556. ,
  25557. n.prototype.getActivePanoTextures = function(e) {
  25558. e = e || [];
  25559. for (var t = 0; t < O.length; t++) {
  25560. var i = O[t];
  25561. i.renderTarget && i.renderTarget.texture && e.push(i.renderTarget.texture)
  25562. }
  25563. }
  25564. ,
  25565. n.prototype.hasQueuedTiles = function() {
  25566. var e = this.peekNextFromUploadQueue();
  25567. return null != e
  25568. }
  25569. ,
  25570. n.prototype.getActiveRenderTargetDescriptor = function(e) {
  25571. return this.activeRenderTargetDescriptors[e]
  25572. }
  25573. ,
  25574. n.prototype.setActiveRenderTargetDescriptor = function(e, t) {
  25575. this.activeRenderTargetDescriptors[e] = t
  25576. }
  25577. ,
  25578. n.prototype.loadOverlayTiles = function() {
  25579. if (0 !== d.tiling.overlayStyle) {
  25580. var n = 0
  25581. , e = function(e, t, i) {
  25582. e = t ? e[t] = this.sceneRenderer.initSizedTexture2D(A.TILE_SIZE, _.ClampToEdgeWrapping) : this.overlayTileBase = this.sceneRenderer.initSizedTexture2D(A.TILE_SIZE, _.ClampToEdgeWrapping),
  25583. this.sceneRenderer.uploadTexture2D(i, e, 0, 0, A.TILE_SIZE, A.TILE_SIZE),
  25584. ++n === r.length && (this.overlayTilesLoaded = !0)
  25585. }
  25586. .bind(this)
  25587. , 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)]];
  25588. r.forEach(function(e) {
  25589. this.tileDownloader.loadImage(e[0], 0, e[1])
  25590. }
  25591. .bind(this)),
  25592. this.usingTileOverlay = !0
  25593. } else
  25594. this.usingTileOverlay = !1
  25595. }
  25596. ,
  25597. n.prototype.bindEvents = function() {
  25598. this.tileDownloader.on(g.TileDownloadSuccess, this.onTileDownloaded.bind(this))
  25599. }
  25600. ,
  25601. n.prototype.setupZoomRenderTarget = function() {
  25602. if (this.qualityManager.getMaxZoomPanoSize() >= this.qualityManager.getMaxNavPanoSize()) {
  25603. if (this.zoomRenderTarget && this.zoomRenderTarget.width === this.qualityManager.getMaxZoomPanoSize())
  25604. return;
  25605. var e = this.zoomRenderTarget;
  25606. if (this.zoomRenderTarget = this.initTiledPano(this.qualityManager.getMaxZoomPanoSize(), !1),
  25607. e) {
  25608. var t = e.width
  25609. , i = this.zoomRenderTarget.width;
  25610. this.sceneRenderer.copyCubeMap(e.texture, this.zoomRenderTarget, t, t, i, i),
  25611. e.texture.dispose(),
  25612. e.texture.loaded = !1,
  25613. e.texture.version = 0,
  25614. this.sceneRenderer.deallocateCubeTexture(e.texture),
  25615. e.texture = null
  25616. }
  25617. this.zoomPanoRenderingDisabled = !1
  25618. } else
  25619. this.zoomPanoRenderingDisabled = !0
  25620. }
  25621. ,
  25622. n.prototype.enableUltraHighQualityMode = function(t) {
  25623. if (!this.qualityManager.ultraHighQualityModeEnabled()) {
  25624. var e = this.qualityManager.getPanoSize(p.ULTRAHIGH);
  25625. this.tileDownloader.testDownload(e, A.TILE_SIZE, function(e) {
  25626. e && (this.qualityManager.enableUltraHighQualityMode(),
  25627. this.setupZoomRenderTarget(),
  25628. t())
  25629. }
  25630. .bind(this))
  25631. }
  25632. }
  25633. ,
  25634. n.prototype.activateTiledPano = function(e, t, i) {
  25635. i && this.clearAllQueuedUploads();
  25636. for (var n = 0; n < A.FACES_PER_PANO; n++)
  25637. this.initTileTree(e.id, n, this.qualityManager.getMaxPossiblePanoSize());
  25638. this.linkAllTilesAndNodes(e);
  25639. var r = this.getActiveRenderTargetDescriptor(e.id)
  25640. , o = t;
  25641. if (o > this.qualityManager.getMaxNavPanoSize() && (o = this.qualityManager.getMaxNavPanoSize()),
  25642. !r || o !== r.size) {
  25643. if (r && c(r.renderTarget),
  25644. !(r = function(e) {
  25645. for (var t = 0; t < O.length; t++) {
  25646. var i = O[t];
  25647. if (!i.inUse && i.size === e)
  25648. return i.inUse = !0,
  25649. i
  25650. }
  25651. return null
  25652. }(o))) {
  25653. var a = this.initTiledPano(o, !1);
  25654. (r = l(a.width)).renderTarget = a
  25655. }
  25656. r.pano = e,
  25657. this.resetPanoDescriptor(e.id),
  25658. this.resetPanoLODDescriptors(e.id),
  25659. this.resetRenderStatus(e.id, !0, !0)
  25660. }
  25661. this.setActiveRenderTargetDescriptor(e.id, r);
  25662. var s = i ? 0 : 1;
  25663. return this.updateActivePanos(e, s),
  25664. r.renderTarget
  25665. }
  25666. ,
  25667. n.prototype.deactivateTiledPano = function(e) {
  25668. var t = this.getActiveRenderTargetDescriptor(e.id);
  25669. this.isRenderTargetDescriptorValid(t) && c(t.renderTarget),
  25670. this.setActiveRenderTargetDescriptor(e.id, null);
  25671. var i = this.getUploadQueueForPano(e.id);
  25672. this.clearUploadQueue(i),
  25673. this.updateActivePanos()
  25674. }
  25675. ,
  25676. n.prototype.updateActivePanos = (s = [],
  25677. function(e, t) {
  25678. for (var i = s.length = 0; i < this.activePanos.length; i++) {
  25679. e && s.length === t && s.push(e);
  25680. var n = this.activePanos[i]
  25681. , r = this.getActiveRenderTargetDescriptor(n.id);
  25682. e && n.id === e.id || !this.isRenderTargetDescriptorValid(r) || s.push(n)
  25683. }
  25684. e && t >= s.length && s.push(e),
  25685. this.activePanos.length = 0,
  25686. this.activePanos.push.apply(this.activePanos, s)
  25687. }
  25688. ),
  25689. n.prototype.getActivePanoCount = function() {
  25690. return this.activePanos.length
  25691. }
  25692. ,
  25693. n.prototype.resetRenderStatus = function(e, r, o, t) {
  25694. var i = null;
  25695. t && (i = v.getLevelCountForSize(A.TILE_SIZE, t) + 1);
  25696. for (var n = function(e, t, i, n) {
  25697. o && (t.tile.zoomUploaded = !1),
  25698. r && (t.tile.uploaded = !1)
  25699. }, a = 0; a < A.FACES_PER_PANO; a++) {
  25700. this.getTileTree(e, a).breadthFirst({
  25701. callback: n.bind(this, a),
  25702. minLevel: i
  25703. })
  25704. }
  25705. }
  25706. ,
  25707. n.prototype.copyBaseRenderStatusToZoomed = function(e) {
  25708. for (var t = v.getLevelCountForSize(A.TILE_SIZE, this.qualityManager.getMaxNavPanoSize()), i = function(e, t, i, n) {
  25709. t.tile.zoomUploaded = t.tile.uploaded,
  25710. t.zoomCovered = t.covered
  25711. }, n = 0; n < A.FACES_PER_PANO; n++) {
  25712. this.getTileTree(e, n).breadthFirst({
  25713. callback: i.bind(this, n),
  25714. maxLevel: t
  25715. })
  25716. }
  25717. }
  25718. ,
  25719. n.prototype.renderPanoTiles = (h = [],
  25720. function(e, t, i, n) {
  25721. this.zoomRenderTarget && this.zoomRenderTarget.width === this.qualityManager.getMaxZoomPanoSize() || this.zoomPanoRenderingDisabled || this.setupZoomRenderTarget(),
  25722. t = t || this.direction || m.FORWARD;
  25723. var r = this.getActiveRenderTargetDescriptor(e);
  25724. if (!this.isRenderTargetDescriptorValid(r))
  25725. throw new u("PanoRenderer.renderPanoTiles() -> Cannot render to a pano that is not activated.");
  25726. for (var o = 0; o < A.FACES_PER_PANO; o++) {
  25727. var a = this.getTileTree(e, o);
  25728. h.length = 0,
  25729. a.breadthFirst({
  25730. saveVisited: h
  25731. });
  25732. for (var s = 0; s < h.length; s++) {
  25733. var l = h[s];
  25734. this.queueTileUpload(l.tile, !1, n || 0 === s && i)
  25735. }
  25736. }
  25737. this.updateDirection(t)
  25738. }
  25739. ),
  25740. n.prototype.isRenderTargetDescriptorValid = function(e) {
  25741. return e && e.renderTarget
  25742. }
  25743. ,
  25744. n.prototype.isPanoActive = function(e) {
  25745. var t = this.getActiveRenderTargetDescriptor(e);
  25746. return this.isRenderTargetDescriptorValid(t)
  25747. }
  25748. ,
  25749. n.prototype.isPanoZoomed = function(e) {
  25750. return this.zoomingActive && this.zoomPanoId === e
  25751. }
  25752. ,
  25753. n.prototype.initTileTree = function(e, t, i) {
  25754. var n = this.tileTrees[e];
  25755. n || (n = [],
  25756. this.tileTrees[e] = n);
  25757. var r = n[t];
  25758. if (!r) {
  25759. var o = v.getLevelCountForSize(A.TILE_SIZE, i);
  25760. r = new v(A.TILE_SIZE,o),
  25761. n[t] = r
  25762. }
  25763. }
  25764. ,
  25765. n.prototype.getTileTree = function(e, t) {
  25766. var i = this.tileTrees[e];
  25767. if (!i)
  25768. throw new u("PanoRenderer.getTileTree() -> Tree array not yet initialized!");
  25769. var n = i[t];
  25770. if (!n)
  25771. throw new u("PanoRenderer.getTileTree() -> Tree not yet initialized!");
  25772. return n
  25773. }
  25774. ,
  25775. n.prototype.initTiledPano = function(e, t) {
  25776. var i = this.sceneRenderer.renderer
  25777. , n = (i.context,
  25778. new _.WebGLRenderTargetCube(e,e,{
  25779. stencilBuffer: !1
  25780. }))
  25781. , r = new _.CubeTexture([]);
  25782. (n.texture = r).image = [null, null, null, null, null, null],
  25783. r.flipY = !0,
  25784. t ? (r.generateMipmaps = !0,
  25785. r.magFilter = _.LinearFilter,
  25786. r.minFilter = _.LinearMipMapLinearFilter) : (r.generateMipmaps = !1,
  25787. r.magFilter = _.LinearFilter,
  25788. r.minFilter = _.LinearFilter),
  25789. r.format = _.RGBAFormat,
  25790. i.setRenderTarget(n),
  25791. i.setRenderTarget(null);
  25792. var o = i.properties.get(r);
  25793. return o.__image__webglTextureCube = o.__webglTexture,
  25794. n
  25795. }
  25796. ,
  25797. n.prototype.getUploadQueueForPano = function(e) {
  25798. var t = this.uploadQueues[e];
  25799. return t || (t = [],
  25800. this.uploadQueues[e] = t),
  25801. t
  25802. }
  25803. ,
  25804. n.prototype.isTileUploaded = function(e) {
  25805. return this.isPanoZoomed(e.panoId) ? e.zoomUploaded : e.uploaded
  25806. }
  25807. ,
  25808. n.prototype.setUploaded = function(e, t) {
  25809. this.isPanoZoomed(e.panoId) ? e.zoomUploaded = t : e.uploaded = t
  25810. }
  25811. ,
  25812. n.prototype.queueTileUpload = function(e, t, i) {
  25813. var n = this.getActiveRenderTargetDescriptor(e.panoId);
  25814. if (this.isRenderTargetDescriptorValid(n) && e.downloaded && !this.isTileUploaded(e) && (!e.uploadQueued || i) && (!(e.panoSize > this.qualityManager.getMaxNavPanoSize()) || this.zoomingActive)) {
  25815. var r = this.getUploadQueueForPano(e.panoId);
  25816. 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),
  25817. e.uploadQueued = !0,
  25818. this.uploadInterval || this.uploadIntervalCancelled || this.refreshUploadInterval(0))
  25819. }
  25820. }
  25821. ,
  25822. n.prototype.shoulPushToFrontOfQueue = function(e) {
  25823. return 0 === v.getLevelCountForSize(A.TILE_SIZE, e.panoSize)
  25824. }
  25825. ,
  25826. n.prototype.getTopUploadQueue = function() {
  25827. for (var e = null, t = null, i = P.Base; i <= P.Remaining; i++)
  25828. for (var n = 0; n < this.activePanos.length; n++)
  25829. if (e = this.activePanos[n],
  25830. 0 < (t = this.getUploadQueueForPano(e.id)).length)
  25831. switch (i) {
  25832. case P.Base:
  25833. if (0 === t[0].level)
  25834. return t;
  25835. break;
  25836. case P.Remaining:
  25837. return t
  25838. }
  25839. return null
  25840. }
  25841. ,
  25842. n.prototype.getNextFromUploadQueue = function() {
  25843. if (0 < this.forceQueue.length)
  25844. return L(this.forceQueue);
  25845. var e = this.getTopUploadQueue();
  25846. return e && 0 < e.length ? L(e) : null
  25847. }
  25848. ,
  25849. n.prototype.peekNextFromUploadQueue = function() {
  25850. if (0 < this.forceQueue.length)
  25851. return this.forceQueue[0];
  25852. var e = this.getTopUploadQueue();
  25853. return e && 0 < e.length ? e[0] : null
  25854. }
  25855. ,
  25856. n.prototype.clearAllQueuedUploads = function() {
  25857. this.clearAllUploadQueues(null, 0)
  25858. }
  25859. ,
  25860. n.prototype.clearAllQueuedUploadsForPano = function(e) {
  25861. this.clearAllUploadQueues(e, 0)
  25862. }
  25863. ,
  25864. n.prototype.clearAllUploadQueues = function(e, t) {
  25865. if (e)
  25866. this.clearUploadQueue(this.getUploadQueueForPano(e), t),
  25867. this.clearUploadQueue(this.forceQueue, t, e);
  25868. else {
  25869. for (var i = 0; i < this.activePanos.length; i++) {
  25870. var n = this.activePanos[i];
  25871. this.clearUploadQueue(this.getUploadQueueForPano(n.id), t)
  25872. }
  25873. this.clearUploadQueue(this.forceQueue, t)
  25874. }
  25875. }
  25876. ,
  25877. n.prototype.clearUploadQueue = function(e, t, i) {
  25878. null != t || (t = 0);
  25879. for (var n = 0; n < e.length; ) {
  25880. var r = e[n];
  25881. (!i || i && i === r.tile.panoId) && r.level >= t ? (r.uploadQueued = !1,
  25882. e.splice(n, 1)) : n++
  25883. }
  25884. }
  25885. ,
  25886. n.prototype.refreshUploadInterval = (a = null,
  25887. function(e) {
  25888. this.uploadIntervalCancelled || (a = a || function() {
  25889. this.uploadIntervalCancelled || (this.overlayTilesLoaded || !this.usingTileOverlay ? (T = !0,
  25890. this.updateUploadQueue(this.maxNonBaseUploadsPerFrame, this.maxBaseUploadsPerFrame),
  25891. this.peekNextFromUploadQueue() ? this.refreshUploadInterval(x) : this.uploadInterval = null) : this.refreshUploadInterval(this.uploadIntervalDelay))
  25892. }
  25893. .bind(this),
  25894. null != e || (e = x),
  25895. T || (e = S),
  25896. this.uploadInterval = window.setTimeout(a, e),
  25897. this.uploadIntervalDelay = e)
  25898. }
  25899. ),
  25900. n.prototype.update = (r = performance.now(),
  25901. o = 0,
  25902. function() {
  25903. this.uploadIntervalCancelled = !0,
  25904. window.clearTimeout(this.uploadInterval),
  25905. this.uploadInterval = null;
  25906. var e = performance.now() - r;
  25907. !(x < e || 0 === o) || !this.overlayTilesLoaded && this.usingTileOverlay || (this.updateUploadQueue(this.maxNonBaseUploadsPerFrame, this.maxBaseUploadsPerFrame),
  25908. r = performance.now()),
  25909. o++
  25910. }
  25911. ),
  25912. n.prototype.updateUploadQueue = function(e, t) {
  25913. e = e || 1;
  25914. for (var i = 0, n = 0; !(t <= n || e <= i); ) {
  25915. var r = this.getNextFromUploadQueue();
  25916. if (!r)
  25917. break;
  25918. if (0 !== r.level ? i++ : n++,
  25919. !(r.panoSize > this.qualityManager.getMaxNavPanoSize()) || this.zoomingActive) {
  25920. var o = this.getActiveRenderTargetDescriptor(r.panoId);
  25921. this.isRenderTargetDescriptorValid(o) && this.uploadTile(r, r.forceUpload)
  25922. }
  25923. }
  25924. }
  25925. ,
  25926. n.prototype.updateDirection = function(e) {
  25927. if (e = e || this.direction) {
  25928. this.direction = e;
  25929. for (var t = 0; t < this.activePanos.length; t++) {
  25930. var i = this.activePanos[t]
  25931. , n = this.getUploadQueueForPano(i.id);
  25932. y.sortPanoTiles(n, i, this.direction)
  25933. }
  25934. }
  25935. }
  25936. ,
  25937. n.prototype.uploadTile = (I = {},
  25938. new _.Vector4,
  25939. E = d.tiling.overlayStyle,
  25940. function(e, t) {
  25941. var i = e.panoId
  25942. , n = e.image
  25943. , r = e.tileSize
  25944. , o = e.panoSize
  25945. , a = e.tileIndex
  25946. , s = (e.faceTileIndex,
  25947. e.totalTiles)
  25948. , l = (e.face,
  25949. e.tileX)
  25950. , c = e.tileY
  25951. , h = !0
  25952. , u = !1
  25953. , d = (this.getPanoDescriptor(i),
  25954. this.getPanoLODDescriptor(i, o))
  25955. , p = this.getActiveRenderTargetDescriptor(i)
  25956. , f = p.renderTarget
  25957. , g = p.size;
  25958. if (this.isPanoZoomed(i) && (f = this.zoomRenderTarget,
  25959. g = this.qualityManager.getMaxZoomPanoSize()),
  25960. this.isRenderTargetDescriptorValid(p) || (u = h = !1),
  25961. t || (this.anyUploaded(e.node) && (u = !(h = !1)),
  25962. this.isTileUploaded(e) && (u = h = !1)),
  25963. h) {
  25964. var m = r / o * g
  25965. , v = l * r / o * g
  25966. , y = c * r / o * g;
  25967. I[r] || (I[r] = this.sceneRenderer.initSizedTexture2D(r, _.ClampToEdgeWrapping));
  25968. var A = I[r];
  25969. if (this.sceneRenderer.uploadTexture2D(n, A, 0, 0, r, r),
  25970. 1 === E || 2 === E) {
  25971. var C = 1 === E ? this.overlayTilesBasic : this.overlayTilesEnhanced;
  25972. this.sceneRenderer.renderToCubeMap(A, f, r, r, 0, 0, r, r, v, y, m, m, e.cubeFace),
  25973. this.sceneRenderer.renderToCubeMap(C[o], f, r, r, 0, 0, r, r, v, y, m, m, e.cubeFace, _.NormalBlending, !0, .5)
  25974. } else
  25975. this.sceneRenderer.renderToCubeMap(A, f, r, r, 0, 0, r, r, v, y, m, m, e.cubeFace);
  25976. d.uploadCount++,
  25977. this.emit(b.TileRenderSuccess, i, o, a, s),
  25978. d.uploadCount === s && this.emit(b.PanoRenderComplete, i, o, s),
  25979. this.setUploaded(e, !0),
  25980. this.addCoverageForNode(e.node)
  25981. } else
  25982. this.setUploaded(e, !1);
  25983. return e.uploadAttempted || (d.uploadAttempts++,
  25984. this.emit(b.TileUploadAttempted, i, o, a, s)),
  25985. e.uploadAttempted = !0,
  25986. d.uploadAttempts === s && this.emit(b.UploadAttemptedForAllTiles, i, o, s),
  25987. u
  25988. }
  25989. ),
  25990. n.prototype.linkTileAndNode = function(e, t) {
  25991. (t.tile = e).node = t
  25992. }
  25993. ,
  25994. n.prototype.linkAllTilesAndNodes = function(a) {
  25995. for (var e = function(e, t, i, n, r) {
  25996. var o = this.getTileDirectoryEntry(a.id, t, n, r);
  25997. this.linkTileAndNode(o, i)
  25998. }, t = 0; t < A.FACES_PER_PANO; t++) {
  25999. var i = this.getTileTree(a.id, t);
  26000. i.breadthFirst({
  26001. callback: e.bind(this, i, t)
  26002. })
  26003. }
  26004. }
  26005. ,
  26006. n.prototype.anyUploaded = function(e) {
  26007. if (!e)
  26008. return !1;
  26009. if (e.tile && this.isTileUploaded(e.tile))
  26010. return !0;
  26011. if (e.children)
  26012. for (var t = 0; t < e.children.length; t++) {
  26013. var i = e.children[t];
  26014. if (this.anyUploaded(i))
  26015. return !0
  26016. }
  26017. return !1
  26018. }
  26019. ,
  26020. n.prototype.setNodeCovered = function(e, t) {
  26021. this.isPanoZoomed(e.tile.panoId) ? e.zoomCovered = t : e.covered = t
  26022. }
  26023. ,
  26024. n.prototype.isNodeCovered = function(e) {
  26025. return !!e && (this.isPanoZoomed(e.tile.panoId) ? e.zoomCovered : e.covered)
  26026. }
  26027. ,
  26028. n.prototype.addCoverageForNode = function(e) {
  26029. if (this.setNodeCovered(e, !0),
  26030. e.parent && e.covered) {
  26031. var t = e.parent;
  26032. this.nodeSubcovered(t) && this.addCoverageForNode(t, !0)
  26033. }
  26034. }
  26035. ,
  26036. n.prototype.calcFullCoverage = function(e) {
  26037. var t = !1;
  26038. if (e.children)
  26039. for (var i = 0; i < e.children.length; i++) {
  26040. var n = e.children[i];
  26041. t = t || this.calcFullCoverage(n)
  26042. }
  26043. e.covered = e.tile.uploaded || t
  26044. }
  26045. ,
  26046. n.prototype.nodeSubcovered = function(e) {
  26047. if (!e.children)
  26048. return !1;
  26049. for (var t = 0; t < e.children.length; t++)
  26050. if (!e.children[t] || !this.isNodeCovered(e.children[t]))
  26051. return !1;
  26052. return !0
  26053. }
  26054. ,
  26055. n.prototype.resetPanoDescriptor = function(e) {
  26056. this.getPanoDescriptor(e)
  26057. }
  26058. ,
  26059. n.prototype.getPanoDescriptor = function(e) {
  26060. var t = this.panoDescriptors[e];
  26061. return t || (t = {},
  26062. this.panoDescriptors[e] = t),
  26063. t
  26064. }
  26065. ,
  26066. n.prototype.resetPanoLODDescriptors = function(e) {
  26067. var t = this.getPanoLODDescriptors(e);
  26068. for (var i in t)
  26069. if (t.hasOwnProperty(i)) {
  26070. var n = t[i];
  26071. n.uploadCount = 0,
  26072. n.uploadAttempts = 0
  26073. }
  26074. }
  26075. ,
  26076. n.prototype.getPanoLODDescriptor = function(e, t) {
  26077. var i = this.getPanoLODDescriptors(e)
  26078. , n = i[t];
  26079. return n || (n = {
  26080. uploadCount: 0,
  26081. uploadAttempts: 0
  26082. },
  26083. i[t] = n),
  26084. n
  26085. }
  26086. ,
  26087. n.prototype.getPanoLODDescriptors = function(e) {
  26088. var t = this.panoLODDescriptors[e];
  26089. return t || (t = {},
  26090. this.panoLODDescriptors[e] = t),
  26091. t
  26092. }
  26093. ,
  26094. n.prototype.onTileDownloaded = function(e) {
  26095. var t = v.getLevelCountForSize(A.TILE_SIZE, e.panoSize)
  26096. , i = this.getTileDirectoryEntry(e.panoId, e.face, t, e.faceTileIndex);
  26097. if (i.downloaded = !0,
  26098. i.image = e.image,
  26099. i.panoSize = e.panoSize,
  26100. i.tileX = e.tileX,
  26101. i.tileY = e.tileY,
  26102. i.totalTiles = e.totalTiles,
  26103. i.tileIndex = e.tileIndex,
  26104. i.faceTileIndex = e.faceTileIndex,
  26105. i.face = e.face,
  26106. i.cubeFace = C.mapFaceToCubemapFace(e.face),
  26107. i.panoId = e.panoId,
  26108. i.tileSize = e.tileSize,
  26109. i.direction = (new _.Vector3).copy(e.direction),
  26110. i.node = null,
  26111. i.level = v.getLevelCountForSize(A.TILE_SIZE, i.panoSize),
  26112. this.isPanoActive(i.panoId)) {
  26113. var n = this.getTileTree(i.panoId, i.face).getSubNode(i.panoSize, i.tileX, i.tileY);
  26114. this.linkTileAndNode(i, n),
  26115. this.queueTileUpload(i, !0)
  26116. }
  26117. }
  26118. ,
  26119. n.prototype.getTileDirectoryEntry = function(e, t, i, n) {
  26120. var r = this.tileDirectory[e];
  26121. r || (r = {},
  26122. this.tileDirectory[e] = r);
  26123. var o = 16384 * t + 1024 * i + n
  26124. , a = r[o];
  26125. return a || (a = {
  26126. downloaded: !1,
  26127. uploaded: !1,
  26128. zoomUploaded: !1
  26129. },
  26130. r[o] = a),
  26131. a._key = e + ":" + t + ":" + i + ":" + n,
  26132. a._tileKey = o,
  26133. a
  26134. }
  26135. ,
  26136. n.prototype.setZoomingActive = function(e, t, i) {
  26137. this.zoomPanoRenderingDisabled || e === this.zoomingActive && this.zoomPanoId === t.id || (this.zoomingActive = e,
  26138. this.zoomPanoId = t.id,
  26139. this.zoomingActive && (this.zoomPanoId !== t.id || i) && this.updateZoomedPanoFromBase(t))
  26140. }
  26141. ,
  26142. n.prototype.updateZoomedPanoFromBase = function(e) {
  26143. if (!this.zoomPanoRenderingDisabled) {
  26144. var t = this.getActiveRenderTargetDescriptor(e.id);
  26145. if (t && t.renderTarget) {
  26146. var i = this.qualityManager.getMaxZoomPanoSize()
  26147. , n = t.renderTarget
  26148. , r = t.size;
  26149. this.sceneRenderer.copyCubeMap(n.texture, this.zoomRenderTarget, r, r, i, i),
  26150. this.copyBaseRenderStatusToZoomed(e.id)
  26151. }
  26152. }
  26153. }
  26154. ,
  26155. t.exports = n
  26156. }
  26157. , {
  26158. "../enum/GLCubeFaces": 25,
  26159. "../enum/PanoRendererEvents": 35,
  26160. "../enum/PanoSizeClass": 36,
  26161. "../enum/SceneRendererEvents": 43,
  26162. "../enum/TileDownloaderEvents": 45,
  26163. "../enum/Vectors": 50,
  26164. "../exception/BasicException": 55,
  26165. "../objects/Panorama": 148,
  26166. "../settings": 166,
  26167. "../util/browser": 182,
  26168. "../util/panorama": 191,
  26169. "./TileDownloader": 171,
  26170. "./TilePrioritizer": 172,
  26171. "./TileTree": 173,
  26172. "./TileUtils": 174,
  26173. events: 202,
  26174. three: 217
  26175. }],
  26176. 170: [function(e, t, i) {
  26177. "use strict";
  26178. function n(e, t, i) {
  26179. this.maxNavPanoSize = -1,
  26180. this.maxZoomPanoSize = -1,
  26181. this.devicePixelDensity = e,
  26182. this.deviceScreenSize = t,
  26183. this.clientBandwidth = i,
  26184. this.panoSizeClassMap = {},
  26185. this.useHighResolutionPanos = !0,
  26186. this.useUltraHighResolutionPanos = !1,
  26187. this.modelHasUltraHighPanos = !1
  26188. }
  26189. var r = e("../enum/PanoSizeClass")
  26190. , o = e("../settings")
  26191. , a = e("../util/browser")
  26192. , s = e("../constants")
  26193. , l = e("../util/showcase")
  26194. , c = e("../enum/ModelManagerEvents");
  26195. n.prototype.init = function(e) {
  26196. this.buildPanoSizeClassMap(this.devicePixelDensity, this.deviceScreenSize, this.clientBandwidth),
  26197. this.ultraHighSize = this.getPanoSize(r.ULTRAHIGH),
  26198. this.highSize = this.getPanoSize(r.HIGH),
  26199. this.standardSize = this.getPanoSize(r.STANDARD),
  26200. this.baseSize = this.getPanoSize(r.BASE),
  26201. o.tiling.maxZoomPanoQuality && this.ultraHighSize <= o.tiling.maxZoomPanoQuality && (o.tiling.allowUltraHighResolution = !0),
  26202. this.highQualityThreshold = a.valueFromHash("threshold2k", s.windowHeightHighQualityThreshold),
  26203. this.updateMaximums(),
  26204. e.on(c.ActiveModelChanged, this.onModelChanged.bind(this))
  26205. }
  26206. ,
  26207. n.prototype.updateFromModel = function(e) {
  26208. this.updateHighResolutionSettings(e),
  26209. this.updateUltraHighResolutionSettings(e)
  26210. }
  26211. ,
  26212. n.prototype.updateHighResolutionSettings = function(e) {
  26213. l.modelDataPromisesTiles(e.data) ? this.useHighResolutionPanos = !0 : this.useHighResolutionPanos = !1,
  26214. this.updateMaximums()
  26215. }
  26216. ,
  26217. n.prototype.updateUltraHighResolutionSettings = function(e) {
  26218. o.tiling.allowUltraHighResolution && this.modelHasUltraHighPanos ? this.useUltraHighResolutionPanos = !0 : this.useUltraHighResolutionPanos = !1,
  26219. this.updateMaximums()
  26220. }
  26221. ,
  26222. n.prototype.enableUltraHighQualityMode = function() {
  26223. this.modelHasUltraHighPanos = !0,
  26224. this.updateUltraHighResolutionSettings(null)
  26225. }
  26226. ,
  26227. n.prototype.ultraHighQualityModeEnabled = function() {
  26228. return this.modelHasUltraHighPanos
  26229. }
  26230. ,
  26231. n.prototype.onModelChanged = function(e) {
  26232. this.updateFromModel(e.model),
  26233. this.updateMaximums()
  26234. }
  26235. ,
  26236. n.prototype.updateMaximums = function() {
  26237. this.maxNavPanoSize = o.tiling.maxNavPanoQuality || this.detectMaxNavPanoSize(),
  26238. this.maxZoomPanoSize = o.tiling.maxZoomPanoQuality || this.detectMaxZoomPanoSize(),
  26239. this.maxZoomPanoSize < this.maxNavPanoSize && (this.maxNavPanoSize = this.maxZoomPanoSize)
  26240. }
  26241. ,
  26242. n.prototype.buildPanoSizeClassMap = function() {
  26243. this.panoSizeClassMap[r.BASE] = 512,
  26244. this.panoSizeClassMap[r.STANDARD] = 1024,
  26245. this.panoSizeClassMap[r.HIGH] = 2048,
  26246. this.panoSizeClassMap[r.ULTRAHIGH] = 4096
  26247. }
  26248. ,
  26249. n.prototype.getPanoSize = function(e) {
  26250. return this.panoSizeClassMap[e]
  26251. }
  26252. ,
  26253. n.prototype.getMaxPossiblePanoSize = function() {
  26254. return this.getPanoSize(r.ULTRAHIGH)
  26255. }
  26256. ,
  26257. n.prototype.getMaxPanoSize = function() {
  26258. return this.maxZoomPanoSize
  26259. }
  26260. ,
  26261. n.prototype.getMaxNavPanoSize = function() {
  26262. return this.maxNavPanoSize
  26263. }
  26264. ,
  26265. n.prototype.getMaxZoomPanoSize = function() {
  26266. return this.maxZoomPanoSize
  26267. }
  26268. ,
  26269. n.prototype.detectMaxNavPanoSizeClass = function() {
  26270. return this.useHighResolutionPanos ? a.isMobile() ? r.STANDARD : $("#player").height() < this.highQualityThreshold ? r.STANDARD : r.HIGH : r.STANDARD
  26271. }
  26272. ,
  26273. n.prototype.detectMaxNavPanoSize = function() {
  26274. var e = this.detectMaxNavPanoSizeClass();
  26275. return this.getPanoSize(e)
  26276. }
  26277. ,
  26278. n.prototype.detectMaxZoomPanoSize = function() {
  26279. 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)
  26280. }
  26281. ,
  26282. t.exports = n
  26283. }
  26284. , {
  26285. "../constants": 8,
  26286. "../enum/ModelManagerEvents": 33,
  26287. "../enum/PanoSizeClass": 36,
  26288. "../settings": 166,
  26289. "../util/browser": 182,
  26290. "../util/showcase": 193
  26291. }],
  26292. 171: [function(A, C, e) {
  26293. (function(e) {
  26294. "use strict";
  26295. function i(e) {
  26296. this.panos = null,
  26297. this.retryMinimumTime = 1e4,
  26298. this.urls = null,
  26299. this.panoLoadCallbacks = {},
  26300. this.downloadDescriptors = {},
  26301. this.priorityQueue = [],
  26302. this.forceQueue = [],
  26303. this.activeDownloads = [],
  26304. this.qualityManager = null,
  26305. this.tilePrioritizer = null,
  26306. this.refreshInterval = null,
  26307. this.processPriorityQueue = !1,
  26308. this.concurrentDownloads = e.concurrentDownloads || 1,
  26309. this.downloadTestResults = {}
  26310. }
  26311. var c, h, n, p, f, t = A("three"), u = (A("../enum/Viewmode"),
  26312. A("../settings")), r = (A("../objects/Panorama"),
  26313. A("../util/logger")), o = (A("../enum/Vectors"),
  26314. A("../enum/PanoSizeClass"),
  26315. A("../enum/TileDownloaderEvents")), g = A("./TilePrioritizer"), m = A("./TileUtils"), v = (A("../enum/GLCubeFaces"),
  26316. A("../enum/DownloadStatus")), a = A("../util/panorama"), s = A("../util/ajax"), d = A("../ab"), l = A("events").EventEmitter, y = (new r(e),
  26317. Object.freeze({
  26318. Testing: 1,
  26319. Success: 2,
  26320. Fail: 3
  26321. }));
  26322. i.prototype = Object.create(l.prototype),
  26323. i.IDLE_REFRESH_DELAY = 500,
  26324. i.ACTIVE_REFRESH_DELAY = 16,
  26325. i.DOWNLOAD_RETRIES = 4,
  26326. i.prototype.init = function(e) {
  26327. this.qualityManager = e
  26328. }
  26329. ,
  26330. i.prototype.setUrls = function(e) {
  26331. this.urls = e
  26332. }
  26333. ,
  26334. i.prototype.setPanoData = function(e, t, i) {
  26335. this.panos = e,
  26336. this.imagePanos = t,
  26337. this.panoGroupId = i
  26338. }
  26339. ,
  26340. i.prototype.start = function() {
  26341. this.refreshUpdateInterval(0)
  26342. }
  26343. ,
  26344. i.prototype.stop = function() {
  26345. window.cancel(this.refreshInterval)
  26346. }
  26347. ,
  26348. i.prototype.refreshUpdateInterval = function(e) {
  26349. e = e || 0,
  26350. this.refreshInterval = window.setTimeout(function() {
  26351. this.update() ? this.refreshUpdateInterval(i.ACTIVE_REFRESH_DELAY) : this.refreshUpdateInterval(i.IDLE_REFRESH_DELAY)
  26352. }
  26353. .bind(this), e)
  26354. }
  26355. ,
  26356. i.prototype.update = function() {
  26357. var e = 0 < this.forceQueue.length;
  26358. return this.processQueueForDownloading(this.forceQueue),
  26359. this.processPriorityQueue && (this.queuePrioritizedTilesForPanos(this.panos),
  26360. 0 < this.priorityQueue.length && (e = !0),
  26361. this.processQueueForDownloading(this.priorityQueue)),
  26362. e
  26363. }
  26364. ,
  26365. i.prototype.forceQueueTilesForPano = (p = [],
  26366. f = [],
  26367. function(e, t, i, n, r, o) {
  26368. p.length = 0;
  26369. for (var a = this.getTileDownloadDescriptors(e, t), s = 0; s < a.length; s++) {
  26370. var l = a[s];
  26371. l.status !== v.None && l.status !== v.Queued || p.push(l)
  26372. }
  26373. if (i && 0 < p.length) {
  26374. g.sortPanoTiles(p, e, i),
  26375. f.length = 0,
  26376. m.matchingTilesInDirection(e, t, i, n, r, f);
  26377. for (var c = 0, h = function(e) {
  26378. return e.face === u.face && e.faceTileIndex === u.faceTileIndex
  26379. }; c < p.length; ) {
  26380. var u = p[c];
  26381. f.findIndex(h) < 0 ? p.splice(c, 1) : c++
  26382. }
  26383. }
  26384. for (var d = 0; d < p.length; d++)
  26385. this.forceQueue.push(p[d]);
  26386. this.setStatusForAllDescriptors(this.forceQueue, v.ForceQueued),
  26387. this.clearFromQueue(this.priorityQueue, v.ForceQueued, !1),
  26388. o && this.processQueueForDownloading(this.forceQueue, !0)
  26389. }
  26390. ),
  26391. i.prototype.clearForceQueue = function() {
  26392. this.clearQueue(this.forceQueue)
  26393. }
  26394. ,
  26395. i.prototype.queuePrioritizedTilesForPanos = function(e) {
  26396. this.tilePrioritizer && (this.clearQueue(this.priorityQueue),
  26397. this.tilePrioritizer.filterAndPrioritize(this.priorityQueue, e, this),
  26398. this.clearFromQueue(this.priorityQueue, v.None, !0),
  26399. this.setStatusOrRemoveForAllDescriptors(this.priorityQueue, v.Queued))
  26400. }
  26401. ,
  26402. i.prototype.clearQueue = function(e) {
  26403. this.setStatusForAllDescriptors(e, v.None),
  26404. e.length = 0
  26405. }
  26406. ,
  26407. i.prototype.clearFromQueue = function(e, t, i) {
  26408. for (var n = 0; n < e.length; n++) {
  26409. var r = e[n];
  26410. r && (t === r.status && !i || t !== r.status && i) && (e[n] = null)
  26411. }
  26412. }
  26413. ,
  26414. i.prototype.setStatusForAllDescriptors = function(e, t) {
  26415. for (var i = 0; i < e.length; i++) {
  26416. var n = e[i];
  26417. n && (n.status = t)
  26418. }
  26419. }
  26420. ,
  26421. i.prototype.setStatusOrRemoveForAllDescriptors = function(e, t) {
  26422. for (var i = 0; i < e.length; i++) {
  26423. var n = e[i];
  26424. n && (n.status !== t ? n.status = t : e[i] = null)
  26425. }
  26426. }
  26427. ,
  26428. i.prototype.getTileDownloadDescriptors = function(e, t) {
  26429. var i = this.getAllTileDownloadDescriptorsForPano(e)
  26430. , n = i[t];
  26431. return n || (n = this.buildDownloadDescriptorArray(t),
  26432. i[t] = n,
  26433. this.initTileDownloadDescriptors(n, e, t)),
  26434. n
  26435. }
  26436. ,
  26437. i.prototype.getAllTileDownloadDescriptorsForPano = function(e) {
  26438. var t = this.downloadDescriptors[e.id];
  26439. return t || (t = {},
  26440. this.downloadDescriptors[e.id] = t),
  26441. t
  26442. }
  26443. ,
  26444. i.prototype.processQueueForDownloading = function(e, t) {
  26445. if (this.cleanupActiveDownloads(),
  26446. this.activeDownloads.length < this.concurrentDownloads || t)
  26447. for (var i = t ? e.length : this.concurrentDownloads - this.activeDownloads.length, n = 0; n < i && 0 < e.length; 0) {
  26448. var r = e.shift();
  26449. r && (this.startDownload(r),
  26450. n++)
  26451. }
  26452. }
  26453. ,
  26454. i.prototype.testDownload = function(t, e, i) {
  26455. var n = this.downloadTestResults[t];
  26456. if (n)
  26457. n === y.Success ? i(!0) : n === y.Fail && i(!1);
  26458. else {
  26459. this.downloadTestResults[t] = y.Testing;
  26460. var r = this.panos.list[0]
  26461. , o = this.getTileUrl(r.id, t, e, 0)
  26462. , a = function(e) {
  26463. this.downloadTestResults[t] = y.Success,
  26464. i(!0)
  26465. }
  26466. .bind(this)
  26467. , s = function() {
  26468. this.downloadTestResults[t] = y.Fail,
  26469. i(!1)
  26470. }
  26471. .bind(this);
  26472. this.loadImage(o, 0, a, s)
  26473. }
  26474. }
  26475. ,
  26476. i.prototype.startDownload = function(e) {
  26477. e.status = v.Downloading;
  26478. var t = this.getTileUrl(e.pano.id, e.panoSize, e.tileSize, e.tileIndex);
  26479. this.activeDownloads.push(e),
  26480. this.loadImage(t, i.DOWNLOAD_RETRIES, this.downloadComplete.bind(this, e), this.downloadFailed.bind(this, e))
  26481. }
  26482. ,
  26483. i.prototype.downloadFailed = function(e, t) {}
  26484. ,
  26485. i.prototype.downloadComplete = function(e, t) {
  26486. if (e.panoGroupId === this.panoGroupId) {
  26487. var i = this.getPanoLoadCallbacks(e.pano, e.panoSize);
  26488. e.status = v.Downloaded,
  26489. i && i.onProgress && i.onProgress(e.pano, e.panoSize);
  26490. var n = {
  26491. panoId: e.pano.id,
  26492. image: t,
  26493. tileSize: e.tileSize,
  26494. panoSize: e.panoSize,
  26495. tileIndex: e.tileIndex,
  26496. faceTileIndex: e.faceTileIndex,
  26497. totalTiles: e.totalTiles,
  26498. face: e.face,
  26499. tileX: e.tileX,
  26500. tileY: e.tileY,
  26501. direction: e.direction
  26502. };
  26503. e.image = t,
  26504. this.emit(o.TileDownloadSuccess, n),
  26505. this.isPanoDownloaded(e.pano, e.panoSize) && (n = {
  26506. panoId: e.pano.id,
  26507. tileSize: e.tileSize,
  26508. panoSize: e.panoSize
  26509. },
  26510. this.emit(o.PanoDownloadComplete, n),
  26511. i && i.onLoad && i.onLoad(e.pano, e.panoSize))
  26512. }
  26513. }
  26514. ,
  26515. i.prototype.cleanupActiveDownloads = (n = [],
  26516. function() {
  26517. for (var e = n.length = 0; e < this.activeDownloads.length; e++) {
  26518. var t = this.activeDownloads[e];
  26519. t.status !== v.Downloaded && t.status !== v.Failed && n.push(t)
  26520. }
  26521. this.activeDownloads.length = 0,
  26522. this.activeDownloads.push.apply(this.activeDownloads, n)
  26523. }
  26524. ),
  26525. i.prototype.isPanoDownloaded = function(e, t) {
  26526. var i = this.getTileDownloadDescriptors(e, t);
  26527. if (i.length <= 0)
  26528. return !1;
  26529. for (var n = 0; n < i.length; n++) {
  26530. if (i[n].status !== v.Downloaded)
  26531. return !1
  26532. }
  26533. return !0
  26534. }
  26535. ,
  26536. i.prototype.setPanoLoadCallbacks = function(e, t, i, n, r) {
  26537. var o = e.id + ":" + this.qualityManager.getPanoSize(t);
  26538. this.panoLoadCallbacks[o] = {
  26539. onLoad: i,
  26540. onFail: n,
  26541. onProgress: r
  26542. }
  26543. }
  26544. ,
  26545. i.prototype.getPanoLoadCallbacks = function(e, t) {
  26546. var i = e.id + ":" + t;
  26547. return this.panoLoadCallbacks[i]
  26548. }
  26549. ,
  26550. i.prototype.buildDownloadDescriptorArray = function(e) {
  26551. for (var t = m.getTileCountForSize(e), i = [], n = 0; n < t; n++) {
  26552. var r = this.buildDownloadDescriptor();
  26553. i.push(r)
  26554. }
  26555. return i
  26556. }
  26557. ,
  26558. i.prototype.buildDownloadDescriptor = function() {
  26559. return {
  26560. panoGroupId: null,
  26561. pano: null,
  26562. panoSize: -1,
  26563. tileSize: -1,
  26564. tileIndex: -1,
  26565. totalTiles: -1,
  26566. faceTileIndex: -1,
  26567. status: v.None,
  26568. url: null,
  26569. image: null,
  26570. direction: new t.Vector3,
  26571. face: -1,
  26572. cubeFace: -1,
  26573. tileX: -1,
  26574. tileY: -1
  26575. }
  26576. }
  26577. ,
  26578. i.prototype.initTileDownloadDescriptors = function(e, t, i) {
  26579. for (var n = 0; n < e.length; n++) {
  26580. var r = e[n];
  26581. this.initTileDownloadDescriptor(r, t, i, n)
  26582. }
  26583. }
  26584. ,
  26585. i.prototype.initTileDownloadDescriptor = function(e, t, i, n) {
  26586. var r = i >= m.TILE_SIZE ? m.TILE_SIZE : i;
  26587. e.face = m.getFaceForTile(i, n),
  26588. e.cubeFace = a.mapFaceToCubemapFace(e.face),
  26589. e.panoGroupId = this.panoGroupId,
  26590. e.pano = t,
  26591. e.panoSize = i,
  26592. e.tileSize = r,
  26593. e.tileIndex = n,
  26594. e.totalTiles = m.getTileCountForSize(i),
  26595. e.status = v.None,
  26596. e.image = null,
  26597. m.getTileLocation(e.panoSize, e.tileIndex, e),
  26598. m.getTileVector(e.panoSize, e.tileSize, e.cubeFace, e.tileX, e.tileY, m.LocationOnTile.Center, 0, e.direction)
  26599. }
  26600. ,
  26601. i.prototype.getTileUrl = (c = {
  26602. 256: "256",
  26603. 512: "512",
  26604. 1024: "1k",
  26605. 2048: "2k",
  26606. 4096: "4k"
  26607. },
  26608. h = {
  26609. face: -1,
  26610. faceTileIndex: -1,
  26611. tileX: -1,
  26612. tileY: -1
  26613. },
  26614. function(e, t, i, n) {
  26615. m.getTileLocation(t, n, h);
  26616. var r = Math.floor(t / i)
  26617. , o = r * r
  26618. , a = Math.floor(n / o)
  26619. , s = "";
  26620. 1 === u.tiling.customCompression && (s = "_" + u.tiling["q" + c[t]]);
  26621. var l = this.urls.get("tiles/" + e + "/" + c[t] + s + "_face" + a + "_" + h.tileX + "_" + h.tileY + ".jpg");
  26622. return d.changeIfTileGenerating(l)
  26623. }
  26624. ),
  26625. i.prototype.loadImage = function(e, t, i, n) {
  26626. s.getImage(e, t).then(function(e) {
  26627. i(e)
  26628. }).fail(n)
  26629. }
  26630. ,
  26631. C.exports = i
  26632. }
  26633. ).call(this, "/js/tile/TileDownloader.js")
  26634. }
  26635. , {
  26636. "../ab": 3,
  26637. "../enum/DownloadStatus": 24,
  26638. "../enum/GLCubeFaces": 25,
  26639. "../enum/PanoSizeClass": 36,
  26640. "../enum/TileDownloaderEvents": 45,
  26641. "../enum/Vectors": 50,
  26642. "../enum/Viewmode": 51,
  26643. "../objects/Panorama": 148,
  26644. "../settings": 166,
  26645. "../util/ajax": 181,
  26646. "../util/logger": 189,
  26647. "../util/panorama": 191,
  26648. "./TilePrioritizer": 172,
  26649. "./TileUtils": 174,
  26650. events: 202,
  26651. three: 217
  26652. }],
  26653. 172: [function(n, C, e) {
  26654. (function(e) {
  26655. "use strict";
  26656. function h(e, t, i, n, r) {
  26657. this.qualityManager = e,
  26658. this.maxNavQuality = this.qualityManager.getMaxNavPanoSize(),
  26659. this.maxZoomQuality = this.qualityManager.getMaxZoomPanoSize(),
  26660. this.baseSize = t,
  26661. this.standardSize = i,
  26662. this.highSize = n,
  26663. this.ultraHighSize = r,
  26664. this.priorityCriteria = new h.PriorityCriteria(null,new o.Vector3(0,0,0),new o.Vector3(0,0,-1),new o.Vector3(0,0,-1))
  26665. }
  26666. var c, s, l, d, r, u, p, f, o = n("three"), g = (n("../enum/Viewmode"),
  26667. n("../settings"),
  26668. n("../settings"),
  26669. n("../objects/Panorama")), t = n("../util/logger"), i = (n("../enum/Vectors"),
  26670. n("../enum/PanoSizeClass"),
  26671. n("../enum/ModelManagerEvents"),
  26672. n("../enum/GLCubeFaces"),
  26673. n("../enum/DownloadStatus")), m = (n("../util/browser"),
  26674. n("./TileUtils")), v = n("../util/math"), a = (n("events").EventEmitter,
  26675. new t(e),
  26676. Object.freeze({
  26677. None: 0,
  26678. DirectionalFOV: 1
  26679. }));
  26680. h.PriorityCriteria = function(e, t, i, n, r) {
  26681. this.pano = e,
  26682. this.cameraPosition = (new o.Vector3).copy(t),
  26683. this.cameraDir = (new o.Vector3).copy(i),
  26684. this.panoSpaceDir = (new o.Vector3).copy(n),
  26685. this.upcomingPanos = r,
  26686. this.copy = function(e) {
  26687. this.pano = e.pano,
  26688. this.cameraPosition.copy(e.cameraPosition),
  26689. this.cameraDir.copy(e.cameraDir),
  26690. this.panoSpaceDir.copy(e.panoSpaceDir),
  26691. this.upcomingPanos = r
  26692. }
  26693. ,
  26694. this.zoomingActive = !1
  26695. }
  26696. ,
  26697. h.DIRECTIONAL_FOV = 180,
  26698. h.DIRECTIONAL_FOV_NARROW = 120,
  26699. h.MAX_SCORED_PANOS_TOCONSIDER = 6,
  26700. h.MAX_SCORED_PANOS_TOADD = 2,
  26701. h.MAX_UPCOMING_PANOS_TOADD = 3,
  26702. h.DIRECTION_SCORE_STRICTNESS = .75,
  26703. h.appendQueue = function(e, t) {
  26704. if (e && t)
  26705. for (var i = 0; i < t.length; i++)
  26706. e.push(t[i])
  26707. }
  26708. ,
  26709. h.prototype.updateCriteria = function(e, t, i, n) {
  26710. this.priorityCriteria.pano = e,
  26711. this.priorityCriteria.cameraPosition.copy(t),
  26712. this.priorityCriteria.cameraDir.copy(i),
  26713. this.priorityCriteria.upcomingPanos = n,
  26714. this.maxNavQuality = this.qualityManager.getMaxNavPanoSize(),
  26715. this.maxZoomQuality = this.qualityManager.getMaxZoomPanoSize()
  26716. }
  26717. ,
  26718. h.prototype.filterAndPrioritize = (u = [],
  26719. p = [],
  26720. f = [],
  26721. function(e, t, i) {
  26722. this.populateNeighborPanos(this.priorityCriteria.pano, t, u),
  26723. this.populateScoredPanos(this.priorityCriteria.pano, t, p, this.priorityCriteria.cameraDir, h.MAX_SCORED_PANOS_TOCONSIDER);
  26724. var n = this.baseSize
  26725. , r = this.standardSize
  26726. , o = this.highSize
  26727. , a = this.ultraHighSize;
  26728. this.queueTilesForPano(e, i, this.priorityCriteria.pano, n),
  26729. this.priorityCriteria.upcomingPanos && this.queueTilesForPanos(e, this.priorityCriteria.upcomingPanos, i, n, h.MAX_UPCOMING_PANOS_TOADD),
  26730. f.length = 0,
  26731. this.canDownloadSize(r) && this.queueTilesInDirectionForPano(f, i, this.priorityCriteria.pano, r, this.priorityCriteria.cameraPosition, this.priorityCriteria.cameraDir, h.DIRECTIONAL_FOV_NARROW),
  26732. h.sortPanoTiles(f, this.priorityCriteria.pano, this.priorityCriteria.cameraDir),
  26733. h.appendQueue(e, f),
  26734. this.queueTilesForPanos(e, p, i, n, h.MAX_SCORED_PANOS_TOADD),
  26735. f.length = 0,
  26736. this.canDownloadSize(o) && this.queueTilesInDirectionForPano(f, i, this.priorityCriteria.pano, o, this.priorityCriteria.cameraPosition, this.priorityCriteria.cameraDir, h.DIRECTIONAL_FOV_NARROW),
  26737. this.canDownloadSize(a) && this.queueTilesInDirectionForPano(f, i, this.priorityCriteria.pano, a, this.priorityCriteria.cameraPosition, this.priorityCriteria.cameraDir, h.DIRECTIONAL_FOV_NARROW),
  26738. h.sortPanoTiles(f, this.priorityCriteria.pano, this.priorityCriteria.cameraDir),
  26739. h.appendQueue(e, f),
  26740. f.length = 0,
  26741. this.canDownloadSize(r) && this.queueTilesInDirectionForPano(f, i, this.priorityCriteria.pano, r, this.priorityCriteria.cameraPosition, this.priorityCriteria.cameraDir, h.DIRECTIONAL_FOV),
  26742. this.canDownloadSize(o) && this.queueTilesInDirectionForPano(f, i, this.priorityCriteria.pano, o, this.priorityCriteria.cameraPosition, this.priorityCriteria.cameraDir, h.DIRECTIONAL_FOV),
  26743. this.canDownloadSize(a) && this.queueTilesInDirectionForPano(f, i, this.priorityCriteria.pano, a, this.priorityCriteria.cameraPosition, this.priorityCriteria.cameraDir, h.DIRECTIONAL_FOV),
  26744. h.sortPanoTiles(f, this.priorityCriteria.pano, this.priorityCriteria.cameraDir),
  26745. h.appendQueue(e, f),
  26746. this.queueTilesForPanos(e, u, i, n)
  26747. }
  26748. ),
  26749. h.prototype.canDownloadSize = function(e) {
  26750. return this.maxNavQuality >= e || this.maxZoomQuality >= e && this.zoomingActive
  26751. }
  26752. ,
  26753. h.prototype.populateNeighborPanos = function(e, t, i) {
  26754. (i = i || []).length = 0;
  26755. var n = t.getNeighbours(e);
  26756. for (var r in n)
  26757. if (n.hasOwnProperty(r)) {
  26758. var o = t.get(r);
  26759. i.push(o)
  26760. }
  26761. return i
  26762. }
  26763. ,
  26764. h.prototype.populateScoredPanos = function(e, t, i, n, r) {
  26765. (i = i || []).length = 0;
  26766. var o = [g.filters.inPanoDirection(e.position, n, h.DIRECTION_SCORE_STRICTNESS), g.filters.not(e)]
  26767. , a = [g.scoreFunctions.distanceSquared(e), g.scoreFunctions.direction(e.position, n)]
  26768. , s = t.sortByScore(o, a);
  26769. if (s)
  26770. for (var l = 0; l < s.length && l < r; l++) {
  26771. var c = s[l].item;
  26772. i.push(c)
  26773. }
  26774. return i
  26775. }
  26776. ,
  26777. h.prototype.queueTilesForPanos = function(e, t, i, n, r) {
  26778. for (var o = 0, a = 0; a < t.length; a++) {
  26779. var s = t[a];
  26780. if (o += 0 < this.queueTilesForPano(e, i, s, n) ? 1 : 0,
  26781. r && r <= o)
  26782. break
  26783. }
  26784. return o
  26785. }
  26786. ,
  26787. h.prototype.queueTilesForPano = (r = {
  26788. filter: a.None
  26789. },
  26790. function(e, t, i, n) {
  26791. return this.filterAndQueueTileDownloadDescriptors(e, t, i, n, r)
  26792. }
  26793. ),
  26794. h.prototype.queueTilesForPanosInDirection = (d = new o.Vector3,
  26795. function(e, t, i, n, r, o, a, s) {
  26796. for (var l = 0, c = 0; c < i.length; c++) {
  26797. var h = i[c];
  26798. d.copy(h.position),
  26799. d.sub(r),
  26800. d.normalize();
  26801. var u = Math.max(Math.min(o.dot(d), 1), -1);
  26802. if (v.getFOVDotThreshold(a) <= u && (l += 0 < this.queueTilesInDirectionForPano(e, t, h, n, r, o, a) ? 1 : 0,
  26803. s && s <= l))
  26804. break
  26805. }
  26806. return l
  26807. }
  26808. ),
  26809. h.prototype.queueTilesInDirectionForPanos = function(e, t, i, n, r, o, a, s) {
  26810. for (var l = 0, c = 0; c < i.length; c++) {
  26811. var h = i[c];
  26812. if (l += 0 < this.queueTilesInDirectionForPano(e, t, h, n, o, a) ? 1 : 0,
  26813. s && s <= l)
  26814. break
  26815. }
  26816. return l
  26817. }
  26818. ,
  26819. h.prototype.queueTilesInDirectionForPano = (s = {
  26820. filter: a.DirectionalFOV,
  26821. direction: new o.Vector3,
  26822. fov: 60
  26823. },
  26824. l = new o.Vector3,
  26825. function(e, t, i, n, r, o, a) {
  26826. return l.copy(o),
  26827. m.getRelativeDirection(i.quaternion, l),
  26828. s.direction.copy(l),
  26829. s.fov = a,
  26830. this.filterAndQueueTileDownloadDescriptors(e, t, i, n, s)
  26831. }
  26832. ),
  26833. h.prototype.filterAndQueueTileDownloadDescriptors = (c = [],
  26834. function(e, t, i, n, r) {
  26835. var o = t.getTileDownloadDescriptors(i, n);
  26836. c.length = 0,
  26837. this.filterTileDownloadDescriptors(i, o, c, r);
  26838. for (var a = 0, s = 0; s < c.length; s++) {
  26839. var l = c[s];
  26840. l && (e.push(l),
  26841. a++)
  26842. }
  26843. return a
  26844. }
  26845. ),
  26846. h.prototype.filterTileDownloadDescriptors = (new o.Vector3,
  26847. function(e, t, i, n) {
  26848. var r, o;
  26849. switch (n.filter) {
  26850. case a.DirectionalFOV:
  26851. for (r = 0; r < t.length; r++)
  26852. o = t[r],
  26853. m.isTileWithinFOV(o.panoSize, o.tileSize, o.face, o.tileX, o.tileY, n.direction, n.fov) && i.push(o);
  26854. break;
  26855. default:
  26856. for (r = 0; r < t.length; r++)
  26857. o = t[r],
  26858. i.push(o)
  26859. }
  26860. for (r = 0; r < i.length; r++)
  26861. o = i[r],
  26862. this.canIncludeDescriptor(o) || (i[r] = null)
  26863. }
  26864. ),
  26865. h.prototype.canIncludeDescriptor = function(e) {
  26866. return e.status !== i.Downloading && e.status !== i.Downloaded
  26867. }
  26868. ,
  26869. h.prototype.canIncludePano = function(e, t) {
  26870. return !e.isLoaded(t)
  26871. }
  26872. ,
  26873. h.getFOVDotThreshold = function(e) {
  26874. return Math.cos(o.Math.degToRad(e / 2))
  26875. }
  26876. ;
  26877. var y = (A._panoSpaceDir = new o.Vector3,
  26878. A._fovThreshold = -1,
  26879. A._fovThresholdNarrow = -1,
  26880. A);
  26881. function A(e, t) {
  26882. var i = A._panoSpaceDir
  26883. , n = A._fovThreshold
  26884. , r = A._fovThresholdNarrow
  26885. , o = Math.max(Math.min(i.dot(e.direction), 1), -1)
  26886. , a = Math.max(Math.min(i.dot(t.direction), 1), -1);
  26887. return e._dot = o,
  26888. t._dot = a,
  26889. 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)
  26890. }
  26891. h.sortPanoTiles = function(e, t, i) {
  26892. y._panoSpaceDir.copy(i),
  26893. m.getRelativeDirection(t.quaternion, y._panoSpaceDir),
  26894. y._fovThresholdNarrow = v.getFOVDotThreshold(h.DIRECTIONAL_FOV_NARROW),
  26895. y._fovThreshold = v.getFOVDotThreshold(h.DIRECTIONAL_FOV),
  26896. e.sort(y)
  26897. }
  26898. ,
  26899. h.insertSortedPanoTile = function(e, t, i, n) {
  26900. y._panoSpaceDir.copy(n),
  26901. m.getRelativeDirection(i.quaternion, y._panoSpaceDir),
  26902. y._fovThresholdNarrow = v.getFOVDotThreshold(h.DIRECTIONAL_FOV_NARROW),
  26903. y._fovThreshold = v.getFOVDotThreshold(h.DIRECTIONAL_FOV);
  26904. for (var r = -1, o = 0; o < e.length; o++) {
  26905. if (y(t, e[o]) <= 0) {
  26906. r = o;
  26907. break
  26908. }
  26909. }
  26910. if (-1 === r)
  26911. e[e.length] = t;
  26912. else {
  26913. for (var a = e.length; r < a; a--)
  26914. e[a] = e[a - 1];
  26915. e[r] = t
  26916. }
  26917. }
  26918. ,
  26919. h.prototype.setZoomingActive = function(e) {
  26920. e !== this.zoomingActive && (this.zoomingActive = e)
  26921. }
  26922. ,
  26923. C.exports = h
  26924. }
  26925. ).call(this, "/js/tile/TilePrioritizer.js")
  26926. }
  26927. , {
  26928. "../enum/DownloadStatus": 24,
  26929. "../enum/GLCubeFaces": 25,
  26930. "../enum/ModelManagerEvents": 33,
  26931. "../enum/PanoSizeClass": 36,
  26932. "../enum/Vectors": 50,
  26933. "../enum/Viewmode": 51,
  26934. "../objects/Panorama": 148,
  26935. "../settings": 166,
  26936. "../util/browser": 182,
  26937. "../util/logger": 189,
  26938. "../util/math": 190,
  26939. "./TileUtils": 174,
  26940. events: 202,
  26941. three: 217
  26942. }],
  26943. 173: [function(e, t, i) {
  26944. "use strict";
  26945. function f(e, t) {
  26946. this.levels = t,
  26947. this.tileSize = e,
  26948. this.root = null,
  26949. this.allNodes = [],
  26950. function(e) {
  26951. e.root = function e(t, i, n) {
  26952. if (n > t.levels)
  26953. return null;
  26954. var r = new a(t,i);
  26955. t.allNodes.push(r);
  26956. for (var o = 0; o < s; o++)
  26957. r.children[o] = e(t, r, n + 1);
  26958. return r
  26959. }(e, null, 0)
  26960. }(this)
  26961. }
  26962. function a(e, t) {
  26963. this.tree = e,
  26964. this.parent = t,
  26965. this.children = [],
  26966. this.id = ++n
  26967. }
  26968. var g = (e("three"),
  26969. e("./TileUtils"),
  26970. e("../objects/Panorama"),
  26971. e("../util/panorama"),
  26972. e("events").EventEmitter,
  26973. 2)
  26974. , s = g * g;
  26975. f.TraversalType = Object.freeze({
  26976. PreOrder: 0,
  26977. PostOrder: 1
  26978. });
  26979. var n = 0;
  26980. f.getLevelCountForSize = function(e, t) {
  26981. var i = 0;
  26982. for (t < e && (t = e); !((t /= g) < e); )
  26983. i++;
  26984. return i
  26985. }
  26986. ,
  26987. f.getSizeForLevel = function(e, t) {
  26988. return Math.pow(g, t) * e
  26989. }
  26990. ,
  26991. f.prototype.getSubNode = function(e, t, i) {
  26992. (!t || e < this.tileSize) && (t = 0),
  26993. (!i || e < this.tileSize) && (i = 0),
  26994. e < this.tileSize && (e = this.tileSize);
  26995. var n = f.getLevelCountForSize(this.tileSize, e);
  26996. return function e(t, i, n, r, o) {
  26997. if (!t)
  26998. return null;
  26999. if (0 === n)
  27000. return t;
  27001. if (!t.children || 0 === t.children.length)
  27002. return null;
  27003. var a = Math.pow(g, n) / g
  27004. , s = r % a
  27005. , l = o % a
  27006. , c = Math.floor(o / a)
  27007. , h = Math.floor(r / a)
  27008. , u = c * g + h;
  27009. return e(t.children[u], i + 1, n - 1, s, l)
  27010. }(this.root, 0, n, t, i)
  27011. }
  27012. ,
  27013. f.prototype.breadthFirst = function(e) {
  27014. var t = !!(e = e || {}).nullLevelEnd
  27015. , i = e.maxLevel
  27016. , n = e.minLevel
  27017. , r = e.callback
  27018. , o = e.saveVisited
  27019. , a = []
  27020. , s = {}
  27021. , l = 0;
  27022. for (a.push(this.root),
  27023. a.push(s); 0 < a.length && !(i && i < l); ) {
  27024. var c = a.shift();
  27025. if (c === s)
  27026. (!n || n <= l) && (r && t && r(null),
  27027. o && t && o.push(null)),
  27028. 0 < a.length && a.push(s),
  27029. l++,
  27030. 0;
  27031. else {
  27032. if (c.children)
  27033. for (var h = 0; h < c.children.length; h++) {
  27034. c.children[h] && a.push(c.children[h])
  27035. }
  27036. var u = this.getFaceIndexFromNode(c);
  27037. (!n || n <= l) && (r && r(c, l, u),
  27038. o && o.push(c)),
  27039. 0
  27040. }
  27041. }
  27042. }
  27043. ,
  27044. f.prototype.getFaceIndexFromNode = function(e) {
  27045. if (!e)
  27046. return -1;
  27047. for (var t = 1, i = e, n = 0, r = 0; ; ) {
  27048. var o = i.parent;
  27049. if (!o)
  27050. break;
  27051. for (var a = -1, s = 0; s < o.children.length; s++)
  27052. o.children[s] === i && (a = s);
  27053. n = a % g * t + n,
  27054. r = Math.floor(a / g) * t + r,
  27055. t *= g,
  27056. i = o
  27057. }
  27058. return r * t + n
  27059. }
  27060. ,
  27061. f.prototype.depthFirst = function(e, t, i) {
  27062. !function e(t, i, n, r, o, a, s, l) {
  27063. if (t) {
  27064. s = s || f.TraversalType.PreOrder;
  27065. var c = r * g + n;
  27066. if (s === f.TraversalType.PreOrder && (o && o(t, i, c, n, r),
  27067. a && a.push(t)),
  27068. t.children && 0 !== t.children.length) {
  27069. for (var h = r * g, u = n * g, d = 0; d < g; d++)
  27070. for (var p = 0; p < g; p++)
  27071. e(t.children[p * g + d], i + 1, u + d, h + p, o, a, s, l);
  27072. s === f.TraversalType.PostOrder && (o && o(t, i, c, n, r),
  27073. a && a.push(t))
  27074. }
  27075. }
  27076. }(this.root, 0, 0, 0, e, t, i, this.tileSize)
  27077. }
  27078. ,
  27079. t.exports = f
  27080. }
  27081. , {
  27082. "../objects/Panorama": 148,
  27083. "../util/panorama": 191,
  27084. "./TileUtils": 174,
  27085. events: 202,
  27086. three: 217
  27087. }],
  27088. 174: [function(e, t, i) {
  27089. "use strict";
  27090. var n, a, s, p, f, g, E, l, c, h, u, d, r, o, m = e("../enum/GLCubeFaces"), _ = e("../util/MathLight"), b = {};
  27091. b.TILE_SIZE = 512,
  27092. b.FACES_PER_PANO = 6,
  27093. b.LocationOnTile = {
  27094. Center: 0,
  27095. UpperLeft: 1,
  27096. UpperRight: 2,
  27097. LowerRight: 3,
  27098. LowerLeft: 4
  27099. },
  27100. b.getTileVector = function(e, t, i, n, r, o, a, s) {
  27101. var l = e / t
  27102. , c = t / e * 2
  27103. , h = c / 2
  27104. , u = n / l * 2 - 1 + h
  27105. , d = (r = l - 1 - r) / l * 2 - 1 + h;
  27106. switch (o = o || b.LocationOnTile.Center) {
  27107. case b.LocationOnTile.UpperLeft:
  27108. u -= h,
  27109. d += h,
  27110. u += a * c;
  27111. break;
  27112. case b.LocationOnTile.UpperRight:
  27113. u += h,
  27114. d += h,
  27115. d -= a * c;
  27116. break;
  27117. case b.LocationOnTile.LowerRight:
  27118. u += h,
  27119. d -= h,
  27120. u -= a * c;
  27121. break;
  27122. case b.LocationOnTile.LowerLeft:
  27123. u -= h,
  27124. d -= h,
  27125. d += a * c;
  27126. break;
  27127. case b.LocationOnTile.Center:
  27128. }
  27129. switch (i) {
  27130. case m.GL_TEXTURE_CUBE_MAP_POSITIVE_X:
  27131. _.setVector(s, -1, d, -u);
  27132. break;
  27133. case m.GL_TEXTURE_CUBE_MAP_NEGATIVE_X:
  27134. _.setVector(s, 1, d, u);
  27135. break;
  27136. case m.GL_TEXTURE_CUBE_MAP_POSITIVE_Y:
  27137. _.setVector(s, -u, 1, -d);
  27138. break;
  27139. case m.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y:
  27140. _.setVector(s, -u, -1, d);
  27141. break;
  27142. case m.GL_TEXTURE_CUBE_MAP_POSITIVE_Z:
  27143. _.setVector(s, -u, d, 1);
  27144. break;
  27145. case m.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z:
  27146. _.setVector(s, u, d, -1)
  27147. }
  27148. _.normalize(s)
  27149. }
  27150. ,
  27151. b.getFaceForTile = function(e, t) {
  27152. var i = b.TILE_SIZE;
  27153. e < b.TILE_SIZE && (i = e);
  27154. var n = Math.floor(e / i)
  27155. , r = n * n;
  27156. return Math.floor(t / r)
  27157. }
  27158. ,
  27159. b.getTileLocation = function(e, t, i) {
  27160. var n = b.TILE_SIZE;
  27161. e < b.TILE_SIZE && (n = e);
  27162. var r = b.getFaceForTile(e, t)
  27163. , o = Math.floor(e / n)
  27164. , a = t - r * (o * o);
  27165. i.tileX = a % o,
  27166. i.tileY = Math.floor(a / o),
  27167. i.face = r,
  27168. i.faceTileIndex = a
  27169. }
  27170. ,
  27171. b.getTileCountForSize = function(e) {
  27172. if (e <= b.TILE_SIZE)
  27173. return b.FACES_PER_PANO;
  27174. var t = Math.floor(e / b.TILE_SIZE);
  27175. return t * t * b.FACES_PER_PANO
  27176. }
  27177. ,
  27178. b.getRelativeDirection = (r = new _.Matrix4,
  27179. o = new _.Quaternion,
  27180. function(e, t) {
  27181. o.copy(e),
  27182. o.inverse(),
  27183. r.makeRotationFromQuaternion(o),
  27184. r.applyToVector3(t),
  27185. _.normalize(t)
  27186. }
  27187. ),
  27188. b.matchingTilesInDirection = (c = new _.Vector3,
  27189. h = new _.Vector3(0,0,-1),
  27190. u = new _.Quaternion,
  27191. l = {
  27192. face: -1,
  27193. faceTileIndex: -1,
  27194. tileX: -1,
  27195. tileY: -1
  27196. },
  27197. d = function(e, t, i) {
  27198. for (var n = b.getTileCountForSize(e), r = 0, o = 0; o < n; o++)
  27199. b.getTileLocation(e, o, l),
  27200. t && !t(l) || (r++,
  27201. i && (a = l,
  27202. i.push({
  27203. face: a.face,
  27204. faceTileIndex: a.faceTileIndex,
  27205. tileX: a.tileX,
  27206. tileY: a.tileY
  27207. })));
  27208. var a;
  27209. return r
  27210. }
  27211. ,
  27212. function(e, t, i, n, r, o) {
  27213. var a = t < b.TILE_SIZE ? t : b.TILE_SIZE;
  27214. if (b.getTileCountForSize(t),
  27215. !n && !r)
  27216. return d(t, null, o);
  27217. var s = !!r;
  27218. return r = r || n,
  27219. r = Math.max(0, Math.min(r, 360)),
  27220. n = Math.max(0, Math.min(n, 360)),
  27221. _.copyVector(i, c),
  27222. b.getRelativeDirection(e.quaternion, c),
  27223. s ? (u.setFromUnitVectors(c, h),
  27224. d(t, function(e) {
  27225. return b.isTileWithinFrustum(t, a, e.face, e.tileX, e.tileY, u, n, r)
  27226. }, o)) : d(t, function(e) {
  27227. return b.isTileWithinFOV(t, a, e.face, e.tileX, e.tileY, c, n)
  27228. }, o)
  27229. }
  27230. ),
  27231. b.isTileWithinFrustum = (E = new _.Vector3,
  27232. function(e, t, i, n, r, o, a, s) {
  27233. 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++)
  27234. if (b.getTileVector(e, t, d, n, r, y, 0, E),
  27235. _.applyQuaternionToVector(o, E),
  27236. -1e-5 <= E.z)
  27237. ;
  27238. else {
  27239. var A = -1 / E.z
  27240. , C = E.x * A
  27241. , I = E.y * A;
  27242. l < I ? p++ : I < c && f++,
  27243. h < C ? g++ : C < u && m++,
  27244. v++
  27245. }
  27246. return f !== v && p !== v && g !== v && m !== v
  27247. }
  27248. ),
  27249. b.isTileWithinFOV = (p = new _.Vector3,
  27250. f = new _.Vector3(0,1,0),
  27251. g = new _.Vector3(1,0,0),
  27252. function(e, t, i, n, r, o, a) {
  27253. var s = b.mapFaceToCubemapFace(i);
  27254. if (_.cross(o, f, g),
  27255. b.getTileVector(e, t, s, n, r, b.LocationOnTile.Center, 0, p),
  27256. b.isWithinFOV(p, o, a, null))
  27257. return !0;
  27258. for (var l = a / 360, c = Math.floor(1 / l), h = 0, u = 0; u < c; u++) {
  27259. for (var d = b.LocationOnTile.UpperLeft; d <= b.LocationOnTile.LowerLeft; d++)
  27260. if (b.getTileVector(e, t, s, n, r, d, h, p),
  27261. b.isWithinFOV(p, o, a, null))
  27262. return !0;
  27263. h += l
  27264. }
  27265. return !1
  27266. }
  27267. ),
  27268. b.isWithinFOV = (a = new _.Vector3,
  27269. s = new _.Vector3,
  27270. function(e, t, i, n) {
  27271. if (_.copyVector(e, s),
  27272. n) {
  27273. _.copyVector(n, a),
  27274. _.normalize(a);
  27275. var r = _.dot(a, e);
  27276. a.x *= r,
  27277. a.y *= r,
  27278. a.z *= r,
  27279. _.subVector(s, a)
  27280. }
  27281. var o = i / 2 * _.RADIANS_PER_DEGREE;
  27282. return Math.cos(o) <= _.dot(s, t)
  27283. }
  27284. ),
  27285. b.mapFaceToCubemapFace = (n = {
  27286. 0: m.GL_TEXTURE_CUBE_MAP_POSITIVE_Y,
  27287. 1: m.GL_TEXTURE_CUBE_MAP_POSITIVE_Z,
  27288. 2: m.GL_TEXTURE_CUBE_MAP_POSITIVE_X,
  27289. 3: m.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z,
  27290. 4: m.GL_TEXTURE_CUBE_MAP_NEGATIVE_X,
  27291. 5: m.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y
  27292. },
  27293. function(e) {
  27294. return n[e]
  27295. }
  27296. ),
  27297. t.exports = b
  27298. }
  27299. , {
  27300. "../enum/GLCubeFaces": 25,
  27301. "../util/MathLight": 176
  27302. }],
  27303. 175: [function(i, n, e) {
  27304. (function(e) {
  27305. "use strict";
  27306. function t() {
  27307. this.list = [],
  27308. this.index = {},
  27309. Object.defineProperty(this, "length", {
  27310. get: function() {
  27311. return this.list.length
  27312. }
  27313. })
  27314. }
  27315. new (i("./common"),
  27316. i("./logger"))(e),
  27317. t.prototype.forEach = function(e) {
  27318. this.list.forEach(e)
  27319. }
  27320. ,
  27321. t.prototype.add = function(e) {
  27322. this.list.push(e),
  27323. this.index[this.getIndex(e)] = e
  27324. }
  27325. ,
  27326. t.prototype.getIndex = function(e) {
  27327. throw new Error("IndexedCollection.getIndex not implemented in subclass.")
  27328. }
  27329. ,
  27330. t.prototype.extend = function(e) {
  27331. for (var t = 0; t < e.length; t++)
  27332. this.add(e[t])
  27333. }
  27334. ,
  27335. t.prototype.get = function(e) {
  27336. return this.index[e]
  27337. }
  27338. ,
  27339. t.prototype.first = function() {
  27340. return this.list[0]
  27341. }
  27342. ,
  27343. t.prototype.last = function() {
  27344. return this.list[this.list.length - 1]
  27345. }
  27346. ,
  27347. t.prototype.reIndex = function() {
  27348. this.index = {};
  27349. var t = this;
  27350. this.forEach(function(e) {
  27351. t.index[t.getIndex(e)] = e
  27352. })
  27353. }
  27354. ,
  27355. t.prototype.filter = function(e) {
  27356. var t = this.list.filter(e);
  27357. return this.reIndex(),
  27358. t
  27359. }
  27360. ,
  27361. t.prototype.reduce = function(e, t) {
  27362. return this.list.reduce(e, t)
  27363. }
  27364. ,
  27365. t.prototype.sort = function(e) {
  27366. return this.list.sort(e)
  27367. }
  27368. ,
  27369. t.prototype.indexOf = function(e) {
  27370. for (var t = 0; t < this.list.length; ++t)
  27371. if (this.list[t] === e)
  27372. return t;
  27373. return -1
  27374. }
  27375. ,
  27376. n.exports = t
  27377. }
  27378. ).call(this, "/js/util/IndexedCollection.js")
  27379. }
  27380. , {
  27381. "./common": 185,
  27382. "./logger": 189
  27383. }],
  27384. 176: [function(e, t, i) {
  27385. "use strict";
  27386. e("../constants");
  27387. var n, r, o = {};
  27388. o.RADIANS_PER_DEGREE = Math.PI / 180,
  27389. o.DEGREES_PER_RADIAN = 180 / Math.PI,
  27390. o.Vector3 = function(e, t, i) {
  27391. this.x = e || 0,
  27392. this.y = t || 0,
  27393. this.z = i || 0
  27394. }
  27395. ,
  27396. o.Matrix4 = function() {
  27397. this.elements = new Float32Array([1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1]),
  27398. 0 < arguments.length && console.error("MathLight.Matrix4: the constructor no longer reads arguments. use .set() instead.")
  27399. }
  27400. ,
  27401. o.Matrix4.prototype = {
  27402. identity: function() {
  27403. return this.set(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1),
  27404. this
  27405. },
  27406. copy: function(e) {
  27407. return this.elements.set(e.elements),
  27408. this
  27409. },
  27410. applyToVector3: function(e) {
  27411. var t = e.x
  27412. , i = e.y
  27413. , n = e.z
  27414. , r = this.elements;
  27415. return e.x = r[0] * t + r[4] * i + r[8] * n + r[12],
  27416. e.y = r[1] * t + r[5] * i + r[9] * n + r[13],
  27417. e.z = r[2] * t + r[6] * i + r[10] * n + r[14],
  27418. this
  27419. },
  27420. getInverse: function(e, t) {
  27421. var i = this.elements
  27422. , n = e.elements
  27423. , r = n[0]
  27424. , o = n[1]
  27425. , a = n[2]
  27426. , s = n[3]
  27427. , l = n[4]
  27428. , c = n[5]
  27429. , h = n[6]
  27430. , u = n[7]
  27431. , d = n[8]
  27432. , p = n[9]
  27433. , f = n[10]
  27434. , g = n[11]
  27435. , m = n[12]
  27436. , v = n[13]
  27437. , y = n[14]
  27438. , A = n[15]
  27439. , C = p * y * u - v * f * u + v * h * g - c * y * g - p * h * A + c * f * A
  27440. , I = m * f * u - d * y * u - m * h * g + l * y * g + d * h * A - l * f * A
  27441. , E = d * v * u - m * p * u + m * c * g - l * v * g - d * c * A + l * p * A
  27442. , _ = m * p * h - d * v * h - m * c * f + l * v * f + d * c * y - l * p * y
  27443. , b = r * C + o * I + a * E + s * _;
  27444. if (0 == b) {
  27445. var w = "MathLight.Matrix4.getInverse(): can't invert matrix, determinant is 0";
  27446. if (t)
  27447. throw new Error(w);
  27448. return console.warn(w),
  27449. this.identity()
  27450. }
  27451. var T = 1 / b;
  27452. return i[0] = C * T,
  27453. i[1] = (v * f * s - p * y * s - v * a * g + o * y * g + p * a * A - o * f * A) * T,
  27454. i[2] = (c * y * s - v * h * s + v * a * u - o * y * u - c * a * A + o * h * A) * T,
  27455. i[3] = (p * h * s - c * f * s - p * a * u + o * f * u + c * a * g - o * h * g) * T,
  27456. i[4] = I * T,
  27457. i[5] = (d * y * s - m * f * s + m * a * g - r * y * g - d * a * A + r * f * A) * T,
  27458. i[6] = (m * h * s - l * y * s - m * a * u + r * y * u + l * a * A - r * h * A) * T,
  27459. i[7] = (l * f * s - d * h * s + d * a * u - r * f * u - l * a * g + r * h * g) * T,
  27460. i[8] = E * T,
  27461. i[9] = (m * p * s - d * v * s - m * o * g + r * v * g + d * o * A - r * p * A) * T,
  27462. i[10] = (l * v * s - m * c * s + m * o * u - r * v * u - l * o * A + r * c * A) * T,
  27463. i[11] = (d * c * s - l * p * s - d * o * u + r * p * u + l * o * g - r * c * g) * T,
  27464. i[12] = _ * T,
  27465. i[13] = (d * v * a - m * p * a + m * o * f - r * v * f - d * o * y + r * p * y) * T,
  27466. i[14] = (m * c * a - l * v * a - m * o * h + r * v * h + l * o * y - r * c * y) * T,
  27467. i[15] = (l * p * a - d * c * a + d * o * h - r * p * h - l * o * f + r * c * f) * T,
  27468. this
  27469. },
  27470. makeRotationFromQuaternion: function(e) {
  27471. var t = this.elements
  27472. , i = e.x
  27473. , n = e.y
  27474. , r = e.z
  27475. , o = e.w
  27476. , a = i + i
  27477. , s = n + n
  27478. , l = r + r
  27479. , c = i * a
  27480. , h = i * s
  27481. , u = i * l
  27482. , d = n * s
  27483. , p = n * l
  27484. , f = r * l
  27485. , g = o * a
  27486. , m = o * s
  27487. , v = o * l;
  27488. return t[0] = 1 - (d + f),
  27489. t[4] = h - v,
  27490. t[8] = u + m,
  27491. t[1] = h + v,
  27492. t[5] = 1 - (c + f),
  27493. t[9] = p - g,
  27494. t[2] = u - m,
  27495. t[6] = p + g,
  27496. t[10] = 1 - (c + d),
  27497. t[3] = 0,
  27498. t[7] = 0,
  27499. t[11] = 0,
  27500. t[12] = 0,
  27501. t[13] = 0,
  27502. t[14] = 0,
  27503. t[15] = 1,
  27504. this
  27505. }
  27506. },
  27507. o.Quaternion = function(e, t, i, n) {
  27508. this._x = e || 0,
  27509. this._y = t || 0,
  27510. this._z = i || 0,
  27511. this._w = void 0 !== n ? n : 1
  27512. }
  27513. ,
  27514. o.Quaternion.prototype = {
  27515. get x() {
  27516. return this._x
  27517. },
  27518. set x(e) {
  27519. this._x = e
  27520. },
  27521. get y() {
  27522. return this._y
  27523. },
  27524. set y(e) {
  27525. this._y = e
  27526. },
  27527. get z() {
  27528. return this._z
  27529. },
  27530. set z(e) {
  27531. this._z = e
  27532. },
  27533. get w() {
  27534. return this._w
  27535. },
  27536. set w(e) {
  27537. this._w = e
  27538. },
  27539. copy: function(e) {
  27540. this._x = e.x,
  27541. this._y = e.y,
  27542. this._z = e.z,
  27543. this._w = e.w
  27544. },
  27545. inverse: function() {
  27546. return this.conjugate().normalize()
  27547. },
  27548. conjugate: function() {
  27549. return this._x *= -1,
  27550. this._y *= -1,
  27551. this._z *= -1,
  27552. this
  27553. },
  27554. length: function() {
  27555. return Math.sqrt(this._x * this._x + this._y * this._y + this._z * this._z + this._w * this._w)
  27556. },
  27557. normalize: function() {
  27558. var e = this.length();
  27559. return 0 === e ? (this._x = 0,
  27560. this._y = 0,
  27561. this._z = 0,
  27562. this._w = 1) : (e = 1 / e,
  27563. this._x = this._x * e,
  27564. this._y = this._y * e,
  27565. this._z = this._z * e,
  27566. this._w = this._w * e),
  27567. this
  27568. },
  27569. setFromAxisAngle: function(e, t) {
  27570. var i = t / 2
  27571. , n = Math.sin(i);
  27572. return this._x = e.x * n,
  27573. this._y = e.y * n,
  27574. this._z = e.z * n,
  27575. this._w = Math.cos(i),
  27576. this
  27577. },
  27578. setFromUnitVectors: function(e, t) {
  27579. return void 0 === n && (n = new o.Vector3),
  27580. (r = o.dot(e, t) + 1) < 1e-6 ? (r = 0,
  27581. 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),
  27582. this._x = n.x,
  27583. this._y = n.y,
  27584. this._z = n.z,
  27585. this._w = r,
  27586. this.normalize()
  27587. },
  27588. multiply: function(e) {
  27589. return this.multiplyQuaternions(this, e)
  27590. },
  27591. premultiply: function(e) {
  27592. return this.multiplyQuaternions(e, this)
  27593. },
  27594. multiplyQuaternions: function(e, t) {
  27595. var i = e._x
  27596. , n = e._y
  27597. , r = e._z
  27598. , o = e._w
  27599. , a = t._x
  27600. , s = t._y
  27601. , l = t._z
  27602. , c = t._w;
  27603. return this._x = i * c + o * a + n * l - r * s,
  27604. this._y = n * c + o * s + r * a - i * l,
  27605. this._z = r * c + o * l + i * s - n * a,
  27606. this._w = o * c - i * a - n * s - r * l,
  27607. this
  27608. }
  27609. },
  27610. o.convertWorkshopVector = function(e) {
  27611. return new o.Vector3(-e.x,e.y,e.z)
  27612. }
  27613. ,
  27614. o.convertWorkshopQuaternion = function(e) {
  27615. 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))
  27616. }
  27617. ,
  27618. o.convertWorkshopOrthoZoom = function(e) {
  27619. return -1 === e ? -1 : e * ($("#player").width() / $("#player").height()) / g_snapShotWidth * g_snapShotHeight
  27620. }
  27621. ,
  27622. o.convertWorkshopPanoramaQuaternion = function(e) {
  27623. 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))
  27624. }
  27625. ,
  27626. o.normalize = function(e) {
  27627. var t = e.x * e.x + e.y * e.y + e.z * e.z
  27628. , i = Math.sqrt(t);
  27629. e.x /= i,
  27630. e.y /= i,
  27631. e.z /= i
  27632. }
  27633. ,
  27634. o.dot = function(e, t) {
  27635. return e.x * t.x + e.y * t.y + e.z * t.z
  27636. }
  27637. ,
  27638. o.cross = function(e, t, i) {
  27639. var n = e.x
  27640. , r = e.y
  27641. , o = e.z;
  27642. i.x = r * t.z - o * t.y,
  27643. i.y = o * t.x - n * t.z,
  27644. i.z = n * t.y - r * t.x
  27645. }
  27646. ,
  27647. o.setVector = function(e, t, i, n) {
  27648. e.x = t,
  27649. e.y = i,
  27650. e.z = n
  27651. }
  27652. ,
  27653. o.copyVector = function(e, t) {
  27654. t.x = e.x,
  27655. t.y = e.y,
  27656. t.z = e.z
  27657. }
  27658. ,
  27659. o.addVector = function(e, t) {
  27660. e.x += t.x,
  27661. e.y += t.y,
  27662. e.z += t.z
  27663. }
  27664. ,
  27665. o.subVector = function(e, t) {
  27666. e.x -= t.x,
  27667. e.y -= t.y,
  27668. e.z -= t.z
  27669. }
  27670. ,
  27671. o.applyQuaternionToVector = function(e, t) {
  27672. var i = t.x
  27673. , n = t.y
  27674. , r = t.z
  27675. , o = e.x
  27676. , a = e.y
  27677. , s = e.z
  27678. , l = e.w
  27679. , c = l * i + a * r - s * n
  27680. , h = l * n + s * i - o * r
  27681. , u = l * r + o * n - a * i
  27682. , d = -o * i - a * n - s * r;
  27683. t.x = c * l + d * -o + h * -s - u * -a,
  27684. t.y = h * l + d * -a + u * -o - c * -s,
  27685. t.z = u * l + d * -s + c * -a - h * -o
  27686. }
  27687. ,
  27688. o.angleBetweenVectors = function(e, t) {
  27689. return Math.acos(o.dot(e, t))
  27690. }
  27691. ,
  27692. t.exports = o
  27693. }
  27694. , {
  27695. "../constants": 8
  27696. }],
  27697. 177: [function(c, h, e) {
  27698. (function(e) {
  27699. "use strict";
  27700. function t(e) {
  27701. this.cache = null,
  27702. this.expires = 0
  27703. }
  27704. function i() {
  27705. this.baseUrl = null,
  27706. this.cache = null,
  27707. this.expires = 0
  27708. }
  27709. function n() {
  27710. this.baseUrl = null,
  27711. this.expires = 0
  27712. }
  27713. function r(e) {
  27714. this.initialLoadingPromise = null,
  27715. this.endpoint = e + "?type=3",
  27716. this.urlContainer = null,
  27717. this.authorizationHeader = s.getAuthorizationHeader(),
  27718. this.containerClasses = [n, i, t]
  27719. }
  27720. c("./ajax");
  27721. var o = c("./logger")
  27722. , a = c("../constants")
  27723. , s = c("./showcase")
  27724. , l = (c("../ab"),
  27725. new o(e));
  27726. t.prototype = {
  27727. version: 1,
  27728. validate: function(e) {
  27729. return "catalog.json"in e && 0 < Object.keys(e).length
  27730. },
  27731. update: function(e) {
  27732. return this.cache = e,
  27733. this.expires = Date.now() + a.signedUrlDefaultExpireTime,
  27734. $.when()
  27735. },
  27736. get: function(e) {
  27737. return this.cache[e]
  27738. }
  27739. },
  27740. i.prototype = {
  27741. version: 2,
  27742. validate: function(e) {
  27743. return "catalog.json"in e && "base.url"in e && 1 < Object.keys(e).length
  27744. },
  27745. update: function(e) {
  27746. return this.baseUrl = e["base.url"],
  27747. this.cache = e,
  27748. this.expires = Date.now() + a.signedUrlDefaultExpireTime,
  27749. $.when()
  27750. },
  27751. get: function(e) {
  27752. var t = this.cache[e];
  27753. return t ? this.baseUrl.replace("{{filename}}", e) + t : null
  27754. }
  27755. },
  27756. n.prototype = {
  27757. version: 3,
  27758. validate: function(e) {
  27759. return e.templates && e.catalog_file && (!e.expires || 1e3 * e.expires > Date.now())
  27760. },
  27761. update: function(e) {
  27762. return this.baseUrl = e.templates[0],
  27763. e.expires ? this.expires = 1e3 * e.expires : this.expires = Date.now() + a.signedUrlDefaultExpireTime,
  27764. $.when()
  27765. },
  27766. get: function(e) {
  27767. return this.baseUrl.replace("{{filename}}", e)
  27768. }
  27769. },
  27770. r.prototype = {
  27771. init: function() {
  27772. return this.initialLoadingPromise || (setInterval(function() {
  27773. var e = this.urlContainer ? this.urlContainer.expires : Date.now();
  27774. Date.now() + a.signedUrlRefreshBuffer > e && (l.debug("Refreshing urls..."),
  27775. this.refresh().done(function() {
  27776. l.debug("Refreshed")
  27777. }).fail(function() {
  27778. l.error("Failed url refresh, urls might go stale soon")
  27779. }))
  27780. }
  27781. .bind(this), a.signedUrlCheckInterval),
  27782. this.initialLoadingPromise = this.refresh()),
  27783. this.initialLoadingPromise
  27784. },
  27785. refresh: function(e) {
  27786. return {},
  27787. $.Deferred().resolve()
  27788. },
  27789. get: function(e) {
  27790. return window.DATA.files.templates[0].replace("{{filename}}", e)
  27791. }
  27792. },
  27793. h.exports = r
  27794. }
  27795. ).call(this, "/js/util/ModelUrls.js")
  27796. }
  27797. , {
  27798. "../ab": 3,
  27799. "../constants": 8,
  27800. "./ajax": 181,
  27801. "./logger": 189,
  27802. "./showcase": 193
  27803. }],
  27804. 178: [function(l, c, e) {
  27805. (function(e) {
  27806. "use strict";
  27807. function t() {
  27808. i.call(this),
  27809. this.neighbourMap = {},
  27810. this.map = null
  27811. }
  27812. 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"),
  27813. l("./aStar")), T = new (l("./logger"))(e), i = l("./IndexedCollection"), s = l("./transitions");
  27814. n.inherit(t, i),
  27815. t.prototype.getIndex = function(e) {
  27816. return e.id
  27817. }
  27818. ,
  27819. t.prototype.find = function(e, t) {
  27820. var i = n.filterAll(this.list, e);
  27821. return 0 === i.length ? null : (t && t.forEach(function(e) {
  27822. i = n.stableSort(i, e)
  27823. }),
  27824. i[0])
  27825. }
  27826. ,
  27827. /* t.prototype.sortByScore = function(e, t) {
  27828. var i = n.filterAll(this.list, e);
  27829. return 0 === i.length ? null : i = i.map(function(i) {
  27830. return {
  27831. pano: i,
  27832. score: t.reduce(function(e, t) {
  27833. return e + t(i)
  27834. }, 0)
  27835. }
  27836. }).sort(function(e, t) {
  27837. return t.score - e.score
  27838. })
  27839. } */
  27840. t.prototype.sortByScore = function( request, rank){
  27841. return common.sortByScore(this.list, request, rank)
  27842. }
  27843. ,
  27844. t.prototype.lowestByScore = function(e, t, i) {
  27845. return this.findRankedByScore(0, e, t, i)
  27846. }
  27847. ,
  27848. t.prototype.findRankedByScore = function(e, t, i, n) {
  27849. n && (n.candidates = null,
  27850. n.pano = null),
  27851. e = e || 0;
  27852. var r = this.sortByScore(t, i);
  27853. return !r || 0 === r.length || e >= r.length ? null : (n && (n.candidates = r,
  27854. n.pano = r[e].item),
  27855. r[e].item)
  27856. }
  27857. ,
  27858. t.prototype.showPanoScores = function(e) {
  27859. this.list.forEach(function(e) {
  27860. e.removeTextSprite()
  27861. });
  27862. var t = 6344768;
  27863. e.forEach(function(e) {
  27864. e.pano.addTextSprite(e.score.toFixed(2), t),
  27865. t = 16428055
  27866. })
  27867. }
  27868. ,
  27869. t.prototype.isNeighbour = function(e, t) {
  27870. return this.neighbourMap[e.id][t.id]
  27871. }
  27872. ,
  27873. t.prototype.getNeighbours = function(e) {
  27874. return this.neighbourMap[e.id]
  27875. }
  27876. ,
  27877. t.prototype.setNeighbour = function(e, t, i) {
  27878. return this.neighbourMap[e.id] || (this.neighbourMap[e.id] = {}),
  27879. this.neighbourMap[t.id] || (this.neighbourMap[t.id] = {}),
  27880. this.neighbourMap[e.id][e.id] = !0,
  27881. this.neighbourMap[t.id][t.id] = !0,
  27882. this.neighbourMap[e.id][t.id] = i,
  27883. this.neighbourMap[t.id][e.id] = i,
  27884. this.neighbourMap[e.id]
  27885. }
  27886. ,
  27887. t.prototype.findClosest = function(e, t) {
  27888. var i = [r.filters.isPanoAligned()];
  27889. return t && i.push(r.filters.inDirection(e, t, .75)),
  27890. this.find(i, [r.sortFunctions.distanceToPoint(e)])
  27891. }
  27892. ,
  27893. t.prototype.dualNeighbors = function(e, t) {
  27894. var i, n = [];
  27895. for (i in this.neighbourMap[e.id])
  27896. this.neighbourMap[t.id][i] && n.push(i);
  27897. return n
  27898. }
  27899. ,
  27900. t.prototype.populate_path_graph = function() {
  27901. var e, t, i, n, r, o, a, s, l = Date.now(), c = {}, h = 0, u = new w.Vector3(0,0,0);
  27902. for (e = 0; e < this.list.length; e += 1) {
  27903. for (t in s = !(a = {}),
  27904. i = (r = this.list[e]).neighbourPanos || r.findNeighourPanos())
  27905. if (i[t]) {
  27906. o = this.index[t],
  27907. u.copy(r.floorPosition),
  27908. u.sub(o.floorPosition);
  27909. var d = Math.sqrt(u.x * u.x + u.z * u.z)
  27910. , p = (Math.abs(u.y),
  27911. Math.max(d, .01),
  27912. Math.max(0, Math.abs(u.y) - .2));
  27913. n = 0 < p ? (1,
  27914. p = Math.pow(4 * p, 2),
  27915. d = Math.pow(d, 2),
  27916. Math.sqrt(p * p + d * d)) : (1,
  27917. u.length()),
  27918. a[o.id] = n,
  27919. s = !0
  27920. }
  27921. s ? c[r.id] = a : h += 1
  27922. }
  27923. this.map = c,
  27924. T.info("graph ready in " + (Date.now() - l) + "ms, " + h + " had no neighbors")
  27925. }
  27926. ,
  27927. t.prototype.aStarSearch = function(e, t) {
  27928. var i = Date.now()
  27929. , n = new o({
  27930. start: e,
  27931. isEnd: function(e) {
  27932. return e === t
  27933. },
  27934. neighbor: function(e) {
  27935. var t = e.neighbourPanos || e.findNeighourPanos()
  27936. , i = [];
  27937. for (var n in t)
  27938. t[n] && i.push(this.index[n]); //add: t[n] &&
  27939. return i
  27940. }
  27941. .bind(this),
  27942. distance: function(e, t) {
  27943. return this.map[e.id][t.id]
  27944. }
  27945. .bind(this),
  27946. heuristic: function(e, t) {
  27947. return 1
  27948. }
  27949. .bind(this),
  27950. hash: function(e) {
  27951. return e.id
  27952. },
  27953. timeout: 5e3
  27954. });
  27955. if (T.debug("A* search in " + (Date.now() - i) + "ms"),
  27956. "success" !== n.status)
  27957. return T.debug("Did not find A* path from " + e + " to " + t),
  27958. null;
  27959. T.debug("Total cost " + n.cost.toPrecision(3) + ", " + n.path.length + " steps");
  27960. var r = [];
  27961. return n.path.forEach(function(e) {
  27962. r.push(e.id)
  27963. }),
  27964. r
  27965. }
  27966. ,
  27967. t.prototype.includeNodesNearPath = (f = new w.Vector3,
  27968. g = new w.Vector3,
  27969. m = new w.Vector3,
  27970. v = new w.Vector3,
  27971. y = new w.Vector3,
  27972. A = new w.Vector3,
  27973. C = new w.Vector3,
  27974. I = new w.Vector3,
  27975. E = [],
  27976. _ = new w.Vector3,
  27977. b = new w.Vector3,
  27978. function(e, t) {
  27979. if (e)
  27980. for (var i = function(e, t, i) {
  27981. return y.copy(t).sub(e),
  27982. y.dot(i)
  27983. }, n = function(e, t) {
  27984. return i(_, e.position, m) - i(_, t.position, m)
  27985. }, r = 0; r < e.length - 1; ) {
  27986. var o = e[r]
  27987. , a = e[r + 1]
  27988. , s = this.index[o]
  27989. , l = this.index[a];
  27990. _.copy(s.position),
  27991. b.copy(l.position),
  27992. E.length = 0,
  27993. f.copy(b).sub(_),
  27994. m.copy(f).normalize();
  27995. for (var c = 0; c < this.list.length; c++) {
  27996. var h = this.list[c];
  27997. y.copy(h.position).sub(_);
  27998. var u = y.dot(m);
  27999. 0 < u && (C.copy(m),
  28000. C.multiplyScalar(u),
  28001. A.copy(y),
  28002. A.sub(C),
  28003. A.length() < t && (g.copy(f).negate(),
  28004. v.copy(g).normalize(),
  28005. I.copy(h.position).sub(b),
  28006. 0 < I.dot(v) && E.push(h)))
  28007. }
  28008. if (0 < E.length) {
  28009. E.sort(n);
  28010. for (var d = e.length + E.length - 1; d >= r + E.length; d--)
  28011. e[d] = e[d - E.length];
  28012. for (var p = 0; p < E.length; p++)
  28013. e[p + r + 1] = E[p].id
  28014. }
  28015. r += E.length + 1
  28016. }
  28017. }
  28018. ),
  28019. /* t.prototype.fadeMarkerOpacity = function(e, t) {
  28020. var i = void 0 === e ? a.panorama.markerOpacity : e
  28021. , n = this.list.findIndex(function(e) {
  28022. return e.marker
  28023. });
  28024. if (!(n < 0)) {
  28025. var r = this.list[n].marker.material.opacity;
  28026. if (r !== e) {
  28027. var o = i - r;
  28028. s.trigger({
  28029. func: function(e, t) {
  28030. var i = r + e * o;
  28031. this.forEach(function(e) {
  28032. e.marker && (e.marker.material.opacity = i)
  28033. })
  28034. }
  28035. .bind(this),
  28036. duration: void 0 === t ? a.markerOpacityTransitionTime : t,
  28037. name: "_fpm"
  28038. })
  28039. }
  28040. }
  28041. } */
  28042. t.prototype.fadeMarkerOpacity = function(e, t, gr) {
  28043. s.cancelById('fadeMarkerOpacity')
  28044. var n = this.list.findIndex(function (e) {
  28045. //why? 难道没有marker的pano吗 findeIndex:获取数组中函数返回值不为fasle的第一个元素索引位置
  28046. return e.marker
  28047. })
  28048. if (n < 0) {
  28049. //logger.info('marker findIndex<0')
  28050. return
  28051. }
  28052. var group
  28053. var tran = function (list, index) {
  28054. list.member = list.member.filter(function (m) {
  28055. return m.marker && m.marker.material.opacity != list.toOp
  28056. })
  28057. s.trigger({
  28058. func: function (e, t) {
  28059. //e:0-1
  28060. list.member.forEach(function (m) {
  28061. var o = m.marker.oldOpacity
  28062. var i = o + e * (list.toOp - o)
  28063. m.marker && (m.marker.material.opacity = i)
  28064. })
  28065. }.bind(this),
  28066. duration: void 0 == t ? a.markerOpacityTransitionTime : t,
  28067. name: '_fpm_' + index,
  28068. id: 'fadeMarkerOpacity',
  28069. })
  28070. }
  28071. this.forEach(function (e) {
  28072. //先记录旧的opacity
  28073. e.marker && (e.marker.oldOpacity = e.marker.material.opacity)
  28074. })
  28075. group = gr
  28076. /* if (e > 0 && gr) {
  28077. group = gr
  28078. } else {
  28079. group = [
  28080. {
  28081. member: this.list,
  28082. toOp: 0,
  28083. },
  28084. ]
  28085. } */
  28086. for (var i = 0; i < group.length; i++) {
  28087. tran(group[i], i)
  28088. }
  28089. }
  28090. ,
  28091. c.exports = t
  28092. }
  28093. ).call(this, "/js/util/PanoramaCollection.js")
  28094. }
  28095. , {
  28096. "../objects/Panorama": 148,
  28097. "../settings": 166,
  28098. "./IndexedCollection": 175,
  28099. "./aStar": 180,
  28100. "./common": 185,
  28101. "./logger": 189,
  28102. "./transitions": 195,
  28103. three: 217
  28104. }],
  28105. 179: [function(e, t, i) {
  28106. "use strict";
  28107. function n() {
  28108. this.actionSequence = [],
  28109. this.actionSequenceInProgress = !1
  28110. }
  28111. function r(e, t, i, n) {
  28112. c.trackAlways("zoom_" + e, {
  28113. from: t,
  28114. to: i,
  28115. pano: n
  28116. })
  28117. }
  28118. var o, a, s, l, c = e("../analytics");
  28119. n.prototype.reset = function(e) {
  28120. this.actionSequenceInProgress = !1,
  28121. this.actionSequence.length = 0
  28122. }
  28123. ,
  28124. n.prototype.addZoomAction = (a = o = null,
  28125. s = !1,
  28126. l = function() {
  28127. if (o = null,
  28128. 0 < this.actionSequence.length) {
  28129. var e = this.actionSequence[0].start
  28130. , t = this.actionSequence[this.actionSequence.length - 1].end;
  28131. 1 === e ? function(e, t) {
  28132. r("initial", 1, e, t)
  28133. }(t, a) : function(e, t, i) {
  28134. r("followup", e, t, i)
  28135. }(e, t, a)
  28136. }
  28137. this.reset()
  28138. }
  28139. ,
  28140. function(e, t, i) {
  28141. if (e !== t) {
  28142. s || (l = l.bind(this),
  28143. s = !0),
  28144. o && (window.clearTimeout(o),
  28145. o = null),
  28146. i === a && this.actionSequenceInProgress || (this.reset(),
  28147. a = i),
  28148. this.actionSequenceInProgress = !0;
  28149. var n = {
  28150. start: e,
  28151. end: t
  28152. };
  28153. this.actionSequence.push(n),
  28154. o = window.setTimeout(l, 150)
  28155. }
  28156. }
  28157. ),
  28158. t.exports = n
  28159. }
  28160. , {
  28161. "../analytics": 4
  28162. }],
  28163. 180: [function(e, t, i) {
  28164. "use strict";
  28165. function g(e) {
  28166. if (void 0 === e.parent)
  28167. return [e.data];
  28168. var t = g(e.parent);
  28169. return t.push(e.data),
  28170. t
  28171. }
  28172. function m(e) {
  28173. return e.toString()
  28174. }
  28175. function v(e, t) {
  28176. return e.f - t.f
  28177. }
  28178. var y = e("Set")
  28179. , A = e("heap")
  28180. , C = e("dict");
  28181. t.exports = function(e) {
  28182. void 0 === e.timeout && (e.timeout = 1 / 0);
  28183. var t = e.hash || m
  28184. , i = {
  28185. data: e.start,
  28186. g: 0,
  28187. h: e.heuristic(e.start)
  28188. }
  28189. , n = i;
  28190. i.f = i.h;
  28191. var r = new y
  28192. , o = new A(v)
  28193. , a = C();
  28194. o.push(i),
  28195. a.set(t(i.data), i);
  28196. for (var s = new Date; o.size(); ) {
  28197. if (new Date - s > e.timeout)
  28198. return {
  28199. status: "timeout",
  28200. cost: n.g,
  28201. path: g(n)
  28202. };
  28203. var l = o.pop();
  28204. if (a.delete(t(l.data)),
  28205. e.isEnd(l.data))
  28206. return {
  28207. status: "success",
  28208. cost: l.g,
  28209. path: g(l)
  28210. };
  28211. r.add(t(l.data));
  28212. for (var c = e.neighbor(l.data), h = 0; h < c.length; h++) {
  28213. var u = c[h];
  28214. if (!r.contains(t(u))) {
  28215. var d = l.g + e.distance(l.data, u)
  28216. , p = a.get(t(u))
  28217. , f = !1;
  28218. if (void 0 === p)
  28219. p = {
  28220. data: u
  28221. },
  28222. a.set(t(u), p);
  28223. else {
  28224. if (p.g < d)
  28225. continue;
  28226. f = !0
  28227. }
  28228. p.parent = l,
  28229. p.g = d,
  28230. p.h = e.heuristic(u),
  28231. p.f = d + p.h,
  28232. p.h < n.h && (n = p),
  28233. f ? o.heapify() : o.push(p)
  28234. }
  28235. }
  28236. }
  28237. return {
  28238. status: "noPath",
  28239. cost: n.g,
  28240. path: g(n)
  28241. }
  28242. }
  28243. }
  28244. , {
  28245. Set: 196,
  28246. dict: 210,
  28247. heap: 211
  28248. }],
  28249. 181: [function(i, n, e) {
  28250. (function(e) {
  28251. "use strict";
  28252. function s(e, t, i) {
  28253. function n() {
  28254. l.warn("Retrying ", t),
  28255. s(e, t, i).done(a.resolve.bind(a)).progress(a.notify.bind(a)).fail(a.reject.bind(a))
  28256. }
  28257. var r = function(e, t, i) {
  28258. var n = new XMLHttpRequest;
  28259. if (i && "withCredentials"in n)
  28260. n.open(e, t, i);
  28261. else if ("undefined" != typeof XDomainRequest)
  28262. (n = new XDomainRequest).open(e, t);
  28263. else {
  28264. if (i)
  28265. throw "Browser does not support CORS!";
  28266. n.open(e, t)
  28267. }
  28268. return n
  28269. }(e, t, !1);
  28270. if ((i = i || {}).retries = void 0 !== i.retries ? i.retries : 0,
  28271. i.retry = void 0 !== i.retry ? i.retry : "get" === e.toLowerCase(),
  28272. i.responseType)
  28273. if (-1 < ["arraybuffer", "text", "json"].indexOf(i.responseType))
  28274. r.responseType = i.responseType;
  28275. else {
  28276. if ("image/jpeg" !== i.responseType)
  28277. throw new Error('reponseType can only be one of "arraybuffer", "text" or "json", "image/jpeg"');
  28278. r.responseType = "arraybuffer"
  28279. }
  28280. if ("json" === i.responseType && r.setRequestHeader("Accept", "application/json"),
  28281. i.auth && r.setRequestHeader("Authorization", i.auth),
  28282. "object" == typeof i.data && (i.data = JSON.stringify(i.data),
  28283. r.setRequestHeader("Content-Type", "application/json")),
  28284. "object" == typeof i.headers)
  28285. for (var o in i.headers)
  28286. r.setRequestHeader(o, i.headers[o]);
  28287. var a = $.Deferred();
  28288. return r.onreadystatechange = function(e) {
  28289. if (4 === this.readyState)
  28290. if (500 <= this.status && this.status <= 600 && i.retry && i.retries < 3)
  28291. i.retries++,
  28292. setTimeout(n, 1e3);
  28293. else if (200 === this.status) {
  28294. var t = function(e, t) {
  28295. var i = e.response;
  28296. if ("json" === t && "object" != typeof i)
  28297. try {
  28298. i = JSON.parse(e.responseText)
  28299. } catch (e) {
  28300. return void a.reject({
  28301. error: "Failed parsing JSON"
  28302. })
  28303. }
  28304. else if ("image/jpeg" === t) {
  28305. var n = new Uint8Array(e.response)
  28306. , r = new Blob([n],{
  28307. type: "image/jpeg"
  28308. })
  28309. , o = URL.createObjectURL(r);
  28310. (i = new Image).src = o,
  28311. i.crossOrigin = "Anonymous",
  28312. i.onload = function() {
  28313. URL.revokeObjectURL(o)
  28314. }
  28315. }
  28316. return i
  28317. }(this, i.responseType);
  28318. a.resolve(t)
  28319. } else
  28320. a.reject(this)
  28321. }
  28322. ,
  28323. r.onprogress = function(e) {
  28324. a.notify(e)
  28325. }
  28326. ,
  28327. r.send(i.data),
  28328. a.promise()
  28329. }
  28330. function o(e, t) {
  28331. var i = e + "__" + (t.responseType || null) + "__" + (t.auth || null) + "__" + (t.prefetchFrom || null);
  28332. return t.headers && function(t) {
  28333. return Object.keys(t).sort().map(function(e) {
  28334. return {
  28335. key: e,
  28336. value: t[e]
  28337. }
  28338. })
  28339. }(t.headers).forEach(function(e) {
  28340. i += "__" + e.key + ":" + e.value
  28341. }),
  28342. i
  28343. }
  28344. var t = i("./logger")
  28345. , a = i("../ab")
  28346. , l = new t(e);
  28347. window.URL = window.URL || window.webkitURL,
  28348. window.MP_REQUEST_CACHE = window.MP_REQUEST_CACHE || {},
  28349. window.DATA = window.DATA || {},
  28350. n.exports = {
  28351. get: function(e, t) {
  28352. var i, n = void 0 === (t = t || {}).cache || t.cache;
  28353. if (n) {
  28354. var r = function(e, t) {
  28355. return window.MP_REQUEST_CACHE ? window.MP_REQUEST_CACHE[o(e, t)] : null
  28356. }(e, t);
  28357. if (r)
  28358. return r
  28359. }
  28360. return i = t.prefetchFrom && window.DATA[t.prefetchFrom] ? $.when(window.DATA[t.prefetchFrom]) : s("GET", e, t),
  28361. n && function(e, t, i) {
  28362. window.MP_REQUEST_CACHE && (window.MP_REQUEST_CACHE[o(e, t)] = i)
  28363. }(e, t, i),
  28364. i
  28365. },
  28366. post: function(e, t) {
  28367. return s("POST", e, t)
  28368. },
  28369. patch: function(e, t) {
  28370. return s("PATCH", e, t)
  28371. },
  28372. getImage: function(e, t) {
  28373. function i() {
  28374. l.warn("Retrying ", e),
  28375. o.getImage(e, t - 1).done(n.resolve.bind(n)).progress(n.notify.bind(n)).fail(n.reject.bind(n))
  28376. }
  28377. var n = $.Deferred()
  28378. , r = new Image
  28379. , o = this;
  28380. return e = a.changeIfImageOptimzing(e),
  28381. null != t || (t = 3),
  28382. r.onerror = function() {
  28383. 0 < t ? setTimeout(i, 1e3) : n.reject()
  28384. }
  28385. ,
  28386. r.onload = function() {
  28387. n.resolve(r)
  28388. }
  28389. ,
  28390. r.crossOrigin = "anonymous",
  28391. r.src = e,
  28392. n
  28393. }
  28394. }
  28395. }
  28396. ).call(this, "/js/util/ajax.js")
  28397. }
  28398. , {
  28399. "../ab": 3,
  28400. "./logger": 189
  28401. }],
  28402. 182: [function(e, t, i) {
  28403. "use strict";
  28404. function n(e, t) {
  28405. var i = window.navigator.userAgent.match(e);
  28406. return i = i ? i[1].split(t) : [],
  28407. {
  28408. major: parseInt(i[0]) || 0,
  28409. minor: parseInt(i[1]) || 0,
  28410. patch: parseInt(i[2]) || 0
  28411. }
  28412. }
  28413. var r = e("../exception/DeviceMismatchException");
  28414. t.exports = {
  28415. supportsFullscreen: function() {
  28416. return document.fullscreenEnabled || document.mozFullscreenEnabled || document.mozFullScreenEnabled || document.webkitFullscreenEnabled || document.msFullscreenEnabled
  28417. },
  28418. isPointerLocked: function() {
  28419. return document.pointerLockElement || document.mozPointerLockElement || document.webkitPointerLockElement
  28420. },
  28421. requestFullscreen: function(e, t) {
  28422. e.requestFullscreen ? e.requestFullscreen() : e.mozRequestFullScreen ? e.mozRequestFullScreen() : e.webkitRequestFullscreen ? e.webkitRequestFullscreen(Element.ALLOW_KEYBOARD_INPUT) : e.msRequestFullscreen && e.msRequestFullscreen(),
  28423. t && $(document).on("fullscreenchange webkitfullscreenchange mozfullscreenchange MSFullscreenChange", browser.requestPointerLock)
  28424. },
  28425. requestPointerLock: function() {
  28426. var e;
  28427. if (document.fullscreenElement)
  28428. e = document.fullscreenElement();
  28429. else if (document.mozFullscreenElement)
  28430. e = document.mozFullscreenElement();
  28431. else if (document.mozFullScreenElement)
  28432. e = document.mozFullScreenElement();
  28433. else {
  28434. if (!document.webkitFullscreenElement)
  28435. return;
  28436. e = document.webkitFullscreenElement()
  28437. }
  28438. e.requestPointerLock = e.requestPointerLock || e.mozRequestPointerLock || e.webkitRequestPointerLock,
  28439. e.requestPointerLock(),
  28440. $(document).off("fullscreenchange webkitfullscreenchange mozfullscreenchange MSFullscreenChange", this)
  28441. },
  28442. exitPointerLock: function() {
  28443. document.exitPointerLock = document.exitPointerLock || document.mozExitPointerLock || document.webkitExitPointerLock,
  28444. document.exitPointerLock()
  28445. },
  28446. exitFullscreen: function() {
  28447. document.exitFullscreen ? document.exitFullscreen() : document.msExitFullscreen ? document.msExitFullscreen() : document.mozCancelFullScreen ? document.mozCancelFullScreen() : document.webkitExitFullscreen && document.webkitExitFullscreen()
  28448. },
  28449. details: function() {
  28450. var e = navigator.userAgent.match("(Firefox|Chrome|Safari)/([\\d]+)");
  28451. return e ? {
  28452. name: e[1],
  28453. version: parseInt(e[2]),
  28454. platform: navigator.platform
  28455. } : {}
  28456. },
  28457. is: function(e) {
  28458. return this.details() && this.details().name === e
  28459. },
  28460. inIframe: function() {
  28461. return window.parent !== window
  28462. },
  28463. aspectRatio: function() {
  28464. var e = $("#player").width() / $("#player").height();
  28465. return isFinite(e) ? e : 0
  28466. },
  28467. userAgent: function() {
  28468. return window.navigator.userAgent
  28469. },
  28470. isLandscape: function() {
  28471. return this.isMobile && 1 < this.aspectRatio()
  28472. },
  28473. isSmallScreen: function() {
  28474. return screen.width / window.devicePixelRatio < 240
  28475. },
  28476. detectIE: function() {
  28477. return -1 !== window.navigator.userAgent.indexOf("MSIE ") || !!navigator.userAgent.match(/Trident.*rv\:11\./)
  28478. },
  28479. detectSafari: function() {
  28480. return -1 !== window.navigator.userAgent.indexOf("Safari") && !this.detectChrome()
  28481. },
  28482. detectFirefox: function() {
  28483. return -1 !== window.navigator.userAgent.indexOf("Firefox")
  28484. },
  28485. detectChrome: function() {
  28486. return -1 !== window.navigator.userAgent.indexOf("Chrome") && !this.detectOpera()
  28487. },
  28488. detectOpera: function() {
  28489. return -1 !== window.navigator.userAgent.indexOf("OPR")
  28490. },
  28491. detectIOS: function() {
  28492. return this.detectIPhone() || this.detectIPad() || this.detectIPod()
  28493. },
  28494. detectIPad: function() {
  28495. var e = window.navigator.userAgent;
  28496. return /iPad/.test(e)
  28497. },
  28498. detectIPod: function() {
  28499. var e = window.navigator.userAgent;
  28500. return /iPod/.test(e)
  28501. },
  28502. detectIPhone: function() {
  28503. var e = window.navigator.userAgent;
  28504. return /iPhone/.test(e)
  28505. },
  28506. detectAndroid: function() {
  28507. return -1 !== window.navigator.userAgent.indexOf("Android")
  28508. },
  28509. detectAndroidMobile: function() {
  28510. var e = window.navigator.userAgent;
  28511. return this.detectAndroid() && -1 !== e.indexOf("Mobile")
  28512. },
  28513. detectSamsungNative: function() {
  28514. var e = window.navigator.userAgent;
  28515. return -1 !== e.indexOf("SM-G900H") || -1 !== e.indexOf("GT-I9500") || -1 !== e.indexOf("SM-N900")
  28516. },
  28517. detectSamsungS6: function() {
  28518. return -1 !== window.navigator.userAgent.indexOf("SM-G92")
  28519. },
  28520. detectHUAWEI5X: function() {
  28521. return -1 !== window.navigator.userAgent.indexOf("KIW-TL00H")
  28522. },
  28523. detectWebVR: function() {
  28524. return !(!window.navigator.getVRDisplays || !window.VRDisplay)
  28525. },
  28526. getVRDisplay: function() {
  28527. var t = $.Deferred();
  28528. return this.detectWebVR() ? (navigator.getVRDisplays().then(function(e) {
  28529. 1 <= e.length && t.resolve(e[0]),
  28530. t.reject(null)
  28531. }),
  28532. t) : t.reject(null)
  28533. },
  28534. iosVersion: function() {
  28535. if (!this.detectIOS())
  28536. throw new r("Did not detect an iDevice");
  28537. return n(/((?:\d+\_?){1,3}) like Mac OS/, "_")
  28538. },
  28539. androidVersion: function() {
  28540. if (!this.detectAndroid())
  28541. throw new r("Did not detect an Android based device");
  28542. return n(/Android ((?:\d+\.?){1,3})/, ".")
  28543. },
  28544. valueFromCookie: function(e, t) {
  28545. var i = new RegExp(e + "=([0-9a-f]+)(; ?|$)").exec(document.cookie);
  28546. if (!i)
  28547. return t;
  28548. var n = i[1];
  28549. return "boolean" == typeof t ? "true" === n || "1" === n : "number" == typeof t ? parseFloat(n) : n
  28550. }
  28551. }
  28552. Object.assign(window.browser, t.exports)
  28553. t.exports = window.browser
  28554. }
  28555. , {
  28556. "../exception/DeviceMismatchException": 56
  28557. }],
  28558. 183: [function(i, n, e) {
  28559. (function(e) {
  28560. "use strict";
  28561. var o = i("../controls/serializer")
  28562. , a = i("../util/math")
  28563. , s = i("./browser")
  28564. , l = i("../enum/Viewmode")
  28565. , t = i("../util/logger")
  28566. , c = i("three")
  28567. , h = new t(e);
  28568. n.exports = {
  28569. getStartCameraOptions: function(e, t) {
  28570. var i = function(e) {
  28571. var t = s.valueFromHash("start", "")
  28572. , i = {};
  28573. if ("" !== t) {
  28574. h.debug("Start override found in parameters, trying to parse..."),
  28575. i = function(e) {
  28576. return o.deserialize(e)
  28577. }(t) || {};
  28578. var n = s.valueFromHash("tag", null);
  28579. n && (i.tag = n),
  28580. i.panoId && (i.pano = e.get(i.panoId))
  28581. }
  28582. return i
  28583. }(t);
  28584. if (0 < Object.keys(i).length)
  28585. return i;
  28586. if (e.heroImage)
  28587. i = function(e, t) {
  28588. if (!e.heroImage || !e.heroImage.metadata.camera_position)
  28589. return {};
  28590. var i = {}
  28591. , n = e.heroImage.metadata;
  28592. h.debug("Using start position from thumbnail image"),
  28593. i.position = n.camera_position,
  28594. i.quaternion = n.camera_quaternion;
  28595. try {
  28596. i.mode = l.convertWorkshopModeInt(n.camera_mode),
  28597. i.mode === l.PANORAMA ? i.pano = t.get(n.scan_id) : i.floorVisibility = n.floor_visibility
  28598. } catch (e) {
  28599. h.debug(e.message)
  28600. }
  28601. return i
  28602. }(e, t);
  28603. else if (window.DATA.camera_start) {
  28604. var n = window.DATA.camera_start;
  28605. try {
  28606. 0 < Object.keys(n).length && !a.isEmptyQuaternion(n.camera.quaternion) && (i.mode = l.convertWorkshopModeInt(n.mode),
  28607. i.position = (new c.Vector3).fromArray(n.camera.position),
  28608. i.quaternion = (new c.Quaternion).fromArray(n.camera.quaternion),
  28609. i.zoom = a.convertWorkshopOrthoZoom(n.camera.zoom),
  28610. n.pano && (i.pano = t.get(n.pano.uuid) || t.findClosest(i.position),
  28611. h.debug("Using camera_start"),
  28612. h.debug("Modeldata pano: ", i.pano.quaternion),
  28613. h.debug("Camera start pano: ", n.pano.quaternion)),
  28614. i.mode !== l.PANORAMA && (i.floorVisibility = e.heroImage.metadata.floor_visibility));
  28615. } catch (e) {
  28616. h.warn(e.message)
  28617. if(i.mode == "panorama" && !i.pano){
  28618. i.pano = t.list[0]
  28619. }
  28620. }
  28621. }
  28622. if (e.outsideAllowed() || i.mode === l.PANORAMA || (i = {}),
  28623. i.mode === l.MESH && i.position && (i.mode = l.PANORAMA,
  28624. i.pano = t.findClosest(i.position) ,
  28625. i.quaternion = i.pano.quaternion),
  28626. 0 === Object.keys(i).length) {
  28627. var r = t.list[0];
  28628. r && (i.mode = l.PANORAMA,
  28629. i.pano = r,
  28630. i.position = r.position,
  28631. i.quaternion = r.quaternion,
  28632. h.info("Starting at 1st pano " + r.id))
  28633. }
  28634. return i.mode = i.mode || l.DOLLHOUSE,
  28635. i
  28636. }
  28637. }
  28638. }
  28639. ).call(this, "/js/util/camera.js")
  28640. }
  28641. , {
  28642. "../controls/serializer": 14,
  28643. "../enum/Viewmode": 51,
  28644. "../util/logger": 189,
  28645. "../util/math": 190,
  28646. "./browser": 182,
  28647. three: 217
  28648. }],
  28649. 184: [function(e, t, i) {
  28650. "use strict";
  28651. function r(e, t, i) {
  28652. var n = t
  28653. , r = i;
  28654. return 2 * Math.atan(Math.tan(e * a.RADIANS_PER_DEGREE / 2) * (n / r)) * a.DEGREES_PER_RADIAN
  28655. }
  28656. function o(e, t, i) {
  28657. var n = t
  28658. , r = i;
  28659. return 2 * Math.atan(Math.tan(e * a.RADIANS_PER_DEGREE / 2) * (r / n)) * a.DEGREES_PER_RADIAN
  28660. }
  28661. var a = e("./MathLight");
  28662. t.exports = {
  28663. clampVFOV: function(e, t, i, n) {
  28664. return t < r(e, i, n) ? o(t, i, n) : e
  28665. },
  28666. getHFOVForCamera: function(e, t, i) {
  28667. return r(e.fov, t, i)
  28668. },
  28669. getHFOVFromVFOV: r,
  28670. getVFOVFromHFOV: o
  28671. }
  28672. window.MathLight = t.exports
  28673. MathLight.closeTo = function(e1,e2, precision){//xzw add 判断e1,e2是否接近
  28674. var prec = Math.pow(10, - (precision || 4));
  28675. var s1 = Math.abs(e1.x - e2.x) < prec && Math.abs(e1.y - e2.y) < prec && Math.abs(e1.z - e2.z) < prec
  28676. if(e1.w){
  28677. return s1 && Math.abs(e1.w - e2.w) < prec
  28678. }else return s1
  28679. }
  28680. }
  28681. , {
  28682. "./MathLight": 176
  28683. }],
  28684. 185: [function(e, t, i) {
  28685. "use strict";
  28686. var a = e("three");
  28687. t.exports = {
  28688. delayOneFrame: function(e) {
  28689. window.setTimeout(e, 1)
  28690. },
  28691. normalizeUrl: function(e) {
  28692. return e.replace("https://", "http://")
  28693. },
  28694. domainFromUrl: function(e) {
  28695. var t = /^([^:]*:\/\/)?(www\.)?([^\/]+)/.exec(e);
  28696. return t ? t[3] : e
  28697. },
  28698. average: function(e, t) {
  28699. if (0 === e.length)
  28700. return null;
  28701. for (var i = 0, n = 0, r = 0; r < e.length; r++) {
  28702. i += t ? e[r][t] : e[r],
  28703. n++
  28704. }
  28705. return i / n
  28706. },
  28707. countUnique: function(e) {
  28708. for (var t = {}, i = 0; i < e.length; i++)
  28709. t[e[i]] = 1 + (t[e[i]] || 0);
  28710. return Object.keys(t).length
  28711. },
  28712. averageVectors: function(e, t) {
  28713. var i = new a.Vector3;
  28714. if (0 === e.length)
  28715. return i;
  28716. for (var n = 0, r = 0; r < e.length; r++) {
  28717. var o = t ? e[r][t] : e[r];
  28718. i.add(o),
  28719. n++
  28720. }
  28721. return i.divideScalar(n)
  28722. },
  28723. equalLists: function(e, t) {
  28724. if (e.length !== t.length)
  28725. return !1;
  28726. for (var i = 0; i < e.length; i++)
  28727. if (e[i] !== t[i])
  28728. return !1;
  28729. return !0
  28730. },
  28731. lowerMedian: function(e, t) {
  28732. return 0 === e.length ? null : (t = t || 2,
  28733. e.sort(function(e, t) {
  28734. return e - t
  28735. }),
  28736. e[Math.floor(e.length / t)])
  28737. },
  28738. stableSort: function(e, n) {
  28739. return e.map(function(e, t) {
  28740. return {
  28741. value: e,
  28742. index: t
  28743. }
  28744. }).sort(function(e, t) {
  28745. var i = n(e.value, t.value);
  28746. return 0 !== i ? i : e.index - t.index
  28747. }).map(function(e) {
  28748. return e.value
  28749. })
  28750. },
  28751. filterAll: function(e, i) {
  28752. return e.filter(function(t) {
  28753. return i.every(function(e) {
  28754. return e(t)
  28755. })
  28756. })
  28757. },
  28758. formatDate: function(e) {
  28759. return [e.getFullYear(), e.getMonth() + 1, e.getDate()].join("-")
  28760. },
  28761. formatDatetime: function(e) {
  28762. return [e.getFullYear(), e.getMonth() + 1, e.getDate(), e.getHours(), e.getMinutes()].join("-")
  28763. },
  28764. randomString: function(e) {
  28765. for (var t = "", i = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789", n = 0; n < e; n++)
  28766. t += i.charAt(Math.floor(Math.random() * i.length));
  28767. return t
  28768. },
  28769. uint8ToBase64: function(e, t) {
  28770. t && "number" == typeof t || (t = 8192);
  28771. for (var i = [], n = 0; n < e.length; n += t)
  28772. i.push(String.fromCharCode.apply(null, e.subarray(n, n + t)));
  28773. return btoa(i.join(""))
  28774. },
  28775. uuid4: function e(t) {
  28776. return t ? (t ^ 16 * Math.random() >> t / 4).toString(16) : ([1e7] + -1e3 + -4e3 + -8e3 + -1e11).replace(/[018]/g, e)
  28777. },
  28778. nth: function(e) {
  28779. return 1 === (e %= 10) ? e + "st" : 2 === e ? e + "nd" : 3 === e ? e + "rd" : e + "th"
  28780. },
  28781. extendObject: function(t, i) {
  28782. return Object.keys(i).forEach(function(e) {
  28783. t[e] = i[e]
  28784. }),
  28785. t
  28786. },
  28787. deepExtend: function e(t) {
  28788. t = t || {};
  28789. for (var i = 1; i < arguments.length; i++) {
  28790. var n = arguments[i];
  28791. if (n)
  28792. for (var r in n)
  28793. n.hasOwnProperty(r) && ("object" == typeof n[r] ? t[r] = e(t[r], n[r]) : t[r] = n[r])
  28794. }
  28795. return t
  28796. },
  28797. inherit: function(e, t) {
  28798. e.prototype = Object.create(t.prototype),
  28799. e.prototype.constructor = e
  28800. },
  28801. extend: function(e, t) {
  28802. for (var i in t.prototype)
  28803. e.prototype[i] = t.prototype[i]
  28804. },
  28805. getFileNameFromUrl:function(url){
  28806. return url.split('/').pop();
  28807. },
  28808. },
  28809. Math.sign = function(e) {
  28810. return e < 0 ? -1 : 1
  28811. }
  28812. window.common = t.exports
  28813. expandCommon(common)
  28814. }
  28815. , {
  28816. three: 217
  28817. }],
  28818. 186: [function(e, t, i) {
  28819. "use strict";
  28820. var r = {
  28821. linearTween: function(e, t, i, n) {
  28822. return i * e / n + t
  28823. },
  28824. easeInQuad: function(e, t, i, n) {
  28825. return i * (e /= n) * e + t
  28826. },
  28827. easeOutQuad: function(e, t, i, n) {
  28828. return -i * (e /= n) * (e - 2) + t
  28829. },
  28830. easeInOutQuad: function(e, t, i, n) {
  28831. return (e /= n / 2) < 1 ? i / 2 * e * e + t : -i / 2 * (--e * (e - 2) - 1) + t
  28832. },
  28833. easeInCubic: function(e, t, i, n) {
  28834. return i * (e /= n) * e * e + t
  28835. },
  28836. easeOutCubic: function(e, t, i, n) {
  28837. return e /= n,
  28838. i * (--e * e * e + 1) + t
  28839. },
  28840. easeInOutCubic: function(e, t, i, n) {
  28841. return (e /= n / 2) < 1 ? i / 2 * e * e * e + t : i / 2 * ((e -= 2) * e * e + 2) + t
  28842. },
  28843. easeInQuart: function(e, t, i, n) {
  28844. return i * (e /= n) * e * e * e + t
  28845. },
  28846. easeOutQuart: function(e, t, i, n) {
  28847. return e /= n,
  28848. -i * (--e * e * e * e - 1) + t
  28849. },
  28850. easeInOutQuart: function(e, t, i, n) {
  28851. return (e /= n / 2) < 1 ? i / 2 * e * e * e * e + t : -i / 2 * ((e -= 2) * e * e * e - 2) + t
  28852. },
  28853. easeInQuint: function(e, t, i, n) {
  28854. return i * (e /= n) * e * e * e * e + t
  28855. },
  28856. easeOutQuint: function(e, t, i, n) {
  28857. return e /= n,
  28858. i * (--e * e * e * e * e + 1) + t
  28859. },
  28860. easeInOutQuint: function(e, t, i, n) {
  28861. return (e /= n / 2) < 1 ? i / 2 * e * e * e * e * e + t : i / 2 * ((e -= 2) * e * e * e * e + 2) + t
  28862. },
  28863. easeInSine: function(e, t, i, n) {
  28864. return -i * Math.cos(e / n * (Math.PI / 2)) + i + t
  28865. },
  28866. easeOutSine: function(e, t, i, n) {
  28867. return i * Math.sin(e / n * (Math.PI / 2)) + t
  28868. },
  28869. easeInOutSine: function(e, t, i, n) {
  28870. return -i / 2 * (Math.cos(Math.PI * e / n) - 1) + t
  28871. },
  28872. easeInExpo: function(e, t, i, n) {
  28873. return i * Math.pow(2, 10 * (e / n - 1)) + t
  28874. },
  28875. easeOutExpo: function(e, t, i, n) {
  28876. return i * (1 - Math.pow(2, -10 * e / n)) + t
  28877. },
  28878. easeInOutExpo: function(e, t, i, n) {
  28879. return (e /= n / 2) < 1 ? i / 2 * Math.pow(2, 10 * (e - 1)) + t : (e--,
  28880. i / 2 * (2 - Math.pow(2, -10 * e)) + t)
  28881. },
  28882. easeInCirc: function(e, t, i, n) {
  28883. return e /= n,
  28884. -i * (Math.sqrt(1 - e * e) - 1) + t
  28885. },
  28886. easeOutCirc: function(e, t, i, n) {
  28887. return e /= n,
  28888. e--,
  28889. i * Math.sqrt(1 - e * e) + t
  28890. },
  28891. easeInOutCirc: function(e, t, i, n) {
  28892. return (e /= n / 2) < 1 ? -i / 2 * (Math.sqrt(1 - e * e) - 1) + t : (e -= 2,
  28893. i / 2 * (Math.sqrt(1 - e * e) + 1) + t)
  28894. },
  28895. easeInElastic: function(e, t, i, n) {
  28896. var r = 1.70158
  28897. , o = 0
  28898. , a = i;
  28899. return 0 === e ? t : 1 == (e /= n) ? t + i : (o = o || .3 * n,
  28900. r = a < Math.abs(i) ? (a = i,
  28901. o / 4) : o / (2 * Math.PI) * Math.asin(i / a),
  28902. -a * Math.pow(2, 10 * (e -= 1)) * Math.sin((e * n - r) * (2 * Math.PI) / o) + t)
  28903. },
  28904. easeOutElastic: function(e, t, i, n) {
  28905. var r = 1.70158
  28906. , o = 0
  28907. , a = i;
  28908. return 0 === e ? t : 1 == (e /= n) ? t + i : (o = o || .3 * n,
  28909. r = a < Math.abs(i) ? (a = i,
  28910. o / 4) : o / (2 * Math.PI) * Math.asin(i / a),
  28911. a * Math.pow(2, -10 * e) * Math.sin((e * n - r) * (2 * Math.PI) / o) + i + t)
  28912. },
  28913. easeInOutElastic: function(e, t, i, n) {
  28914. var r = 1.70158
  28915. , o = 0
  28916. , a = i;
  28917. return 0 === e ? t : 2 == (e /= n / 2) ? t + i : (o = o || n * (.3 * 1.5),
  28918. r = a < Math.abs(i) ? (a = i,
  28919. o / 4) : o / (2 * Math.PI) * Math.asin(i / a),
  28920. 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)
  28921. },
  28922. easeInBack: function(e, t, i, n, r) {
  28923. return void 0 === r && (r = 1.70158),
  28924. i * (e /= n) * e * ((r + 1) * e - r) + t
  28925. },
  28926. easeOutBack: function(e, t, i, n, r) {
  28927. return void 0 === r && (r = 1.70158),
  28928. i * ((e = e / n - 1) * e * ((r + 1) * e + r) + 1) + t
  28929. },
  28930. easeInOutBack: function(e, t, i, n, r) {
  28931. return void 0 === r && (r = 1.70158),
  28932. (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
  28933. },
  28934. easeOutBounce: function(e, t, i, n) {
  28935. 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
  28936. },
  28937. easeInBounce: function(e, t, i, n) {
  28938. return i - r.easeOutBounce(n - e, 0, i, n) + t
  28939. },
  28940. easeInOutBounce: function(e, t, i, n) {
  28941. 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
  28942. }
  28943. };
  28944. window.easing = t.exports = r
  28945. }
  28946. , {}],
  28947. 187: [function(e, t, i) {
  28948. "use strict";
  28949. function n() {
  28950. this.events = [],
  28951. this.valid = !1
  28952. }
  28953. var r = e("../enum/Joystick");
  28954. n.prototype.push = function(e, t) {
  28955. this.events.push({
  28956. direction: e,
  28957. pano: t
  28958. }),
  28959. this.valid = !0
  28960. }
  28961. ,
  28962. n.prototype.pop = function(e) {
  28963. var t = this.events.pop();
  28964. return this.events.length < 1 && (this.valid = !1),
  28965. t
  28966. }
  28967. ,
  28968. n.prototype.peek = function() {
  28969. return this.events.length ? this.events[this.events.length - 1] : {
  28970. direction: null,
  28971. pano: null
  28972. }
  28973. }
  28974. ,
  28975. n.prototype.invalidate = function() {
  28976. this.events = [],
  28977. this.valid = !1
  28978. }
  28979. ,
  28980. n.prototype.reversePano = function(e) {
  28981. if (!this.valid)
  28982. return null;
  28983. var t = this.peek();
  28984. return r.opposite(e) === t.direction ? (this.pop(),
  28985. t.pano) : null
  28986. }
  28987. ,
  28988. t.exports = n
  28989. }
  28990. , {
  28991. "../enum/Joystick": 29
  28992. }],
  28993. 188: [function(e, t, i) {
  28994. "use strict";
  28995. t.exports = {
  28996. vector: function(t, i) {
  28997. var n = t.clone();
  28998. return i = i.clone(),
  28999. function(e) {
  29000. t.set(n.x * (1 - e) + i.x * e, n.y * (1 - e) + i.y * e, n.z * (1 - e) + i.z * e)
  29001. }
  29002. },
  29003. quaternion: function(t, i) {
  29004. var n = t.clone();
  29005. return function(e) {
  29006. t.copy(n).slerp(i, e)
  29007. }
  29008. },
  29009. property: function(t, i, n, r) {
  29010. var o = t[i];
  29011. return function(e) {
  29012. t[i] = o * (1 - e) + n * e,
  29013. r && r(t[i])
  29014. }
  29015. },
  29016. uniform: function(t, i, n) {
  29017. var r = t.material.uniforms[i].value;
  29018. return function(e) {
  29019. t.material.uniforms[i] && (t.material.uniforms[i].value = r * (1 - e) + n * e)
  29020. }
  29021. },
  29022. matrix4: function(o, a) {
  29023. var s = o.clone();
  29024. return function(e) {
  29025. for (var t = o.elements, i = s.elements, n = a.elements, r = 0; r < 16; r++)
  29026. t[r] = i[r] * (1 - e) + n[r] * e
  29027. }
  29028. },
  29029. allUniforms: function(e, t, i) {
  29030. var n = e.map(function(e) {
  29031. return this.uniform(e, t, i)
  29032. }
  29033. .bind(this));
  29034. return function(t) {
  29035. n.forEach(function(e) {
  29036. e(t)
  29037. })
  29038. }
  29039. }
  29040. }
  29041. }
  29042. , {}],
  29043. 189: [function(e, t, i) {
  29044. "use strict";
  29045. function h(n) {
  29046. var e, t, i, r, o = n.split("/"), a = "[" + o[o.length - 1].replace(".js", "") + "]", s = {};
  29047. if (h.consoleEnabled) {
  29048. var l = function(e) {
  29049. $("#debug-console").append("<p>" + e + "</p>"),
  29050. $("#debug-console")[0].scrollTop = $("#debug-console")[0].scrollHeight
  29051. };
  29052. e = function(e) {
  29053. l(Array.prototype.slice.call(arguments).join(" "))
  29054. }
  29055. ,
  29056. t = function(e) {
  29057. l(Array.prototype.slice.call(arguments).join(" "))
  29058. }
  29059. ,
  29060. i = function(e) {
  29061. l("WARN: " + Array.prototype.slice.call(arguments).join(" "))
  29062. }
  29063. ,
  29064. r = function(e) {
  29065. l("ERROR: " + Array.prototype.slice.call(arguments).join(" "))
  29066. }
  29067. } else
  29068. console.log ? (e = console.log,
  29069. t = console.info ? console.info : console.log,
  29070. i = console.warn ? console.warn : console.log,
  29071. r = console.error ? console.error : console.log) : e = t = i = r = function() {}
  29072. ;
  29073. function c(e) {
  29074. return [a, h.timestamp()].concat(Array.prototype.slice.call(e))
  29075. }
  29076. return {
  29077. debug: function() {
  29078. h.level >= h.levels.debug && e.apply(console, c(arguments))
  29079. },
  29080. info: function() {
  29081. h.level >= h.levels.info && t.apply(console, c(arguments))
  29082. },
  29083. warn: function() {
  29084. (function(e, t) {
  29085. if (u) {
  29086. var i = Array.prototype.slice.call(e).join(" ");
  29087. u.captureMessage(i, {
  29088. level: t,
  29089. path: n,
  29090. timestamp: h.timestamp()
  29091. })
  29092. }
  29093. }
  29094. )(arguments, "warn"),
  29095. h.level >= h.levels.warn && i.apply(console, c(arguments))
  29096. },
  29097. error: function() {
  29098. (function(e, t) {
  29099. if (u) {
  29100. var i = Array.prototype.slice.call(e).join(" ");
  29101. u.captureException(new Error(i), {
  29102. level: t,
  29103. path: n,
  29104. timestamp: h.timestamp()
  29105. })
  29106. }
  29107. }
  29108. )(arguments, "error"),
  29109. h.level >= h.levels.error && r.apply(console, c(arguments))
  29110. },
  29111. v3str: function(e, t) {
  29112. var i = void 0 === t ? 2 : t;
  29113. return "(" + e.x.toPrecision(i) + ", " + e.y.toPrecision(i) + ", " + e.z.toPrecision(i) + ")"
  29114. },
  29115. eulstr: function(e, t) {
  29116. var i = void 0 === t ? 2 : t;
  29117. return "(" + THREE.Math.radToDeg(e.x).toPrecision(i) + ", " + THREE.Math.radToDeg(e.y).toPrecision(i) + ", " + THREE.Math.radToDeg(e.z).toPrecision(i) + ' "' + e.order + '")'
  29118. },
  29119. time: function(e) {
  29120. h.level >= h.levels.debug && (s[e] = Date.now())
  29121. },
  29122. timeEnd: function(e) {
  29123. if (h.level >= h.levels.debug) {
  29124. var t = s[e];
  29125. if (!t)
  29126. return;
  29127. var i = (Date.now() - t) / 1e3;
  29128. this.debug(e, i + "s")
  29129. }
  29130. }
  29131. }
  29132. }
  29133. var u = window.Raven;
  29134. h.timestamp = function() {
  29135. return (Date.now() - window.navigationStart) / 1e3 + "s"
  29136. }
  29137. ,
  29138. h.level = (h.levels = {
  29139. debug: 3,
  29140. info: 2,
  29141. warn: 1,
  29142. error: 0
  29143. }).info,
  29144. t.exports = h
  29145. }
  29146. , {}],
  29147. 190: [function(e, t, i) {
  29148. "use strict";
  29149. var o = e("three")
  29150. , r = e("../enum/GLCubeFaces");
  29151. e("../constants");
  29152. t.exports = {
  29153. convertVisionVector: function(e) {
  29154. return new o.Vector3(e.x,e.z,-e.y)
  29155. },
  29156. convertVisionQuaternion: function(e) {
  29157. 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)))
  29158. },
  29159. convertWorkshopVector: function(e) {
  29160. return new o.Vector3(-e.x,e.y,e.z)
  29161. },
  29162. convertWorkshopQuaternion: function(e) {
  29163. 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))
  29164. },
  29165. convertWorkshopPanoramaQuaternion: function(e) {
  29166. 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)))
  29167. },
  29168. convertWorkshopOrthoZoom: function(e) {
  29169. return -1 === e ? -1 : e * ($("#player").width() / $("#player").height()) / g_snapShotWidth * g_snapShotHeight
  29170. },
  29171. toPrecision: function(e, t) {
  29172. function i(e, t) {
  29173. var i = Math.pow(10, t);
  29174. return Math.round(e * i) / i
  29175. }
  29176. if (e instanceof Array) {
  29177. for (var n = 0; n < e.length; n++)
  29178. e[n] = i(e[n], t);
  29179. return e
  29180. }
  29181. return i(e, t)
  29182. },
  29183. isEmptyQuaternion: function(e) {
  29184. return 0 === Math.abs(e.x) && 0 === Math.abs(e.y) && 0 === Math.abs(e.z) && 0 === Math.abs(e.w)
  29185. },
  29186. projectPositionToCanvas: function(e, t, i) {
  29187. (i = i || new o.Vector3).copy(e);
  29188. var n = .5 * $("#player").width()
  29189. , r = .5 * $("#player").height();
  29190. return i.project(t),
  29191. i.x = i.x * n + n,
  29192. i.y = -i.y * r + r,
  29193. i
  29194. },
  29195. convertScreenPositionToNDC: function(e, t, i) {
  29196. return (i = i || new o.Vector2).x = e / $("#player").width() * 2 - 1,
  29197. i.y = -t / $("#player").height() * 2 + 1,
  29198. i
  29199. },
  29200. constrainedTurn: function(e) {
  29201. var t = e % (2 * Math.PI);
  29202. return t > Math.PI ? t -= 2 * Math.PI : t < -Math.PI ? t += 2 * Math.PI : t
  29203. },
  29204. getFOVDotThreshold: function(e) {
  29205. return Math.cos(o.Math.degToRad(e / 2))
  29206. },
  29207. transform2DForwardVectorByCubeFace: function(e, t, i, n) {
  29208. switch (e) {
  29209. case r.GL_TEXTURE_CUBE_MAP_POSITIVE_X:
  29210. i.set(1, t.y, t.x);
  29211. break;
  29212. case r.GL_TEXTURE_CUBE_MAP_NEGATIVE_X:
  29213. i.set(-1, t.y, -t.x);
  29214. break;
  29215. case r.GL_TEXTURE_CUBE_MAP_POSITIVE_Y:
  29216. i.set(-t.x, 1, -t.y);
  29217. break;
  29218. case r.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y:
  29219. i.set(-t.x, -1, t.y);
  29220. break;
  29221. case r.GL_TEXTURE_CUBE_MAP_POSITIVE_Z:
  29222. i.set(-t.x, t.y, 1);
  29223. break;
  29224. case r.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z:
  29225. i.set(t.x, t.y, -1)
  29226. }
  29227. n && i.normalize()
  29228. },
  29229. //add:
  29230. getPos2d : function(point, camera, dom){
  29231. var camera = camera ;
  29232. var dom = dom;
  29233. 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);
  29234. var x,y;
  29235. x = (pos.x + 1) / 2 * dom.clientWidth;
  29236. y = (1 - (pos.y + 1) / 2) * dom.clientHeight;
  29237. var inSight = x <= dom.clientWidth && x >= 0
  29238. && y <= dom.clientHeight && y >= 0
  29239. return {
  29240. pos: new THREE.Vector2(x,y),
  29241. vector: pos,
  29242. trueSide : pos.z<1, //trueSide为false时,即使在屏幕范围内可见,也是反方向的另一个不可以被渲染的点 参见Tag.update
  29243. inSight : inSight //在屏幕范围内可见
  29244. };
  29245. },
  29246. getDirByLonLat: function(lon, lat) {
  29247. var dir = new THREE.Vector3();
  29248. var phi = THREE.Math.degToRad(90 - lat);
  29249. var theta = THREE.Math.degToRad(lon);
  29250. dir.x = Math.sin(phi) * Math.cos(theta);
  29251. dir.y = Math.cos(phi);
  29252. dir.z = Math.sin(phi) * Math.sin(theta);
  29253. return dir.negate();
  29254. }
  29255. }
  29256. window.math = t.exports
  29257. expandMath(math)
  29258. }
  29259. , {
  29260. "../constants": 8,
  29261. "../enum/GLCubeFaces": 25,
  29262. three: 217
  29263. }],
  29264. 191: [function(e, t, i) {
  29265. "use strict";
  29266. function o(e) {
  29267. return r[e]
  29268. }
  29269. var n = e("../enum/GLCubeFaces")
  29270. , a = [0, 1, 2, 3, 4, 5]
  29271. , r = {
  29272. 0: n.GL_TEXTURE_CUBE_MAP_POSITIVE_Y,
  29273. 1: n.GL_TEXTURE_CUBE_MAP_POSITIVE_Z,
  29274. 2: n.GL_TEXTURE_CUBE_MAP_POSITIVE_X,
  29275. 3: n.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z,
  29276. 4: n.GL_TEXTURE_CUBE_MAP_NEGATIVE_X,
  29277. 5: n.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y
  29278. };
  29279. t.exports = {
  29280. mapFaceToCubemapFace: o,
  29281. getCubemapUrls: function(i, n, r) {
  29282. return a.map(function(e, t) {
  29283. return i.get("pan/" + r + "/" + n + "_skybox" + o(e) + ".jpg")
  29284. }
  29285. .bind(this))
  29286. }
  29287. }
  29288. }
  29289. , {
  29290. "../enum/GLCubeFaces": 25
  29291. }],
  29292. 192: [function(e, t, i) {
  29293. "use strict";
  29294. t.exports = {
  29295. captureErrors: function(e, t, i) {
  29296. if ("Raven"in window) {
  29297. Raven.config(e, t).install(),
  29298. i && Raven.setTagsContext(i);
  29299. var n = console.warn
  29300. , r = console.error;
  29301. console.warn = function() {
  29302. var e = Array.prototype.slice.call(arguments);
  29303. Raven.captureMessage(e.join(" "), {
  29304. level: "warning"
  29305. }),
  29306. n.apply(console, e)
  29307. }
  29308. ,
  29309. console.error = function() {
  29310. var e = Array.prototype.slice.call(arguments);
  29311. Raven.captureException(new Error(e.join(" ")), {
  29312. level: "error"
  29313. }),
  29314. r.apply(console, e)
  29315. }
  29316. } else
  29317. console.error("Raven not found, not capturing errors.")
  29318. }
  29319. }
  29320. }
  29321. , {}],
  29322. 193: [function(c, h, e) {
  29323. (function(e) {
  29324. "use strict";
  29325. var i, n = c("./browser"), r = c("../constants"), o = c("url"), t = c("./logger"), a = c("three"), s = new t(e), l = {
  29326. getAuthorizationHeader: function() {
  29327. var e = n.valueFromHash("auth");
  29328. if (e)
  29329. return e.replace(",", " ");
  29330. var t = n.valueFromCookie("token");
  29331. return t ? "Token " + t : null
  29332. },
  29333. parseSidUrl: function(e) {
  29334. var t, i;
  29335. if (t = g_Prefix,
  29336. (e = e || "").match(/^https?/)) {
  29337. o.parse(e);
  29338. t = g_Prefix,
  29339. i = e
  29340. } else
  29341. i = (t = g_Prefix) + "data/" + e;
  29342. return {
  29343. urlBase: t,
  29344. urlModel: i,
  29345. urlFiles: i + (i.match(/\/$/) ? "files" : "/files"),
  29346. urlThumb: i + (i.match(/\/$/) ? "thumb" : "/thumb")
  29347. }
  29348. },
  29349. getModelIDFromQueryString: function() {
  29350. return n.valueFromHash("model") || n.valueFromHash("m")
  29351. },
  29352. /* normalizeModeldata: function(e, i) {
  29353. e = JSON.parse(JSON.stringify(e));
  29354. var n = null;
  29355. if (e.images.forEach(function(t) {
  29356. if (t.metadata) {
  29357. if ("string" == typeof t.metadata)
  29358. try {
  29359. t.metadata = JSON.parse(t.metadata)
  29360. } catch (e) {
  29361. s.warn("Unable to parse image metadata"),
  29362. t.metadata = null
  29363. }
  29364. else
  29365. "object" == typeof t.metadata && s.debug("image.metadata already a JSON object");
  29366. t.metadata.camera_position instanceof Array ? (t.metadata.camera_position = (new a.Vector3).fromArray(t.metadata.camera_position),
  29367. 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)),
  29368. t.metadata.camera_position && (t.metadata.camera_position = i.convertWorkshopVector(t.metadata.camera_position)),
  29369. t.metadata.zoom = t.metadata.zoom || 1),
  29370. !n && e.icon && e.icon === t.sid && (n = t.metadata)
  29371. }
  29372. }),
  29373. n && n.camera_quaternion && n.camera_position && n.scan_position && n.scan_quaternion) {
  29374. var t = {};
  29375. t.pano = {
  29376. quaternion: i.convertWorkshopPanoramaQuaternion(n.scan_quaternion),
  29377. position: i.convertWorkshopVector(n.scan_position),
  29378. uuid: n.scan_id
  29379. },
  29380. t.camera = {
  29381. quaternion: n.camera_quaternion,
  29382. position: n.camera_position
  29383. },
  29384. e.startPano = t
  29385. }
  29386. return e
  29387. }, */
  29388. normalizeModeldata: function(e, t) {//xzw 修改导览images数据
  29389. e = JSON.parse(JSON.stringify(e));
  29390. var i = null;
  29391. var deal = function(n) {
  29392. if(!n.metadata) return;
  29393. if ("string" == typeof n.metadata)
  29394. try {
  29395. n.metadata = JSON.parse(n.metadata)
  29396. } catch (e) {
  29397. s.warn("Unable to parse image metadata"),
  29398. n.metadata = null
  29399. }
  29400. else{
  29401. "object" == typeof n.metadata && s.debug("image.metadata already a JSON object");
  29402. }
  29403. if(n.metadata.camera_position instanceof Array){//xzw 改的格式
  29404. n.metadata.camera_position = new a.Vector3().fromArray(n.metadata.camera_position);
  29405. n.metadata.camera_quaternion = new a.Quaternion().fromArray(n.metadata.camera_quaternion);
  29406. }else{
  29407. n.metadata.camera_position = new a.Vector3().copy(n.metadata.camera_position)
  29408. n.metadata.camera_quaternion = new a.Quaternion().copy(n.metadata.camera_quaternion)
  29409. /* n.metadata.camera_quaternion && (n.metadata.camera_quaternion = i.convertWorkshopQuaternion(n.metadata.camera_quaternion)),
  29410. n.metadata.camera_position && (n.metadata.camera_position = i.convertWorkshopVector(n.metadata.camera_position)) */
  29411. }
  29412. !i && e.icon && e.icon === n.sid && (i = n.metadata)
  29413. }
  29414. //改
  29415. e.images.forEach(info=>{
  29416. if(info.locations){
  29417. info.locations.forEach(a=>deal(a))
  29418. }else{
  29419. deal(info)
  29420. }
  29421. })
  29422. //icon初始视角的:
  29423. if(i && i.camera_quaternion && i.camera_position && i.scan_position && i.scan_quaternion) {
  29424. var n = {};
  29425. n.pano = {
  29426. quaternion: t.convertWorkshopPanoramaQuaternion(i.scan_quaternion),
  29427. position: t.convertWorkshopVector(i.scan_position),
  29428. uuid: i.scan_id
  29429. },
  29430. n.camera = {
  29431. quaternion: i.camera_quaternion,
  29432. position: i.camera_position
  29433. },
  29434. e.startPano = n
  29435. }
  29436. return e
  29437. },
  29438. visionVersionToInt: (i = new RegExp(["(?:[0-9.]+\\.){1,4}", "([0-9]+)", "[^\\.]*$"].join("")),
  29439. function(e) {
  29440. if (!e)
  29441. throw new Error("Vision version is required");
  29442. var t = i.exec(e);
  29443. if (null === t)
  29444. throw new Error("String is not a vision version: " + e);
  29445. return parseInt(t[1])
  29446. }
  29447. ),
  29448. modelDataPromisesTiles: function(e) {
  29449. var t = e.vision_version || window.DATA.vision_version;
  29450. if (t)
  29451. try {
  29452. return l.visionVersionToInt(t) >= l.visionVersionToInt(r.visionTilingStartVersion)
  29453. } catch (e) {
  29454. s.warn("Invalid vision version: " + t)
  29455. }
  29456. return !1
  29457. }
  29458. };
  29459. h.exports = l
  29460. }
  29461. ).call(this, "/js/util/showcase.js")
  29462. }
  29463. , {
  29464. "../constants": 8,
  29465. "./browser": 182,
  29466. "./logger": 189,
  29467. three: 217,
  29468. url: 208
  29469. }],
  29470. 194: [function(e, t, i) {
  29471. "use strict";
  29472. var r = e("../util/ajax")
  29473. , o = e("three")
  29474. , a = e("../settings")
  29475. , s = {};
  29476. t.exports = {
  29477. load: function(e, t, i) {
  29478. var n = s[e];
  29479. return n ? t && setTimeout(function() {
  29480. t(n)
  29481. }, 1) : (n = new o.Texture,
  29482. a.minimalMemoryMode && (n.minFilter = o.LinearFilter,
  29483. n.magFilter = o.LinearFilter,
  29484. n.generateMipmaps = !1),
  29485. n.sourceFile = e,
  29486. s[e] = n,
  29487. r.getImage(e).then(function(e) {
  29488. n.image = e,
  29489. n.needsUpdate = !0,
  29490. t && t(n)
  29491. }).fail(i)),
  29492. n
  29493. },
  29494. loadBase64: function(e, t) {
  29495. t = t || "png";
  29496. var i = new o.Texture;
  29497. return i.image = document.createElement("img"),
  29498. i.image.setAttribute("src", "data:image/" + t + ";base64," + e),
  29499. a.minimalMemoryMode && (i.minFilter = o.LinearFilter,
  29500. i.magFilter = o.LinearFilter,
  29501. i.generateMipmaps = !1),
  29502. i.needsUpdate = !0,
  29503. i
  29504. },
  29505. isLoaded: function(e) {
  29506. return !!s[e]
  29507. }
  29508. }
  29509. window.Texture = t.exports
  29510. }
  29511. , {
  29512. "../settings": 166,
  29513. "../util/ajax": 181,
  29514. three: 217
  29515. }],
  29516. 195: [function(e, t, i) {
  29517. "use strict";
  29518. var l = e("./easing");
  29519. window.transitions = t.exports = {
  29520. globalDone: null,
  29521. funcs: [],
  29522. counter: 0,
  29523. uniqueID: 0,
  29524. start: function(e, t, i, n, r, o, a) {
  29525. return n = n || 0,
  29526. this.funcs.push({
  29527. func: e,
  29528. current: -n * Math.abs(t),
  29529. duration: (1 - Math.max(n, 0)) * Math.abs(t),
  29530. done: i,
  29531. easing: r || l.linearTween,
  29532. cycling: t < 0,
  29533. running: !0,
  29534. debug: n < 0,
  29535. name: o || "T" + this.counter,
  29536. id: void 0 === a ? this.counter : a,
  29537. paused: !1
  29538. }),
  29539. e(0, 16),
  29540. this.counter += 1,
  29541. e
  29542. },
  29543. trigger: function(e) {
  29544. var t = void 0 === e.delayRatio ? 0 : e.delayRatio
  29545. , i = e.func || function() {}
  29546. , n = void 0 === e.duration ? 0 : e.duration;
  29547. void 0 !== e.cycling && e.cycling && (n = -Math.abs(n));
  29548. var r = e.done || null
  29549. , o = e.easing || l.linearTween
  29550. , a = e.name || "R" + this.counter
  29551. , s = void 0 === e.id ? this.counter : e.id;
  29552. return this.start(i, n, r, t, o, a, s)
  29553. },
  29554. setTimeout: function(e, t, i) {
  29555. var n = void 0 === i ? this.counter : i;
  29556. return this.trigger({
  29557. done: e,
  29558. duration: void 0 === t ? 0 : t,
  29559. name: "O" + this.counter,
  29560. id: n
  29561. })
  29562. },
  29563. pause: function() {
  29564. this.paused = !0
  29565. },
  29566. resume: function() {
  29567. this.paused = !1
  29568. },
  29569. update: function(n) {
  29570. this.funcs.forEach(function(e) {
  29571. if (!(e.paused || (e.current += 1e3 * n,
  29572. e.current < 0)))
  29573. if (e.current >= e.duration && !e.cycling) {
  29574. var t = e.easing(1, 0, 1, 1);
  29575. e.func(t, 1e3 * n),
  29576. e.done && e.done(),
  29577. e.running = !1
  29578. } else {
  29579. var i = e.easing(e.current % e.duration / e.duration, 0, 1, 1);
  29580. (e.func(i, 1e3 * n) || !1) && (e.done && e.done(),
  29581. e.running = !1)
  29582. }
  29583. });
  29584. var e = this.funcs.length;
  29585. this.funcs = this.funcs.filter(function(e) {
  29586. return e.running
  29587. });
  29588. var t = this.funcs.length;
  29589. if (0 < e && 0 === t && this.globalDone) {
  29590. var i = this.globalDone;
  29591. this.globalDone = null,
  29592. i()
  29593. }
  29594. },
  29595. adjustSpeed: function(e, t) {
  29596. for (var i = this.getById(e), n = 0; n < i.length; n++) {
  29597. var r = i[n];
  29598. r.duration /= t,
  29599. r.current /= t
  29600. }
  29601. },
  29602. getById: function(t) {
  29603. return this.funcs.filter(function(e) {
  29604. return t === e.id
  29605. })
  29606. },
  29607. get: function(e) {
  29608. for (var t = 0; t < this.funcs.length; t += 1)
  29609. if (this.funcs[t].func === e)
  29610. return this.funcs[t];
  29611. return null
  29612. },
  29613. isRunning: function(e) {
  29614. var t = this.get(e);
  29615. return null !== t && t.running
  29616. },
  29617. countActive: function() {
  29618. for (var e = 0, t = 0; t < this.funcs.length; t += 1)
  29619. e += this.funcs[t].running;
  29620. return e
  29621. },
  29622. listActive: function() {
  29623. for (var e = [], t = 0; t < this.funcs.length; t += 1)
  29624. this.funcs[t].running && e.push(this.funcs[t].name);
  29625. return e
  29626. },
  29627. done: function(e) {
  29628. this.globalDone = e
  29629. },
  29630. cancelById: function(e) {
  29631. var t = void 0 === e ? 0 : e;
  29632. this.funcs = this.funcs.filter(function(e) {
  29633. return e.id !== t
  29634. })
  29635. },
  29636. cancel: function(t) {
  29637. this.funcs = this.funcs.filter(function(e) {
  29638. return e.func !== t
  29639. })
  29640. },
  29641. getUniqueId: function() {
  29642. return this.uniqueID -= 1,
  29643. this.uniqueID
  29644. }
  29645. }
  29646. }
  29647. , {
  29648. "./easing": 186
  29649. }],
  29650. 196: [function(e, t, i) {
  29651. function n(e) {
  29652. if (this.set = {},
  29653. this.infContains = function() {
  29654. return !0
  29655. }
  29656. ,
  29657. "object" == typeof e)
  29658. if (e instanceof Array)
  29659. for (var t = 0; t < e.length; t++)
  29660. this.set[e[t]] = !0;
  29661. else
  29662. this.set = e;
  29663. else if ("function" == typeof e)
  29664. this.infContains = e;
  29665. else if (void 0 !== e)
  29666. throw new Error("set must be either an array or an object.")
  29667. }
  29668. (t.exports = n).prototype.has = n.prototype.contains = function(e) {
  29669. return !!this.set[e]
  29670. }
  29671. ,
  29672. n.prototype.add = function(e) {
  29673. if (1 == arguments.length)
  29674. this.set[e] = !0;
  29675. else
  29676. for (var t = 0; t < arguments.length; t++)
  29677. this.set[arguments[t]] = !0
  29678. }
  29679. ,
  29680. n.prototype.addAll = function(e) {
  29681. if ("object" != typeof e && !(e instanceof Array))
  29682. throw new Error("arr must be an array.");
  29683. for (var t = 0; t < e.length; t++)
  29684. this.add(e[t])
  29685. }
  29686. ,
  29687. n.prototype.delete = n.prototype.remove = function(e) {
  29688. if (1 == arguments.length)
  29689. delete this.set[e];
  29690. else
  29691. for (var t = 0; t < arguments.length; t++)
  29692. delete this.set[arguments[t]]
  29693. }
  29694. ,
  29695. n.prototype.clear = function() {
  29696. this.set = {}
  29697. }
  29698. ,
  29699. n.prototype.size = function() {
  29700. return Object.keys(this.set).length
  29701. }
  29702. ,
  29703. n.prototype.toString = function() {
  29704. return "{" + Object.keys(this.set).toString() + "}"
  29705. }
  29706. ,
  29707. n.prototype["*values"] = n.prototype.toArray = function() {
  29708. return void 0 === this.set ? [] : Object.keys(this.set)
  29709. }
  29710. }
  29711. , {}],
  29712. 197: [function(e, t, i) {}
  29713. , {}],
  29714. 198: [function(N, e, F) {
  29715. (function(e) {
  29716. "use strict";
  29717. function i() {
  29718. return u.TYPED_ARRAY_SUPPORT ? 2147483647 : 1073741823
  29719. }
  29720. function o(e, t) {
  29721. if (i() < t)
  29722. throw new RangeError("Invalid typed array length");
  29723. return u.TYPED_ARRAY_SUPPORT ? (e = new Uint8Array(t)).__proto__ = u.prototype : (null === e && (e = new u(t)),
  29724. e.length = t),
  29725. e
  29726. }
  29727. function u(e, t, i) {
  29728. if (!(u.TYPED_ARRAY_SUPPORT || this instanceof u))
  29729. return new u(e,t,i);
  29730. if ("number" != typeof e)
  29731. return n(this, e, t, i);
  29732. if ("string" == typeof t)
  29733. throw new Error("If encoding is specified then the first argument must be a string");
  29734. return a(this, e)
  29735. }
  29736. function n(e, t, i, n) {
  29737. if ("number" == typeof t)
  29738. throw new TypeError('"value" argument must not be a number');
  29739. return "undefined" != typeof ArrayBuffer && t instanceof ArrayBuffer ? function(e, t, i, n) {
  29740. if (t.byteLength,
  29741. i < 0 || t.byteLength < i)
  29742. throw new RangeError("'offset' is out of bounds");
  29743. if (t.byteLength < i + (n || 0))
  29744. throw new RangeError("'length' is out of bounds");
  29745. return t = void 0 === i && void 0 === n ? new Uint8Array(t) : void 0 === n ? new Uint8Array(t,i) : new Uint8Array(t,i,n),
  29746. u.TYPED_ARRAY_SUPPORT ? (e = t).__proto__ = u.prototype : e = s(e, t),
  29747. e
  29748. }(e, t, i, n) : "string" == typeof t ? function(e, t, i) {
  29749. if ("string" == typeof i && "" !== i || (i = "utf8"),
  29750. !u.isEncoding(i))
  29751. throw new TypeError('"encoding" must be a valid string encoding');
  29752. var n = 0 | c(t, i)
  29753. , r = (e = o(e, n)).write(t, i);
  29754. return r !== n && (e = e.slice(0, r)),
  29755. e
  29756. }(e, t, i) : function(e, t) {
  29757. if (u.isBuffer(t)) {
  29758. var i = 0 | l(t.length);
  29759. return 0 === (e = o(e, i)).length || t.copy(e, 0, 0, i),
  29760. e
  29761. }
  29762. if (t) {
  29763. if ("undefined" != typeof ArrayBuffer && t.buffer instanceof ArrayBuffer || "length"in t)
  29764. return "number" != typeof t.length || function(e) {
  29765. return e != e
  29766. }(t.length) ? o(e, 0) : s(e, t);
  29767. if ("Buffer" === t.type && L(t.data))
  29768. return s(e, t.data)
  29769. }
  29770. throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")
  29771. }(e, t)
  29772. }
  29773. function r(e) {
  29774. if ("number" != typeof e)
  29775. throw new TypeError('"size" argument must be a number');
  29776. if (e < 0)
  29777. throw new RangeError('"size" argument must not be negative')
  29778. }
  29779. function a(e, t) {
  29780. if (r(t),
  29781. e = o(e, t < 0 ? 0 : 0 | l(t)),
  29782. !u.TYPED_ARRAY_SUPPORT)
  29783. for (var i = 0; i < t; ++i)
  29784. e[i] = 0;
  29785. return e
  29786. }
  29787. function s(e, t) {
  29788. var i = t.length < 0 ? 0 : 0 | l(t.length);
  29789. e = o(e, i);
  29790. for (var n = 0; n < i; n += 1)
  29791. e[n] = 255 & t[n];
  29792. return e
  29793. }
  29794. function l(e) {
  29795. if (e >= i())
  29796. throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x" + i().toString(16) + " bytes");
  29797. return 0 | e
  29798. }
  29799. function c(e, t) {
  29800. if (u.isBuffer(e))
  29801. return e.length;
  29802. if ("undefined" != typeof ArrayBuffer && "function" == typeof ArrayBuffer.isView && (ArrayBuffer.isView(e) || e instanceof ArrayBuffer))
  29803. return e.byteLength;
  29804. "string" != typeof e && (e = "" + e);
  29805. var i = e.length;
  29806. if (0 === i)
  29807. return 0;
  29808. for (var n = !1; ; )
  29809. switch (t) {
  29810. case "ascii":
  29811. case "latin1":
  29812. case "binary":
  29813. return i;
  29814. case "utf8":
  29815. case "utf-8":
  29816. case void 0:
  29817. return S(e).length;
  29818. case "ucs2":
  29819. case "ucs-2":
  29820. case "utf16le":
  29821. case "utf-16le":
  29822. return 2 * i;
  29823. case "hex":
  29824. return i >>> 1;
  29825. case "base64":
  29826. return M(e).length;
  29827. default:
  29828. if (n)
  29829. return S(e).length;
  29830. t = ("" + t).toLowerCase(),
  29831. n = !0
  29832. }
  29833. }
  29834. function h(e, t, i) {
  29835. var n = e[t];
  29836. e[t] = e[i],
  29837. e[i] = n
  29838. }
  29839. function d(e, t, i, n, r) {
  29840. if (0 === e.length)
  29841. return -1;
  29842. if ("string" == typeof i ? (n = i,
  29843. i = 0) : 2147483647 < i ? i = 2147483647 : i < -2147483648 && (i = -2147483648),
  29844. i = +i,
  29845. isNaN(i) && (i = r ? 0 : e.length - 1),
  29846. i < 0 && (i = e.length + i),
  29847. i >= e.length) {
  29848. if (r)
  29849. return -1;
  29850. i = e.length - 1
  29851. } else if (i < 0) {
  29852. if (!r)
  29853. return -1;
  29854. i = 0
  29855. }
  29856. if ("string" == typeof t && (t = u.from(t, n)),
  29857. u.isBuffer(t))
  29858. return 0 === t.length ? -1 : p(e, t, i, n, r);
  29859. if ("number" == typeof t)
  29860. return t &= 255,
  29861. 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);
  29862. throw new TypeError("val must be string, number or Buffer")
  29863. }
  29864. function p(e, t, i, n, r) {
  29865. function o(e, t) {
  29866. return 1 === s ? e[t] : e.readUInt16BE(t * s)
  29867. }
  29868. var a, s = 1, l = e.length, c = t.length;
  29869. if (void 0 !== n && ("ucs2" === (n = String(n).toLowerCase()) || "ucs-2" === n || "utf16le" === n || "utf-16le" === n)) {
  29870. if (e.length < 2 || t.length < 2)
  29871. return -1;
  29872. l /= s = 2,
  29873. c /= 2,
  29874. i /= 2
  29875. }
  29876. if (r) {
  29877. var h = -1;
  29878. for (a = i; a < l; a++)
  29879. if (o(e, a) === o(t, -1 === h ? 0 : a - h)) {
  29880. if (-1 === h && (h = a),
  29881. a - h + 1 === c)
  29882. return h * s
  29883. } else
  29884. -1 !== h && (a -= a - h),
  29885. h = -1
  29886. } else
  29887. for (l < i + c && (i = l - c),
  29888. a = i; 0 <= a; a--) {
  29889. for (var u = !0, d = 0; d < c; d++)
  29890. if (o(e, a + d) !== o(t, d)) {
  29891. u = !1;
  29892. break
  29893. }
  29894. if (u)
  29895. return a
  29896. }
  29897. return -1
  29898. }
  29899. function g(e, t, i, n) {
  29900. i = Number(i) || 0;
  29901. var r = e.length - i;
  29902. n ? r < (n = Number(n)) && (n = r) : n = r;
  29903. var o = t.length;
  29904. if (o % 2 != 0)
  29905. throw new TypeError("Invalid hex string");
  29906. o / 2 < n && (n = o / 2);
  29907. for (var a = 0; a < n; ++a) {
  29908. var s = parseInt(t.substr(2 * a, 2), 16);
  29909. if (isNaN(s))
  29910. return a;
  29911. e[i + a] = s
  29912. }
  29913. return a
  29914. }
  29915. function m(e, t, i, n) {
  29916. return R(function(e) {
  29917. for (var t = [], i = 0; i < e.length; ++i)
  29918. t.push(255 & e.charCodeAt(i));
  29919. return t
  29920. }(t), e, i, n)
  29921. }
  29922. function f(e, t, i) {
  29923. i = Math.min(e.length, i);
  29924. for (var n = [], r = t; r < i; ) {
  29925. var o, a, s, l, c = e[r], h = null, u = 239 < c ? 4 : 223 < c ? 3 : 191 < c ? 2 : 1;
  29926. if (r + u <= i)
  29927. switch (u) {
  29928. case 1:
  29929. c < 128 && (h = c);
  29930. break;
  29931. case 2:
  29932. 128 == (192 & (o = e[r + 1])) && (127 < (l = (31 & c) << 6 | 63 & o) && (h = l));
  29933. break;
  29934. case 3:
  29935. o = e[r + 1],
  29936. a = e[r + 2],
  29937. 128 == (192 & o) && 128 == (192 & a) && (2047 < (l = (15 & c) << 12 | (63 & o) << 6 | 63 & a) && (l < 55296 || 57343 < l) && (h = l));
  29938. break;
  29939. case 4:
  29940. o = e[r + 1],
  29941. a = e[r + 2],
  29942. s = e[r + 3],
  29943. 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))
  29944. }
  29945. null === h ? (h = 65533,
  29946. u = 1) : 65535 < h && (h -= 65536,
  29947. n.push(h >>> 10 & 1023 | 55296),
  29948. h = 56320 | 1023 & h),
  29949. n.push(h),
  29950. r += u
  29951. }
  29952. return function(e) {
  29953. var t = e.length;
  29954. if (t <= D)
  29955. return String.fromCharCode.apply(String, e);
  29956. for (var i = "", n = 0; n < t; )
  29957. i += String.fromCharCode.apply(String, e.slice(n, n += D));
  29958. return i
  29959. }(n)
  29960. }
  29961. function v(e, t, i) {
  29962. var n = "";
  29963. i = Math.min(e.length, i);
  29964. for (var r = t; r < i; ++r)
  29965. n += String.fromCharCode(127 & e[r]);
  29966. return n
  29967. }
  29968. function y(e, t, i) {
  29969. var n = "";
  29970. i = Math.min(e.length, i);
  29971. for (var r = t; r < i; ++r)
  29972. n += String.fromCharCode(e[r]);
  29973. return n
  29974. }
  29975. function A(e, t, i) {
  29976. var n, r = e.length;
  29977. (!t || t < 0) && (t = 0),
  29978. (!i || i < 0 || r < i) && (i = r);
  29979. for (var o = "", a = t; a < i; ++a)
  29980. o += (n = e[a]) < 16 ? "0" + n.toString(16) : n.toString(16);
  29981. return o
  29982. }
  29983. function C(e, t, i) {
  29984. for (var n = e.slice(t, i), r = "", o = 0; o < n.length; o += 2)
  29985. r += String.fromCharCode(n[o] + 256 * n[o + 1]);
  29986. return r
  29987. }
  29988. function I(e, t, i) {
  29989. if (e % 1 != 0 || e < 0)
  29990. throw new RangeError("offset is not uint");
  29991. if (i < e + t)
  29992. throw new RangeError("Trying to access beyond buffer length")
  29993. }
  29994. function E(e, t, i, n, r, o) {
  29995. if (!u.isBuffer(e))
  29996. throw new TypeError('"buffer" argument must be a Buffer instance');
  29997. if (r < t || t < o)
  29998. throw new RangeError('"value" argument is out of bounds');
  29999. if (i + n > e.length)
  30000. throw new RangeError("Index out of range")
  30001. }
  30002. function _(e, t, i, n) {
  30003. t < 0 && (t = 65535 + t + 1);
  30004. for (var r = 0, o = Math.min(e.length - i, 2); r < o; ++r)
  30005. e[i + r] = (t & 255 << 8 * (n ? r : 1 - r)) >>> 8 * (n ? r : 1 - r)
  30006. }
  30007. function b(e, t, i, n) {
  30008. t < 0 && (t = 4294967295 + t + 1);
  30009. for (var r = 0, o = Math.min(e.length - i, 4); r < o; ++r)
  30010. e[i + r] = t >>> 8 * (n ? r : 3 - r) & 255
  30011. }
  30012. function w(e, t, i, n) {
  30013. if (i + n > e.length)
  30014. throw new RangeError("Index out of range");
  30015. if (i < 0)
  30016. throw new RangeError("Index out of range")
  30017. }
  30018. function T(e, t, i, n, r) {
  30019. return r || w(e, 0, i, 4),
  30020. O.write(e, t, i, n, 23, 4),
  30021. i + 4
  30022. }
  30023. function x(e, t, i, n, r) {
  30024. return r || w(e, 0, i, 8),
  30025. O.write(e, t, i, n, 52, 8),
  30026. i + 8
  30027. }
  30028. function S(e, t) {
  30029. t = t || 1 / 0;
  30030. for (var i, n = e.length, r = null, o = [], a = 0; a < n; ++a) {
  30031. if (55295 < (i = e.charCodeAt(a)) && i < 57344) {
  30032. if (!r) {
  30033. if (56319 < i) {
  30034. -1 < (t -= 3) && o.push(239, 191, 189);
  30035. continue
  30036. }
  30037. if (a + 1 === n) {
  30038. -1 < (t -= 3) && o.push(239, 191, 189);
  30039. continue
  30040. }
  30041. r = i;
  30042. continue
  30043. }
  30044. if (i < 56320) {
  30045. -1 < (t -= 3) && o.push(239, 191, 189),
  30046. r = i;
  30047. continue
  30048. }
  30049. i = 65536 + (r - 55296 << 10 | i - 56320)
  30050. } else
  30051. r && -1 < (t -= 3) && o.push(239, 191, 189);
  30052. if (r = null,
  30053. i < 128) {
  30054. if ((t -= 1) < 0)
  30055. break;
  30056. o.push(i)
  30057. } else if (i < 2048) {
  30058. if ((t -= 2) < 0)
  30059. break;
  30060. o.push(i >> 6 | 192, 63 & i | 128)
  30061. } else if (i < 65536) {
  30062. if ((t -= 3) < 0)
  30063. break;
  30064. o.push(i >> 12 | 224, i >> 6 & 63 | 128, 63 & i | 128)
  30065. } else {
  30066. if (!(i < 1114112))
  30067. throw new Error("Invalid code point");
  30068. if ((t -= 4) < 0)
  30069. break;
  30070. o.push(i >> 18 | 240, i >> 12 & 63 | 128, i >> 6 & 63 | 128, 63 & i | 128)
  30071. }
  30072. }
  30073. return o
  30074. }
  30075. function M(e) {
  30076. return P.toByteArray(function(e) {
  30077. if ((e = function(e) {
  30078. return e.trim ? e.trim() : e.replace(/^\s+|\s+$/g, "")
  30079. }(e).replace(t, "")).length < 2)
  30080. return "";
  30081. for (; e.length % 4 != 0; )
  30082. e += "=";
  30083. return e
  30084. }(e))
  30085. }
  30086. function R(e, t, i, n) {
  30087. for (var r = 0; r < n && !(r + i >= t.length || r >= e.length); ++r)
  30088. t[r + i] = e[r];
  30089. return r
  30090. }
  30091. var P = N("base64-js")
  30092. , O = N("ieee754")
  30093. , L = N("isarray");
  30094. F.Buffer = u,
  30095. F.SlowBuffer = function(e) {
  30096. return +e != e && (e = 0),
  30097. u.alloc(+e)
  30098. }
  30099. ,
  30100. F.INSPECT_MAX_BYTES = 50,
  30101. u.TYPED_ARRAY_SUPPORT = void 0 !== e.TYPED_ARRAY_SUPPORT ? e.TYPED_ARRAY_SUPPORT : function() {
  30102. try {
  30103. var e = new Uint8Array(1);
  30104. return e.__proto__ = {
  30105. __proto__: Uint8Array.prototype,
  30106. foo: function() {
  30107. return 42
  30108. }
  30109. },
  30110. 42 === e.foo() && "function" == typeof e.subarray && 0 === e.subarray(1, 1).byteLength
  30111. } catch (e) {
  30112. return !1
  30113. }
  30114. }(),
  30115. F.kMaxLength = i(),
  30116. u.poolSize = 8192,
  30117. u._augment = function(e) {
  30118. return e.__proto__ = u.prototype,
  30119. e
  30120. }
  30121. ,
  30122. u.from = function(e, t, i) {
  30123. return n(null, e, t, i)
  30124. }
  30125. ,
  30126. u.TYPED_ARRAY_SUPPORT && (u.prototype.__proto__ = Uint8Array.prototype,
  30127. u.__proto__ = Uint8Array,
  30128. "undefined" != typeof Symbol && Symbol.species && u[Symbol.species] === u && Object.defineProperty(u, Symbol.species, {
  30129. value: null,
  30130. configurable: !0
  30131. })),
  30132. u.alloc = function(e, t, i) {
  30133. return function(e, t, i, n) {
  30134. return r(t),
  30135. 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)
  30136. }(null, e, t, i)
  30137. }
  30138. ,
  30139. u.allocUnsafe = function(e) {
  30140. return a(null, e)
  30141. }
  30142. ,
  30143. u.allocUnsafeSlow = function(e) {
  30144. return a(null, e)
  30145. }
  30146. ,
  30147. u.isBuffer = function(e) {
  30148. return !(null == e || !e._isBuffer)
  30149. }
  30150. ,
  30151. u.compare = function(e, t) {
  30152. if (!u.isBuffer(e) || !u.isBuffer(t))
  30153. throw new TypeError("Arguments must be Buffers");
  30154. if (e === t)
  30155. return 0;
  30156. for (var i = e.length, n = t.length, r = 0, o = Math.min(i, n); r < o; ++r)
  30157. if (e[r] !== t[r]) {
  30158. i = e[r],
  30159. n = t[r];
  30160. break
  30161. }
  30162. return i < n ? -1 : n < i ? 1 : 0
  30163. }
  30164. ,
  30165. u.isEncoding = function(e) {
  30166. switch (String(e).toLowerCase()) {
  30167. case "hex":
  30168. case "utf8":
  30169. case "utf-8":
  30170. case "ascii":
  30171. case "latin1":
  30172. case "binary":
  30173. case "base64":
  30174. case "ucs2":
  30175. case "ucs-2":
  30176. case "utf16le":
  30177. case "utf-16le":
  30178. return !0;
  30179. default:
  30180. return !1
  30181. }
  30182. }
  30183. ,
  30184. u.concat = function(e, t) {
  30185. if (!L(e))
  30186. throw new TypeError('"list" argument must be an Array of Buffers');
  30187. if (0 === e.length)
  30188. return u.alloc(0);
  30189. var i;
  30190. if (void 0 === t)
  30191. for (i = t = 0; i < e.length; ++i)
  30192. t += e[i].length;
  30193. var n = u.allocUnsafe(t)
  30194. , r = 0;
  30195. for (i = 0; i < e.length; ++i) {
  30196. var o = e[i];
  30197. if (!u.isBuffer(o))
  30198. throw new TypeError('"list" argument must be an Array of Buffers');
  30199. o.copy(n, r),
  30200. r += o.length
  30201. }
  30202. return n
  30203. }
  30204. ,
  30205. u.byteLength = c,
  30206. u.prototype._isBuffer = !0,
  30207. u.prototype.swap16 = function() {
  30208. var e = this.length;
  30209. if (e % 2 != 0)
  30210. throw new RangeError("Buffer size must be a multiple of 16-bits");
  30211. for (var t = 0; t < e; t += 2)
  30212. h(this, t, t + 1);
  30213. return this
  30214. }
  30215. ,
  30216. u.prototype.swap32 = function() {
  30217. var e = this.length;
  30218. if (e % 4 != 0)
  30219. throw new RangeError("Buffer size must be a multiple of 32-bits");
  30220. for (var t = 0; t < e; t += 4)
  30221. h(this, t, t + 3),
  30222. h(this, t + 1, t + 2);
  30223. return this
  30224. }
  30225. ,
  30226. u.prototype.swap64 = function() {
  30227. var e = this.length;
  30228. if (e % 8 != 0)
  30229. throw new RangeError("Buffer size must be a multiple of 64-bits");
  30230. for (var t = 0; t < e; t += 8)
  30231. h(this, t, t + 7),
  30232. h(this, t + 1, t + 6),
  30233. h(this, t + 2, t + 5),
  30234. h(this, t + 3, t + 4);
  30235. return this
  30236. }
  30237. ,
  30238. u.prototype.toString = function() {
  30239. var e = 0 | this.length;
  30240. return 0 == e ? "" : 0 === arguments.length ? f(this, 0, e) : function(e, t, i) {
  30241. var n, r, o, a = !1;
  30242. if ((void 0 === t || t < 0) && (t = 0),
  30243. t > this.length)
  30244. return "";
  30245. if ((void 0 === i || i > this.length) && (i = this.length),
  30246. i <= 0)
  30247. return "";
  30248. if ((i >>>= 0) <= (t >>>= 0))
  30249. return "";
  30250. for (e = e || "utf8"; ; )
  30251. switch (e) {
  30252. case "hex":
  30253. return A(this, t, i);
  30254. case "utf8":
  30255. case "utf-8":
  30256. return f(this, t, i);
  30257. case "ascii":
  30258. return v(this, t, i);
  30259. case "latin1":
  30260. case "binary":
  30261. return y(this, t, i);
  30262. case "base64":
  30263. return n = this,
  30264. o = i,
  30265. 0 === (r = t) && o === n.length ? P.fromByteArray(n) : P.fromByteArray(n.slice(r, o));
  30266. case "ucs2":
  30267. case "ucs-2":
  30268. case "utf16le":
  30269. case "utf-16le":
  30270. return C(this, t, i);
  30271. default:
  30272. if (a)
  30273. throw new TypeError("Unknown encoding: " + e);
  30274. e = (e + "").toLowerCase(),
  30275. a = !0
  30276. }
  30277. }
  30278. .apply(this, arguments)
  30279. }
  30280. ,
  30281. u.prototype.equals = function(e) {
  30282. if (!u.isBuffer(e))
  30283. throw new TypeError("Argument must be a Buffer");
  30284. return this === e || 0 === u.compare(this, e)
  30285. }
  30286. ,
  30287. u.prototype.inspect = function() {
  30288. var e = ""
  30289. , t = F.INSPECT_MAX_BYTES;
  30290. return 0 < this.length && (e = this.toString("hex", 0, t).match(/.{2}/g).join(" "),
  30291. this.length > t && (e += " ... ")),
  30292. "<Buffer " + e + ">"
  30293. }
  30294. ,
  30295. u.prototype.compare = function(e, t, i, n, r) {
  30296. if (!u.isBuffer(e))
  30297. throw new TypeError("Argument must be a Buffer");
  30298. if (void 0 === t && (t = 0),
  30299. void 0 === i && (i = e ? e.length : 0),
  30300. void 0 === n && (n = 0),
  30301. void 0 === r && (r = this.length),
  30302. t < 0 || i > e.length || n < 0 || r > this.length)
  30303. throw new RangeError("out of range index");
  30304. if (r <= n && i <= t)
  30305. return 0;
  30306. if (r <= n)
  30307. return -1;
  30308. if (i <= t)
  30309. return 1;
  30310. if (this === e)
  30311. return 0;
  30312. 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)
  30313. if (l[h] !== c[h]) {
  30314. o = l[h],
  30315. a = c[h];
  30316. break
  30317. }
  30318. return o < a ? -1 : a < o ? 1 : 0
  30319. }
  30320. ,
  30321. u.prototype.includes = function(e, t, i) {
  30322. return -1 !== this.indexOf(e, t, i)
  30323. }
  30324. ,
  30325. u.prototype.indexOf = function(e, t, i) {
  30326. return d(this, e, t, i, !0)
  30327. }
  30328. ,
  30329. u.prototype.lastIndexOf = function(e, t, i) {
  30330. return d(this, e, t, i, !1)
  30331. }
  30332. ,
  30333. u.prototype.write = function(e, t, i, n) {
  30334. if (void 0 === t)
  30335. n = "utf8",
  30336. i = this.length,
  30337. t = 0;
  30338. else if (void 0 === i && "string" == typeof t)
  30339. n = t,
  30340. i = this.length,
  30341. t = 0;
  30342. else {
  30343. if (!isFinite(t))
  30344. throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");
  30345. t |= 0,
  30346. isFinite(i) ? (i |= 0,
  30347. void 0 === n && (n = "utf8")) : (n = i,
  30348. i = void 0)
  30349. }
  30350. var r, o, a, s, l, c, h, u, d, p = this.length - t;
  30351. if ((void 0 === i || p < i) && (i = p),
  30352. 0 < e.length && (i < 0 || t < 0) || t > this.length)
  30353. throw new RangeError("Attempt to write outside buffer bounds");
  30354. n = n || "utf8";
  30355. for (var f = !1; ; )
  30356. switch (n) {
  30357. case "hex":
  30358. return g(this, e, t, i);
  30359. case "utf8":
  30360. case "utf-8":
  30361. return u = t,
  30362. d = i,
  30363. R(S(e, (h = this).length - u), h, u, d);
  30364. case "ascii":
  30365. return m(this, e, t, i);
  30366. case "latin1":
  30367. case "binary":
  30368. return m(this, e, t, i);
  30369. case "base64":
  30370. return s = this,
  30371. l = t,
  30372. c = i,
  30373. R(M(e), s, l, c);
  30374. case "ucs2":
  30375. case "ucs-2":
  30376. case "utf16le":
  30377. case "utf-16le":
  30378. return o = t,
  30379. a = i,
  30380. R(function(e, t) {
  30381. for (var i, n, r, o = [], a = 0; a < e.length && !((t -= 2) < 0); ++a)
  30382. i = e.charCodeAt(a),
  30383. n = i >> 8,
  30384. r = i % 256,
  30385. o.push(r),
  30386. o.push(n);
  30387. return o
  30388. }(e, (r = this).length - o), r, o, a);
  30389. default:
  30390. if (f)
  30391. throw new TypeError("Unknown encoding: " + n);
  30392. n = ("" + n).toLowerCase(),
  30393. f = !0
  30394. }
  30395. }
  30396. ,
  30397. u.prototype.toJSON = function() {
  30398. return {
  30399. type: "Buffer",
  30400. data: Array.prototype.slice.call(this._arr || this, 0)
  30401. }
  30402. }
  30403. ;
  30404. var D = 4096;
  30405. u.prototype.slice = function(e, t) {
  30406. var i, n = this.length;
  30407. if ((e = ~~e) < 0 ? (e += n) < 0 && (e = 0) : n < e && (e = n),
  30408. (t = void 0 === t ? n : ~~t) < 0 ? (t += n) < 0 && (t = 0) : n < t && (t = n),
  30409. t < e && (t = e),
  30410. u.TYPED_ARRAY_SUPPORT)
  30411. (i = this.subarray(e, t)).__proto__ = u.prototype;
  30412. else {
  30413. var r = t - e;
  30414. i = new u(r,void 0);
  30415. for (var o = 0; o < r; ++o)
  30416. i[o] = this[o + e]
  30417. }
  30418. return i
  30419. }
  30420. ,
  30421. u.prototype.readUIntLE = function(e, t, i) {
  30422. e |= 0,
  30423. t |= 0,
  30424. i || I(e, t, this.length);
  30425. for (var n = this[e], r = 1, o = 0; ++o < t && (r *= 256); )
  30426. n += this[e + o] * r;
  30427. return n
  30428. }
  30429. ,
  30430. u.prototype.readUIntBE = function(e, t, i) {
  30431. e |= 0,
  30432. t |= 0,
  30433. i || I(e, t, this.length);
  30434. for (var n = this[e + --t], r = 1; 0 < t && (r *= 256); )
  30435. n += this[e + --t] * r;
  30436. return n
  30437. }
  30438. ,
  30439. u.prototype.readUInt8 = function(e, t) {
  30440. return t || I(e, 1, this.length),
  30441. this[e]
  30442. }
  30443. ,
  30444. u.prototype.readUInt16LE = function(e, t) {
  30445. return t || I(e, 2, this.length),
  30446. this[e] | this[e + 1] << 8
  30447. }
  30448. ,
  30449. u.prototype.readUInt16BE = function(e, t) {
  30450. return t || I(e, 2, this.length),
  30451. this[e] << 8 | this[e + 1]
  30452. }
  30453. ,
  30454. u.prototype.readUInt32LE = function(e, t) {
  30455. return t || I(e, 4, this.length),
  30456. (this[e] | this[e + 1] << 8 | this[e + 2] << 16) + 16777216 * this[e + 3]
  30457. }
  30458. ,
  30459. u.prototype.readUInt32BE = function(e, t) {
  30460. return t || I(e, 4, this.length),
  30461. 16777216 * this[e] + (this[e + 1] << 16 | this[e + 2] << 8 | this[e + 3])
  30462. }
  30463. ,
  30464. u.prototype.readIntLE = function(e, t, i) {
  30465. e |= 0,
  30466. t |= 0,
  30467. i || I(e, t, this.length);
  30468. for (var n = this[e], r = 1, o = 0; ++o < t && (r *= 256); )
  30469. n += this[e + o] * r;
  30470. return (r *= 128) <= n && (n -= Math.pow(2, 8 * t)),
  30471. n
  30472. }
  30473. ,
  30474. u.prototype.readIntBE = function(e, t, i) {
  30475. e |= 0,
  30476. t |= 0,
  30477. i || I(e, t, this.length);
  30478. for (var n = t, r = 1, o = this[e + --n]; 0 < n && (r *= 256); )
  30479. o += this[e + --n] * r;
  30480. return (r *= 128) <= o && (o -= Math.pow(2, 8 * t)),
  30481. o
  30482. }
  30483. ,
  30484. u.prototype.readInt8 = function(e, t) {
  30485. return t || I(e, 1, this.length),
  30486. 128 & this[e] ? -1 * (255 - this[e] + 1) : this[e]
  30487. }
  30488. ,
  30489. u.prototype.readInt16LE = function(e, t) {
  30490. t || I(e, 2, this.length);
  30491. var i = this[e] | this[e + 1] << 8;
  30492. return 32768 & i ? 4294901760 | i : i
  30493. }
  30494. ,
  30495. u.prototype.readInt16BE = function(e, t) {
  30496. t || I(e, 2, this.length);
  30497. var i = this[e + 1] | this[e] << 8;
  30498. return 32768 & i ? 4294901760 | i : i
  30499. }
  30500. ,
  30501. u.prototype.readInt32LE = function(e, t) {
  30502. return t || I(e, 4, this.length),
  30503. this[e] | this[e + 1] << 8 | this[e + 2] << 16 | this[e + 3] << 24
  30504. }
  30505. ,
  30506. u.prototype.readInt32BE = function(e, t) {
  30507. return t || I(e, 4, this.length),
  30508. this[e] << 24 | this[e + 1] << 16 | this[e + 2] << 8 | this[e + 3]
  30509. }
  30510. ,
  30511. u.prototype.readFloatLE = function(e, t) {
  30512. return t || I(e, 4, this.length),
  30513. O.read(this, e, !0, 23, 4)
  30514. }
  30515. ,
  30516. u.prototype.readFloatBE = function(e, t) {
  30517. return t || I(e, 4, this.length),
  30518. O.read(this, e, !1, 23, 4)
  30519. }
  30520. ,
  30521. u.prototype.readDoubleLE = function(e, t) {
  30522. return t || I(e, 8, this.length),
  30523. O.read(this, e, !0, 52, 8)
  30524. }
  30525. ,
  30526. u.prototype.readDoubleBE = function(e, t) {
  30527. return t || I(e, 8, this.length),
  30528. O.read(this, e, !1, 52, 8)
  30529. }
  30530. ,
  30531. u.prototype.writeUIntLE = function(e, t, i, n) {
  30532. e = +e,
  30533. t |= 0,
  30534. i |= 0,
  30535. n || E(this, e, t, i, Math.pow(2, 8 * i) - 1, 0);
  30536. var r = 1
  30537. , o = 0;
  30538. for (this[t] = 255 & e; ++o < i && (r *= 256); )
  30539. this[t + o] = e / r & 255;
  30540. return t + i
  30541. }
  30542. ,
  30543. u.prototype.writeUIntBE = function(e, t, i, n) {
  30544. e = +e,
  30545. t |= 0,
  30546. i |= 0,
  30547. n || E(this, e, t, i, Math.pow(2, 8 * i) - 1, 0);
  30548. var r = i - 1
  30549. , o = 1;
  30550. for (this[t + r] = 255 & e; 0 <= --r && (o *= 256); )
  30551. this[t + r] = e / o & 255;
  30552. return t + i
  30553. }
  30554. ,
  30555. u.prototype.writeUInt8 = function(e, t, i) {
  30556. return e = +e,
  30557. t |= 0,
  30558. i || E(this, e, t, 1, 255, 0),
  30559. u.TYPED_ARRAY_SUPPORT || (e = Math.floor(e)),
  30560. this[t] = 255 & e,
  30561. t + 1
  30562. }
  30563. ,
  30564. u.prototype.writeUInt16LE = function(e, t, i) {
  30565. return e = +e,
  30566. t |= 0,
  30567. i || E(this, e, t, 2, 65535, 0),
  30568. u.TYPED_ARRAY_SUPPORT ? (this[t] = 255 & e,
  30569. this[t + 1] = e >>> 8) : _(this, e, t, !0),
  30570. t + 2
  30571. }
  30572. ,
  30573. u.prototype.writeUInt16BE = function(e, t, i) {
  30574. return e = +e,
  30575. t |= 0,
  30576. i || E(this, e, t, 2, 65535, 0),
  30577. u.TYPED_ARRAY_SUPPORT ? (this[t] = e >>> 8,
  30578. this[t + 1] = 255 & e) : _(this, e, t, !1),
  30579. t + 2
  30580. }
  30581. ,
  30582. u.prototype.writeUInt32LE = function(e, t, i) {
  30583. return e = +e,
  30584. t |= 0,
  30585. i || E(this, e, t, 4, 4294967295, 0),
  30586. u.TYPED_ARRAY_SUPPORT ? (this[t + 3] = e >>> 24,
  30587. this[t + 2] = e >>> 16,
  30588. this[t + 1] = e >>> 8,
  30589. this[t] = 255 & e) : b(this, e, t, !0),
  30590. t + 4
  30591. }
  30592. ,
  30593. u.prototype.writeUInt32BE = function(e, t, i) {
  30594. return e = +e,
  30595. t |= 0,
  30596. i || E(this, e, t, 4, 4294967295, 0),
  30597. u.TYPED_ARRAY_SUPPORT ? (this[t] = e >>> 24,
  30598. this[t + 1] = e >>> 16,
  30599. this[t + 2] = e >>> 8,
  30600. this[t + 3] = 255 & e) : b(this, e, t, !1),
  30601. t + 4
  30602. }
  30603. ,
  30604. u.prototype.writeIntLE = function(e, t, i, n) {
  30605. if (e = +e,
  30606. t |= 0,
  30607. !n) {
  30608. var r = Math.pow(2, 8 * i - 1);
  30609. E(this, e, t, i, r - 1, -r)
  30610. }
  30611. var o = 0
  30612. , a = 1
  30613. , s = 0;
  30614. for (this[t] = 255 & e; ++o < i && (a *= 256); )
  30615. e < 0 && 0 === s && 0 !== this[t + o - 1] && (s = 1),
  30616. this[t + o] = (e / a >> 0) - s & 255;
  30617. return t + i
  30618. }
  30619. ,
  30620. u.prototype.writeIntBE = function(e, t, i, n) {
  30621. if (e = +e,
  30622. t |= 0,
  30623. !n) {
  30624. var r = Math.pow(2, 8 * i - 1);
  30625. E(this, e, t, i, r - 1, -r)
  30626. }
  30627. var o = i - 1
  30628. , a = 1
  30629. , s = 0;
  30630. for (this[t + o] = 255 & e; 0 <= --o && (a *= 256); )
  30631. e < 0 && 0 === s && 0 !== this[t + o + 1] && (s = 1),
  30632. this[t + o] = (e / a >> 0) - s & 255;
  30633. return t + i
  30634. }
  30635. ,
  30636. u.prototype.writeInt8 = function(e, t, i) {
  30637. return e = +e,
  30638. t |= 0,
  30639. i || E(this, e, t, 1, 127, -128),
  30640. u.TYPED_ARRAY_SUPPORT || (e = Math.floor(e)),
  30641. e < 0 && (e = 255 + e + 1),
  30642. this[t] = 255 & e,
  30643. t + 1
  30644. }
  30645. ,
  30646. u.prototype.writeInt16LE = function(e, t, i) {
  30647. return e = +e,
  30648. t |= 0,
  30649. i || E(this, e, t, 2, 32767, -32768),
  30650. u.TYPED_ARRAY_SUPPORT ? (this[t] = 255 & e,
  30651. this[t + 1] = e >>> 8) : _(this, e, t, !0),
  30652. t + 2
  30653. }
  30654. ,
  30655. u.prototype.writeInt16BE = function(e, t, i) {
  30656. return e = +e,
  30657. t |= 0,
  30658. i || E(this, e, t, 2, 32767, -32768),
  30659. u.TYPED_ARRAY_SUPPORT ? (this[t] = e >>> 8,
  30660. this[t + 1] = 255 & e) : _(this, e, t, !1),
  30661. t + 2
  30662. }
  30663. ,
  30664. u.prototype.writeInt32LE = function(e, t, i) {
  30665. return e = +e,
  30666. t |= 0,
  30667. i || E(this, e, t, 4, 2147483647, -2147483648),
  30668. u.TYPED_ARRAY_SUPPORT ? (this[t] = 255 & e,
  30669. this[t + 1] = e >>> 8,
  30670. this[t + 2] = e >>> 16,
  30671. this[t + 3] = e >>> 24) : b(this, e, t, !0),
  30672. t + 4
  30673. }
  30674. ,
  30675. u.prototype.writeInt32BE = function(e, t, i) {
  30676. return e = +e,
  30677. t |= 0,
  30678. i || E(this, e, t, 4, 2147483647, -2147483648),
  30679. e < 0 && (e = 4294967295 + e + 1),
  30680. u.TYPED_ARRAY_SUPPORT ? (this[t] = e >>> 24,
  30681. this[t + 1] = e >>> 16,
  30682. this[t + 2] = e >>> 8,
  30683. this[t + 3] = 255 & e) : b(this, e, t, !1),
  30684. t + 4
  30685. }
  30686. ,
  30687. u.prototype.writeFloatLE = function(e, t, i) {
  30688. return T(this, e, t, !0, i)
  30689. }
  30690. ,
  30691. u.prototype.writeFloatBE = function(e, t, i) {
  30692. return T(this, e, t, !1, i)
  30693. }
  30694. ,
  30695. u.prototype.writeDoubleLE = function(e, t, i) {
  30696. return x(this, e, t, !0, i)
  30697. }
  30698. ,
  30699. u.prototype.writeDoubleBE = function(e, t, i) {
  30700. return x(this, e, t, !1, i)
  30701. }
  30702. ,
  30703. u.prototype.copy = function(e, t, i, n) {
  30704. if (i = i || 0,
  30705. n || 0 === n || (n = this.length),
  30706. t >= e.length && (t = e.length),
  30707. t = t || 0,
  30708. 0 < n && n < i && (n = i),
  30709. n === i)
  30710. return 0;
  30711. if (0 === e.length || 0 === this.length)
  30712. return 0;
  30713. if (t < 0)
  30714. throw new RangeError("targetStart out of bounds");
  30715. if (i < 0 || i >= this.length)
  30716. throw new RangeError("sourceStart out of bounds");
  30717. if (n < 0)
  30718. throw new RangeError("sourceEnd out of bounds");
  30719. n > this.length && (n = this.length),
  30720. e.length - t < n - i && (n = e.length - t + i);
  30721. var r, o = n - i;
  30722. if (this === e && i < t && t < n)
  30723. for (r = o - 1; 0 <= r; --r)
  30724. e[r + t] = this[r + i];
  30725. else if (o < 1e3 || !u.TYPED_ARRAY_SUPPORT)
  30726. for (r = 0; r < o; ++r)
  30727. e[r + t] = this[r + i];
  30728. else
  30729. Uint8Array.prototype.set.call(e, this.subarray(i, i + o), t);
  30730. return o
  30731. }
  30732. ,
  30733. u.prototype.fill = function(e, t, i, n) {
  30734. if ("string" == typeof e) {
  30735. if ("string" == typeof t ? (n = t,
  30736. t = 0,
  30737. i = this.length) : "string" == typeof i && (n = i,
  30738. i = this.length),
  30739. 1 === e.length) {
  30740. var r = e.charCodeAt(0);
  30741. r < 256 && (e = r)
  30742. }
  30743. if (void 0 !== n && "string" != typeof n)
  30744. throw new TypeError("encoding must be a string");
  30745. if ("string" == typeof n && !u.isEncoding(n))
  30746. throw new TypeError("Unknown encoding: " + n)
  30747. } else
  30748. "number" == typeof e && (e &= 255);
  30749. if (t < 0 || this.length < t || this.length < i)
  30750. throw new RangeError("Out of range index");
  30751. if (i <= t)
  30752. return this;
  30753. var o;
  30754. if (t >>>= 0,
  30755. i = void 0 === i ? this.length : i >>> 0,
  30756. "number" == typeof (e = e || 0))
  30757. for (o = t; o < i; ++o)
  30758. this[o] = e;
  30759. else {
  30760. var a = u.isBuffer(e) ? e : S(new u(e,n).toString())
  30761. , s = a.length;
  30762. for (o = 0; o < i - t; ++o)
  30763. this[o + t] = a[o % s]
  30764. }
  30765. return this
  30766. }
  30767. ;
  30768. var t = /[^+\/0-9A-Za-z-_]/g
  30769. }
  30770. ).call(this, "undefined" != typeof global ? global : "undefined" != typeof self ? self : "undefined" != typeof window ? window : {})
  30771. }
  30772. , {
  30773. "base64-js": 199,
  30774. ieee754: 200,
  30775. isarray: 201
  30776. }],
  30777. 199: [function(e, t, i) {
  30778. "use strict";
  30779. function l(e) {
  30780. var t = e.length;
  30781. if (0 < t % 4)
  30782. throw new Error("Invalid string. Length must be a multiple of 4");
  30783. return "=" === e[t - 2] ? 2 : "=" === e[t - 1] ? 1 : 0
  30784. }
  30785. function c(e, t, i) {
  30786. for (var n, r = [], o = t; o < i; o += 3)
  30787. n = (e[o] << 16) + (e[o + 1] << 8) + e[o + 2],
  30788. r.push(h[(a = n) >> 18 & 63] + h[a >> 12 & 63] + h[a >> 6 & 63] + h[63 & a]);
  30789. var a;
  30790. return r.join("")
  30791. }
  30792. i.byteLength = function(e) {
  30793. return 3 * e.length / 4 - l(e)
  30794. }
  30795. ,
  30796. i.toByteArray = function(e) {
  30797. var t, i, n, r, o, a = e.length;
  30798. r = l(e),
  30799. o = new d(3 * a / 4 - r),
  30800. i = 0 < r ? a - 4 : a;
  30801. var s = 0;
  30802. for (t = 0; t < i; t += 4,
  30803. 3)
  30804. n = u[e.charCodeAt(t)] << 18 | u[e.charCodeAt(t + 1)] << 12 | u[e.charCodeAt(t + 2)] << 6 | u[e.charCodeAt(t + 3)],
  30805. o[s++] = n >> 16 & 255,
  30806. o[s++] = n >> 8 & 255,
  30807. o[s++] = 255 & n;
  30808. return 2 === r ? (n = u[e.charCodeAt(t)] << 2 | u[e.charCodeAt(t + 1)] >> 4,
  30809. o[s++] = 255 & n) : 1 === r && (n = u[e.charCodeAt(t)] << 10 | u[e.charCodeAt(t + 1)] << 4 | u[e.charCodeAt(t + 2)] >> 2,
  30810. o[s++] = n >> 8 & 255,
  30811. o[s++] = 255 & n),
  30812. o
  30813. }
  30814. ,
  30815. i.fromByteArray = function(e) {
  30816. for (var t, i = e.length, n = i % 3, r = "", o = [], a = 0, s = i - n; a < s; a += 16383)
  30817. o.push(c(e, a, s < a + 16383 ? s : a + 16383));
  30818. return 1 == n ? (t = e[i - 1],
  30819. r += h[t >> 2],
  30820. r += h[t << 4 & 63],
  30821. r += "==") : 2 == n && (t = (e[i - 2] << 8) + e[i - 1],
  30822. r += h[t >> 10],
  30823. r += h[t >> 4 & 63],
  30824. r += h[t << 2 & 63],
  30825. r += "="),
  30826. o.push(r),
  30827. o.join("")
  30828. }
  30829. ;
  30830. for (var h = [], u = [], d = "undefined" != typeof Uint8Array ? Uint8Array : Array, n = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", r = 0, o = n.length; r < o; ++r)
  30831. h[r] = n[r],
  30832. u[n.charCodeAt(r)] = r;
  30833. u["-".charCodeAt(0)] = 62,
  30834. u["_".charCodeAt(0)] = 63
  30835. }
  30836. , {}],
  30837. 200: [function(e, t, i) {
  30838. i.read = function(e, t, i, n, r) {
  30839. 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];
  30840. for (u += d,
  30841. o = p & (1 << -h) - 1,
  30842. p >>= -h,
  30843. h += s; 0 < h; o = 256 * o + e[t + u],
  30844. u += d,
  30845. h -= 8)
  30846. ;
  30847. for (a = o & (1 << -h) - 1,
  30848. o >>= -h,
  30849. h += n; 0 < h; a = 256 * a + e[t + u],
  30850. u += d,
  30851. h -= 8)
  30852. ;
  30853. if (0 === o)
  30854. o = 1 - c;
  30855. else {
  30856. if (o === l)
  30857. return a ? NaN : 1 / 0 * (p ? -1 : 1);
  30858. a += Math.pow(2, n),
  30859. o -= c
  30860. }
  30861. return (p ? -1 : 1) * a * Math.pow(2, o - n)
  30862. }
  30863. ,
  30864. i.write = function(e, t, i, n, r, o) {
  30865. 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;
  30866. for (t = Math.abs(t),
  30867. isNaN(t) || t === 1 / 0 ? (s = isNaN(t) ? 1 : 0,
  30868. a = h) : (a = Math.floor(Math.log(t) / Math.LN2),
  30869. t * (l = Math.pow(2, -a)) < 1 && (a--,
  30870. l *= 2),
  30871. 2 <= (t += 1 <= a + u ? d / l : d * Math.pow(2, 1 - u)) * l && (a++,
  30872. l /= 2),
  30873. h <= a + u ? (s = 0,
  30874. a = h) : 1 <= a + u ? (s = (t * l - 1) * Math.pow(2, r),
  30875. a += u) : (s = t * Math.pow(2, u - 1) * Math.pow(2, r),
  30876. a = 0)); 8 <= r; e[i + p] = 255 & s,
  30877. p += f,
  30878. s /= 256,
  30879. r -= 8)
  30880. ;
  30881. for (a = a << r | s,
  30882. c += r; 0 < c; e[i + p] = 255 & a,
  30883. p += f,
  30884. a /= 256,
  30885. c -= 8)
  30886. ;
  30887. e[i + p - f] |= 128 * g
  30888. }
  30889. }
  30890. , {}],
  30891. 201: [function(e, t, i) {
  30892. var n = {}.toString;
  30893. t.exports = Array.isArray || function(e) {
  30894. return "[object Array]" == n.call(e)
  30895. }
  30896. }
  30897. , {}],
  30898. 202: [function(e, t, i) {
  30899. function n() {
  30900. this._events = this._events || {},
  30901. this._maxListeners = this._maxListeners || void 0
  30902. }
  30903. function l(e) {
  30904. return "function" == typeof e
  30905. }
  30906. function c(e) {
  30907. return "object" == typeof e && null !== e
  30908. }
  30909. function h(e) {
  30910. return void 0 === e
  30911. }
  30912. ((t.exports = n).EventEmitter = n).prototype._events = void 0,
  30913. n.prototype._maxListeners = void 0,
  30914. n.defaultMaxListeners = 10,
  30915. n.prototype.setMaxListeners = function(e) {
  30916. if (!function(e) {
  30917. return "number" == typeof e
  30918. }(e) || e < 0 || isNaN(e))
  30919. throw TypeError("n must be a positive number");
  30920. return this._maxListeners = e,
  30921. this
  30922. }
  30923. ,
  30924. n.prototype.emit = function(e) {
  30925. var t, i, n, r, o, a;
  30926. if (this._events || (this._events = {}),
  30927. "error" === e && (!this._events.error || c(this._events.error) && !this._events.error.length)) {
  30928. if ((t = arguments[1])instanceof Error)
  30929. throw t;
  30930. var s = new Error('Uncaught, unspecified "error" event. (' + t + ")");
  30931. throw s.context = t,
  30932. s
  30933. }
  30934. if (h(i = this._events[e]))
  30935. return !1;
  30936. if (l(i))
  30937. switch (arguments.length) {
  30938. case 1:
  30939. i.call(this);
  30940. break;
  30941. case 2:
  30942. i.call(this, arguments[1]);
  30943. break;
  30944. case 3:
  30945. i.call(this, arguments[1], arguments[2]);
  30946. break;
  30947. default:
  30948. r = Array.prototype.slice.call(arguments, 1),
  30949. i.apply(this, r)
  30950. }
  30951. else if (c(i))
  30952. for (r = Array.prototype.slice.call(arguments, 1),
  30953. n = (a = i.slice()).length,
  30954. o = 0; o < n; o++)
  30955. a[o].apply(this, r);
  30956. return !0
  30957. }
  30958. ,
  30959. n.prototype.on = n.prototype.addListener = function(e, t) {
  30960. var i;
  30961. if (!l(t))
  30962. throw TypeError("listener must be a function");
  30963. return this._events || (this._events = {}),
  30964. this._events.newListener && this.emit("newListener", e, l(t.listener) ? t.listener : t),
  30965. this._events[e] ? c(this._events[e]) ? this._events[e].push(t) : this._events[e] = [this._events[e], t] : this._events[e] = t,
  30966. 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,
  30967. console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.", this._events[e].length),
  30968. "function" == typeof console.trace && console.trace())),
  30969. this
  30970. }
  30971. ,
  30972. n.prototype.once = function(e, t) {
  30973. function i() {
  30974. this.removeListener(e, i),
  30975. n || (n = !0,
  30976. t.apply(this, arguments))
  30977. }
  30978. if (!l(t))
  30979. throw TypeError("listener must be a function");
  30980. var n = !1;
  30981. return i.listener = t,
  30982. this.on(e, i),
  30983. this
  30984. }
  30985. ,
  30986. n.prototype.removeListener = function(e, t) {
  30987. var i, n, r, o;
  30988. if (!l(t))
  30989. throw TypeError("listener must be a function");
  30990. if (!this._events || !this._events[e])
  30991. return this;
  30992. if (r = (i = this._events[e]).length,
  30993. n = -1,
  30994. i === t || l(i.listener) && i.listener === t)
  30995. delete this._events[e],
  30996. this._events.removeListener && this.emit("removeListener", e, t);
  30997. else if (c(i)) {
  30998. for (o = r; 0 < o--; )
  30999. if (i[o] === t || i[o].listener && i[o].listener === t) {
  31000. n = o;
  31001. break
  31002. }
  31003. if (n < 0)
  31004. return this;
  31005. 1 === i.length ? (i.length = 0,
  31006. delete this._events[e]) : i.splice(n, 1),
  31007. this._events.removeListener && this.emit("removeListener", e, t)
  31008. }
  31009. return this
  31010. }
  31011. ,
  31012. n.prototype.removeAllListeners = function(e) {
  31013. var t, i;
  31014. if (!this._events)
  31015. return this;
  31016. if (!this._events.removeListener)
  31017. return 0 === arguments.length ? this._events = {} : this._events[e] && delete this._events[e],
  31018. this;
  31019. if (0 === arguments.length) {
  31020. for (t in this._events)
  31021. "removeListener" !== t && this.removeAllListeners(t);
  31022. return this.removeAllListeners("removeListener"),
  31023. this._events = {},
  31024. this
  31025. }
  31026. if (l(i = this._events[e]))
  31027. this.removeListener(e, i);
  31028. else if (i)
  31029. for (; i.length; )
  31030. this.removeListener(e, i[i.length - 1]);
  31031. return delete this._events[e],
  31032. this
  31033. }
  31034. ,
  31035. n.prototype.listeners = function(e) {
  31036. return this._events && this._events[e] ? l(this._events[e]) ? [this._events[e]] : this._events[e].slice() : []
  31037. }
  31038. ,
  31039. n.prototype.listenerCount = function(e) {
  31040. if (this._events) {
  31041. var t = this._events[e];
  31042. if (l(t))
  31043. return 1;
  31044. if (t)
  31045. return t.length
  31046. }
  31047. return 0
  31048. }
  31049. ,
  31050. n.listenerCount = function(e, t) {
  31051. return e.listenerCount(t)
  31052. }
  31053. }
  31054. , {}],
  31055. 203: [function(e, t, i) {
  31056. function n() {
  31057. throw new Error("setTimeout has not been defined")
  31058. }
  31059. function r() {
  31060. throw new Error("clearTimeout has not been defined")
  31061. }
  31062. function o(t) {
  31063. if (h === setTimeout)
  31064. return setTimeout(t, 0);
  31065. if ((h === n || !h) && setTimeout)
  31066. return h = setTimeout,
  31067. setTimeout(t, 0);
  31068. try {
  31069. return h(t, 0)
  31070. } catch (e) {
  31071. try {
  31072. return h.call(null, t, 0)
  31073. } catch (e) {
  31074. return h.call(this, t, 0)
  31075. }
  31076. }
  31077. }
  31078. function a() {
  31079. g && p && (g = !1,
  31080. p.length ? f = p.concat(f) : m = -1,
  31081. f.length && s())
  31082. }
  31083. function s() {
  31084. if (!g) {
  31085. var e = o(a);
  31086. g = !0;
  31087. for (var t = f.length; t; ) {
  31088. for (p = f,
  31089. f = []; ++m < t; )
  31090. p && p[m].run();
  31091. m = -1,
  31092. t = f.length
  31093. }
  31094. p = null,
  31095. g = !1,
  31096. function(t) {
  31097. if (u === clearTimeout)
  31098. return clearTimeout(t);
  31099. if ((u === r || !u) && clearTimeout)
  31100. return u = clearTimeout,
  31101. clearTimeout(t);
  31102. try {
  31103. u(t)
  31104. } catch (e) {
  31105. try {
  31106. return u.call(null, t)
  31107. } catch (e) {
  31108. return u.call(this, t)
  31109. }
  31110. }
  31111. }(e)
  31112. }
  31113. }
  31114. function l(e, t) {
  31115. this.fun = e,
  31116. this.array = t
  31117. }
  31118. function c() {}
  31119. var h, u, d = t.exports = {};
  31120. !function() {
  31121. try {
  31122. h = "function" == typeof setTimeout ? setTimeout : n
  31123. } catch (e) {
  31124. h = n
  31125. }
  31126. try {
  31127. u = "function" == typeof clearTimeout ? clearTimeout : r
  31128. } catch (e) {
  31129. u = r
  31130. }
  31131. }();
  31132. var p, f = [], g = !1, m = -1;
  31133. d.nextTick = function(e) {
  31134. var t = new Array(arguments.length - 1);
  31135. if (1 < arguments.length)
  31136. for (var i = 1; i < arguments.length; i++)
  31137. t[i - 1] = arguments[i];
  31138. f.push(new l(e,t)),
  31139. 1 !== f.length || g || o(s)
  31140. }
  31141. ,
  31142. l.prototype.run = function() {
  31143. this.fun.apply(null, this.array)
  31144. }
  31145. ,
  31146. d.title = "browser",
  31147. d.browser = !0,
  31148. d.env = {},
  31149. d.argv = [],
  31150. d.version = "",
  31151. d.versions = {},
  31152. d.on = c,
  31153. d.addListener = c,
  31154. d.once = c,
  31155. d.off = c,
  31156. d.removeListener = c,
  31157. d.removeAllListeners = c,
  31158. d.emit = c,
  31159. d.binding = function(e) {
  31160. throw new Error("process.binding is not supported")
  31161. }
  31162. ,
  31163. d.cwd = function() {
  31164. return "/"
  31165. }
  31166. ,
  31167. d.chdir = function(e) {
  31168. throw new Error("process.chdir is not supported")
  31169. }
  31170. ,
  31171. d.umask = function() {
  31172. return 0
  31173. }
  31174. }
  31175. , {}],
  31176. 204: [function(e, O, L) {
  31177. (function(P) {
  31178. !function(e) {
  31179. function v(e) {
  31180. throw new RangeError(g[e])
  31181. }
  31182. function r(e, t) {
  31183. for (var i = e.length, n = []; i--; )
  31184. n[i] = t(e[i]);
  31185. return n
  31186. }
  31187. function t(e, t) {
  31188. var i = e.split("@")
  31189. , n = "";
  31190. return 1 < i.length && (n = i[0] + "@",
  31191. e = i[1]),
  31192. n + r((e = e.replace(f, ".")).split("."), t).join(".")
  31193. }
  31194. function y(e) {
  31195. for (var t, i, n = [], r = 0, o = e.length; r < o; )
  31196. 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),
  31197. r--) : n.push(t);
  31198. return n
  31199. }
  31200. function A(e) {
  31201. return r(e, function(e) {
  31202. var t = "";
  31203. return 65535 < e && (t += R((e -= 65536) >>> 10 & 1023 | 55296),
  31204. e = 56320 | 1023 & e),
  31205. t + R(e)
  31206. }).join("")
  31207. }
  31208. function C(e, t) {
  31209. return e + 22 + 75 * (e < 26) - ((0 != t) << 5)
  31210. }
  31211. function I(e, t, i) {
  31212. var n = 0;
  31213. for (e = i ? M(e / u) : e >> 1,
  31214. e += M(e / t); m * w >> 1 < e; n += _)
  31215. e = M(e / m);
  31216. return M(n + (m + 1) * e / (e + h))
  31217. }
  31218. function i(e) {
  31219. var t, i, n, r, o, a, s, l, c, h, u, d = [], p = e.length, f = 0, g = x, m = T;
  31220. for ((i = e.lastIndexOf(S)) < 0 && (i = 0),
  31221. n = 0; n < i; ++n)
  31222. 128 <= e.charCodeAt(n) && v("not-basic"),
  31223. d.push(e.charCodeAt(n));
  31224. for (r = 0 < i ? i + 1 : 0; r < p; ) {
  31225. for (o = f,
  31226. a = 1,
  31227. s = _; p <= r && v("invalid-input"),
  31228. u = e.charCodeAt(r++),
  31229. (_ <= (l = u - 48 < 10 ? u - 22 : u - 65 < 26 ? u - 65 : u - 97 < 26 ? u - 97 : _) || l > M((E - f) / a)) && v("overflow"),
  31230. f += l * a,
  31231. !(l < (c = s <= m ? b : m + w <= s ? w : s - m)); s += _)
  31232. a > M(E / (h = _ - c)) && v("overflow"),
  31233. a *= h;
  31234. m = I(f - o, t = d.length + 1, 0 == o),
  31235. M(f / t) > E - g && v("overflow"),
  31236. g += M(f / t),
  31237. f %= t,
  31238. d.splice(f++, 0, g)
  31239. }
  31240. return A(d)
  31241. }
  31242. function n(e) {
  31243. var t, i, n, r, o, a, s, l, c, h, u, d, p, f, g, m = [];
  31244. for (d = (e = y(e)).length,
  31245. t = x,
  31246. o = T,
  31247. a = i = 0; a < d; ++a)
  31248. (u = e[a]) < 128 && m.push(R(u));
  31249. for (n = r = m.length,
  31250. r && m.push(S); n < d; ) {
  31251. for (s = E,
  31252. a = 0; a < d; ++a)
  31253. t <= (u = e[a]) && u < s && (s = u);
  31254. for (s - t > M((E - i) / (p = n + 1)) && v("overflow"),
  31255. i += (s - t) * p,
  31256. t = s,
  31257. a = 0; a < d; ++a)
  31258. if ((u = e[a]) < t && ++i > E && v("overflow"),
  31259. u == t) {
  31260. for (l = i,
  31261. c = _; !(l < (h = c <= o ? b : o + w <= c ? w : c - o)); c += _)
  31262. g = l - h,
  31263. f = _ - h,
  31264. m.push(R(C(h + g % f, 0))),
  31265. l = M(g / f);
  31266. m.push(R(C(l, 0))),
  31267. o = I(i, p, n == r),
  31268. i = 0,
  31269. ++n
  31270. }
  31271. ++i,
  31272. ++t
  31273. }
  31274. return m.join("")
  31275. }
  31276. var o = "object" == typeof L && L && !L.nodeType && L
  31277. , a = "object" == typeof O && O && !O.nodeType && O
  31278. , s = "object" == typeof P && P;
  31279. s.global !== s && s.window !== s && s.self !== s || (e = s);
  31280. 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 = {
  31281. overflow: "Overflow: input needs wider integers to process",
  31282. "not-basic": "Illegal input >= 0x80 (not a basic code point)",
  31283. "invalid-input": "Invalid input"
  31284. }, m = _ - b, M = Math.floor, R = String.fromCharCode;
  31285. if (l = {
  31286. version: "1.4.1",
  31287. ucs2: {
  31288. decode: y,
  31289. encode: A
  31290. },
  31291. decode: i,
  31292. encode: n,
  31293. toASCII: function(e) {
  31294. return t(e, function(e) {
  31295. return p.test(e) ? "xn--" + n(e) : e
  31296. })
  31297. },
  31298. toUnicode: function(e) {
  31299. return t(e, function(e) {
  31300. return d.test(e) ? i(e.slice(4).toLowerCase()) : e
  31301. })
  31302. }
  31303. },
  31304. "function" == typeof define && "object" == typeof define.amd && define.amd)
  31305. define("punycode", function() {
  31306. return l
  31307. });
  31308. else if (o && a)
  31309. if (O.exports == o)
  31310. a.exports = l;
  31311. else
  31312. for (c in l)
  31313. l.hasOwnProperty(c) && (o[c] = l[c]);
  31314. else
  31315. e.punycode = l
  31316. }(this)
  31317. }
  31318. ).call(this, "undefined" != typeof global ? global : "undefined" != typeof self ? self : "undefined" != typeof window ? window : {})
  31319. }
  31320. , {}],
  31321. 205: [function(e, t, i) {
  31322. "use strict";
  31323. t.exports = function(e, t, i, n) {
  31324. t = t || "&",
  31325. i = i || "=";
  31326. var r = {};
  31327. if ("string" != typeof e || 0 === e.length)
  31328. return r;
  31329. var o = /\+/g;
  31330. e = e.split(t);
  31331. var a = 1e3;
  31332. n && "number" == typeof n.maxKeys && (a = n.maxKeys);
  31333. var s, l, c = e.length;
  31334. 0 < a && a < c && (c = a);
  31335. for (var h = 0; h < c; ++h) {
  31336. var u, d, p, f, g = e[h].replace(o, "%20"), m = g.indexOf(i);
  31337. d = 0 <= m ? (u = g.substr(0, m),
  31338. g.substr(m + 1)) : (u = g,
  31339. ""),
  31340. p = decodeURIComponent(u),
  31341. f = decodeURIComponent(d),
  31342. s = r,
  31343. l = p,
  31344. Object.prototype.hasOwnProperty.call(s, l) ? v(r[p]) ? r[p].push(f) : r[p] = [r[p], f] : r[p] = f
  31345. }
  31346. return r
  31347. }
  31348. ;
  31349. var v = Array.isArray || function(e) {
  31350. return "[object Array]" === Object.prototype.toString.call(e)
  31351. }
  31352. }
  31353. , {}],
  31354. 206: [function(e, t, i) {
  31355. "use strict";
  31356. function o(e, t) {
  31357. if (e.map)
  31358. return e.map(t);
  31359. for (var i = [], n = 0; n < e.length; n++)
  31360. i.push(t(e[n], n));
  31361. return i
  31362. }
  31363. function a(e) {
  31364. switch (typeof e) {
  31365. case "string":
  31366. return e;
  31367. case "boolean":
  31368. return e ? "true" : "false";
  31369. case "number":
  31370. return isFinite(e) ? e : "";
  31371. default:
  31372. return ""
  31373. }
  31374. }
  31375. t.exports = function(i, n, r, e) {
  31376. return n = n || "&",
  31377. r = r || "=",
  31378. null === i && (i = void 0),
  31379. "object" == typeof i ? o(l(i), function(e) {
  31380. var t = encodeURIComponent(a(e)) + r;
  31381. return s(i[e]) ? o(i[e], function(e) {
  31382. return t + encodeURIComponent(a(e))
  31383. }).join(n) : t + encodeURIComponent(a(i[e]))
  31384. }).join(n) : e ? encodeURIComponent(a(e)) + r + encodeURIComponent(a(i)) : ""
  31385. }
  31386. ;
  31387. var s = Array.isArray || function(e) {
  31388. return "[object Array]" === Object.prototype.toString.call(e)
  31389. }
  31390. , l = Object.keys || function(e) {
  31391. var t = [];
  31392. for (var i in e)
  31393. Object.prototype.hasOwnProperty.call(e, i) && t.push(i);
  31394. return t
  31395. }
  31396. }
  31397. , {}],
  31398. 207: [function(e, t, i) {
  31399. "use strict";
  31400. i.decode = i.parse = e("./decode"),
  31401. i.encode = i.stringify = e("./encode")
  31402. }
  31403. , {
  31404. "./decode": 205,
  31405. "./encode": 206
  31406. }],
  31407. 208: [function(e, t, i) {
  31408. "use strict";
  31409. function x() {
  31410. this.protocol = null,
  31411. this.slashes = null,
  31412. this.auth = null,
  31413. this.host = null,
  31414. this.port = null,
  31415. this.hostname = null,
  31416. this.hash = null,
  31417. this.search = null,
  31418. this.query = null,
  31419. this.pathname = null,
  31420. this.path = null,
  31421. this.href = null
  31422. }
  31423. function n(e, t, i) {
  31424. if (e && D.isObject(e) && e instanceof x)
  31425. return e;
  31426. var n = new x;
  31427. return n.parse(e, t, i),
  31428. n
  31429. }
  31430. var L = e("punycode")
  31431. , D = e("./util");
  31432. i.parse = n,
  31433. i.resolve = function(e, t) {
  31434. return n(e, !1, !0).resolve(t)
  31435. }
  31436. ,
  31437. i.resolveObject = function(e, t) {
  31438. return e ? n(e, !1, !0).resolveObject(t) : t
  31439. }
  31440. ,
  31441. i.format = function(e) {
  31442. return D.isString(e) && (e = n(e)),
  31443. e instanceof x ? e.format() : x.prototype.format.call(e)
  31444. }
  31445. ,
  31446. i.Url = x;
  31447. var N = /^([a-z0-9.+-]+:)/i
  31448. , r = /:[0-9]*$/
  31449. , F = /^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/
  31450. , o = ["{", "}", "|", "\\", "^", "`"].concat(["<", ">", '"', "`", " ", "\r", "\n", "\t"])
  31451. , B = ["'"].concat(o)
  31452. , V = ["%", "/", "?", ";", "#"].concat(B)
  31453. , k = ["/", "?", "#"]
  31454. , U = /^[+a-z0-9A-Z_-]{0,63}$/
  31455. , H = /^([+a-z0-9A-Z_-]{0,63})(.*)$/
  31456. , z = {
  31457. javascript: !0,
  31458. "javascript:": !0
  31459. }
  31460. , G = {
  31461. javascript: !0,
  31462. "javascript:": !0
  31463. }
  31464. , W = {
  31465. http: !0,
  31466. https: !0,
  31467. ftp: !0,
  31468. gopher: !0,
  31469. file: !0,
  31470. "http:": !0,
  31471. "https:": !0,
  31472. "ftp:": !0,
  31473. "gopher:": !0,
  31474. "file:": !0
  31475. }
  31476. , j = e("querystring");
  31477. x.prototype.parse = function(e, t, i) {
  31478. if (!D.isString(e))
  31479. throw new TypeError("Parameter 'url' must be a string, not " + typeof e);
  31480. var n = e.indexOf("?")
  31481. , r = -1 !== n && n < e.indexOf("#") ? "?" : "#"
  31482. , o = e.split(r);
  31483. o[0] = o[0].replace(/\\/g, "/");
  31484. var a = e = o.join(r);
  31485. if (a = a.trim(),
  31486. !i && 1 === e.split("#").length) {
  31487. var s = F.exec(a);
  31488. if (s)
  31489. return this.path = a,
  31490. this.href = a,
  31491. this.pathname = s[1],
  31492. s[2] ? (this.search = s[2],
  31493. this.query = t ? j.parse(this.search.substr(1)) : this.search.substr(1)) : t && (this.search = "",
  31494. this.query = {}),
  31495. this
  31496. }
  31497. var l = N.exec(a);
  31498. if (l) {
  31499. var c = (l = l[0]).toLowerCase();
  31500. this.protocol = c,
  31501. a = a.substr(l.length)
  31502. }
  31503. if (i || l || a.match(/^\/\/[^@\/]+@[^@\/]+/)) {
  31504. var h = "//" === a.substr(0, 2);
  31505. !h || l && G[l] || (a = a.substr(2),
  31506. this.slashes = !0)
  31507. }
  31508. if (!G[l] && (h || l && !W[l])) {
  31509. for (var u = -1, d = 0; d < k.length; d++) {
  31510. -1 !== (g = a.indexOf(k[d])) && (-1 === u || g < u) && (u = g)
  31511. }
  31512. var p, f;
  31513. -1 !== (f = -1 === u ? a.lastIndexOf("@") : a.lastIndexOf("@", u)) && (p = a.slice(0, f),
  31514. a = a.slice(f + 1),
  31515. this.auth = decodeURIComponent(p)),
  31516. u = -1;
  31517. for (d = 0; d < V.length; d++) {
  31518. var g;
  31519. -1 !== (g = a.indexOf(V[d])) && (-1 === u || g < u) && (u = g)
  31520. }
  31521. -1 === u && (u = a.length),
  31522. this.host = a.slice(0, u),
  31523. a = a.slice(u),
  31524. this.parseHost(),
  31525. this.hostname = this.hostname || "";
  31526. var m = "[" === this.hostname[0] && "]" === this.hostname[this.hostname.length - 1];
  31527. if (!m)
  31528. for (var v = this.hostname.split(/\./), y = (d = 0,
  31529. v.length); d < y; d++) {
  31530. var A = v[d];
  31531. if (A && !A.match(U)) {
  31532. for (var C = "", I = 0, E = A.length; I < E; I++)
  31533. C += 127 < A.charCodeAt(I) ? "x" : A[I];
  31534. if (!C.match(U)) {
  31535. var _ = v.slice(0, d)
  31536. , b = v.slice(d + 1)
  31537. , w = A.match(H);
  31538. w && (_.push(w[1]),
  31539. b.unshift(w[2])),
  31540. b.length && (a = "/" + b.join(".") + a),
  31541. this.hostname = _.join(".");
  31542. break
  31543. }
  31544. }
  31545. }
  31546. 255 < this.hostname.length ? this.hostname = "" : this.hostname = this.hostname.toLowerCase(),
  31547. m || (this.hostname = L.toASCII(this.hostname));
  31548. var T = this.port ? ":" + this.port : ""
  31549. , x = this.hostname || "";
  31550. this.host = x + T,
  31551. this.href += this.host,
  31552. m && (this.hostname = this.hostname.substr(1, this.hostname.length - 2),
  31553. "/" !== a[0] && (a = "/" + a))
  31554. }
  31555. if (!z[c])
  31556. for (d = 0,
  31557. y = B.length; d < y; d++) {
  31558. var S = B[d];
  31559. if (-1 !== a.indexOf(S)) {
  31560. var M = encodeURIComponent(S);
  31561. M === S && (M = escape(S)),
  31562. a = a.split(S).join(M)
  31563. }
  31564. }
  31565. var R = a.indexOf("#");
  31566. -1 !== R && (this.hash = a.substr(R),
  31567. a = a.slice(0, R));
  31568. var P = a.indexOf("?");
  31569. if (-1 !== P ? (this.search = a.substr(P),
  31570. this.query = a.substr(P + 1),
  31571. t && (this.query = j.parse(this.query)),
  31572. a = a.slice(0, P)) : t && (this.search = "",
  31573. this.query = {}),
  31574. a && (this.pathname = a),
  31575. W[c] && this.hostname && !this.pathname && (this.pathname = "/"),
  31576. this.pathname || this.search) {
  31577. T = this.pathname || "";
  31578. var O = this.search || "";
  31579. this.path = T + O
  31580. }
  31581. return this.href = this.format(),
  31582. this
  31583. }
  31584. ,
  31585. x.prototype.format = function() {
  31586. var e = this.auth || "";
  31587. e && (e = (e = encodeURIComponent(e)).replace(/%3A/i, ":"),
  31588. e += "@");
  31589. var t = this.protocol || ""
  31590. , i = this.pathname || ""
  31591. , n = this.hash || ""
  31592. , r = !1
  31593. , o = "";
  31594. this.host ? r = e + this.host : this.hostname && (r = e + (-1 === this.hostname.indexOf(":") ? this.hostname : "[" + this.hostname + "]"),
  31595. this.port && (r += ":" + this.port)),
  31596. this.query && D.isObject(this.query) && Object.keys(this.query).length && (o = j.stringify(this.query));
  31597. var a = this.search || o && "?" + o || "";
  31598. return t && ":" !== t.substr(-1) && (t += ":"),
  31599. this.slashes || (!t || W[t]) && !1 !== r ? (r = "//" + (r || ""),
  31600. i && "/" !== i.charAt(0) && (i = "/" + i)) : r = r || "",
  31601. n && "#" !== n.charAt(0) && (n = "#" + n),
  31602. a && "?" !== a.charAt(0) && (a = "?" + a),
  31603. t + r + (i = i.replace(/[?#]/g, function(e) {
  31604. return encodeURIComponent(e)
  31605. })) + (a = a.replace("#", "%23")) + n
  31606. }
  31607. ,
  31608. x.prototype.resolve = function(e) {
  31609. return this.resolveObject(n(e, !1, !0)).format()
  31610. }
  31611. ,
  31612. x.prototype.resolveObject = function(e) {
  31613. if (D.isString(e)) {
  31614. var t = new x;
  31615. t.parse(e, !1, !0),
  31616. e = t
  31617. }
  31618. for (var i = new x, n = Object.keys(this), r = 0; r < n.length; r++) {
  31619. var o = n[r];
  31620. i[o] = this[o]
  31621. }
  31622. if (i.hash = e.hash,
  31623. "" === e.href)
  31624. return i.href = i.format(),
  31625. i;
  31626. if (e.slashes && !e.protocol) {
  31627. for (var a = Object.keys(e), s = 0; s < a.length; s++) {
  31628. var l = a[s];
  31629. "protocol" !== l && (i[l] = e[l])
  31630. }
  31631. return W[i.protocol] && i.hostname && !i.pathname && (i.path = i.pathname = "/"),
  31632. i.href = i.format(),
  31633. i
  31634. }
  31635. if (e.protocol && e.protocol !== i.protocol) {
  31636. if (!W[e.protocol]) {
  31637. for (var c = Object.keys(e), h = 0; h < c.length; h++) {
  31638. var u = c[h];
  31639. i[u] = e[u]
  31640. }
  31641. return i.href = i.format(),
  31642. i
  31643. }
  31644. if (i.protocol = e.protocol,
  31645. e.host || G[e.protocol])
  31646. i.pathname = e.pathname;
  31647. else {
  31648. for (var d = (e.pathname || "").split("/"); d.length && !(e.host = d.shift()); )
  31649. ;
  31650. e.host || (e.host = ""),
  31651. e.hostname || (e.hostname = ""),
  31652. "" !== d[0] && d.unshift(""),
  31653. d.length < 2 && d.unshift(""),
  31654. i.pathname = d.join("/")
  31655. }
  31656. if (i.search = e.search,
  31657. i.query = e.query,
  31658. i.host = e.host || "",
  31659. i.auth = e.auth,
  31660. i.hostname = e.hostname || e.host,
  31661. i.port = e.port,
  31662. i.pathname || i.search) {
  31663. var p = i.pathname || ""
  31664. , f = i.search || "";
  31665. i.path = p + f
  31666. }
  31667. return i.slashes = i.slashes || e.slashes,
  31668. i.href = i.format(),
  31669. i
  31670. }
  31671. var g = i.pathname && "/" === i.pathname.charAt(0)
  31672. , m = e.host || e.pathname && "/" === e.pathname.charAt(0)
  31673. , v = m || g || i.host && e.pathname
  31674. , y = v
  31675. , A = i.pathname && i.pathname.split("/") || []
  31676. , C = (d = e.pathname && e.pathname.split("/") || [],
  31677. i.protocol && !W[i.protocol]);
  31678. if (C && (i.hostname = "",
  31679. i.port = null,
  31680. i.host && ("" === A[0] ? A[0] = i.host : A.unshift(i.host)),
  31681. i.host = "",
  31682. e.protocol && (e.hostname = null,
  31683. e.port = null,
  31684. e.host && ("" === d[0] ? d[0] = e.host : d.unshift(e.host)),
  31685. e.host = null),
  31686. v = v && ("" === d[0] || "" === A[0])),
  31687. m)
  31688. i.host = e.host || "" === e.host ? e.host : i.host,
  31689. i.hostname = e.hostname || "" === e.hostname ? e.hostname : i.hostname,
  31690. i.search = e.search,
  31691. i.query = e.query,
  31692. A = d;
  31693. else if (d.length)
  31694. (A = A || []).pop(),
  31695. A = A.concat(d),
  31696. i.search = e.search,
  31697. i.query = e.query;
  31698. else if (!D.isNullOrUndefined(e.search)) {
  31699. if (C)
  31700. i.hostname = i.host = A.shift(),
  31701. (w = !!(i.host && 0 < i.host.indexOf("@")) && i.host.split("@")) && (i.auth = w.shift(),
  31702. i.host = i.hostname = w.shift());
  31703. return i.search = e.search,
  31704. i.query = e.query,
  31705. D.isNull(i.pathname) && D.isNull(i.search) || (i.path = (i.pathname ? i.pathname : "") + (i.search ? i.search : "")),
  31706. i.href = i.format(),
  31707. i
  31708. }
  31709. if (!A.length)
  31710. return i.pathname = null,
  31711. i.search ? i.path = "/" + i.search : i.path = null,
  31712. i.href = i.format(),
  31713. i;
  31714. 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--)
  31715. "." === (I = A[b]) ? A.splice(b, 1) : ".." === I ? (A.splice(b, 1),
  31716. _++) : _ && (A.splice(b, 1),
  31717. _--);
  31718. if (!v && !y)
  31719. for (; _--; )
  31720. A.unshift("..");
  31721. !v || "" === A[0] || A[0] && "/" === A[0].charAt(0) || A.unshift(""),
  31722. E && "/" !== A.join("/").substr(-1) && A.push("");
  31723. var w, T = "" === A[0] || A[0] && "/" === A[0].charAt(0);
  31724. C && (i.hostname = i.host = T ? "" : A.length ? A.shift() : "",
  31725. (w = !!(i.host && 0 < i.host.indexOf("@")) && i.host.split("@")) && (i.auth = w.shift(),
  31726. i.host = i.hostname = w.shift()));
  31727. return (v = v || i.host && A.length) && !T && A.unshift(""),
  31728. A.length ? i.pathname = A.join("/") : (i.pathname = null,
  31729. i.path = null),
  31730. D.isNull(i.pathname) && D.isNull(i.search) || (i.path = (i.pathname ? i.pathname : "") + (i.search ? i.search : "")),
  31731. i.auth = e.auth || i.auth,
  31732. i.slashes = i.slashes || e.slashes,
  31733. i.href = i.format(),
  31734. i
  31735. }
  31736. ,
  31737. x.prototype.parseHost = function() {
  31738. var e = this.host
  31739. , t = r.exec(e);
  31740. t && (":" !== (t = t[0]) && (this.port = t.substr(1)),
  31741. e = e.substr(0, e.length - t.length)),
  31742. e && (this.hostname = e)
  31743. }
  31744. }
  31745. , {
  31746. "./util": 209,
  31747. punycode: 204,
  31748. querystring: 207
  31749. }],
  31750. 209: [function(e, t, i) {
  31751. "use strict";
  31752. t.exports = {
  31753. isString: function(e) {
  31754. return "string" == typeof e
  31755. },
  31756. isObject: function(e) {
  31757. return "object" == typeof e && null !== e
  31758. },
  31759. isNull: function(e) {
  31760. return null === e
  31761. },
  31762. isNullOrUndefined: function(e) {
  31763. return null == e
  31764. }
  31765. }
  31766. }
  31767. , {}],
  31768. 210: [function(e, t, i) {
  31769. "use strict";
  31770. function r(e) {
  31771. return c + e
  31772. }
  31773. function s(e) {
  31774. if ("string" != typeof e)
  31775. throw new TypeError("key must be a string.")
  31776. }
  31777. var l = Object.prototype.hasOwnProperty
  31778. , c = "~";
  31779. t.exports = function(t) {
  31780. var o = Object.create(null)
  31781. , n = 0
  31782. , a = {};
  31783. return function(e, t) {
  31784. for (var i in t)
  31785. Object.defineProperty(e, i, {
  31786. value: t[i],
  31787. configurable: !0,
  31788. writable: !0
  31789. })
  31790. }(a, {
  31791. get: function(e, t) {
  31792. s(e);
  31793. var i = r(e);
  31794. return i in o ? o[i] : t
  31795. },
  31796. set: function(e, t) {
  31797. s(e);
  31798. var i = r(e);
  31799. return i in o || ++n,
  31800. o[i] = t
  31801. },
  31802. has: function(e) {
  31803. return s(e),
  31804. r(e)in o
  31805. },
  31806. delete: function(e) {
  31807. s(e);
  31808. var t = r(e);
  31809. return t in o && (--n,
  31810. delete o[t],
  31811. !0)
  31812. },
  31813. clear: function() {
  31814. o = Object.create(null),
  31815. n = 0
  31816. },
  31817. forEach: function(e, t) {
  31818. if ("function" != typeof e)
  31819. throw new TypeError("`callback` must be a function");
  31820. for (var i in o)
  31821. if (l.call(o, i)) {
  31822. var n = i.substring(c.length)
  31823. , r = o[i];
  31824. e.call(t, r, n, a)
  31825. }
  31826. }
  31827. }),
  31828. Object.defineProperty(a, "size", {
  31829. get: function() {
  31830. return n
  31831. },
  31832. configurable: !0
  31833. }),
  31834. "object" == typeof t && null !== t && Object.keys(t).forEach(function(e) {
  31835. a.set(e, t[e])
  31836. }),
  31837. a
  31838. }
  31839. }
  31840. , {}],
  31841. 211: [function(e, t, i) {
  31842. t.exports = e("./lib/heap")
  31843. }
  31844. , {
  31845. "./lib/heap": 212
  31846. }],
  31847. 212: [function(e, y, A) {
  31848. (function() {
  31849. var e, d, l, p, f, t, c, i, g, m, n, r, o, h, u, a, s;
  31850. function v(e) {
  31851. this.cmp = null != e ? e : d,
  31852. this.nodes = []
  31853. }
  31854. l = Math.floor,
  31855. m = Math.min,
  31856. d = function(e, t) {
  31857. return e < t ? -1 : t < e ? 1 : 0
  31858. }
  31859. ,
  31860. g = function(e, t, i, n, r) {
  31861. var o;
  31862. if (null == i && (i = 0),
  31863. null == r && (r = d),
  31864. i < 0)
  31865. throw new Error("lo must be non-negative");
  31866. for (null == n && (n = e.length); i < n; )
  31867. r(t, e[o = l((i + n) / 2)]) < 0 ? n = o : i = o + 1;
  31868. return [].splice.apply(e, [i, i - i].concat(t)),
  31869. t
  31870. }
  31871. ,
  31872. t = function(e, t, i) {
  31873. return null == i && (i = d),
  31874. e.push(t),
  31875. h(e, 0, e.length - 1, i)
  31876. }
  31877. ,
  31878. f = function(e, t) {
  31879. var i, n;
  31880. return null == t && (t = d),
  31881. i = e.pop(),
  31882. e.length ? (n = e[0],
  31883. e[0] = i,
  31884. u(e, 0, t)) : n = i,
  31885. n
  31886. }
  31887. ,
  31888. i = function(e, t, i) {
  31889. var n;
  31890. return null == i && (i = d),
  31891. n = e[0],
  31892. e[0] = t,
  31893. u(e, 0, i),
  31894. n
  31895. }
  31896. ,
  31897. c = function(e, t, i) {
  31898. var n;
  31899. return null == i && (i = d),
  31900. e.length && i(e[0], t) < 0 && (t = (n = [e[0], t])[0],
  31901. e[0] = n[1],
  31902. u(e, 0, i)),
  31903. t
  31904. }
  31905. ,
  31906. p = function(i, e) {
  31907. var t, n, r, o, a, s;
  31908. for (null == e && (e = d),
  31909. a = [],
  31910. n = 0,
  31911. r = (o = function() {
  31912. s = [];
  31913. for (var e = 0, t = l(i.length / 2); 0 <= t ? e < t : t < e; 0 <= t ? e++ : e--)
  31914. s.push(e);
  31915. return s
  31916. }
  31917. .apply(this).reverse()).length; n < r; n++)
  31918. t = o[n],
  31919. a.push(u(i, t, e));
  31920. return a
  31921. }
  31922. ,
  31923. o = function(e, t, i) {
  31924. var n;
  31925. if (null == i && (i = d),
  31926. -1 !== (n = e.indexOf(t)))
  31927. return h(e, 0, n, i),
  31928. u(e, n, i)
  31929. }
  31930. ,
  31931. n = function(e, t, i) {
  31932. var n, r, o, a, s;
  31933. if (null == i && (i = d),
  31934. !(r = e.slice(0, t)).length)
  31935. return r;
  31936. for (p(r, i),
  31937. o = 0,
  31938. a = (s = e.slice(t)).length; o < a; o++)
  31939. n = s[o],
  31940. c(r, n, i);
  31941. return r.sort(i).reverse()
  31942. }
  31943. ,
  31944. r = function(e, t, i) {
  31945. var n, r, o, a, s, l, c, h, u;
  31946. if (null == i && (i = d),
  31947. 10 * t <= e.length) {
  31948. if (!(o = e.slice(0, t).sort(i)).length)
  31949. return o;
  31950. for (r = o[o.length - 1],
  31951. a = 0,
  31952. l = (c = e.slice(t)).length; a < l; a++)
  31953. i(n = c[a], r) < 0 && (g(o, n, 0, null, i),
  31954. o.pop(),
  31955. r = o[o.length - 1]);
  31956. return o
  31957. }
  31958. for (p(e, i),
  31959. u = [],
  31960. s = 0,
  31961. h = m(t, e.length); 0 <= h ? s < h : h < s; 0 <= h ? ++s : --s)
  31962. u.push(f(e, i));
  31963. return u
  31964. }
  31965. ,
  31966. h = function(e, t, i, n) {
  31967. var r, o, a;
  31968. for (null == n && (n = d),
  31969. r = e[i]; t < i && n(r, o = e[a = i - 1 >> 1]) < 0; )
  31970. e[i] = o,
  31971. i = a;
  31972. return e[i] = r
  31973. }
  31974. ,
  31975. u = function(e, t, i) {
  31976. var n, r, o, a, s;
  31977. for (null == i && (i = d),
  31978. r = e.length,
  31979. o = e[s = t],
  31980. n = 2 * t + 1; n < r; )
  31981. (a = n + 1) < r && !(i(e[n], e[a]) < 0) && (n = a),
  31982. e[t] = e[n],
  31983. n = 2 * (t = n) + 1;
  31984. return e[t] = o,
  31985. h(e, s, t, i)
  31986. }
  31987. ,
  31988. v.push = t,
  31989. v.pop = f,
  31990. v.replace = i,
  31991. v.pushpop = c,
  31992. v.heapify = p,
  31993. v.updateItem = o,
  31994. v.nlargest = n,
  31995. v.nsmallest = r,
  31996. v.prototype.push = function(e) {
  31997. return t(this.nodes, e, this.cmp)
  31998. }
  31999. ,
  32000. v.prototype.pop = function() {
  32001. return f(this.nodes, this.cmp)
  32002. }
  32003. ,
  32004. v.prototype.peek = function() {
  32005. return this.nodes[0]
  32006. }
  32007. ,
  32008. v.prototype.contains = function(e) {
  32009. return -1 !== this.nodes.indexOf(e)
  32010. }
  32011. ,
  32012. v.prototype.replace = function(e) {
  32013. return i(this.nodes, e, this.cmp)
  32014. }
  32015. ,
  32016. v.prototype.pushpop = function(e) {
  32017. return c(this.nodes, e, this.cmp)
  32018. }
  32019. ,
  32020. v.prototype.heapify = function() {
  32021. return p(this.nodes, this.cmp)
  32022. }
  32023. ,
  32024. v.prototype.updateItem = function(e) {
  32025. return o(this.nodes, e, this.cmp)
  32026. }
  32027. ,
  32028. v.prototype.clear = function() {
  32029. return this.nodes = []
  32030. }
  32031. ,
  32032. v.prototype.empty = function() {
  32033. return 0 === this.nodes.length
  32034. }
  32035. ,
  32036. v.prototype.size = function() {
  32037. return this.nodes.length
  32038. }
  32039. ,
  32040. v.prototype.clone = function() {
  32041. var e;
  32042. return (e = new v).nodes = this.nodes.slice(0),
  32043. e
  32044. }
  32045. ,
  32046. v.prototype.toArray = function() {
  32047. return this.nodes.slice(0)
  32048. }
  32049. ,
  32050. v.prototype.insert = v.prototype.push,
  32051. v.prototype.top = v.prototype.peek,
  32052. v.prototype.front = v.prototype.peek,
  32053. v.prototype.has = v.prototype.contains,
  32054. v.prototype.copy = v.prototype.clone,
  32055. e = v,
  32056. a = this,
  32057. s = function() {
  32058. return e
  32059. }
  32060. ,
  32061. "function" == typeof define && define.amd ? define([], s) : "object" == typeof A ? y.exports = s() : a.Heap = s()
  32062. }
  32063. ).call(this)
  32064. }
  32065. , {}],
  32066. 213: [function(e, t, i) {
  32067. function n() {}
  32068. function o(e) {
  32069. if ("object" != typeof this)
  32070. throw new TypeError("Promises must be constructed via new");
  32071. if ("function" != typeof e)
  32072. throw new TypeError("not a function");
  32073. this._state = 0,
  32074. this._handled = !1,
  32075. this._value = void 0,
  32076. this._deferreds = [],
  32077. h(e, this)
  32078. }
  32079. function r(i, n) {
  32080. for (; 3 === i._state; )
  32081. i = i._value;
  32082. return 0 === i._state ? void i._deferreds.push(n) : (i._handled = !0,
  32083. void o._immediateFn(function() {
  32084. var e = 1 === i._state ? n.onFulfilled : n.onRejected;
  32085. if (null !== e) {
  32086. var t;
  32087. try {
  32088. t = e(i._value)
  32089. } catch (e) {
  32090. return void s(n.promise, e)
  32091. }
  32092. a(n.promise, t)
  32093. } else
  32094. (1 === i._state ? a : s)(n.promise, i._value)
  32095. }))
  32096. }
  32097. function a(e, t) {
  32098. try {
  32099. if (t === e)
  32100. throw new TypeError("A promise cannot be resolved with itself.");
  32101. if (t && ("object" == typeof t || "function" == typeof t)) {
  32102. var i = t.then;
  32103. if (t instanceof o)
  32104. return e._state = 3,
  32105. e._value = t,
  32106. void l(e);
  32107. if ("function" == typeof i)
  32108. return void h(function(e, t) {
  32109. return function() {
  32110. e.apply(t, arguments)
  32111. }
  32112. }(i, t), e)
  32113. }
  32114. e._state = 1,
  32115. e._value = t,
  32116. l(e)
  32117. } catch (t) {
  32118. s(e, t)
  32119. }
  32120. }
  32121. function s(e, t) {
  32122. e._state = 2,
  32123. e._value = t,
  32124. l(e)
  32125. }
  32126. function l(e) {
  32127. 2 === e._state && 0 === e._deferreds.length && o._immediateFn(function() {
  32128. e._handled || o._unhandledRejectionFn(e._value)
  32129. });
  32130. for (var t = 0, i = e._deferreds.length; t < i; t++)
  32131. r(e, e._deferreds[t]);
  32132. e._deferreds = null
  32133. }
  32134. function c(e, t, i) {
  32135. this.onFulfilled = "function" == typeof e ? e : null,
  32136. this.onRejected = "function" == typeof t ? t : null,
  32137. this.promise = i
  32138. }
  32139. function h(e, t) {
  32140. var i = !1;
  32141. try {
  32142. e(function(e) {
  32143. i || (i = !0,
  32144. a(t, e))
  32145. }, function(e) {
  32146. i || (i = !0,
  32147. s(t, e))
  32148. })
  32149. } catch (e) {
  32150. if (i)
  32151. return;
  32152. i = !0,
  32153. s(t, e)
  32154. }
  32155. }
  32156. var u, d;
  32157. u = this,
  32158. d = setTimeout,
  32159. o.prototype.catch = function(e) {
  32160. return this.then(null, e)
  32161. }
  32162. ,
  32163. o.prototype.then = function(e, t) {
  32164. var i = new this.constructor(n);
  32165. return r(this, new c(e,t,i)),
  32166. i
  32167. }
  32168. ,
  32169. o.all = function(e) {
  32170. var s = Array.prototype.slice.call(e);
  32171. return new o(function(n, r) {
  32172. function o(t, e) {
  32173. try {
  32174. if (e && ("object" == typeof e || "function" == typeof e)) {
  32175. var i = e.then;
  32176. if ("function" == typeof i)
  32177. return void i.call(e, function(e) {
  32178. o(t, e)
  32179. }, r)
  32180. }
  32181. s[t] = e,
  32182. 0 == --a && n(s)
  32183. } catch (e) {
  32184. r(e)
  32185. }
  32186. }
  32187. if (0 === s.length)
  32188. return n([]);
  32189. for (var a = s.length, e = 0; e < s.length; e++)
  32190. o(e, s[e])
  32191. }
  32192. )
  32193. }
  32194. ,
  32195. o.resolve = function(t) {
  32196. return t && "object" == typeof t && t.constructor === o ? t : new o(function(e) {
  32197. e(t)
  32198. }
  32199. )
  32200. }
  32201. ,
  32202. o.reject = function(i) {
  32203. return new o(function(e, t) {
  32204. t(i)
  32205. }
  32206. )
  32207. }
  32208. ,
  32209. o.race = function(r) {
  32210. return new o(function(e, t) {
  32211. for (var i = 0, n = r.length; i < n; i++)
  32212. r[i].then(e, t)
  32213. }
  32214. )
  32215. }
  32216. ,
  32217. o._immediateFn = "function" == typeof setImmediate && function(e) {
  32218. setImmediate(e)
  32219. }
  32220. || function(e) {
  32221. d(e, 0)
  32222. }
  32223. ,
  32224. o._unhandledRejectionFn = function(e) {
  32225. "undefined" != typeof console && console && console.warn("Possible Unhandled Promise Rejection:", e)
  32226. }
  32227. ,
  32228. o._setImmediateFn = function(e) {
  32229. o._immediateFn = e
  32230. }
  32231. ,
  32232. o._setUnhandledRejectionFn = function(e) {
  32233. o._unhandledRejectionFn = e
  32234. }
  32235. ,
  32236. void 0 !== t && t.exports ? t.exports = o : u.Promise || (u.Promise = o)
  32237. }
  32238. , {}],
  32239. 214: [function(p, i, e) {
  32240. (function(d) {
  32241. var e, t;
  32242. e = this,
  32243. t = function(I, e) {
  32244. "use strict";
  32245. var a, t, u, i, s, n, r, o = {};
  32246. return o.ByteBuffer = I,
  32247. o.Long = I.Long || null,
  32248. o.VERSION = "5.0.1",
  32249. o.WIRE_TYPES = {},
  32250. o.WIRE_TYPES.VARINT = 0,
  32251. o.WIRE_TYPES.BITS64 = 1,
  32252. o.WIRE_TYPES.LDELIM = 2,
  32253. o.WIRE_TYPES.STARTGROUP = 3,
  32254. o.WIRE_TYPES.ENDGROUP = 4,
  32255. o.WIRE_TYPES.BITS32 = 5,
  32256. o.PACKABLE_WIRE_TYPES = [o.WIRE_TYPES.VARINT, o.WIRE_TYPES.BITS64, o.WIRE_TYPES.BITS32],
  32257. o.TYPES = {
  32258. int32: {
  32259. name: "int32",
  32260. wireType: o.WIRE_TYPES.VARINT,
  32261. defaultValue: 0
  32262. },
  32263. uint32: {
  32264. name: "uint32",
  32265. wireType: o.WIRE_TYPES.VARINT,
  32266. defaultValue: 0
  32267. },
  32268. sint32: {
  32269. name: "sint32",
  32270. wireType: o.WIRE_TYPES.VARINT,
  32271. defaultValue: 0
  32272. },
  32273. int64: {
  32274. name: "int64",
  32275. wireType: o.WIRE_TYPES.VARINT,
  32276. defaultValue: o.Long ? o.Long.ZERO : void 0
  32277. },
  32278. uint64: {
  32279. name: "uint64",
  32280. wireType: o.WIRE_TYPES.VARINT,
  32281. defaultValue: o.Long ? o.Long.UZERO : void 0
  32282. },
  32283. sint64: {
  32284. name: "sint64",
  32285. wireType: o.WIRE_TYPES.VARINT,
  32286. defaultValue: o.Long ? o.Long.ZERO : void 0
  32287. },
  32288. bool: {
  32289. name: "bool",
  32290. wireType: o.WIRE_TYPES.VARINT,
  32291. defaultValue: !1
  32292. },
  32293. double: {
  32294. name: "double",
  32295. wireType: o.WIRE_TYPES.BITS64,
  32296. defaultValue: 0
  32297. },
  32298. string: {
  32299. name: "string",
  32300. wireType: o.WIRE_TYPES.LDELIM,
  32301. defaultValue: ""
  32302. },
  32303. bytes: {
  32304. name: "bytes",
  32305. wireType: o.WIRE_TYPES.LDELIM,
  32306. defaultValue: null
  32307. },
  32308. fixed32: {
  32309. name: "fixed32",
  32310. wireType: o.WIRE_TYPES.BITS32,
  32311. defaultValue: 0
  32312. },
  32313. sfixed32: {
  32314. name: "sfixed32",
  32315. wireType: o.WIRE_TYPES.BITS32,
  32316. defaultValue: 0
  32317. },
  32318. fixed64: {
  32319. name: "fixed64",
  32320. wireType: o.WIRE_TYPES.BITS64,
  32321. defaultValue: o.Long ? o.Long.UZERO : void 0
  32322. },
  32323. sfixed64: {
  32324. name: "sfixed64",
  32325. wireType: o.WIRE_TYPES.BITS64,
  32326. defaultValue: o.Long ? o.Long.ZERO : void 0
  32327. },
  32328. float: {
  32329. name: "float",
  32330. wireType: o.WIRE_TYPES.BITS32,
  32331. defaultValue: 0
  32332. },
  32333. enum: {
  32334. name: "enum",
  32335. wireType: o.WIRE_TYPES.VARINT,
  32336. defaultValue: 0
  32337. },
  32338. message: {
  32339. name: "message",
  32340. wireType: o.WIRE_TYPES.LDELIM,
  32341. defaultValue: null
  32342. },
  32343. group: {
  32344. name: "group",
  32345. wireType: o.WIRE_TYPES.STARTGROUP,
  32346. defaultValue: null
  32347. }
  32348. },
  32349. 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],
  32350. o.ID_MIN = 1,
  32351. o.ID_MAX = 536870911,
  32352. o.convertFieldsToCamelCase = !1,
  32353. o.populateAccessors = !0,
  32354. o.populateDefaults = !0,
  32355. o.Util = ((r = {}).IS_NODE = !("object" != typeof d || d + "" != "[object process]" || d.browser),
  32356. r.XHR = function() {
  32357. for (var e = [function() {
  32358. return new XMLHttpRequest
  32359. }
  32360. , function() {
  32361. return new ActiveXObject("Msxml2.XMLHTTP")
  32362. }
  32363. , function() {
  32364. return new ActiveXObject("Msxml3.XMLHTTP")
  32365. }
  32366. , function() {
  32367. return new ActiveXObject("Microsoft.XMLHTTP")
  32368. }
  32369. ], t = null, i = 0; i < e.length; i++) {
  32370. try {
  32371. t = e[i]()
  32372. } catch (e) {
  32373. continue
  32374. }
  32375. break
  32376. }
  32377. if (!t)
  32378. throw Error("XMLHttpRequest is not supported");
  32379. return t
  32380. }
  32381. ,
  32382. r.fetch = function(e, i) {
  32383. if (i && "function" != typeof i && (i = null),
  32384. r.IS_NODE) {
  32385. var t = p("fs");
  32386. if (i)
  32387. t.readFile(e, function(e, t) {
  32388. i(e ? null : "" + t)
  32389. });
  32390. else
  32391. try {
  32392. return t.readFileSync(e)
  32393. } catch (e) {
  32394. return null
  32395. }
  32396. } else {
  32397. var n = r.XHR();
  32398. if (n.open("GET", e, !!i),
  32399. n.setRequestHeader("Accept", "text/plain"),
  32400. "function" == typeof n.overrideMimeType && n.overrideMimeType("text/plain"),
  32401. !i)
  32402. return n.send(null),
  32403. 200 == n.status || 0 == n.status && "string" == typeof n.responseText ? n.responseText : null;
  32404. if (n.onreadystatechange = function() {
  32405. 4 == n.readyState && i(200 == n.status || 0 == n.status && "string" == typeof n.responseText ? n.responseText : null)
  32406. }
  32407. ,
  32408. 4 == n.readyState)
  32409. return;
  32410. n.send(null)
  32411. }
  32412. }
  32413. ,
  32414. r.toCamelCase = function(e) {
  32415. return e.replace(/_([a-zA-Z])/g, function(e, t) {
  32416. return t.toUpperCase()
  32417. })
  32418. }
  32419. ,
  32420. r),
  32421. o.Lang = {
  32422. DELIM: /[\s\{\}=;:\[\],'"\(\)<>]/g,
  32423. RULE: /^(?:required|optional|repeated|map)$/,
  32424. TYPE: /^(?:double|float|int32|uint32|sint32|int64|uint64|sint64|fixed32|sfixed32|fixed64|sfixed64|bool|string|bytes)$/,
  32425. NAME: /^[a-zA-Z_][a-zA-Z_0-9]*$/,
  32426. TYPEDEF: /^[a-zA-Z][a-zA-Z_0-9]*$/,
  32427. TYPEREF: /^(?:\.?[a-zA-Z_][a-zA-Z_0-9]*)+$/,
  32428. FQTYPEREF: /^(?:\.[a-zA-Z][a-zA-Z_0-9]*)+$/,
  32429. NUMBER: /^-?(?:[1-9][0-9]*|0|0[xX][0-9a-fA-F]+|0[0-7]+|([0-9]*(\.[0-9]*)?([Ee][+-]?[0-9]+)?)|inf|nan)$/,
  32430. NUMBER_DEC: /^(?:[1-9][0-9]*|0)$/,
  32431. NUMBER_HEX: /^0[xX][0-9a-fA-F]+$/,
  32432. NUMBER_OCT: /^0[0-7]+$/,
  32433. NUMBER_FLT: /^([0-9]*(\.[0-9]*)?([Ee][+-]?[0-9]+)?|inf|nan)$/,
  32434. BOOL: /^(?:true|false)$/i,
  32435. ID: /^(?:[1-9][0-9]*|0|0[xX][0-9a-fA-F]+|0[0-7]+)$/,
  32436. NEGID: /^\-?(?:[1-9][0-9]*|0|0[xX][0-9a-fA-F]+|0[0-7]+)$/,
  32437. WHITESPACE: /\s/,
  32438. STRING: /(?:"([^"\\]*(?:\\.[^"\\]*)*)")|(?:'([^'\\]*(?:\\.[^'\\]*)*)')/g,
  32439. STRING_DQ: /(?:"([^"\\]*(?:\\.[^"\\]*)*)")/g,
  32440. STRING_SQ: /(?:'([^'\\]*(?:\\.[^'\\]*)*)')/g
  32441. },
  32442. o.DotProto = function(r, a) {
  32443. function s(e, t) {
  32444. var i = -1
  32445. , n = 1;
  32446. if ("-" == e.charAt(0) && (n = -1,
  32447. e = e.substring(1)),
  32448. a.NUMBER_DEC.test(e))
  32449. i = parseInt(e);
  32450. else if (a.NUMBER_HEX.test(e))
  32451. i = parseInt(e.substring(2), 16);
  32452. else {
  32453. if (!a.NUMBER_OCT.test(e))
  32454. throw Error("illegal id value: " + (n < 0 ? "-" : "") + e);
  32455. i = parseInt(e.substring(1), 8)
  32456. }
  32457. if (i = n * i | 0,
  32458. !t && i < 0)
  32459. throw Error("illegal id value: " + (n < 0 ? "-" : "") + e);
  32460. return i
  32461. }
  32462. function o(e) {
  32463. var t = 1;
  32464. if ("-" == e.charAt(0) && (t = -1,
  32465. e = e.substring(1)),
  32466. a.NUMBER_DEC.test(e))
  32467. return t * parseInt(e, 10);
  32468. if (a.NUMBER_HEX.test(e))
  32469. return t * parseInt(e.substring(2), 16);
  32470. if (a.NUMBER_OCT.test(e))
  32471. return t * parseInt(e.substring(1), 8);
  32472. if ("inf" === e)
  32473. return t * (1 / 0);
  32474. if ("nan" === e)
  32475. return NaN;
  32476. if (a.NUMBER_FLT.test(e))
  32477. return t * parseFloat(e);
  32478. throw Error("illegal number value: " + (t < 0 ? "-" : "") + e)
  32479. }
  32480. function n(e, t, i) {
  32481. void 0 === e[t] ? e[t] = i : (Array.isArray(e[t]) || (e[t] = [e[t]]),
  32482. e[t].push(i))
  32483. }
  32484. function t(e) {
  32485. this.source = e + "",
  32486. this.index = 0,
  32487. this.line = 1,
  32488. this.stack = [],
  32489. this._stringOpen = null
  32490. }
  32491. var e = {}
  32492. , i = t.prototype;
  32493. i._readString = function() {
  32494. var e = '"' === this._stringOpen ? a.STRING_DQ : a.STRING_SQ;
  32495. e.lastIndex = this.index - 1;
  32496. var t = e.exec(this.source);
  32497. if (!t)
  32498. throw Error("unterminated string");
  32499. return this.index = e.lastIndex,
  32500. this.stack.push(this._stringOpen),
  32501. this._stringOpen = null,
  32502. t[1]
  32503. }
  32504. ,
  32505. i.next = function() {
  32506. if (0 < this.stack.length)
  32507. return this.stack.shift();
  32508. if (this.index >= this.source.length)
  32509. return null;
  32510. if (null !== this._stringOpen)
  32511. return this._readString();
  32512. var e, t, i;
  32513. do {
  32514. for (e = !1; a.WHITESPACE.test(i = this.source.charAt(this.index)); )
  32515. if ("\n" === i && ++this.line,
  32516. ++this.index === this.source.length)
  32517. return null;
  32518. if ("/" === this.source.charAt(this.index))
  32519. if (++this.index,
  32520. "/" === this.source.charAt(this.index)) {
  32521. for (; "\n" !== this.source.charAt(++this.index); )
  32522. if (this.index == this.source.length)
  32523. return null;
  32524. ++this.index,
  32525. ++this.line,
  32526. e = !0
  32527. } else {
  32528. if ("*" !== (i = this.source.charAt(this.index)))
  32529. return "/";
  32530. do {
  32531. if ("\n" === i && ++this.line,
  32532. ++this.index === this.source.length)
  32533. return null;
  32534. t = i,
  32535. i = this.source.charAt(this.index)
  32536. } while ("*" !== t || "/" !== i);++this.index,
  32537. e = !0
  32538. }
  32539. } while (e);if (this.index === this.source.length)
  32540. return null;
  32541. var n = this.index;
  32542. if (a.DELIM.lastIndex = 0,
  32543. !a.DELIM.test(this.source.charAt(n++)))
  32544. for (; n < this.source.length && !a.DELIM.test(this.source.charAt(n)); )
  32545. ++n;
  32546. var r = this.source.substring(this.index, this.index = n);
  32547. return '"' !== r && "'" !== r || (this._stringOpen = r),
  32548. r
  32549. }
  32550. ,
  32551. i.peek = function() {
  32552. if (0 === this.stack.length) {
  32553. var e = this.next();
  32554. if (null === e)
  32555. return null;
  32556. this.stack.push(e)
  32557. }
  32558. return this.stack[0]
  32559. }
  32560. ,
  32561. i.skip = function(e) {
  32562. var t = this.next();
  32563. if (t !== e)
  32564. throw Error("illegal '" + t + "', '" + e + "' expected")
  32565. }
  32566. ,
  32567. i.omit = function(e) {
  32568. return this.peek() === e && (this.next(),
  32569. !0)
  32570. }
  32571. ,
  32572. i.toString = function() {
  32573. return "Tokenizer (" + this.index + "/" + this.source.length + " at line " + this.line + ")"
  32574. }
  32575. ,
  32576. e.Tokenizer = t;
  32577. function l(e) {
  32578. this.tn = new t(e),
  32579. this.proto3 = !1
  32580. }
  32581. var c = l.prototype;
  32582. return c.parse = function() {
  32583. var e, t, i = {
  32584. name: "[ROOT]",
  32585. package: null,
  32586. messages: [],
  32587. enums: [],
  32588. imports: [],
  32589. options: {},
  32590. services: []
  32591. }, n = !0;
  32592. try {
  32593. for (; e = this.tn.next(); )
  32594. switch (e) {
  32595. case "package":
  32596. if (!n || null !== i.package)
  32597. throw Error("unexpected 'package'");
  32598. if (e = this.tn.next(),
  32599. !a.TYPEREF.test(e))
  32600. throw Error("illegal package name: " + e);
  32601. this.tn.skip(";"),
  32602. i.package = e;
  32603. break;
  32604. case "import":
  32605. if (!n)
  32606. throw Error("unexpected 'import'");
  32607. "public" !== (e = this.tn.peek()) && !(t = "weak" === e) || this.tn.next(),
  32608. e = this._readString(),
  32609. this.tn.skip(";"),
  32610. t || i.imports.push(e);
  32611. break;
  32612. case "syntax":
  32613. if (!n)
  32614. throw Error("unexpected 'syntax'");
  32615. this.tn.skip("="),
  32616. "proto3" === (i.syntax = this._readString()) && (this.proto3 = !0),
  32617. this.tn.skip(";");
  32618. break;
  32619. case "message":
  32620. this._parseMessage(i, null),
  32621. n = !1;
  32622. break;
  32623. case "enum":
  32624. this._parseEnum(i),
  32625. n = !1;
  32626. break;
  32627. case "option":
  32628. this._parseOption(i);
  32629. break;
  32630. case "service":
  32631. this._parseService(i);
  32632. break;
  32633. case "extend":
  32634. this._parseExtend(i);
  32635. break;
  32636. default:
  32637. throw Error("unexpected '" + e + "'")
  32638. }
  32639. } catch (e) {
  32640. throw e.message = "Parse error at line " + this.tn.line + ": " + e.message,
  32641. e
  32642. }
  32643. return delete i.name,
  32644. i
  32645. }
  32646. ,
  32647. l.parse = function(e) {
  32648. return new l(e).parse()
  32649. }
  32650. ,
  32651. c._readString = function() {
  32652. var e, t, i = "";
  32653. do {
  32654. if ("'" !== (t = this.tn.next()) && '"' !== t)
  32655. throw Error("illegal string delimiter: " + t);
  32656. i += this.tn.next(),
  32657. this.tn.skip(t),
  32658. e = this.tn.peek()
  32659. } while ('"' === e || '"' === e);return i
  32660. }
  32661. ,
  32662. c._readValue = function(e) {
  32663. var t = this.tn.peek();
  32664. if ('"' === t || "'" === t)
  32665. return this._readString();
  32666. if (this.tn.next(),
  32667. a.NUMBER.test(t))
  32668. return o(t);
  32669. if (a.BOOL.test(t))
  32670. return "true" === t.toLowerCase();
  32671. if (e && a.TYPEREF.test(t))
  32672. return t;
  32673. throw Error("illegal value: " + t)
  32674. }
  32675. ,
  32676. c._parseOption = function(e, t) {
  32677. var i = this.tn.next()
  32678. , n = !1;
  32679. if ("(" === i && (n = !0,
  32680. i = this.tn.next()),
  32681. !a.TYPEREF.test(i))
  32682. throw Error("illegal option name: " + i);
  32683. var r = i;
  32684. n && (this.tn.skip(")"),
  32685. r = "(" + r + ")",
  32686. i = this.tn.peek(),
  32687. a.FQTYPEREF.test(i) && (r += i,
  32688. this.tn.next())),
  32689. this.tn.skip("="),
  32690. this._parseOptionValue(e, r),
  32691. t || this.tn.skip(";")
  32692. }
  32693. ,
  32694. c._parseOptionValue = function(e, t) {
  32695. var i = this.tn.peek();
  32696. if ("{" !== i)
  32697. n(e.options, t, this._readValue(!0));
  32698. else
  32699. for (this.tn.skip("{"); "}" !== (i = this.tn.next()); ) {
  32700. if (!a.NAME.test(i))
  32701. throw Error("illegal option name: " + t + "." + i);
  32702. this.tn.omit(":") ? n(e.options, t + "." + i, this._readValue(!0)) : this._parseOptionValue(e, t + "." + i)
  32703. }
  32704. }
  32705. ,
  32706. c._parseService = function(e) {
  32707. var t = this.tn.next();
  32708. if (!a.NAME.test(t))
  32709. throw Error("illegal service name at line " + this.tn.line + ": " + t);
  32710. var i = {
  32711. name: t,
  32712. rpc: {},
  32713. options: {}
  32714. };
  32715. for (this.tn.skip("{"); "}" !== (t = this.tn.next()); )
  32716. if ("option" === t)
  32717. this._parseOption(i);
  32718. else {
  32719. if ("rpc" !== t)
  32720. throw Error("illegal service token: " + t);
  32721. this._parseServiceRPC(i)
  32722. }
  32723. this.tn.omit(";"),
  32724. e.services.push(i)
  32725. }
  32726. ,
  32727. c._parseServiceRPC = function(e) {
  32728. var t = this.tn.next();
  32729. if (!a.NAME.test(t))
  32730. throw Error("illegal rpc service method name: " + t);
  32731. var i = t
  32732. , n = {
  32733. request: null,
  32734. response: null,
  32735. request_stream: !1,
  32736. response_stream: !1,
  32737. options: {}
  32738. };
  32739. if (this.tn.skip("("),
  32740. "stream" === (t = this.tn.next()).toLowerCase() && (n.request_stream = !0,
  32741. t = this.tn.next()),
  32742. !a.TYPEREF.test(t))
  32743. throw Error("illegal rpc service request type: " + t);
  32744. if (n.request = t,
  32745. this.tn.skip(")"),
  32746. "returns" !== (t = this.tn.next()).toLowerCase())
  32747. throw Error("illegal rpc service request type delimiter: " + t);
  32748. if (this.tn.skip("("),
  32749. "stream" === (t = this.tn.next()).toLowerCase() && (n.response_stream = !0,
  32750. t = this.tn.next()),
  32751. n.response = t,
  32752. this.tn.skip(")"),
  32753. "{" === (t = this.tn.peek())) {
  32754. for (this.tn.next(); "}" !== (t = this.tn.next()); ) {
  32755. if ("option" !== t)
  32756. throw Error("illegal rpc service token: " + t);
  32757. this._parseOption(n)
  32758. }
  32759. this.tn.omit(";")
  32760. } else
  32761. this.tn.skip(";");
  32762. void 0 === e.rpc && (e.rpc = {}),
  32763. e.rpc[i] = n
  32764. }
  32765. ,
  32766. c._parseMessage = function(e, t) {
  32767. var i = !!t
  32768. , n = this.tn.next()
  32769. , r = {
  32770. name: "",
  32771. fields: [],
  32772. enums: [],
  32773. messages: [],
  32774. options: {},
  32775. services: [],
  32776. oneofs: {}
  32777. };
  32778. if (!a.NAME.test(n))
  32779. throw Error("illegal " + (i ? "group" : "message") + " name: " + n);
  32780. for (r.name = n,
  32781. i && (this.tn.skip("="),
  32782. t.id = s(this.tn.next()),
  32783. r.isGroup = !0),
  32784. "[" === (n = this.tn.peek()) && t && this._parseFieldOptions(t),
  32785. this.tn.skip("{"); "}" !== (n = this.tn.next()); )
  32786. if (a.RULE.test(n))
  32787. this._parseMessageField(r, n);
  32788. else if ("oneof" === n)
  32789. this._parseMessageOneOf(r);
  32790. else if ("enum" === n)
  32791. this._parseEnum(r);
  32792. else if ("message" === n)
  32793. this._parseMessage(r);
  32794. else if ("option" === n)
  32795. this._parseOption(r);
  32796. else if ("service" === n)
  32797. this._parseService(r);
  32798. else if ("extensions" === n)
  32799. r.extensions = this._parseExtensionRanges();
  32800. else if ("reserved" === n)
  32801. this._parseIgnored();
  32802. else if ("extend" === n)
  32803. this._parseExtend(r);
  32804. else {
  32805. if (!a.TYPEREF.test(n))
  32806. throw Error("illegal message token: " + n);
  32807. if (!this.proto3)
  32808. throw Error("illegal field rule: " + n);
  32809. this._parseMessageField(r, "optional", n)
  32810. }
  32811. return this.tn.omit(";"),
  32812. e.messages.push(r),
  32813. r
  32814. }
  32815. ,
  32816. c._parseIgnored = function() {
  32817. for (; ";" !== this.tn.peek(); )
  32818. this.tn.next();
  32819. this.tn.skip(";")
  32820. }
  32821. ,
  32822. c._parseMessageField = function(e, t, i) {
  32823. if (!a.RULE.test(t))
  32824. throw Error("illegal message field rule: " + t);
  32825. var n, r = {
  32826. rule: t,
  32827. type: "",
  32828. name: "",
  32829. options: {},
  32830. id: 0
  32831. };
  32832. if ("map" === t) {
  32833. if (i)
  32834. throw Error("illegal type: " + i);
  32835. if (this.tn.skip("<"),
  32836. n = this.tn.next(),
  32837. !a.TYPE.test(n) && !a.TYPEREF.test(n))
  32838. throw Error("illegal message field type: " + n);
  32839. if (r.keytype = n,
  32840. this.tn.skip(","),
  32841. n = this.tn.next(),
  32842. !a.TYPE.test(n) && !a.TYPEREF.test(n))
  32843. throw Error("illegal message field: " + n);
  32844. if (r.type = n,
  32845. this.tn.skip(">"),
  32846. n = this.tn.next(),
  32847. !a.NAME.test(n))
  32848. throw Error("illegal message field name: " + n);
  32849. r.name = n,
  32850. this.tn.skip("="),
  32851. r.id = s(this.tn.next()),
  32852. "[" === (n = this.tn.peek()) && this._parseFieldOptions(r),
  32853. this.tn.skip(";")
  32854. } else if ("group" === (i = void 0 !== i ? i : this.tn.next())) {
  32855. var o = this._parseMessage(e, r);
  32856. if (!/^[A-Z]/.test(o.name))
  32857. throw Error("illegal group name: " + o.name);
  32858. r.type = o.name,
  32859. r.name = o.name.toLowerCase(),
  32860. this.tn.omit(";")
  32861. } else {
  32862. if (!a.TYPE.test(i) && !a.TYPEREF.test(i))
  32863. throw Error("illegal message field type: " + i);
  32864. if (r.type = i,
  32865. n = this.tn.next(),
  32866. !a.NAME.test(n))
  32867. throw Error("illegal message field name: " + n);
  32868. r.name = n,
  32869. this.tn.skip("="),
  32870. r.id = s(this.tn.next()),
  32871. "[" === (n = this.tn.peek()) && this._parseFieldOptions(r),
  32872. this.tn.skip(";")
  32873. }
  32874. return e.fields.push(r),
  32875. r
  32876. }
  32877. ,
  32878. c._parseMessageOneOf = function(e) {
  32879. var t = this.tn.next();
  32880. if (!a.NAME.test(t))
  32881. throw Error("illegal oneof name: " + t);
  32882. var i, n = t, r = [];
  32883. for (this.tn.skip("{"); "}" !== (t = this.tn.next()); )
  32884. (i = this._parseMessageField(e, "optional", t)).oneof = n,
  32885. r.push(i.id);
  32886. this.tn.omit(";"),
  32887. e.oneofs[n] = r
  32888. }
  32889. ,
  32890. c._parseFieldOptions = function(e) {
  32891. this.tn.skip("[");
  32892. for (var t = !0; "]" !== this.tn.peek(); )
  32893. t || this.tn.skip(","),
  32894. this._parseOption(e, !0),
  32895. t = !1;
  32896. this.tn.next()
  32897. }
  32898. ,
  32899. c._parseEnum = function(e) {
  32900. var t = {
  32901. name: "",
  32902. values: [],
  32903. options: {}
  32904. }
  32905. , i = this.tn.next();
  32906. if (!a.NAME.test(i))
  32907. throw Error("illegal name: " + i);
  32908. for (t.name = i,
  32909. this.tn.skip("{"); "}" !== (i = this.tn.next()); )
  32910. if ("option" === i)
  32911. this._parseOption(t);
  32912. else {
  32913. if (!a.NAME.test(i))
  32914. throw Error("illegal name: " + i);
  32915. this.tn.skip("=");
  32916. var n = {
  32917. name: i,
  32918. id: s(this.tn.next(), !0)
  32919. };
  32920. "[" === (i = this.tn.peek()) && this._parseFieldOptions({
  32921. options: {}
  32922. }),
  32923. this.tn.skip(";"),
  32924. t.values.push(n)
  32925. }
  32926. this.tn.omit(";"),
  32927. e.enums.push(t)
  32928. }
  32929. ,
  32930. c._parseExtensionRanges = function() {
  32931. var e, t, i, n = [];
  32932. do {
  32933. for (t = []; ; ) {
  32934. switch (e = this.tn.next()) {
  32935. case "min":
  32936. i = r.ID_MIN;
  32937. break;
  32938. case "max":
  32939. i = r.ID_MAX;
  32940. break;
  32941. default:
  32942. i = o(e)
  32943. }
  32944. if (t.push(i),
  32945. 2 === t.length)
  32946. break;
  32947. if ("to" !== this.tn.peek()) {
  32948. t.push(i);
  32949. break
  32950. }
  32951. this.tn.next()
  32952. }
  32953. n.push(t)
  32954. } while (this.tn.omit(","));return this.tn.skip(";"),
  32955. n
  32956. }
  32957. ,
  32958. c._parseExtend = function(e) {
  32959. var t = this.tn.next();
  32960. if (!a.TYPEREF.test(t))
  32961. throw Error("illegal extend reference: " + t);
  32962. var i = {
  32963. ref: t,
  32964. fields: []
  32965. };
  32966. for (this.tn.skip("{"); "}" !== (t = this.tn.next()); )
  32967. if (a.RULE.test(t))
  32968. this._parseMessageField(i, t);
  32969. else {
  32970. if (!a.TYPEREF.test(t))
  32971. throw Error("illegal extend token: " + t);
  32972. if (!this.proto3)
  32973. throw Error("illegal field rule: " + t);
  32974. this._parseMessageField(i, "optional", t)
  32975. }
  32976. return this.tn.omit(";"),
  32977. e.messages.push(i),
  32978. i
  32979. }
  32980. ,
  32981. c.toString = function() {
  32982. return "Parser at line " + this.tn.line
  32983. }
  32984. ,
  32985. e.Parser = l,
  32986. e
  32987. }(o, o.Lang),
  32988. o.Reflect = function(g) {
  32989. function a(e, t) {
  32990. if (e && "number" == typeof e.low && "number" == typeof e.high && "boolean" == typeof e.unsigned && e.low == e.low && e.high == e.high)
  32991. return new g.Long(e.low,e.high,void 0 === t ? e.unsigned : t);
  32992. if ("string" == typeof e)
  32993. return g.Long.fromString(e, t || !1, 10);
  32994. if ("number" == typeof e)
  32995. return g.Long.fromNumber(e, t || !1);
  32996. throw Error("not convertible to Long")
  32997. }
  32998. function m(e, t) {
  32999. var i = t.readVarint32()
  33000. , n = 7 & i
  33001. , r = i >>> 3;
  33002. switch (n) {
  33003. case g.WIRE_TYPES.VARINT:
  33004. for (; 128 == (128 & (i = t.readUint8())); )
  33005. ;
  33006. break;
  33007. case g.WIRE_TYPES.BITS64:
  33008. t.offset += 8;
  33009. break;
  33010. case g.WIRE_TYPES.LDELIM:
  33011. i = t.readVarint32(),
  33012. t.offset += i;
  33013. break;
  33014. case g.WIRE_TYPES.STARTGROUP:
  33015. m(r, t);
  33016. break;
  33017. case g.WIRE_TYPES.ENDGROUP:
  33018. if (r === e)
  33019. return !1;
  33020. throw Error("Illegal GROUPEND after unknown group: " + r + " (" + e + " expected)");
  33021. case g.WIRE_TYPES.BITS32:
  33022. t.offset += 4;
  33023. break;
  33024. default:
  33025. throw Error("Illegal wire type in unknown group " + e + ": " + n)
  33026. }
  33027. return !0
  33028. }
  33029. function h(e, t, i) {
  33030. this.builder = e,
  33031. this.parent = t,
  33032. this.name = i,
  33033. this.className
  33034. }
  33035. var s = {}
  33036. , e = h.prototype;
  33037. e.fqn = function() {
  33038. for (var e = this.name, t = this; null != (t = t.parent); )
  33039. e = t.name + "." + e;
  33040. return e
  33041. }
  33042. ,
  33043. e.toString = function(e) {
  33044. return (e ? this.className + " " : "") + this.fqn()
  33045. }
  33046. ,
  33047. e.build = function() {
  33048. throw Error(this.toString(!0) + " cannot be built directly")
  33049. }
  33050. ,
  33051. s.T = h;
  33052. function l(e, t, i, n, r) {
  33053. h.call(this, e, t, i),
  33054. this.className = "Namespace",
  33055. this.children = [],
  33056. this.options = n || {},
  33057. this.syntax = r || "proto2"
  33058. }
  33059. var t = l.prototype = Object.create(h.prototype);
  33060. t.getChildren = function(e) {
  33061. if (null == (e = e || null))
  33062. return this.children.slice();
  33063. for (var t = [], i = 0, n = this.children.length; i < n; ++i)
  33064. this.children[i]instanceof e && t.push(this.children[i]);
  33065. return t
  33066. }
  33067. ,
  33068. t.addChild = function(e) {
  33069. var t;
  33070. if (t = this.getChild(e.name))
  33071. if (t instanceof d.Field && t.name !== t.originalName && null === this.getChild(t.originalName))
  33072. t.name = t.originalName;
  33073. else {
  33074. if (!(e instanceof d.Field && e.name !== e.originalName && null === this.getChild(e.originalName)))
  33075. throw Error("Duplicate name in namespace " + this.toString(!0) + ": " + e.name);
  33076. e.name = e.originalName
  33077. }
  33078. this.children.push(e)
  33079. }
  33080. ,
  33081. t.getChild = function(e) {
  33082. for (var t = "number" == typeof e ? "id" : "name", i = 0, n = this.children.length; i < n; ++i)
  33083. if (this.children[i][t] === e)
  33084. return this.children[i];
  33085. return null
  33086. }
  33087. ,
  33088. t.resolve = function(e, t) {
  33089. var i, n = "string" == typeof e ? e.split(".") : e, r = this, o = 0;
  33090. if ("" === n[o]) {
  33091. for (; null !== r.parent; )
  33092. r = r.parent;
  33093. o++
  33094. }
  33095. do {
  33096. do {
  33097. if (!(r instanceof s.Namespace)) {
  33098. r = null;
  33099. break
  33100. }
  33101. if (!(i = r.getChild(n[o])) || !(i instanceof s.T) || t && !(i instanceof s.Namespace)) {
  33102. r = null;
  33103. break
  33104. }
  33105. r = i,
  33106. o++
  33107. } while (o < n.length);if (null != r)
  33108. break;
  33109. if (null !== this.parent)
  33110. return this.parent.resolve(e, t)
  33111. } while (null != r);return r
  33112. }
  33113. ,
  33114. t.qn = function(e) {
  33115. for (var t = [], i = e; t.unshift(i.name),
  33116. null !== (i = i.parent); )
  33117. ;
  33118. for (var n = 1; n <= t.length; n++) {
  33119. var r = t.slice(t.length - n);
  33120. if (e === this.resolve(r, e instanceof s.Namespace))
  33121. return r.join(".")
  33122. }
  33123. return e.fqn()
  33124. }
  33125. ,
  33126. t.build = function() {
  33127. for (var e, t = {}, i = this.children, n = 0, r = i.length; n < r; ++n)
  33128. (e = i[n])instanceof l && (t[e.name] = e.build());
  33129. return Object.defineProperty && Object.defineProperty(t, "$options", {
  33130. value: this.buildOpt()
  33131. }),
  33132. t
  33133. }
  33134. ,
  33135. t.buildOpt = function() {
  33136. for (var e = {}, t = Object.keys(this.options), i = 0, n = t.length; i < n; ++i) {
  33137. var r = t[i]
  33138. , o = this.options[t[i]];
  33139. e[r] = o
  33140. }
  33141. return e
  33142. }
  33143. ,
  33144. t.getOption = function(e) {
  33145. return void 0 === e ? this.options : void 0 !== this.options[e] ? this.options[e] : null
  33146. }
  33147. ,
  33148. s.Namespace = l;
  33149. function u(e, t, i, n) {
  33150. if (this.type = e,
  33151. this.resolvedType = t,
  33152. this.isMapKey = i,
  33153. this.syntax = n,
  33154. i && g.MAP_KEY_TYPES.indexOf(e) < 0)
  33155. throw Error("Invalid map key type: " + e.name)
  33156. }
  33157. var i = u.prototype;
  33158. u.defaultFieldValue = function(e) {
  33159. if ("string" == typeof e && (e = g.TYPES[e]),
  33160. void 0 === e.defaultValue)
  33161. throw Error("default value for type " + e.name + " is not supported");
  33162. return e == g.TYPES.bytes ? new I(0) : e.defaultValue
  33163. }
  33164. ,
  33165. i.verifyValue = function(t) {
  33166. function i(e, t) {
  33167. throw Error("Illegal value for " + n.toString(!0) + " of type " + n.type.name + ": " + e + " (" + t + ")")
  33168. }
  33169. var n = this;
  33170. switch (this.type) {
  33171. case g.TYPES.int32:
  33172. case g.TYPES.sint32:
  33173. case g.TYPES.sfixed32:
  33174. return ("number" != typeof t || t == t && t % 1 != 0) && i(typeof t, "not an integer"),
  33175. 4294967295 < t ? 0 | t : t;
  33176. case g.TYPES.uint32:
  33177. case g.TYPES.fixed32:
  33178. return ("number" != typeof t || t == t && t % 1 != 0) && i(typeof t, "not an integer"),
  33179. t < 0 ? t >>> 0 : t;
  33180. case g.TYPES.int64:
  33181. case g.TYPES.sint64:
  33182. case g.TYPES.sfixed64:
  33183. if (g.Long)
  33184. try {
  33185. return a(t, !1)
  33186. } catch (e) {
  33187. i(typeof t, e.message)
  33188. }
  33189. else
  33190. i(typeof t, "requires Long.js");
  33191. case g.TYPES.uint64:
  33192. case g.TYPES.fixed64:
  33193. if (g.Long)
  33194. try {
  33195. return a(t, !0)
  33196. } catch (e) {
  33197. i(typeof t, e.message)
  33198. }
  33199. else
  33200. i(typeof t, "requires Long.js");
  33201. case g.TYPES.bool:
  33202. return "boolean" != typeof t && i(typeof t, "not a boolean"),
  33203. t;
  33204. case g.TYPES.float:
  33205. case g.TYPES.double:
  33206. return "number" != typeof t && i(typeof t, "not a number"),
  33207. t;
  33208. case g.TYPES.string:
  33209. return "string" == typeof t || t && t instanceof String || i(typeof t, "not a string"),
  33210. "" + t;
  33211. case g.TYPES.bytes:
  33212. return I.isByteBuffer(t) ? t : I.wrap(t, "base64");
  33213. case g.TYPES.enum:
  33214. var e = this.resolvedType.getChildren(g.Reflect.Enum.Value);
  33215. for (o = 0; o < e.length; o++) {
  33216. if (e[o].name == t)
  33217. return e[o].id;
  33218. if (e[o].id == t)
  33219. return e[o].id
  33220. }
  33221. if ("proto3" === this.syntax)
  33222. return ("number" != typeof t || t == t && t % 1 != 0) && i(typeof t, "not an integer"),
  33223. (4294967295 < t || t < 0) && i(typeof t, "not in range for uint32"),
  33224. t;
  33225. i(t, "not a valid enum value");
  33226. case g.TYPES.group:
  33227. case g.TYPES.message:
  33228. if (t && "object" == typeof t || i(typeof t, "object expected"),
  33229. t instanceof this.resolvedType.clazz)
  33230. return t;
  33231. if (t instanceof g.Builder.Message) {
  33232. var r = {};
  33233. for (var o in t)
  33234. t.hasOwnProperty(o) && (r[o] = t[o]);
  33235. t = r
  33236. }
  33237. return new this.resolvedType.clazz(t)
  33238. }
  33239. throw Error("[INTERNAL] Illegal value for " + this.toString(!0) + ": " + t + " (undefined type " + this.type + ")")
  33240. }
  33241. ,
  33242. i.calculateLength = function(e, t) {
  33243. if (null === t)
  33244. return 0;
  33245. var i;
  33246. switch (this.type) {
  33247. case g.TYPES.int32:
  33248. return t < 0 ? I.calculateVarint64(t) : I.calculateVarint32(t);
  33249. case g.TYPES.uint32:
  33250. return I.calculateVarint32(t);
  33251. case g.TYPES.sint32:
  33252. return I.calculateVarint32(I.zigZagEncode32(t));
  33253. case g.TYPES.fixed32:
  33254. case g.TYPES.sfixed32:
  33255. case g.TYPES.float:
  33256. return 4;
  33257. case g.TYPES.int64:
  33258. case g.TYPES.uint64:
  33259. return I.calculateVarint64(t);
  33260. case g.TYPES.sint64:
  33261. return I.calculateVarint64(I.zigZagEncode64(t));
  33262. case g.TYPES.fixed64:
  33263. case g.TYPES.sfixed64:
  33264. return 8;
  33265. case g.TYPES.bool:
  33266. return 1;
  33267. case g.TYPES.enum:
  33268. return I.calculateVarint32(t);
  33269. case g.TYPES.double:
  33270. return 8;
  33271. case g.TYPES.string:
  33272. return i = I.calculateUTF8Bytes(t),
  33273. I.calculateVarint32(i) + i;
  33274. case g.TYPES.bytes:
  33275. if (t.remaining() < 0)
  33276. throw Error("Illegal value for " + this.toString(!0) + ": " + t.remaining() + " bytes remaining");
  33277. return I.calculateVarint32(t.remaining()) + t.remaining();
  33278. case g.TYPES.message:
  33279. return i = this.resolvedType.calculate(t),
  33280. I.calculateVarint32(i) + i;
  33281. case g.TYPES.group:
  33282. return (i = this.resolvedType.calculate(t)) + I.calculateVarint32(e << 3 | g.WIRE_TYPES.ENDGROUP)
  33283. }
  33284. throw Error("[INTERNAL] Illegal value to encode in " + this.toString(!0) + ": " + t + " (unknown type)")
  33285. }
  33286. ,
  33287. i.encodeValue = function(e, t, i) {
  33288. if (null === t)
  33289. return i;
  33290. switch (this.type) {
  33291. case g.TYPES.int32:
  33292. t < 0 ? i.writeVarint64(t) : i.writeVarint32(t);
  33293. break;
  33294. case g.TYPES.uint32:
  33295. i.writeVarint32(t);
  33296. break;
  33297. case g.TYPES.sint32:
  33298. i.writeVarint32ZigZag(t);
  33299. break;
  33300. case g.TYPES.fixed32:
  33301. i.writeUint32(t);
  33302. break;
  33303. case g.TYPES.sfixed32:
  33304. i.writeInt32(t);
  33305. break;
  33306. case g.TYPES.int64:
  33307. case g.TYPES.uint64:
  33308. i.writeVarint64(t);
  33309. break;
  33310. case g.TYPES.sint64:
  33311. i.writeVarint64ZigZag(t);
  33312. break;
  33313. case g.TYPES.fixed64:
  33314. i.writeUint64(t);
  33315. break;
  33316. case g.TYPES.sfixed64:
  33317. i.writeInt64(t);
  33318. break;
  33319. case g.TYPES.bool:
  33320. "string" == typeof t ? i.writeVarint32("false" === t.toLowerCase() ? 0 : !!t) : i.writeVarint32(t ? 1 : 0);
  33321. break;
  33322. case g.TYPES.enum:
  33323. i.writeVarint32(t);
  33324. break;
  33325. case g.TYPES.float:
  33326. i.writeFloat32(t);
  33327. break;
  33328. case g.TYPES.double:
  33329. i.writeFloat64(t);
  33330. break;
  33331. case g.TYPES.string:
  33332. i.writeVString(t);
  33333. break;
  33334. case g.TYPES.bytes:
  33335. if (t.remaining() < 0)
  33336. throw Error("Illegal value for " + this.toString(!0) + ": " + t.remaining() + " bytes remaining");
  33337. var n = t.offset;
  33338. i.writeVarint32(t.remaining()),
  33339. i.append(t),
  33340. t.offset = n;
  33341. break;
  33342. case g.TYPES.message:
  33343. var r = (new I).LE();
  33344. this.resolvedType.encode(t, r),
  33345. i.writeVarint32(r.offset),
  33346. i.append(r.flip());
  33347. break;
  33348. case g.TYPES.group:
  33349. this.resolvedType.encode(t, i),
  33350. i.writeVarint32(e << 3 | g.WIRE_TYPES.ENDGROUP);
  33351. break;
  33352. default:
  33353. throw Error("[INTERNAL] Illegal value to encode in " + this.toString(!0) + ": " + t + " (unknown type)")
  33354. }
  33355. return i
  33356. }
  33357. ,
  33358. i.decode = function(e, t, i) {
  33359. if (t != this.type.wireType)
  33360. throw Error("Unexpected wire type for element");
  33361. var n, r;
  33362. switch (this.type) {
  33363. case g.TYPES.int32:
  33364. return 0 | e.readVarint32();
  33365. case g.TYPES.uint32:
  33366. return e.readVarint32() >>> 0;
  33367. case g.TYPES.sint32:
  33368. return 0 | e.readVarint32ZigZag();
  33369. case g.TYPES.fixed32:
  33370. return e.readUint32() >>> 0;
  33371. case g.TYPES.sfixed32:
  33372. return 0 | e.readInt32();
  33373. case g.TYPES.int64:
  33374. return e.readVarint64();
  33375. case g.TYPES.uint64:
  33376. return e.readVarint64().toUnsigned();
  33377. case g.TYPES.sint64:
  33378. return e.readVarint64ZigZag();
  33379. case g.TYPES.fixed64:
  33380. return e.readUint64();
  33381. case g.TYPES.sfixed64:
  33382. return e.readInt64();
  33383. case g.TYPES.bool:
  33384. return !!e.readVarint32();
  33385. case g.TYPES.enum:
  33386. return e.readVarint32();
  33387. case g.TYPES.float:
  33388. return e.readFloat();
  33389. case g.TYPES.double:
  33390. return e.readDouble();
  33391. case g.TYPES.string:
  33392. return e.readVString();
  33393. case g.TYPES.bytes:
  33394. if (r = e.readVarint32(),
  33395. e.remaining() < r)
  33396. throw Error("Illegal number of bytes for " + this.toString(!0) + ": " + r + " required but got only " + e.remaining());
  33397. return (n = e.clone()).limit = n.offset + r,
  33398. e.offset += r,
  33399. n;
  33400. case g.TYPES.message:
  33401. return r = e.readVarint32(),
  33402. this.resolvedType.decode(e, r);
  33403. case g.TYPES.group:
  33404. return this.resolvedType.decode(e, -1, i)
  33405. }
  33406. throw Error("[INTERNAL] Illegal decode type")
  33407. }
  33408. ,
  33409. i.valueFromString = function(e) {
  33410. if (!this.isMapKey)
  33411. throw Error("valueFromString() called on non-map-key element");
  33412. switch (this.type) {
  33413. case g.TYPES.int32:
  33414. case g.TYPES.sint32:
  33415. case g.TYPES.sfixed32:
  33416. case g.TYPES.uint32:
  33417. case g.TYPES.fixed32:
  33418. return this.verifyValue(parseInt(e));
  33419. case g.TYPES.int64:
  33420. case g.TYPES.sint64:
  33421. case g.TYPES.sfixed64:
  33422. case g.TYPES.uint64:
  33423. case g.TYPES.fixed64:
  33424. return this.verifyValue(e);
  33425. case g.TYPES.bool:
  33426. return "true" === e;
  33427. case g.TYPES.string:
  33428. return this.verifyValue(e);
  33429. case g.TYPES.bytes:
  33430. return I.fromBinary(e)
  33431. }
  33432. }
  33433. ,
  33434. i.valueToString = function(e) {
  33435. if (!this.isMapKey)
  33436. throw Error("valueToString() called on non-map-key element");
  33437. return this.type === g.TYPES.bytes ? e.toString("binary") : e.toString()
  33438. }
  33439. ,
  33440. s.Element = u;
  33441. var d = function(e, t, i, n, r, o) {
  33442. l.call(this, e, t, i, n, o),
  33443. this.className = "Message",
  33444. this.extensions = void 0,
  33445. this.clazz = null,
  33446. this.isGroup = !!r,
  33447. this._fields = null,
  33448. this._fieldsById = null,
  33449. this._fieldsByName = null
  33450. }
  33451. , n = d.prototype = Object.create(l.prototype);
  33452. n.build = function(e) {
  33453. if (this.clazz && !e)
  33454. return this.clazz;
  33455. var t = function(u, a) {
  33456. function d(e, i, n, r) {
  33457. if (null === e || "object" != typeof e) {
  33458. if (r && r instanceof u.Reflect.Enum) {
  33459. var t = u.Reflect.Enum.getName(r.object, e);
  33460. if (null !== t)
  33461. return t
  33462. }
  33463. return e
  33464. }
  33465. if (I.isByteBuffer(e))
  33466. return i ? e.toBase64() : e.toBuffer();
  33467. if (u.Long.isLong(e))
  33468. return n ? e.toString() : u.Long.fromValue(e);
  33469. var o;
  33470. if (Array.isArray(e))
  33471. return o = [],
  33472. e.forEach(function(e, t) {
  33473. o[t] = d(e, i, n, r)
  33474. }),
  33475. o;
  33476. if (o = {},
  33477. e instanceof u.Map) {
  33478. for (var a = e.entries(), s = a.next(); !s.done; s = a.next())
  33479. o[e.keyElem.valueToString(s.value[0])] = d(s.value[1], i, n, e.valueElem.resolvedType);
  33480. return o
  33481. }
  33482. var l = e.$type
  33483. , c = void 0;
  33484. for (var h in e)
  33485. e.hasOwnProperty(h) && (l && (c = l.getChild(h)) ? o[h] = d(e[h], i, n, c.resolvedType) : o[h] = d(e[h], i, n));
  33486. return o
  33487. }
  33488. var s = a.getChildren(u.Reflect.Message.Field)
  33489. , l = a.getChildren(u.Reflect.Message.OneOf)
  33490. , c = function(e, t) {
  33491. u.Builder.Message.call(this);
  33492. for (var i = 0, n = l.length; i < n; ++i)
  33493. this[l[i].name] = null;
  33494. for (i = 0,
  33495. n = s.length; i < n; ++i) {
  33496. var r = s[i];
  33497. this[r.name] = r.repeated ? [] : r.map ? new u.Map(r) : null,
  33498. !r.required && "proto3" !== a.syntax || null === r.defaultValue || (this[r.name] = r.defaultValue)
  33499. }
  33500. var o;
  33501. if (0 < arguments.length)
  33502. 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)
  33503. for (i = 0,
  33504. n = arguments.length; i < n; ++i)
  33505. void 0 !== (o = arguments[i]) && this.$set(s[i].name, o);
  33506. else
  33507. this.$set(e)
  33508. }
  33509. , o = c.prototype = Object.create(u.Builder.Message.prototype);
  33510. o.add = function(e, t, i) {
  33511. var n = a._fieldsByName[e];
  33512. if (!i) {
  33513. if (!n)
  33514. throw Error(this + "#" + e + " is undefined");
  33515. if (!(n instanceof u.Reflect.Message.Field))
  33516. throw Error(this + "#" + e + " is not a field: " + n.toString(!0));
  33517. if (!n.repeated)
  33518. throw Error(this + "#" + e + " is not a repeated field");
  33519. t = n.verifyValue(t, !0)
  33520. }
  33521. return null === this[e] && (this[e] = []),
  33522. this[e].push(t),
  33523. this
  33524. }
  33525. ,
  33526. o.$add = o.add,
  33527. o.set = function(e, t, i) {
  33528. if (e && "object" == typeof e) {
  33529. for (var n in i = t,
  33530. e)
  33531. e.hasOwnProperty(n) && void 0 !== (t = e[n]) && this.$set(n, t, i);
  33532. return this
  33533. }
  33534. var r = a._fieldsByName[e];
  33535. if (i)
  33536. this[e] = t;
  33537. else {
  33538. if (!r)
  33539. throw Error(this + "#" + e + " is not a field: undefined");
  33540. if (!(r instanceof u.Reflect.Message.Field))
  33541. throw Error(this + "#" + e + " is not a field: " + r.toString(!0));
  33542. this[r.name] = t = r.verifyValue(t)
  33543. }
  33544. if (r && r.oneof) {
  33545. var o = this[r.oneof.name];
  33546. null !== t ? (null !== o && o !== r.name && (this[o] = null),
  33547. this[r.oneof.name] = r.name) : o === e && (this[r.oneof.name] = null)
  33548. }
  33549. return this
  33550. }
  33551. ,
  33552. o.$set = o.set,
  33553. o.get = function(e, t) {
  33554. if (t)
  33555. return this[e];
  33556. var i = a._fieldsByName[e];
  33557. if (!(i && i instanceof u.Reflect.Message.Field))
  33558. throw Error(this + "#" + e + " is not a field: undefined");
  33559. if (!(i instanceof u.Reflect.Message.Field))
  33560. throw Error(this + "#" + e + " is not a field: " + i.toString(!0));
  33561. return this[i.name]
  33562. }
  33563. ,
  33564. o.$get = o.get;
  33565. for (var e = 0; e < s.length; e++) {
  33566. var t = s[e];
  33567. t instanceof u.Reflect.Message.ExtensionField || a.builder.options.populateAccessors && function(i) {
  33568. var e = i.originalName.replace(/(_[a-zA-Z])/g, function(e) {
  33569. return e.toUpperCase().replace("_", "")
  33570. });
  33571. e = e.substring(0, 1).toUpperCase() + e.substring(1);
  33572. function t(e, t) {
  33573. return this[i.name] = t ? e : i.verifyValue(e),
  33574. this
  33575. }
  33576. function n() {
  33577. return this[i.name]
  33578. }
  33579. var r = i.originalName.replace(/([A-Z])/g, function(e) {
  33580. return "_" + e
  33581. });
  33582. null === a.getChild("set" + e) && (o["set" + e] = t),
  33583. null === a.getChild("set_" + r) && (o["set_" + r] = t),
  33584. null === a.getChild("get" + e) && (o["get" + e] = n),
  33585. null === a.getChild("get_" + r) && (o["get_" + r] = n)
  33586. }(t)
  33587. }
  33588. return o.encode = function(t, e) {
  33589. "boolean" == typeof t && (e = t,
  33590. t = void 0);
  33591. var i = !1;
  33592. t || (t = new I,
  33593. i = !0);
  33594. var n = t.littleEndian;
  33595. try {
  33596. return a.encode(this, t.LE(), e),
  33597. (i ? t.flip() : t).LE(n)
  33598. } catch (e) {
  33599. throw t.LE(n),
  33600. e
  33601. }
  33602. }
  33603. ,
  33604. c.encode = function(e, t, i) {
  33605. return new c(e).encode(t, i)
  33606. }
  33607. ,
  33608. o.calculate = function() {
  33609. return a.calculate(this)
  33610. }
  33611. ,
  33612. o.encodeDelimited = function(e, t) {
  33613. var i = !1;
  33614. e || (e = new I,
  33615. i = !0);
  33616. var n = (new I).LE();
  33617. return a.encode(this, n, t).flip(),
  33618. e.writeVarint32(n.remaining()),
  33619. e.append(n),
  33620. i ? e.flip() : e
  33621. }
  33622. ,
  33623. o.encodeAB = function() {
  33624. try {
  33625. return this.encode().toArrayBuffer()
  33626. } catch (e) {
  33627. throw e.encoded && (e.encoded = e.encoded.toArrayBuffer()),
  33628. e
  33629. }
  33630. }
  33631. ,
  33632. o.toArrayBuffer = o.encodeAB,
  33633. o.encodeNB = function() {
  33634. try {
  33635. return this.encode().toBuffer()
  33636. } catch (e) {
  33637. throw e.encoded && (e.encoded = e.encoded.toBuffer()),
  33638. e
  33639. }
  33640. }
  33641. ,
  33642. o.toBuffer = o.encodeNB,
  33643. o.encode64 = function() {
  33644. try {
  33645. return this.encode().toBase64()
  33646. } catch (e) {
  33647. throw e.encoded && (e.encoded = e.encoded.toBase64()),
  33648. e
  33649. }
  33650. }
  33651. ,
  33652. o.toBase64 = o.encode64,
  33653. o.encodeHex = function() {
  33654. try {
  33655. return this.encode().toHex()
  33656. } catch (e) {
  33657. throw e.encoded && (e.encoded = e.encoded.toHex()),
  33658. e
  33659. }
  33660. }
  33661. ,
  33662. o.toHex = o.encodeHex,
  33663. o.toRaw = function(e, t) {
  33664. return d(this, !!e, !!t, this.$type)
  33665. }
  33666. ,
  33667. o.encodeJSON = function() {
  33668. return JSON.stringify(d(this, !0, !0, this.$type))
  33669. }
  33670. ,
  33671. c.decode = function(t, e, i) {
  33672. "string" == typeof e && (i = e,
  33673. e = -1),
  33674. "string" == typeof t && (t = I.wrap(t, i || "base64"));
  33675. var n = (t = I.isByteBuffer(t) ? t : I.wrap(t)).littleEndian;
  33676. try {
  33677. var r = a.decode(t.LE());
  33678. return t.LE(n),
  33679. r
  33680. } catch (e) {
  33681. throw t.LE(n),
  33682. e
  33683. }
  33684. }
  33685. ,
  33686. c.decodeDelimited = function(t, e) {
  33687. if ("string" == typeof t && (t = I.wrap(t, e || "base64")),
  33688. (t = I.isByteBuffer(t) ? t : I.wrap(t)).remaining() < 1)
  33689. return null;
  33690. var i = t.offset
  33691. , n = t.readVarint32();
  33692. if (t.remaining() < n)
  33693. return t.offset = i,
  33694. null;
  33695. try {
  33696. var r = a.decode(t.slice(t.offset, t.offset + n).LE());
  33697. return t.offset += n,
  33698. r
  33699. } catch (e) {
  33700. throw t.offset += n,
  33701. e
  33702. }
  33703. }
  33704. ,
  33705. c.decode64 = function(e) {
  33706. return c.decode(e, "base64")
  33707. }
  33708. ,
  33709. c.decodeHex = function(e) {
  33710. return c.decode(e, "hex")
  33711. }
  33712. ,
  33713. c.decodeJSON = function(e) {
  33714. return new c(JSON.parse(e))
  33715. }
  33716. ,
  33717. o.toString = function() {
  33718. return a.toString()
  33719. }
  33720. ,
  33721. Object.defineProperty && (Object.defineProperty(c, "$options", {
  33722. value: a.buildOpt()
  33723. }),
  33724. Object.defineProperty(o, "$options", {
  33725. value: c.$options
  33726. }),
  33727. Object.defineProperty(c, "$type", {
  33728. value: a
  33729. }),
  33730. Object.defineProperty(o, "$type", {
  33731. value: a
  33732. })),
  33733. c
  33734. }(g, this);
  33735. this._fields = [],
  33736. this._fieldsById = {},
  33737. this._fieldsByName = {};
  33738. for (var i, n = 0, r = this.children.length; n < r; n++)
  33739. if ((i = this.children[n])instanceof p || i instanceof d || i instanceof y) {
  33740. if (t.hasOwnProperty(i.name))
  33741. throw Error("Illegal reflect child of " + this.toString(!0) + ": " + i.toString(!0) + " cannot override static property '" + i.name + "'");
  33742. t[i.name] = i.build()
  33743. } else if (i instanceof d.Field)
  33744. i.build(),
  33745. this._fields.push(i),
  33746. this._fieldsById[i.id] = i,
  33747. this._fieldsByName[i.name] = i;
  33748. else if (!(i instanceof d.OneOf || i instanceof v))
  33749. throw Error("Illegal reflect child of " + this.toString(!0) + ": " + this.children[n].toString(!0));
  33750. return this.clazz = t
  33751. }
  33752. ,
  33753. n.encode = function(e, t, i) {
  33754. for (var n, r, o = null, a = 0, s = this._fields.length; a < s; ++a)
  33755. r = e[(n = this._fields[a]).name],
  33756. n.required && null === r ? null === o && (o = n) : n.encode(i ? r : n.verifyValue(r), t, e);
  33757. if (null === o)
  33758. return t;
  33759. var l = Error("Missing at least one required field for " + this.toString(!0) + ": " + o);
  33760. throw l.encoded = t,
  33761. l
  33762. }
  33763. ,
  33764. n.calculate = function(e) {
  33765. for (var t, i, n = 0, r = 0, o = this._fields.length; r < o; ++r) {
  33766. if (i = e[(t = this._fields[r]).name],
  33767. t.required && null === i)
  33768. throw Error("Missing at least one required field for " + this.toString(!0) + ": " + t);
  33769. n += t.calculate(i, e)
  33770. }
  33771. return n
  33772. }
  33773. ,
  33774. n.decode = function(e, t, i) {
  33775. t = "number" == typeof t ? t : -1;
  33776. for (var n, r, o, a, s = e.offset, l = new this.clazz; e.offset < s + t || -1 === t && 0 < e.remaining(); ) {
  33777. if (o = (n = e.readVarint32()) >>> 3,
  33778. (r = 7 & n) === g.WIRE_TYPES.ENDGROUP) {
  33779. if (o !== i)
  33780. throw Error("Illegal group end indicator for " + this.toString(!0) + ": " + o + " (" + (i ? i + " expected" : "not a group") + ")");
  33781. break
  33782. }
  33783. if (a = this._fieldsById[o]) {
  33784. if (a.repeated && !a.options.packed)
  33785. l[a.name].push(a.decode(r, e));
  33786. else if (a.map) {
  33787. var c = a.decode(r, e);
  33788. l[a.name].set(c[0], c[1])
  33789. } else if (l[a.name] = a.decode(r, e),
  33790. a.oneof) {
  33791. var h = l[a.oneof.name];
  33792. null !== h && h !== a.name && (l[h] = null),
  33793. l[a.oneof.name] = a.name
  33794. }
  33795. } else
  33796. switch (r) {
  33797. case g.WIRE_TYPES.VARINT:
  33798. e.readVarint32();
  33799. break;
  33800. case g.WIRE_TYPES.BITS32:
  33801. e.offset += 4;
  33802. break;
  33803. case g.WIRE_TYPES.BITS64:
  33804. e.offset += 8;
  33805. break;
  33806. case g.WIRE_TYPES.LDELIM:
  33807. var u = e.readVarint32();
  33808. e.offset += u;
  33809. break;
  33810. case g.WIRE_TYPES.STARTGROUP:
  33811. for (; m(o, e); )
  33812. ;
  33813. break;
  33814. default:
  33815. throw Error("Illegal wire type for unknown field " + o + " in " + this.toString(!0) + "#decode: " + r)
  33816. }
  33817. }
  33818. for (var d = 0, p = this._fields.length; d < p; ++d)
  33819. if (null === l[(a = this._fields[d]).name])
  33820. if ("proto3" === this.syntax)
  33821. l[a.name] = a.defaultValue;
  33822. else {
  33823. if (a.required) {
  33824. var f = Error("Missing at least one required field for " + this.toString(!0) + ": " + a.name);
  33825. throw f.decoded = l,
  33826. f
  33827. }
  33828. g.populateDefaults && null !== a.defaultValue && (l[a.name] = a.defaultValue)
  33829. }
  33830. return l
  33831. }
  33832. ,
  33833. s.Message = d;
  33834. function c(e, t, i, n, r, o, a, s, l, c) {
  33835. h.call(this, e, t, o),
  33836. this.className = "Message.Field",
  33837. this.required = "required" === i,
  33838. this.repeated = "repeated" === i,
  33839. this.map = "map" === i,
  33840. this.keyType = n || null,
  33841. this.type = r,
  33842. this.resolvedType = null,
  33843. this.id = a,
  33844. this.options = s || {},
  33845. this.defaultValue = null,
  33846. this.oneof = l || null,
  33847. this.syntax = c || "proto2",
  33848. this.originalName = this.name,
  33849. this.element = null,
  33850. this.keyElement = null,
  33851. !this.builder.options.convertFieldsToCamelCase || this instanceof d.ExtensionField || (this.name = g.Util.toCamelCase(this.name))
  33852. }
  33853. var r = c.prototype = Object.create(h.prototype);
  33854. r.build = function() {
  33855. this.element = new u(this.type,this.resolvedType,!1,this.syntax),
  33856. this.map && (this.keyElement = new u(this.keyType,void 0,!0,this.syntax)),
  33857. "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)
  33858. }
  33859. ,
  33860. r.verifyValue = function(e, t) {
  33861. function i(e, t) {
  33862. throw Error("Illegal value for " + r.toString(!0) + " of type " + r.type.name + ": " + e + " (" + t + ")")
  33863. }
  33864. t = t || !1;
  33865. var n, r = this;
  33866. if (null === e)
  33867. return this.required && i(typeof e, "required"),
  33868. "proto3" === this.syntax && this.type !== g.TYPES.message && i(typeof e, "proto3 field without field presence cannot be null"),
  33869. null;
  33870. if (!this.repeated || t)
  33871. return this.map && !t ? e instanceof g.Map ? e : (e instanceof Object || i(typeof e, "expected ProtoBuf.Map or raw object for map field"),
  33872. new g.Map(this,e)) : (!this.repeated && Array.isArray(e) && i(typeof e, "no array expected"),
  33873. this.element.verifyValue(e));
  33874. Array.isArray(e) || (e = [e]);
  33875. var o = [];
  33876. for (n = 0; n < e.length; n++)
  33877. o.push(this.element.verifyValue(e[n]));
  33878. return o
  33879. }
  33880. ,
  33881. r.hasWirePresence = function(e, t) {
  33882. if ("proto3" !== this.syntax)
  33883. return null !== e;
  33884. if (this.oneof && t[this.oneof.name] === this.name)
  33885. return !0;
  33886. switch (this.type) {
  33887. case g.TYPES.int32:
  33888. case g.TYPES.sint32:
  33889. case g.TYPES.sfixed32:
  33890. case g.TYPES.uint32:
  33891. case g.TYPES.fixed32:
  33892. return 0 !== e;
  33893. case g.TYPES.int64:
  33894. case g.TYPES.sint64:
  33895. case g.TYPES.sfixed64:
  33896. case g.TYPES.uint64:
  33897. case g.TYPES.fixed64:
  33898. return 0 !== e.low || 0 !== e.high;
  33899. case g.TYPES.bool:
  33900. return e;
  33901. case g.TYPES.float:
  33902. case g.TYPES.double:
  33903. return 0 !== e;
  33904. case g.TYPES.string:
  33905. return 0 < e.length;
  33906. case g.TYPES.bytes:
  33907. return 0 < e.remaining();
  33908. case g.TYPES.enum:
  33909. return 0 !== e;
  33910. case g.TYPES.message:
  33911. return null !== e;
  33912. default:
  33913. return !0
  33914. }
  33915. }
  33916. ,
  33917. r.encode = function(t, r, e) {
  33918. if (null === this.type || "object" != typeof this.type)
  33919. throw Error("[INTERNAL] Unresolved type in " + this.toString(!0) + ": " + this.type);
  33920. if (null === t || this.repeated && 0 == t.length)
  33921. return r;
  33922. try {
  33923. var i;
  33924. if (this.repeated)
  33925. if (this.options.packed && 0 <= g.PACKABLE_WIRE_TYPES.indexOf(this.type.wireType)) {
  33926. r.writeVarint32(this.id << 3 | g.WIRE_TYPES.LDELIM),
  33927. r.ensureCapacity(r.offset += 1);
  33928. var n = r.offset;
  33929. for (i = 0; i < t.length; i++)
  33930. this.element.encodeValue(this.id, t[i], r);
  33931. var o = r.offset - n
  33932. , a = I.calculateVarint32(o);
  33933. if (1 < a) {
  33934. var s = r.slice(n, r.offset);
  33935. n += a - 1,
  33936. r.offset = n,
  33937. r.append(s)
  33938. }
  33939. r.writeVarint32(o, n - a)
  33940. } else
  33941. for (i = 0; i < t.length; i++)
  33942. r.writeVarint32(this.id << 3 | this.type.wireType),
  33943. this.element.encodeValue(this.id, t[i], r);
  33944. else
  33945. this.map ? t.forEach(function(e, t, i) {
  33946. var n = I.calculateVarint32(8 | this.keyType.wireType) + this.keyElement.calculateLength(1, t) + I.calculateVarint32(16 | this.type.wireType) + this.element.calculateLength(2, e);
  33947. r.writeVarint32(this.id << 3 | g.WIRE_TYPES.LDELIM),
  33948. r.writeVarint32(n),
  33949. r.writeVarint32(8 | this.keyType.wireType),
  33950. this.keyElement.encodeValue(1, t, r),
  33951. r.writeVarint32(16 | this.type.wireType),
  33952. this.element.encodeValue(2, e, r)
  33953. }, this) : this.hasWirePresence(t, e) && (r.writeVarint32(this.id << 3 | this.type.wireType),
  33954. this.element.encodeValue(this.id, t, r))
  33955. } catch (e) {
  33956. throw Error("Illegal value for " + this.toString(!0) + ": " + t + " (" + e + ")")
  33957. }
  33958. return r
  33959. }
  33960. ,
  33961. r.calculate = function(t, e) {
  33962. if (t = this.verifyValue(t),
  33963. null === this.type || "object" != typeof this.type)
  33964. throw Error("[INTERNAL] Unresolved type in " + this.toString(!0) + ": " + this.type);
  33965. if (null === t || this.repeated && 0 == t.length)
  33966. return 0;
  33967. var r = 0;
  33968. try {
  33969. var i, n;
  33970. if (this.repeated)
  33971. if (this.options.packed && 0 <= g.PACKABLE_WIRE_TYPES.indexOf(this.type.wireType)) {
  33972. for (r += I.calculateVarint32(this.id << 3 | g.WIRE_TYPES.LDELIM),
  33973. i = n = 0; i < t.length; i++)
  33974. n += this.element.calculateLength(this.id, t[i]);
  33975. r += I.calculateVarint32(n),
  33976. r += n
  33977. } else
  33978. for (i = 0; i < t.length; i++)
  33979. r += I.calculateVarint32(this.id << 3 | this.type.wireType),
  33980. r += this.element.calculateLength(this.id, t[i]);
  33981. else
  33982. this.map ? t.forEach(function(e, t, i) {
  33983. var n = I.calculateVarint32(8 | this.keyType.wireType) + this.keyElement.calculateLength(1, t) + I.calculateVarint32(16 | this.type.wireType) + this.element.calculateLength(2, e);
  33984. r += I.calculateVarint32(this.id << 3 | g.WIRE_TYPES.LDELIM),
  33985. r += I.calculateVarint32(n),
  33986. r += n
  33987. }, this) : this.hasWirePresence(t, e) && (r += I.calculateVarint32(this.id << 3 | this.type.wireType),
  33988. r += this.element.calculateLength(this.id, t))
  33989. } catch (e) {
  33990. throw Error("Illegal value for " + this.toString(!0) + ": " + t + " (" + e + ")")
  33991. }
  33992. return r
  33993. }
  33994. ,
  33995. r.decode = function(e, t, i) {
  33996. var n, r;
  33997. 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))
  33998. throw Error("Illegal wire type for field " + this.toString(!0) + ": " + e + " (" + this.type.wireType + " expected)");
  33999. if (e == g.WIRE_TYPES.LDELIM && this.repeated && this.options.packed && 0 <= g.PACKABLE_WIRE_TYPES.indexOf(this.type.wireType) && !i) {
  34000. r = t.readVarint32(),
  34001. r = t.offset + r;
  34002. for (var o = []; t.offset < r; )
  34003. o.push(this.decode(this.type.wireType, t, !0));
  34004. return o
  34005. }
  34006. if (this.map) {
  34007. var a = u.defaultFieldValue(this.keyType);
  34008. if (n = u.defaultFieldValue(this.type),
  34009. r = t.readVarint32(),
  34010. t.remaining() < r)
  34011. throw Error("Illegal number of bytes for " + this.toString(!0) + ": " + r + " required but got only " + t.remaining());
  34012. var s = t.clone();
  34013. for (s.limit = s.offset + r,
  34014. t.offset += r; 0 < s.remaining(); ) {
  34015. var l = s.readVarint32();
  34016. e = 7 & l;
  34017. var c = l >>> 3;
  34018. if (1 == c)
  34019. a = this.keyElement.decode(s, e, c);
  34020. else {
  34021. if (2 != c)
  34022. throw Error("Unexpected tag in map field key/value submessage");
  34023. n = this.element.decode(s, e, c)
  34024. }
  34025. }
  34026. return [a, n]
  34027. }
  34028. return this.element.decode(t, e, this.id)
  34029. }
  34030. ,
  34031. s.Message.Field = c;
  34032. function o(e, t, i, n, r, o, a) {
  34033. c.call(this, e, t, i, null, n, r, o, a),
  34034. this.extension
  34035. }
  34036. o.prototype = Object.create(c.prototype),
  34037. s.Message.ExtensionField = o;
  34038. s.Message.OneOf = function(e, t, i) {
  34039. h.call(this, e, t, i),
  34040. this.fields = []
  34041. }
  34042. ;
  34043. var p = function(e, t, i, n, r) {
  34044. l.call(this, e, t, i, n, r),
  34045. this.className = "Enum",
  34046. this.object = null
  34047. };
  34048. p.getName = function(e, t) {
  34049. for (var i, n = Object.keys(e), r = 0; r < n.length; ++r)
  34050. if (e[i = n[r]] === t)
  34051. return i;
  34052. return null
  34053. }
  34054. ,
  34055. (p.prototype = Object.create(l.prototype)).build = function(e) {
  34056. if (this.object && !e)
  34057. return this.object;
  34058. for (var t = new g.Builder.Enum, i = this.getChildren(p.Value), n = 0, r = i.length; n < r; ++n)
  34059. t[i[n].name] = i[n].id;
  34060. return Object.defineProperty && Object.defineProperty(t, "$options", {
  34061. value: this.buildOpt(),
  34062. enumerable: !1
  34063. }),
  34064. this.object = t
  34065. }
  34066. ,
  34067. s.Enum = p;
  34068. function f(e, t, i, n) {
  34069. h.call(this, e, t, i),
  34070. this.className = "Enum.Value",
  34071. this.id = n
  34072. }
  34073. f.prototype = Object.create(h.prototype),
  34074. s.Enum.Value = f;
  34075. var v = function(e, t, i, n) {
  34076. h.call(this, e, t, i),
  34077. this.field = n
  34078. };
  34079. v.prototype = Object.create(h.prototype),
  34080. s.Extension = v;
  34081. var y = function(e, t, i, n) {
  34082. l.call(this, e, t, i, n),
  34083. this.className = "Service",
  34084. this.clazz = null
  34085. };
  34086. (y.prototype = Object.create(l.prototype)).build = function(e) {
  34087. return this.clazz && !e ? this.clazz : this.clazz = function(t, r) {
  34088. for (var o = function(e) {
  34089. t.Builder.Service.call(this),
  34090. this.rpcImpl = e || function(e, t, i) {
  34091. setTimeout(i.bind(this, Error("Not implemented, see: https://github.com/dcodeIO/ProtoBuf.js/wiki/Services")), 0)
  34092. }
  34093. }, e = o.prototype = Object.create(t.Builder.Service.prototype), i = r.getChildren(t.Reflect.Service.RPCMethod), n = 0; n < i.length; n++)
  34094. !function(n) {
  34095. e[n.name] = function(e, i) {
  34096. try {
  34097. try {
  34098. e = n.resolvedRequestType.clazz.decode(I.wrap(e))
  34099. } catch (e) {
  34100. if (!(e instanceof TypeError))
  34101. throw e
  34102. }
  34103. if (null === e || "object" != typeof e)
  34104. throw Error("Illegal arguments");
  34105. e instanceof n.resolvedRequestType.clazz || (e = new n.resolvedRequestType.clazz(e)),
  34106. this.rpcImpl(n.fqn(), e, function(e, t) {
  34107. if (!e) {
  34108. null === t && (t = "");
  34109. try {
  34110. t = n.resolvedResponseType.clazz.decode(t)
  34111. } catch (e) {}
  34112. 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))
  34113. }
  34114. i(e)
  34115. })
  34116. } catch (e) {
  34117. setTimeout(i.bind(this, e), 0)
  34118. }
  34119. }
  34120. ,
  34121. o[n.name] = function(e, t, i) {
  34122. new o(e)[n.name](t, i)
  34123. }
  34124. ,
  34125. Object.defineProperty && (Object.defineProperty(o[n.name], "$options", {
  34126. value: n.buildOpt()
  34127. }),
  34128. Object.defineProperty(e[n.name], "$options", {
  34129. value: o[n.name].$options
  34130. }))
  34131. }(i[n]);
  34132. return Object.defineProperty && (Object.defineProperty(o, "$options", {
  34133. value: r.buildOpt()
  34134. }),
  34135. Object.defineProperty(e, "$options", {
  34136. value: o.$options
  34137. }),
  34138. Object.defineProperty(o, "$type", {
  34139. value: r
  34140. }),
  34141. Object.defineProperty(e, "$type", {
  34142. value: r
  34143. })),
  34144. o
  34145. }(g, this)
  34146. }
  34147. ,
  34148. s.Service = y;
  34149. function A(e, t, i, n) {
  34150. h.call(this, e, t, i),
  34151. this.className = "Service.Method",
  34152. this.options = n || {}
  34153. }
  34154. (A.prototype = Object.create(h.prototype)).buildOpt = t.buildOpt,
  34155. s.Service.Method = A;
  34156. function C(e, t, i, n, r, o, a, s) {
  34157. A.call(this, e, t, i, s),
  34158. this.className = "Service.RPCMethod",
  34159. this.requestName = n,
  34160. this.responseName = r,
  34161. this.requestStream = o,
  34162. this.responseStream = a,
  34163. this.resolvedRequestType = null,
  34164. this.resolvedResponseType = null
  34165. }
  34166. return C.prototype = Object.create(A.prototype),
  34167. s.Service.RPCMethod = C,
  34168. s
  34169. }(o),
  34170. o.Builder = (i = (u = o).Lang,
  34171. s = o.Reflect,
  34172. n = h.prototype,
  34173. h.isMessage = function(e) {
  34174. return "string" == typeof e.name && void 0 === e.values && void 0 === e.rpc
  34175. }
  34176. ,
  34177. h.isMessageField = function(e) {
  34178. return "string" == typeof e.rule && "string" == typeof e.name && "string" == typeof e.type && void 0 !== e.id
  34179. }
  34180. ,
  34181. h.isEnum = function(e) {
  34182. return "string" == typeof e.name && !(void 0 === e.values || !Array.isArray(e.values) || 0 === e.values.length)
  34183. }
  34184. ,
  34185. h.isService = function(e) {
  34186. return !("string" != typeof e.name || "object" != typeof e.rpc || !e.rpc)
  34187. }
  34188. ,
  34189. h.isExtend = function(e) {
  34190. return "string" == typeof e.ref
  34191. }
  34192. ,
  34193. n.reset = function() {
  34194. return this.ptr = this.ns,
  34195. this
  34196. }
  34197. ,
  34198. n.define = function(e) {
  34199. if ("string" != typeof e || !i.TYPEREF.test(e))
  34200. throw Error("illegal namespace: " + e);
  34201. return e.split(".").forEach(function(e) {
  34202. var t = this.ptr.getChild(e);
  34203. null === t && this.ptr.addChild(t = new s.Namespace(this,this.ptr,e)),
  34204. this.ptr = t
  34205. }, this),
  34206. this
  34207. }
  34208. ,
  34209. n.create = function(e) {
  34210. if (!e)
  34211. return this;
  34212. if (Array.isArray(e)) {
  34213. if (0 === e.length)
  34214. return this;
  34215. e = e.slice()
  34216. } else
  34217. e = [e];
  34218. for (var t = [e]; 0 < t.length; ) {
  34219. if (e = t.pop(),
  34220. !Array.isArray(e))
  34221. throw Error("not a valid namespace: " + JSON.stringify(e));
  34222. for (; 0 < e.length; ) {
  34223. var i = e.shift();
  34224. if (h.isMessage(i)) {
  34225. var o = new s.Message(this,this.ptr,i.name,i.options,i.isGroup,i.syntax)
  34226. , n = {};
  34227. i.oneofs && Object.keys(i.oneofs).forEach(function(e) {
  34228. o.addChild(n[e] = new s.Message.OneOf(this,o,e))
  34229. }, this),
  34230. i.fields && i.fields.forEach(function(e) {
  34231. if (null !== o.getChild(0 | e.id))
  34232. throw Error("duplicate or invalid field id in " + o.name + ": " + e.id);
  34233. if (e.options && "object" != typeof e.options)
  34234. throw Error("illegal field options in " + o.name + "#" + e.name);
  34235. var t = null;
  34236. if ("string" == typeof e.oneof && !(t = n[e.oneof]))
  34237. throw Error("illegal oneof in " + o.name + "#" + e.name + ": " + e.oneof);
  34238. e = new s.Message.Field(this,o,e.rule,e.keytype,e.type,e.name,e.id,e.options,t,i.syntax),
  34239. t && t.fields.push(e),
  34240. o.addChild(e)
  34241. }, this);
  34242. var r = [];
  34243. if (i.enums && i.enums.forEach(function(e) {
  34244. r.push(e)
  34245. }),
  34246. i.messages && i.messages.forEach(function(e) {
  34247. r.push(e)
  34248. }),
  34249. i.services && i.services.forEach(function(e) {
  34250. r.push(e)
  34251. }),
  34252. i.extensions && ("number" == typeof i.extensions[0] ? o.extensions = [i.extensions] : o.extensions = i.extensions),
  34253. this.ptr.addChild(o),
  34254. 0 < r.length) {
  34255. t.push(e),
  34256. e = r,
  34257. r = null,
  34258. this.ptr = o,
  34259. o = null;
  34260. continue
  34261. }
  34262. r = null
  34263. } else if (h.isEnum(i))
  34264. o = new s.Enum(this,this.ptr,i.name,i.options,i.syntax),
  34265. i.values.forEach(function(e) {
  34266. o.addChild(new s.Enum.Value(this,o,e.name,e.id))
  34267. }, this),
  34268. this.ptr.addChild(o);
  34269. else if (h.isService(i))
  34270. o = new s.Service(this,this.ptr,i.name,i.options),
  34271. Object.keys(i.rpc).forEach(function(e) {
  34272. var t = i.rpc[e];
  34273. o.addChild(new s.Service.RPCMethod(this,o,e,t.request,t.response,!!t.request_stream,!!t.response_stream,t.options))
  34274. }, this),
  34275. this.ptr.addChild(o);
  34276. else {
  34277. if (!h.isExtend(i))
  34278. throw Error("not a valid definition: " + JSON.stringify(i));
  34279. if (o = this.ptr.resolve(i.ref, !0))
  34280. i.fields.forEach(function(t) {
  34281. if (null !== o.getChild(0 | t.id))
  34282. throw Error("duplicate extended field id in " + o.name + ": " + t.id);
  34283. if (o.extensions) {
  34284. var i = !1;
  34285. if (o.extensions.forEach(function(e) {
  34286. t.id >= e[0] && t.id <= e[1] && (i = !0)
  34287. }),
  34288. !i)
  34289. throw Error("illegal extended field id in " + o.name + ": " + t.id + " (not within valid ranges)")
  34290. }
  34291. var e = t.name;
  34292. this.options.convertFieldsToCamelCase && (e = u.Util.toCamelCase(e));
  34293. var n = new s.Message.ExtensionField(this,o,t.rule,t.type,this.ptr.fqn() + "." + e,t.id,t.options)
  34294. , r = new s.Extension(this,this.ptr,t.name,n);
  34295. n.extension = r,
  34296. this.ptr.addChild(r),
  34297. o.addChild(n)
  34298. }, this);
  34299. else if (!/\.?google\.protobuf\./.test(i.ref))
  34300. throw Error("extended message " + i.ref + " is not defined")
  34301. }
  34302. o = i = null
  34303. }
  34304. e = null,
  34305. this.ptr = this.ptr.parent
  34306. }
  34307. return this.resolved = !1,
  34308. this.result = null,
  34309. this
  34310. }
  34311. ,
  34312. n.import = function(t, e) {
  34313. var i = "/";
  34314. if ("string" == typeof e) {
  34315. if (u.Util.IS_NODE && (e = p("path").resolve(e)),
  34316. !0 === this.files[e])
  34317. return this.reset();
  34318. this.files[e] = !0
  34319. } else if ("object" == typeof e) {
  34320. var n = e.root;
  34321. u.Util.IS_NODE && (n = p("path").resolve(n)),
  34322. (0 <= n.indexOf("\\") || 0 <= e.file.indexOf("\\")) && (i = "\\");
  34323. var r = n + i + e.file;
  34324. if (!0 === this.files[r])
  34325. return this.reset();
  34326. this.files[r] = !0
  34327. }
  34328. if (t.imports && 0 < t.imports.length) {
  34329. var o, a = !1;
  34330. "object" == typeof e ? (this.importRoot = e.root,
  34331. a = !0,
  34332. o = this.importRoot,
  34333. e = e.file,
  34334. (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(/\\[^\\]*$/, ""),
  34335. i = "\\") : o = "." : o = null;
  34336. for (var s = 0; s < t.imports.length; s++)
  34337. if ("string" == typeof t.imports[s]) {
  34338. if (!o)
  34339. throw Error("cannot determine import root");
  34340. var l = t.imports[s];
  34341. if ("google/protobuf/descriptor.proto" === l)
  34342. continue;
  34343. if (l = o + i + l,
  34344. !0 === this.files[l])
  34345. continue;
  34346. /\.proto$/i.test(l) && !u.DotProto && (l = l.replace(/\.proto$/, ".json"));
  34347. var c = u.Util.fetch(l);
  34348. if (null === c)
  34349. throw Error("failed to import '" + l + "' in '" + e + "': file not found");
  34350. /\.json$/i.test(l) ? this.import(JSON.parse(c + ""), l) : this.import(u.DotProto.Parser.parse(c), l)
  34351. } else
  34352. e ? /\.(\w+)$/.test(e) ? this.import(t.imports[s], e.replace(/^(.+)\.(\w+)$/, function(e, t, i) {
  34353. return t + "_import" + s + "." + i
  34354. })) : this.import(t.imports[s], e + "_import" + s) : this.import(t.imports[s]);
  34355. a && (this.importRoot = null)
  34356. }
  34357. t.package && this.define(t.package),
  34358. t.syntax && function t(i) {
  34359. i.messages && i.messages.forEach(function(e) {
  34360. e.syntax = i.syntax,
  34361. t(e)
  34362. }),
  34363. i.enums && i.enums.forEach(function(e) {
  34364. e.syntax = i.syntax
  34365. })
  34366. }(t);
  34367. var h = this.ptr;
  34368. return t.options && Object.keys(t.options).forEach(function(e) {
  34369. h.options[e] = t.options[e]
  34370. }),
  34371. t.messages && (this.create(t.messages),
  34372. this.ptr = h),
  34373. t.enums && (this.create(t.enums),
  34374. this.ptr = h),
  34375. t.services && (this.create(t.services),
  34376. this.ptr = h),
  34377. t.extends && this.create(t.extends),
  34378. this.reset()
  34379. }
  34380. ,
  34381. n.resolveAll = function() {
  34382. var e;
  34383. if (null == this.ptr || "object" == typeof this.ptr.type)
  34384. return this;
  34385. if (this.ptr instanceof s.Namespace)
  34386. this.ptr.children.forEach(function(e) {
  34387. this.ptr = e,
  34388. this.resolveAll()
  34389. }, this);
  34390. else if (this.ptr instanceof s.Message.Field) {
  34391. if (i.TYPE.test(this.ptr.type))
  34392. this.ptr.type = u.TYPES[this.ptr.type];
  34393. else {
  34394. if (!i.TYPEREF.test(this.ptr.type))
  34395. throw Error("illegal type reference in " + this.ptr.toString(!0) + ": " + this.ptr.type);
  34396. if (!(e = (this.ptr instanceof s.Message.ExtensionField ? this.ptr.extension.parent : this.ptr.parent).resolve(this.ptr.type, !0)))
  34397. throw Error("unresolvable type reference in " + this.ptr.toString(!0) + ": " + this.ptr.type);
  34398. if ((this.ptr.resolvedType = e)instanceof s.Enum) {
  34399. if (this.ptr.type = u.TYPES.enum,
  34400. "proto3" === this.ptr.syntax && "proto3" !== e.syntax)
  34401. throw Error("proto3 message cannot reference proto2 enum")
  34402. } else {
  34403. if (!(e instanceof s.Message))
  34404. throw Error("illegal type reference in " + this.ptr.toString(!0) + ": " + this.ptr.type);
  34405. this.ptr.type = e.isGroup ? u.TYPES.group : u.TYPES.message
  34406. }
  34407. }
  34408. if (this.ptr.map) {
  34409. if (!i.TYPE.test(this.ptr.keyType))
  34410. throw Error("illegal key type for map field in " + this.ptr.toString(!0) + ": " + this.ptr.keyType);
  34411. this.ptr.keyType = u.TYPES[this.ptr.keyType]
  34412. }
  34413. } else if (this.ptr instanceof u.Reflect.Service.Method) {
  34414. if (!(this.ptr instanceof u.Reflect.Service.RPCMethod))
  34415. throw Error("illegal service type in " + this.ptr.toString(!0));
  34416. if (!((e = this.ptr.parent.resolve(this.ptr.requestName, !0)) && e instanceof u.Reflect.Message))
  34417. throw Error("Illegal type reference in " + this.ptr.toString(!0) + ": " + this.ptr.requestName);
  34418. if (this.ptr.resolvedRequestType = e,
  34419. !((e = this.ptr.parent.resolve(this.ptr.responseName, !0)) && e instanceof u.Reflect.Message))
  34420. throw Error("Illegal type reference in " + this.ptr.toString(!0) + ": " + this.ptr.responseName);
  34421. this.ptr.resolvedResponseType = e
  34422. } else if (!(this.ptr instanceof u.Reflect.Message.OneOf || this.ptr instanceof u.Reflect.Extension || this.ptr instanceof u.Reflect.Enum.Value))
  34423. throw Error("illegal object in namespace: " + typeof this.ptr + ": " + this.ptr);
  34424. return this.reset()
  34425. }
  34426. ,
  34427. n.build = function(e) {
  34428. if (this.reset(),
  34429. this.resolved || (this.resolveAll(),
  34430. this.resolved = !0,
  34431. this.result = null),
  34432. null === this.result && (this.result = this.ns.build()),
  34433. !e)
  34434. return this.result;
  34435. for (var t = "string" == typeof e ? e.split(".") : e, i = this.result, n = 0; n < t.length; n++) {
  34436. if (!i[t[n]]) {
  34437. i = null;
  34438. break
  34439. }
  34440. i = i[t[n]]
  34441. }
  34442. return i
  34443. }
  34444. ,
  34445. n.lookup = function(e, t) {
  34446. return e ? this.ns.resolve(e, t) : this.ns
  34447. }
  34448. ,
  34449. n.toString = function() {
  34450. return "Builder"
  34451. }
  34452. ,
  34453. h.Message = function() {}
  34454. ,
  34455. h.Enum = function() {}
  34456. ,
  34457. h.Service = function() {}
  34458. ,
  34459. h),
  34460. o.Map = (a = o.Reflect,
  34461. (t = c.prototype).clear = function() {
  34462. this.map = {}
  34463. }
  34464. ,
  34465. t.delete = function(e) {
  34466. var t = this.keyElem.valueToString(this.keyElem.verifyValue(e))
  34467. , i = t in this.map;
  34468. return delete this.map[t],
  34469. i
  34470. }
  34471. ,
  34472. t.entries = function() {
  34473. for (var e, t = [], i = Object.keys(this.map), n = 0; n < i.length; n++)
  34474. t.push([(e = this.map[i[n]]).key, e.value]);
  34475. return l(t)
  34476. }
  34477. ,
  34478. t.keys = function() {
  34479. for (var e = [], t = Object.keys(this.map), i = 0; i < t.length; i++)
  34480. e.push(this.map[t[i]].key);
  34481. return l(e)
  34482. }
  34483. ,
  34484. t.values = function() {
  34485. for (var e = [], t = Object.keys(this.map), i = 0; i < t.length; i++)
  34486. e.push(this.map[t[i]].value);
  34487. return l(e)
  34488. }
  34489. ,
  34490. t.forEach = function(e, t) {
  34491. for (var i, n = Object.keys(this.map), r = 0; r < n.length; r++)
  34492. e.call(t, (i = this.map[n[r]]).value, i.key, this)
  34493. }
  34494. ,
  34495. t.set = function(e, t) {
  34496. var i = this.keyElem.verifyValue(e)
  34497. , n = this.valueElem.verifyValue(t);
  34498. return this.map[this.keyElem.valueToString(i)] = {
  34499. key: i,
  34500. value: n
  34501. },
  34502. this
  34503. }
  34504. ,
  34505. t.get = function(e) {
  34506. var t = this.keyElem.valueToString(this.keyElem.verifyValue(e));
  34507. if (t in this.map)
  34508. return this.map[t].value
  34509. }
  34510. ,
  34511. t.has = function(e) {
  34512. return this.keyElem.valueToString(this.keyElem.verifyValue(e))in this.map
  34513. }
  34514. ,
  34515. c),
  34516. o.loadProto = function(e, t, i) {
  34517. return ("string" == typeof t || t && "string" == typeof t.file && "string" == typeof t.root) && (i = t,
  34518. t = void 0),
  34519. o.loadJson(o.DotProto.Parser.parse(e), t, i)
  34520. }
  34521. ,
  34522. o.protoFromString = o.loadProto,
  34523. o.loadProtoFile = function(t, i, n) {
  34524. if (i && "object" == typeof i ? (n = i,
  34525. i = null) : i && "function" == typeof i || (i = null),
  34526. i)
  34527. return o.Util.fetch("string" == typeof t ? t : t.root + "/" + t.file, function(e) {
  34528. if (null !== e)
  34529. try {
  34530. i(null, o.loadProto(e, n, t))
  34531. } catch (e) {
  34532. i(e)
  34533. }
  34534. else
  34535. i(Error("Failed to fetch file"))
  34536. });
  34537. var e = o.Util.fetch("object" == typeof t ? t.root + "/" + t.file : t);
  34538. return null === e ? null : o.loadProto(e, n, t)
  34539. }
  34540. ,
  34541. o.protoFromFile = o.loadProtoFile,
  34542. o.newBuilder = function(e) {
  34543. return void 0 === (e = e || {}).convertFieldsToCamelCase && (e.convertFieldsToCamelCase = o.convertFieldsToCamelCase),
  34544. void 0 === e.populateAccessors && (e.populateAccessors = o.populateAccessors),
  34545. new o.Builder(e)
  34546. }
  34547. ,
  34548. o.loadJson = function(e, t, i) {
  34549. return ("string" == typeof t || t && "string" == typeof t.file && "string" == typeof t.root) && (i = t,
  34550. t = null),
  34551. t && "object" == typeof t || (t = o.newBuilder()),
  34552. "string" == typeof e && (e = JSON.parse(e)),
  34553. t.import(e, i),
  34554. t.resolveAll(),
  34555. t
  34556. }
  34557. ,
  34558. o.loadJsonFile = function(t, i, n) {
  34559. if (i && "object" == typeof i ? (n = i,
  34560. i = null) : i && "function" == typeof i || (i = null),
  34561. i)
  34562. return o.Util.fetch("string" == typeof t ? t : t.root + "/" + t.file, function(e) {
  34563. if (null !== e)
  34564. try {
  34565. i(null, o.loadJson(JSON.parse(e), n, t))
  34566. } catch (e) {
  34567. i(e)
  34568. }
  34569. else
  34570. i(Error("Failed to fetch file"))
  34571. });
  34572. var e = o.Util.fetch("object" == typeof t ? t.root + "/" + t.file : t);
  34573. return null === e ? null : o.loadJson(JSON.parse(e), n, t)
  34574. }
  34575. ,
  34576. o;
  34577. function l(e) {
  34578. var t = 0;
  34579. return {
  34580. next: function() {
  34581. return t < e.length ? {
  34582. done: !1,
  34583. value: e[t++]
  34584. } : {
  34585. done: !0
  34586. }
  34587. }
  34588. }
  34589. }
  34590. function c(e, t) {
  34591. if (!e.map)
  34592. throw Error("field is not a map");
  34593. if (this.field = e,
  34594. this.keyElem = new a.Element(e.keyType,null,!0,e.syntax),
  34595. this.valueElem = new a.Element(e.type,e.resolvedType,!1,e.syntax),
  34596. this.map = {},
  34597. Object.defineProperty(this, "size", {
  34598. get: function() {
  34599. return Object.keys(this.map).length
  34600. }
  34601. }),
  34602. t)
  34603. for (var i = Object.keys(t), n = 0; n < i.length; n++) {
  34604. var r = this.keyElem.valueFromString(i[n])
  34605. , o = this.valueElem.verifyValue(t[i[n]]);
  34606. this.map[this.keyElem.valueToString(r)] = {
  34607. key: r,
  34608. value: o
  34609. }
  34610. }
  34611. }
  34612. function h(e) {
  34613. this.ns = new s.Namespace(this,null,""),
  34614. this.ptr = this.ns,
  34615. this.resolved = !1,
  34616. this.result = null,
  34617. this.files = {},
  34618. this.importRoot = null,
  34619. this.options = e || {}
  34620. }
  34621. }
  34622. ,
  34623. "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)
  34624. }
  34625. ).call(this, p("_process"))
  34626. }
  34627. , {
  34628. _process: 203,
  34629. bytebuffer: 215,
  34630. fs: 197,
  34631. path: 197
  34632. }],
  34633. 215: [function(t, e, i) {
  34634. var n, r;
  34635. n = this,
  34636. r = function(l) {
  34637. "use strict";
  34638. function s(e) {
  34639. var t = 0;
  34640. return function() {
  34641. return t < e.length ? e.charCodeAt(t++) : null
  34642. }
  34643. }
  34644. function c() {
  34645. var e = []
  34646. , t = [];
  34647. return function() {
  34648. return 0 === arguments.length ? t.join("") + i.apply(String, e) : (1024 < e.length + arguments.length && (t.push(i.apply(String, e)),
  34649. e.length = 0),
  34650. void Array.prototype.push.apply(e, arguments))
  34651. }
  34652. }
  34653. function n(e, t, i, n, r) {
  34654. 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];
  34655. for (u += d,
  34656. o = p & (1 << -h) - 1,
  34657. p >>= -h,
  34658. h += s; 0 < h; o = 256 * o + e[t + u],
  34659. u += d,
  34660. h -= 8)
  34661. ;
  34662. for (a = o & (1 << -h) - 1,
  34663. o >>= -h,
  34664. h += n; 0 < h; a = 256 * a + e[t + u],
  34665. u += d,
  34666. h -= 8)
  34667. ;
  34668. if (0 === o)
  34669. o = 1 - c;
  34670. else {
  34671. if (o === l)
  34672. return a ? NaN : 1 / 0 * (p ? -1 : 1);
  34673. a += Math.pow(2, n),
  34674. o -= c
  34675. }
  34676. return (p ? -1 : 1) * a * Math.pow(2, o - n)
  34677. }
  34678. function r(e, t, i, n, r, o) {
  34679. 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;
  34680. for (t = Math.abs(t),
  34681. isNaN(t) || t === 1 / 0 ? (s = isNaN(t) ? 1 : 0,
  34682. a = h) : (a = Math.floor(Math.log(t) / Math.LN2),
  34683. t * (l = Math.pow(2, -a)) < 1 && (a--,
  34684. l *= 2),
  34685. 2 <= (t += 1 <= a + u ? d / l : d * Math.pow(2, 1 - u)) * l && (a++,
  34686. l /= 2),
  34687. h <= a + u ? (s = 0,
  34688. a = h) : 1 <= a + u ? (s = (t * l - 1) * Math.pow(2, r),
  34689. a += u) : (s = t * Math.pow(2, u - 1) * Math.pow(2, r),
  34690. a = 0)); 8 <= r; e[i + p] = 255 & s,
  34691. p += f,
  34692. s /= 256,
  34693. r -= 8)
  34694. ;
  34695. for (a = a << r | s,
  34696. c += r; 0 < c; e[i + p] = 255 & a,
  34697. p += f,
  34698. a /= 256,
  34699. c -= 8)
  34700. ;
  34701. e[i + p - f] |= 128 * g
  34702. }
  34703. var f = function(e, t, i) {
  34704. if (void 0 === e && (e = f.DEFAULT_CAPACITY),
  34705. void 0 === t && (t = f.DEFAULT_ENDIAN),
  34706. void 0 === i && (i = f.DEFAULT_NOASSERT),
  34707. !i) {
  34708. if ((e |= 0) < 0)
  34709. throw RangeError("Illegal capacity");
  34710. t = !!t,
  34711. i = !!i
  34712. }
  34713. this.buffer = 0 === e ? o : new ArrayBuffer(e),
  34714. this.view = 0 === e ? null : new Uint8Array(this.buffer),
  34715. this.offset = 0,
  34716. this.markedOffset = -1,
  34717. this.limit = e,
  34718. this.littleEndian = t,
  34719. this.noAssert = i
  34720. };
  34721. f.VERSION = "5.0.1",
  34722. f.LITTLE_ENDIAN = !0,
  34723. f.BIG_ENDIAN = !1,
  34724. f.DEFAULT_CAPACITY = 16,
  34725. f.DEFAULT_ENDIAN = f.BIG_ENDIAN,
  34726. f.DEFAULT_NOASSERT = !1,
  34727. f.Long = l || null;
  34728. var a = f.prototype;
  34729. a.__isByteBuffer__,
  34730. Object.defineProperty(a, "__isByteBuffer__", {
  34731. value: !0,
  34732. enumerable: !1,
  34733. configurable: !1
  34734. });
  34735. var o = new ArrayBuffer(0)
  34736. , i = String.fromCharCode;
  34737. f.accessor = function() {
  34738. return Uint8Array
  34739. }
  34740. ,
  34741. f.allocate = function(e, t, i) {
  34742. return new f(e,t,i)
  34743. }
  34744. ,
  34745. f.concat = function(e, t, i, n) {
  34746. "boolean" != typeof t && "string" == typeof t || (n = i,
  34747. i = t,
  34748. t = void 0);
  34749. for (var r, o = 0, a = 0, s = e.length; a < s; ++a)
  34750. f.isByteBuffer(e[a]) || (e[a] = f.wrap(e[a], t)),
  34751. 0 < (r = e[a].limit - e[a].offset) && (o += r);
  34752. if (0 === o)
  34753. return new f(0,i,n);
  34754. var l, c = new f(o,i,n);
  34755. for (a = 0; a < s; )
  34756. (r = (l = e[a++]).limit - l.offset) <= 0 || (c.view.set(l.view.subarray(l.offset, l.limit), c.offset),
  34757. c.offset += r);
  34758. return c.limit = c.offset,
  34759. c.offset = 0,
  34760. c
  34761. }
  34762. ,
  34763. f.isByteBuffer = function(e) {
  34764. return !0 === (e && e.__isByteBuffer__)
  34765. }
  34766. ,
  34767. f.type = function() {
  34768. return ArrayBuffer
  34769. }
  34770. ,
  34771. f.wrap = function(e, t, i, n) {
  34772. if ("string" != typeof t && (n = i,
  34773. i = t,
  34774. t = void 0),
  34775. "string" == typeof e)
  34776. switch (void 0 === t && (t = "utf8"),
  34777. t) {
  34778. case "base64":
  34779. return f.fromBase64(e, i);
  34780. case "hex":
  34781. return f.fromHex(e, i);
  34782. case "binary":
  34783. return f.fromBinary(e, i);
  34784. case "utf8":
  34785. return f.fromUTF8(e, i);
  34786. case "debug":
  34787. return f.fromDebug(e, i);
  34788. default:
  34789. throw Error("Unsupported encoding: " + t)
  34790. }
  34791. if (null === e || "object" != typeof e)
  34792. throw TypeError("Illegal buffer");
  34793. var r;
  34794. if (f.isByteBuffer(e))
  34795. return (r = a.clone.call(e)).markedOffset = -1,
  34796. r;
  34797. if (e instanceof Uint8Array)
  34798. r = new f(0,i,n),
  34799. 0 < e.length && (r.buffer = e.buffer,
  34800. r.offset = e.byteOffset,
  34801. r.limit = e.byteOffset + e.byteLength,
  34802. r.view = new Uint8Array(e.buffer));
  34803. else if (e instanceof ArrayBuffer)
  34804. r = new f(0,i,n),
  34805. 0 < e.byteLength && (r.buffer = e,
  34806. r.offset = 0,
  34807. r.limit = e.byteLength,
  34808. r.view = 0 < e.byteLength ? new Uint8Array(e) : null);
  34809. else {
  34810. if ("[object Array]" !== Object.prototype.toString.call(e))
  34811. throw TypeError("Illegal buffer");
  34812. (r = new f(e.length,i,n)).limit = e.length;
  34813. for (var o = 0; o < e.length; ++o)
  34814. r.view[o] = e[o]
  34815. }
  34816. return r
  34817. }
  34818. ,
  34819. a.writeBitSet = function(e, t) {
  34820. var i = void 0 === t;
  34821. if (i && (t = this.offset),
  34822. !this.noAssert) {
  34823. if (!(e instanceof Array))
  34824. throw TypeError("Illegal BitSet: Not an array");
  34825. if ("number" != typeof t || t % 1 != 0)
  34826. throw TypeError("Illegal offset: " + t + " (not an integer)");
  34827. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  34828. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  34829. }
  34830. var n, r = t, o = e.length, a = o >> 3, s = 0;
  34831. for (t += this.writeVarint32(o, t); a--; )
  34832. 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,
  34833. this.writeByte(n, t++);
  34834. if (s < o) {
  34835. var l = 0;
  34836. for (n = 0; s < o; )
  34837. n |= (1 & !!e[s++]) << l++;
  34838. this.writeByte(n, t++)
  34839. }
  34840. return i ? (this.offset = t,
  34841. this) : t - r
  34842. }
  34843. ,
  34844. a.readBitSet = function(e) {
  34845. var t = void 0 === e;
  34846. t && (e = this.offset);
  34847. var i, n = this.readVarint32(e), r = n.value, o = r >> 3, a = 0, s = [];
  34848. for (e += n.length; o--; )
  34849. i = this.readByte(e++),
  34850. s[a++] = !!(1 & i),
  34851. s[a++] = !!(2 & i),
  34852. s[a++] = !!(4 & i),
  34853. s[a++] = !!(8 & i),
  34854. s[a++] = !!(16 & i),
  34855. s[a++] = !!(32 & i),
  34856. s[a++] = !!(64 & i),
  34857. s[a++] = !!(128 & i);
  34858. if (a < r) {
  34859. var l = 0;
  34860. for (i = this.readByte(e++); a < r; )
  34861. s[a++] = !!(i >> l++ & 1)
  34862. }
  34863. return t && (this.offset = e),
  34864. s
  34865. }
  34866. ,
  34867. a.readBytes = function(e, t) {
  34868. var i = void 0 === t;
  34869. if (i && (t = this.offset),
  34870. !this.noAssert) {
  34871. if ("number" != typeof t || t % 1 != 0)
  34872. throw TypeError("Illegal offset: " + t + " (not an integer)");
  34873. if ((t >>>= 0) < 0 || t + e > this.buffer.byteLength)
  34874. throw RangeError("Illegal offset: 0 <= " + t + " (+" + e + ") <= " + this.buffer.byteLength)
  34875. }
  34876. var n = this.slice(t, t + e);
  34877. return i && (this.offset += e),
  34878. n
  34879. }
  34880. ,
  34881. a.writeBytes = a.append,
  34882. a.writeInt8 = function(e, t) {
  34883. var i = void 0 === t;
  34884. if (i && (t = this.offset),
  34885. !this.noAssert) {
  34886. if ("number" != typeof e || e % 1 != 0)
  34887. throw TypeError("Illegal value: " + e + " (not an integer)");
  34888. if (e |= 0,
  34889. "number" != typeof t || t % 1 != 0)
  34890. throw TypeError("Illegal offset: " + t + " (not an integer)");
  34891. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  34892. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  34893. }
  34894. t += 1;
  34895. var n = this.buffer.byteLength;
  34896. return n < t && this.resize((n *= 2) > t ? n : t),
  34897. t -= 1,
  34898. this.view[t] = e,
  34899. i && (this.offset += 1),
  34900. this
  34901. }
  34902. ,
  34903. a.writeByte = a.writeInt8,
  34904. a.readInt8 = function(e) {
  34905. var t = void 0 === e;
  34906. if (t && (e = this.offset),
  34907. !this.noAssert) {
  34908. if ("number" != typeof e || e % 1 != 0)
  34909. throw TypeError("Illegal offset: " + e + " (not an integer)");
  34910. if ((e >>>= 0) < 0 || e + 1 > this.buffer.byteLength)
  34911. throw RangeError("Illegal offset: 0 <= " + e + " (+1) <= " + this.buffer.byteLength)
  34912. }
  34913. var i = this.view[e];
  34914. return 128 == (128 & i) && (i = -(255 - i + 1)),
  34915. t && (this.offset += 1),
  34916. i
  34917. }
  34918. ,
  34919. a.readByte = a.readInt8,
  34920. a.writeUint8 = function(e, t) {
  34921. var i = void 0 === t;
  34922. if (i && (t = this.offset),
  34923. !this.noAssert) {
  34924. if ("number" != typeof e || e % 1 != 0)
  34925. throw TypeError("Illegal value: " + e + " (not an integer)");
  34926. if (e >>>= 0,
  34927. "number" != typeof t || t % 1 != 0)
  34928. throw TypeError("Illegal offset: " + t + " (not an integer)");
  34929. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  34930. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  34931. }
  34932. t += 1;
  34933. var n = this.buffer.byteLength;
  34934. return n < t && this.resize((n *= 2) > t ? n : t),
  34935. t -= 1,
  34936. this.view[t] = e,
  34937. i && (this.offset += 1),
  34938. this
  34939. }
  34940. ,
  34941. a.writeUInt8 = a.writeUint8,
  34942. a.readUint8 = function(e) {
  34943. var t = void 0 === e;
  34944. if (t && (e = this.offset),
  34945. !this.noAssert) {
  34946. if ("number" != typeof e || e % 1 != 0)
  34947. throw TypeError("Illegal offset: " + e + " (not an integer)");
  34948. if ((e >>>= 0) < 0 || e + 1 > this.buffer.byteLength)
  34949. throw RangeError("Illegal offset: 0 <= " + e + " (+1) <= " + this.buffer.byteLength)
  34950. }
  34951. var i = this.view[e];
  34952. return t && (this.offset += 1),
  34953. i
  34954. }
  34955. ,
  34956. a.readUInt8 = a.readUint8,
  34957. a.writeInt16 = function(e, t) {
  34958. var i = void 0 === t;
  34959. if (i && (t = this.offset),
  34960. !this.noAssert) {
  34961. if ("number" != typeof e || e % 1 != 0)
  34962. throw TypeError("Illegal value: " + e + " (not an integer)");
  34963. if (e |= 0,
  34964. "number" != typeof t || t % 1 != 0)
  34965. throw TypeError("Illegal offset: " + t + " (not an integer)");
  34966. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  34967. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  34968. }
  34969. t += 2;
  34970. var n = this.buffer.byteLength;
  34971. return n < t && this.resize((n *= 2) > t ? n : t),
  34972. t -= 2,
  34973. this.littleEndian ? (this.view[t + 1] = (65280 & e) >>> 8,
  34974. this.view[t] = 255 & e) : (this.view[t] = (65280 & e) >>> 8,
  34975. this.view[t + 1] = 255 & e),
  34976. i && (this.offset += 2),
  34977. this
  34978. }
  34979. ,
  34980. a.writeShort = a.writeInt16,
  34981. a.readInt16 = function(e) {
  34982. var t = void 0 === e;
  34983. if (t && (e = this.offset),
  34984. !this.noAssert) {
  34985. if ("number" != typeof e || e % 1 != 0)
  34986. throw TypeError("Illegal offset: " + e + " (not an integer)");
  34987. if ((e >>>= 0) < 0 || e + 2 > this.buffer.byteLength)
  34988. throw RangeError("Illegal offset: 0 <= " + e + " (+2) <= " + this.buffer.byteLength)
  34989. }
  34990. var i = 0;
  34991. return this.littleEndian ? (i = this.view[e],
  34992. i |= this.view[e + 1] << 8) : (i = this.view[e] << 8,
  34993. i |= this.view[e + 1]),
  34994. 32768 == (32768 & i) && (i = -(65535 - i + 1)),
  34995. t && (this.offset += 2),
  34996. i
  34997. }
  34998. ,
  34999. a.readShort = a.readInt16,
  35000. a.writeUint16 = function(e, t) {
  35001. var i = void 0 === t;
  35002. if (i && (t = this.offset),
  35003. !this.noAssert) {
  35004. if ("number" != typeof e || e % 1 != 0)
  35005. throw TypeError("Illegal value: " + e + " (not an integer)");
  35006. if (e >>>= 0,
  35007. "number" != typeof t || t % 1 != 0)
  35008. throw TypeError("Illegal offset: " + t + " (not an integer)");
  35009. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  35010. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  35011. }
  35012. t += 2;
  35013. var n = this.buffer.byteLength;
  35014. return n < t && this.resize((n *= 2) > t ? n : t),
  35015. t -= 2,
  35016. this.littleEndian ? (this.view[t + 1] = (65280 & e) >>> 8,
  35017. this.view[t] = 255 & e) : (this.view[t] = (65280 & e) >>> 8,
  35018. this.view[t + 1] = 255 & e),
  35019. i && (this.offset += 2),
  35020. this
  35021. }
  35022. ,
  35023. a.writeUInt16 = a.writeUint16,
  35024. a.readUint16 = function(e) {
  35025. var t = void 0 === e;
  35026. if (t && (e = this.offset),
  35027. !this.noAssert) {
  35028. if ("number" != typeof e || e % 1 != 0)
  35029. throw TypeError("Illegal offset: " + e + " (not an integer)");
  35030. if ((e >>>= 0) < 0 || e + 2 > this.buffer.byteLength)
  35031. throw RangeError("Illegal offset: 0 <= " + e + " (+2) <= " + this.buffer.byteLength)
  35032. }
  35033. var i = 0;
  35034. return this.littleEndian ? (i = this.view[e],
  35035. i |= this.view[e + 1] << 8) : (i = this.view[e] << 8,
  35036. i |= this.view[e + 1]),
  35037. t && (this.offset += 2),
  35038. i
  35039. }
  35040. ,
  35041. a.readUInt16 = a.readUint16,
  35042. a.writeInt32 = function(e, t) {
  35043. var i = void 0 === t;
  35044. if (i && (t = this.offset),
  35045. !this.noAssert) {
  35046. if ("number" != typeof e || e % 1 != 0)
  35047. throw TypeError("Illegal value: " + e + " (not an integer)");
  35048. if (e |= 0,
  35049. "number" != typeof t || t % 1 != 0)
  35050. throw TypeError("Illegal offset: " + t + " (not an integer)");
  35051. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  35052. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  35053. }
  35054. t += 4;
  35055. var n = this.buffer.byteLength;
  35056. return n < t && this.resize((n *= 2) > t ? n : t),
  35057. t -= 4,
  35058. this.littleEndian ? (this.view[t + 3] = e >>> 24 & 255,
  35059. this.view[t + 2] = e >>> 16 & 255,
  35060. this.view[t + 1] = e >>> 8 & 255,
  35061. this.view[t] = 255 & e) : (this.view[t] = e >>> 24 & 255,
  35062. this.view[t + 1] = e >>> 16 & 255,
  35063. this.view[t + 2] = e >>> 8 & 255,
  35064. this.view[t + 3] = 255 & e),
  35065. i && (this.offset += 4),
  35066. this
  35067. }
  35068. ,
  35069. a.writeInt = a.writeInt32,
  35070. a.readInt32 = function(e) {
  35071. var t = void 0 === e;
  35072. if (t && (e = this.offset),
  35073. !this.noAssert) {
  35074. if ("number" != typeof e || e % 1 != 0)
  35075. throw TypeError("Illegal offset: " + e + " (not an integer)");
  35076. if ((e >>>= 0) < 0 || e + 4 > this.buffer.byteLength)
  35077. throw RangeError("Illegal offset: 0 <= " + e + " (+4) <= " + this.buffer.byteLength)
  35078. }
  35079. var i = 0;
  35080. return this.littleEndian ? (i = this.view[e + 2] << 16,
  35081. i |= this.view[e + 1] << 8,
  35082. i |= this.view[e],
  35083. i += this.view[e + 3] << 24 >>> 0) : (i = this.view[e + 1] << 16,
  35084. i |= this.view[e + 2] << 8,
  35085. i |= this.view[e + 3],
  35086. i += this.view[e] << 24 >>> 0),
  35087. i |= 0,
  35088. t && (this.offset += 4),
  35089. i
  35090. }
  35091. ,
  35092. a.readInt = a.readInt32,
  35093. a.writeUint32 = function(e, t) {
  35094. var i = void 0 === t;
  35095. if (i && (t = this.offset),
  35096. !this.noAssert) {
  35097. if ("number" != typeof e || e % 1 != 0)
  35098. throw TypeError("Illegal value: " + e + " (not an integer)");
  35099. if (e >>>= 0,
  35100. "number" != typeof t || t % 1 != 0)
  35101. throw TypeError("Illegal offset: " + t + " (not an integer)");
  35102. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  35103. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  35104. }
  35105. t += 4;
  35106. var n = this.buffer.byteLength;
  35107. return n < t && this.resize((n *= 2) > t ? n : t),
  35108. t -= 4,
  35109. this.littleEndian ? (this.view[t + 3] = e >>> 24 & 255,
  35110. this.view[t + 2] = e >>> 16 & 255,
  35111. this.view[t + 1] = e >>> 8 & 255,
  35112. this.view[t] = 255 & e) : (this.view[t] = e >>> 24 & 255,
  35113. this.view[t + 1] = e >>> 16 & 255,
  35114. this.view[t + 2] = e >>> 8 & 255,
  35115. this.view[t + 3] = 255 & e),
  35116. i && (this.offset += 4),
  35117. this
  35118. }
  35119. ,
  35120. a.writeUInt32 = a.writeUint32,
  35121. a.readUint32 = function(e) {
  35122. var t = void 0 === e;
  35123. if (t && (e = this.offset),
  35124. !this.noAssert) {
  35125. if ("number" != typeof e || e % 1 != 0)
  35126. throw TypeError("Illegal offset: " + e + " (not an integer)");
  35127. if ((e >>>= 0) < 0 || e + 4 > this.buffer.byteLength)
  35128. throw RangeError("Illegal offset: 0 <= " + e + " (+4) <= " + this.buffer.byteLength)
  35129. }
  35130. var i = 0;
  35131. return this.littleEndian ? (i = this.view[e + 2] << 16,
  35132. i |= this.view[e + 1] << 8,
  35133. i |= this.view[e],
  35134. i += this.view[e + 3] << 24 >>> 0) : (i = this.view[e + 1] << 16,
  35135. i |= this.view[e + 2] << 8,
  35136. i |= this.view[e + 3],
  35137. i += this.view[e] << 24 >>> 0),
  35138. t && (this.offset += 4),
  35139. i
  35140. }
  35141. ,
  35142. a.readUInt32 = a.readUint32,
  35143. l && (a.writeInt64 = function(e, t) {
  35144. var i = void 0 === t;
  35145. if (i && (t = this.offset),
  35146. !this.noAssert) {
  35147. if ("number" == typeof e)
  35148. e = l.fromNumber(e);
  35149. else if ("string" == typeof e)
  35150. e = l.fromString(e);
  35151. else if (!(e && e instanceof l))
  35152. throw TypeError("Illegal value: " + e + " (not an integer or Long)");
  35153. if ("number" != typeof t || t % 1 != 0)
  35154. throw TypeError("Illegal offset: " + t + " (not an integer)");
  35155. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  35156. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  35157. }
  35158. "number" == typeof e ? e = l.fromNumber(e) : "string" == typeof e && (e = l.fromString(e)),
  35159. t += 8;
  35160. var n = this.buffer.byteLength;
  35161. n < t && this.resize((n *= 2) > t ? n : t),
  35162. t -= 8;
  35163. var r = e.low
  35164. , o = e.high;
  35165. return this.littleEndian ? (this.view[t + 3] = r >>> 24 & 255,
  35166. this.view[t + 2] = r >>> 16 & 255,
  35167. this.view[t + 1] = r >>> 8 & 255,
  35168. this.view[t] = 255 & r,
  35169. t += 4,
  35170. this.view[t + 3] = o >>> 24 & 255,
  35171. this.view[t + 2] = o >>> 16 & 255,
  35172. this.view[t + 1] = o >>> 8 & 255,
  35173. this.view[t] = 255 & o) : (this.view[t] = o >>> 24 & 255,
  35174. this.view[t + 1] = o >>> 16 & 255,
  35175. this.view[t + 2] = o >>> 8 & 255,
  35176. this.view[t + 3] = 255 & o,
  35177. t += 4,
  35178. this.view[t] = r >>> 24 & 255,
  35179. this.view[t + 1] = r >>> 16 & 255,
  35180. this.view[t + 2] = r >>> 8 & 255,
  35181. this.view[t + 3] = 255 & r),
  35182. i && (this.offset += 8),
  35183. this
  35184. }
  35185. ,
  35186. a.writeLong = a.writeInt64,
  35187. a.readInt64 = function(e) {
  35188. var t = void 0 === e;
  35189. if (t && (e = this.offset),
  35190. !this.noAssert) {
  35191. if ("number" != typeof e || e % 1 != 0)
  35192. throw TypeError("Illegal offset: " + e + " (not an integer)");
  35193. if ((e >>>= 0) < 0 || e + 8 > this.buffer.byteLength)
  35194. throw RangeError("Illegal offset: 0 <= " + e + " (+8) <= " + this.buffer.byteLength)
  35195. }
  35196. var i = 0
  35197. , n = 0;
  35198. this.littleEndian ? (i = this.view[e + 2] << 16,
  35199. i |= this.view[e + 1] << 8,
  35200. i |= this.view[e],
  35201. i += this.view[e + 3] << 24 >>> 0,
  35202. e += 4,
  35203. n = this.view[e + 2] << 16,
  35204. n |= this.view[e + 1] << 8,
  35205. n |= this.view[e],
  35206. n += this.view[e + 3] << 24 >>> 0) : (n = this.view[e + 1] << 16,
  35207. n |= this.view[e + 2] << 8,
  35208. n |= this.view[e + 3],
  35209. n += this.view[e] << 24 >>> 0,
  35210. e += 4,
  35211. i = this.view[e + 1] << 16,
  35212. i |= this.view[e + 2] << 8,
  35213. i |= this.view[e + 3],
  35214. i += this.view[e] << 24 >>> 0);
  35215. var r = new l(i,n,!1);
  35216. return t && (this.offset += 8),
  35217. r
  35218. }
  35219. ,
  35220. a.readLong = a.readInt64,
  35221. a.writeUint64 = function(e, t) {
  35222. var i = void 0 === t;
  35223. if (i && (t = this.offset),
  35224. !this.noAssert) {
  35225. if ("number" == typeof e)
  35226. e = l.fromNumber(e);
  35227. else if ("string" == typeof e)
  35228. e = l.fromString(e);
  35229. else if (!(e && e instanceof l))
  35230. throw TypeError("Illegal value: " + e + " (not an integer or Long)");
  35231. if ("number" != typeof t || t % 1 != 0)
  35232. throw TypeError("Illegal offset: " + t + " (not an integer)");
  35233. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  35234. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  35235. }
  35236. "number" == typeof e ? e = l.fromNumber(e) : "string" == typeof e && (e = l.fromString(e)),
  35237. t += 8;
  35238. var n = this.buffer.byteLength;
  35239. n < t && this.resize((n *= 2) > t ? n : t),
  35240. t -= 8;
  35241. var r = e.low
  35242. , o = e.high;
  35243. return this.littleEndian ? (this.view[t + 3] = r >>> 24 & 255,
  35244. this.view[t + 2] = r >>> 16 & 255,
  35245. this.view[t + 1] = r >>> 8 & 255,
  35246. this.view[t] = 255 & r,
  35247. t += 4,
  35248. this.view[t + 3] = o >>> 24 & 255,
  35249. this.view[t + 2] = o >>> 16 & 255,
  35250. this.view[t + 1] = o >>> 8 & 255,
  35251. this.view[t] = 255 & o) : (this.view[t] = o >>> 24 & 255,
  35252. this.view[t + 1] = o >>> 16 & 255,
  35253. this.view[t + 2] = o >>> 8 & 255,
  35254. this.view[t + 3] = 255 & o,
  35255. t += 4,
  35256. this.view[t] = r >>> 24 & 255,
  35257. this.view[t + 1] = r >>> 16 & 255,
  35258. this.view[t + 2] = r >>> 8 & 255,
  35259. this.view[t + 3] = 255 & r),
  35260. i && (this.offset += 8),
  35261. this
  35262. }
  35263. ,
  35264. a.writeUInt64 = a.writeUint64,
  35265. a.readUint64 = function(e) {
  35266. var t = void 0 === e;
  35267. if (t && (e = this.offset),
  35268. !this.noAssert) {
  35269. if ("number" != typeof e || e % 1 != 0)
  35270. throw TypeError("Illegal offset: " + e + " (not an integer)");
  35271. if ((e >>>= 0) < 0 || e + 8 > this.buffer.byteLength)
  35272. throw RangeError("Illegal offset: 0 <= " + e + " (+8) <= " + this.buffer.byteLength)
  35273. }
  35274. var i = 0
  35275. , n = 0;
  35276. this.littleEndian ? (i = this.view[e + 2] << 16,
  35277. i |= this.view[e + 1] << 8,
  35278. i |= this.view[e],
  35279. i += this.view[e + 3] << 24 >>> 0,
  35280. e += 4,
  35281. n = this.view[e + 2] << 16,
  35282. n |= this.view[e + 1] << 8,
  35283. n |= this.view[e],
  35284. n += this.view[e + 3] << 24 >>> 0) : (n = this.view[e + 1] << 16,
  35285. n |= this.view[e + 2] << 8,
  35286. n |= this.view[e + 3],
  35287. n += this.view[e] << 24 >>> 0,
  35288. e += 4,
  35289. i = this.view[e + 1] << 16,
  35290. i |= this.view[e + 2] << 8,
  35291. i |= this.view[e + 3],
  35292. i += this.view[e] << 24 >>> 0);
  35293. var r = new l(i,n,!0);
  35294. return t && (this.offset += 8),
  35295. r
  35296. }
  35297. ,
  35298. a.readUInt64 = a.readUint64),
  35299. a.writeFloat32 = function(e, t) {
  35300. var i = void 0 === t;
  35301. if (i && (t = this.offset),
  35302. !this.noAssert) {
  35303. if ("number" != typeof e)
  35304. throw TypeError("Illegal value: " + e + " (not a number)");
  35305. if ("number" != typeof t || t % 1 != 0)
  35306. throw TypeError("Illegal offset: " + t + " (not an integer)");
  35307. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  35308. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  35309. }
  35310. t += 4;
  35311. var n = this.buffer.byteLength;
  35312. return n < t && this.resize((n *= 2) > t ? n : t),
  35313. t -= 4,
  35314. r(this.view, e, t, this.littleEndian, 23, 4),
  35315. i && (this.offset += 4),
  35316. this
  35317. }
  35318. ,
  35319. a.writeFloat = a.writeFloat32,
  35320. a.readFloat32 = function(e) {
  35321. var t = void 0 === e;
  35322. if (t && (e = this.offset),
  35323. !this.noAssert) {
  35324. if ("number" != typeof e || e % 1 != 0)
  35325. throw TypeError("Illegal offset: " + e + " (not an integer)");
  35326. if ((e >>>= 0) < 0 || e + 4 > this.buffer.byteLength)
  35327. throw RangeError("Illegal offset: 0 <= " + e + " (+4) <= " + this.buffer.byteLength)
  35328. }
  35329. var i = n(this.view, e, this.littleEndian, 23, 4);
  35330. return t && (this.offset += 4),
  35331. i
  35332. }
  35333. ,
  35334. a.readFloat = a.readFloat32,
  35335. a.writeFloat64 = function(e, t) {
  35336. var i = void 0 === t;
  35337. if (i && (t = this.offset),
  35338. !this.noAssert) {
  35339. if ("number" != typeof e)
  35340. throw TypeError("Illegal value: " + e + " (not a number)");
  35341. if ("number" != typeof t || t % 1 != 0)
  35342. throw TypeError("Illegal offset: " + t + " (not an integer)");
  35343. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  35344. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  35345. }
  35346. t += 8;
  35347. var n = this.buffer.byteLength;
  35348. return n < t && this.resize((n *= 2) > t ? n : t),
  35349. t -= 8,
  35350. r(this.view, e, t, this.littleEndian, 52, 8),
  35351. i && (this.offset += 8),
  35352. this
  35353. }
  35354. ,
  35355. a.writeDouble = a.writeFloat64,
  35356. a.readFloat64 = function(e) {
  35357. var t = void 0 === e;
  35358. if (t && (e = this.offset),
  35359. !this.noAssert) {
  35360. if ("number" != typeof e || e % 1 != 0)
  35361. throw TypeError("Illegal offset: " + e + " (not an integer)");
  35362. if ((e >>>= 0) < 0 || e + 8 > this.buffer.byteLength)
  35363. throw RangeError("Illegal offset: 0 <= " + e + " (+8) <= " + this.buffer.byteLength)
  35364. }
  35365. var i = n(this.view, e, this.littleEndian, 52, 8);
  35366. return t && (this.offset += 8),
  35367. i
  35368. }
  35369. ,
  35370. a.readDouble = a.readFloat64,
  35371. f.MAX_VARINT32_BYTES = 5,
  35372. f.calculateVarint32 = function(e) {
  35373. return (e >>>= 0) < 128 ? 1 : e < 16384 ? 2 : e < 1 << 21 ? 3 : e < 1 << 28 ? 4 : 5
  35374. }
  35375. ,
  35376. f.zigZagEncode32 = function(e) {
  35377. return ((e |= 0) << 1 ^ e >> 31) >>> 0
  35378. }
  35379. ,
  35380. f.zigZagDecode32 = function(e) {
  35381. return e >>> 1 ^ -(1 & e) | 0
  35382. }
  35383. ,
  35384. a.writeVarint32 = function(e, t) {
  35385. var i = void 0 === t;
  35386. if (i && (t = this.offset),
  35387. !this.noAssert) {
  35388. if ("number" != typeof e || e % 1 != 0)
  35389. throw TypeError("Illegal value: " + e + " (not an integer)");
  35390. if (e |= 0,
  35391. "number" != typeof t || t % 1 != 0)
  35392. throw TypeError("Illegal offset: " + t + " (not an integer)");
  35393. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  35394. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  35395. }
  35396. var n, r = f.calculateVarint32(e);
  35397. t += r;
  35398. var o = this.buffer.byteLength;
  35399. for (o < t && this.resize((o *= 2) > t ? o : t),
  35400. t -= r,
  35401. e >>>= 0; 128 <= e; )
  35402. n = 127 & e | 128,
  35403. this.view[t++] = n,
  35404. e >>>= 7;
  35405. return this.view[t++] = e,
  35406. i ? (this.offset = t,
  35407. this) : r
  35408. }
  35409. ,
  35410. a.writeVarint32ZigZag = function(e, t) {
  35411. return this.writeVarint32(f.zigZagEncode32(e), t)
  35412. }
  35413. ,
  35414. a.readVarint32 = function(e) {
  35415. var t = void 0 === e;
  35416. if (t && (e = this.offset),
  35417. !this.noAssert) {
  35418. if ("number" != typeof e || e % 1 != 0)
  35419. throw TypeError("Illegal offset: " + e + " (not an integer)");
  35420. if ((e >>>= 0) < 0 || e + 1 > this.buffer.byteLength)
  35421. throw RangeError("Illegal offset: 0 <= " + e + " (+1) <= " + this.buffer.byteLength)
  35422. }
  35423. var i, n = 0, r = 0;
  35424. do {
  35425. if (!this.noAssert && e > this.limit) {
  35426. var o = Error("Truncated");
  35427. throw o.truncated = !0,
  35428. o
  35429. }
  35430. i = this.view[e++],
  35431. n < 5 && (r |= (127 & i) << 7 * n),
  35432. ++n
  35433. } while (0 != (128 & i));return r |= 0,
  35434. t ? (this.offset = e,
  35435. r) : {
  35436. value: r,
  35437. length: n
  35438. }
  35439. }
  35440. ,
  35441. a.readVarint32ZigZag = function(e) {
  35442. var t = this.readVarint32(e);
  35443. return "object" == typeof t ? t.value = f.zigZagDecode32(t.value) : t = f.zigZagDecode32(t),
  35444. t
  35445. }
  35446. ,
  35447. l && (f.MAX_VARINT64_BYTES = 10,
  35448. f.calculateVarint64 = function(e) {
  35449. "number" == typeof e ? e = l.fromNumber(e) : "string" == typeof e && (e = l.fromString(e));
  35450. var t = e.toInt() >>> 0
  35451. , i = e.shiftRightUnsigned(28).toInt() >>> 0
  35452. , n = e.shiftRightUnsigned(56).toInt() >>> 0;
  35453. 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
  35454. }
  35455. ,
  35456. f.zigZagEncode64 = function(e) {
  35457. return "number" == typeof e ? e = l.fromNumber(e, !1) : "string" == typeof e ? e = l.fromString(e, !1) : !1 !== e.unsigned && (e = e.toSigned()),
  35458. e.shiftLeft(1).xor(e.shiftRight(63)).toUnsigned()
  35459. }
  35460. ,
  35461. f.zigZagDecode64 = function(e) {
  35462. return "number" == typeof e ? e = l.fromNumber(e, !1) : "string" == typeof e ? e = l.fromString(e, !1) : !1 !== e.unsigned && (e = e.toSigned()),
  35463. e.shiftRightUnsigned(1).xor(e.and(l.ONE).toSigned().negate()).toSigned()
  35464. }
  35465. ,
  35466. a.writeVarint64 = function(e, t) {
  35467. var i = void 0 === t;
  35468. if (i && (t = this.offset),
  35469. !this.noAssert) {
  35470. if ("number" == typeof e)
  35471. e = l.fromNumber(e);
  35472. else if ("string" == typeof e)
  35473. e = l.fromString(e);
  35474. else if (!(e && e instanceof l))
  35475. throw TypeError("Illegal value: " + e + " (not an integer or Long)");
  35476. if ("number" != typeof t || t % 1 != 0)
  35477. throw TypeError("Illegal offset: " + t + " (not an integer)");
  35478. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  35479. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  35480. }
  35481. "number" == typeof e ? e = l.fromNumber(e, !1) : "string" == typeof e ? e = l.fromString(e, !1) : !1 !== e.unsigned && (e = e.toSigned());
  35482. var n = f.calculateVarint64(e)
  35483. , r = e.toInt() >>> 0
  35484. , o = e.shiftRightUnsigned(28).toInt() >>> 0
  35485. , a = e.shiftRightUnsigned(56).toInt() >>> 0;
  35486. t += n;
  35487. var s = this.buffer.byteLength;
  35488. switch (s < t && this.resize((s *= 2) > t ? s : t),
  35489. t -= n,
  35490. n) {
  35491. case 10:
  35492. this.view[t + 9] = a >>> 7 & 1;
  35493. case 9:
  35494. this.view[t + 8] = 9 !== n ? 128 | a : 127 & a;
  35495. case 8:
  35496. this.view[t + 7] = 8 !== n ? o >>> 21 | 128 : o >>> 21 & 127;
  35497. case 7:
  35498. this.view[t + 6] = 7 !== n ? o >>> 14 | 128 : o >>> 14 & 127;
  35499. case 6:
  35500. this.view[t + 5] = 6 !== n ? o >>> 7 | 128 : o >>> 7 & 127;
  35501. case 5:
  35502. this.view[t + 4] = 5 !== n ? 128 | o : 127 & o;
  35503. case 4:
  35504. this.view[t + 3] = 4 !== n ? r >>> 21 | 128 : r >>> 21 & 127;
  35505. case 3:
  35506. this.view[t + 2] = 3 !== n ? r >>> 14 | 128 : r >>> 14 & 127;
  35507. case 2:
  35508. this.view[t + 1] = 2 !== n ? r >>> 7 | 128 : r >>> 7 & 127;
  35509. case 1:
  35510. this.view[t] = 1 !== n ? 128 | r : 127 & r
  35511. }
  35512. return i ? (this.offset += n,
  35513. this) : n
  35514. }
  35515. ,
  35516. a.writeVarint64ZigZag = function(e, t) {
  35517. return this.writeVarint64(f.zigZagEncode64(e), t)
  35518. }
  35519. ,
  35520. a.readVarint64 = function(e) {
  35521. var t = void 0 === e;
  35522. if (t && (e = this.offset),
  35523. !this.noAssert) {
  35524. if ("number" != typeof e || e % 1 != 0)
  35525. throw TypeError("Illegal offset: " + e + " (not an integer)");
  35526. if ((e >>>= 0) < 0 || e + 1 > this.buffer.byteLength)
  35527. throw RangeError("Illegal offset: 0 <= " + e + " (+1) <= " + this.buffer.byteLength)
  35528. }
  35529. var i = e
  35530. , n = 0
  35531. , r = 0
  35532. , o = 0
  35533. , a = 0;
  35534. if (n = 127 & (a = this.view[e++]),
  35535. 128 & a && (n |= (127 & (a = this.view[e++])) << 7,
  35536. (128 & a || this.noAssert && void 0 === a) && (n |= (127 & (a = this.view[e++])) << 14,
  35537. (128 & a || this.noAssert && void 0 === a) && (n |= (127 & (a = this.view[e++])) << 21,
  35538. (128 & a || this.noAssert && void 0 === a) && (r = 127 & (a = this.view[e++]),
  35539. (128 & a || this.noAssert && void 0 === a) && (r |= (127 & (a = this.view[e++])) << 7,
  35540. (128 & a || this.noAssert && void 0 === a) && (r |= (127 & (a = this.view[e++])) << 14,
  35541. (128 & a || this.noAssert && void 0 === a) && (r |= (127 & (a = this.view[e++])) << 21,
  35542. (128 & a || this.noAssert && void 0 === a) && (o = 127 & (a = this.view[e++]),
  35543. (128 & a || this.noAssert && void 0 === a) && (o |= (127 & (a = this.view[e++])) << 7,
  35544. 128 & a || this.noAssert && void 0 === a))))))))))
  35545. throw Error("Buffer overrun");
  35546. var s = l.fromBits(n | r << 28, r >>> 4 | o << 24, !1);
  35547. return t ? (this.offset = e,
  35548. s) : {
  35549. value: s,
  35550. length: e - i
  35551. }
  35552. }
  35553. ,
  35554. a.readVarint64ZigZag = function(e) {
  35555. var t = this.readVarint64(e);
  35556. return t && t.value instanceof l ? t.value = f.zigZagDecode64(t.value) : t = f.zigZagDecode64(t),
  35557. t
  35558. }
  35559. ),
  35560. a.writeCString = function(e, t) {
  35561. var i = void 0 === t;
  35562. i && (t = this.offset);
  35563. var n, r = e.length;
  35564. if (!this.noAssert) {
  35565. if ("string" != typeof e)
  35566. throw TypeError("Illegal str: Not a string");
  35567. for (n = 0; n < r; ++n)
  35568. if (0 === e.charCodeAt(n))
  35569. throw RangeError("Illegal str: Contains NULL-characters");
  35570. if ("number" != typeof t || t % 1 != 0)
  35571. throw TypeError("Illegal offset: " + t + " (not an integer)");
  35572. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  35573. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  35574. }
  35575. r = d.calculateUTF16asUTF8(s(e))[1],
  35576. t += r + 1;
  35577. var o = this.buffer.byteLength;
  35578. return o < t && this.resize((o *= 2) > t ? o : t),
  35579. t -= r + 1,
  35580. d.encodeUTF16toUTF8(s(e), function(e) {
  35581. this.view[t++] = e
  35582. }
  35583. .bind(this)),
  35584. this.view[t++] = 0,
  35585. i ? (this.offset = t,
  35586. this) : r
  35587. }
  35588. ,
  35589. a.readCString = function(e) {
  35590. var t = void 0 === e;
  35591. if (t && (e = this.offset),
  35592. !this.noAssert) {
  35593. if ("number" != typeof e || e % 1 != 0)
  35594. throw TypeError("Illegal offset: " + e + " (not an integer)");
  35595. if ((e >>>= 0) < 0 || e + 1 > this.buffer.byteLength)
  35596. throw RangeError("Illegal offset: 0 <= " + e + " (+1) <= " + this.buffer.byteLength)
  35597. }
  35598. var i, n = e, r = -1;
  35599. return d.decodeUTF8toUTF16(function() {
  35600. if (0 === r)
  35601. return null;
  35602. if (e >= this.limit)
  35603. throw RangeError("Illegal range: Truncated data, " + e + " < " + this.limit);
  35604. return 0 === (r = this.view[e++]) ? null : r
  35605. }
  35606. .bind(this), i = c(), !0),
  35607. t ? (this.offset = e,
  35608. i()) : {
  35609. string: i(),
  35610. length: e - n
  35611. }
  35612. }
  35613. ,
  35614. a.writeIString = function(e, t) {
  35615. var i = void 0 === t;
  35616. if (i && (t = this.offset),
  35617. !this.noAssert) {
  35618. if ("string" != typeof e)
  35619. throw TypeError("Illegal str: Not a string");
  35620. if ("number" != typeof t || t % 1 != 0)
  35621. throw TypeError("Illegal offset: " + t + " (not an integer)");
  35622. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  35623. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  35624. }
  35625. var n, r = t;
  35626. n = d.calculateUTF16asUTF8(s(e), this.noAssert)[1],
  35627. t += 4 + n;
  35628. var o = this.buffer.byteLength;
  35629. if (o < t && this.resize((o *= 2) > t ? o : t),
  35630. t -= 4 + n,
  35631. this.littleEndian ? (this.view[t + 3] = n >>> 24 & 255,
  35632. this.view[t + 2] = n >>> 16 & 255,
  35633. this.view[t + 1] = n >>> 8 & 255,
  35634. this.view[t] = 255 & n) : (this.view[t] = n >>> 24 & 255,
  35635. this.view[t + 1] = n >>> 16 & 255,
  35636. this.view[t + 2] = n >>> 8 & 255,
  35637. this.view[t + 3] = 255 & n),
  35638. t += 4,
  35639. d.encodeUTF16toUTF8(s(e), function(e) {
  35640. this.view[t++] = e
  35641. }
  35642. .bind(this)),
  35643. t !== r + 4 + n)
  35644. throw RangeError("Illegal range: Truncated data, " + t + " == " + (t + 4 + n));
  35645. return i ? (this.offset = t,
  35646. this) : t - r
  35647. }
  35648. ,
  35649. a.readIString = function(e) {
  35650. var t = void 0 === e;
  35651. if (t && (e = this.offset),
  35652. !this.noAssert) {
  35653. if ("number" != typeof e || e % 1 != 0)
  35654. throw TypeError("Illegal offset: " + e + " (not an integer)");
  35655. if ((e >>>= 0) < 0 || e + 4 > this.buffer.byteLength)
  35656. throw RangeError("Illegal offset: 0 <= " + e + " (+4) <= " + this.buffer.byteLength)
  35657. }
  35658. var i = e
  35659. , n = this.readUint32(e)
  35660. , r = this.readUTF8String(n, f.METRICS_BYTES, e += 4);
  35661. return e += r.length,
  35662. t ? (this.offset = e,
  35663. r.string) : {
  35664. string: r.string,
  35665. length: e - i
  35666. }
  35667. }
  35668. ,
  35669. f.METRICS_CHARS = "c",
  35670. f.METRICS_BYTES = "b",
  35671. a.writeUTF8String = function(e, t) {
  35672. var i = void 0 === t;
  35673. if (i && (t = this.offset),
  35674. !this.noAssert) {
  35675. if ("number" != typeof t || t % 1 != 0)
  35676. throw TypeError("Illegal offset: " + t + " (not an integer)");
  35677. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  35678. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  35679. }
  35680. var n, r = t;
  35681. n = d.calculateUTF16asUTF8(s(e))[1],
  35682. t += n;
  35683. var o = this.buffer.byteLength;
  35684. return o < t && this.resize((o *= 2) > t ? o : t),
  35685. t -= n,
  35686. d.encodeUTF16toUTF8(s(e), function(e) {
  35687. this.view[t++] = e
  35688. }
  35689. .bind(this)),
  35690. i ? (this.offset = t,
  35691. this) : t - r
  35692. }
  35693. ,
  35694. a.writeString = a.writeUTF8String,
  35695. f.calculateUTF8Chars = function(e) {
  35696. return d.calculateUTF16asUTF8(s(e))[0]
  35697. }
  35698. ,
  35699. f.calculateUTF8Bytes = function(e) {
  35700. return d.calculateUTF16asUTF8(s(e))[1]
  35701. }
  35702. ,
  35703. f.calculateString = f.calculateUTF8Bytes,
  35704. a.readUTF8String = function(e, t, i) {
  35705. "number" == typeof t && (i = t,
  35706. t = void 0);
  35707. var n = void 0 === i;
  35708. if (n && (i = this.offset),
  35709. void 0 === t && (t = f.METRICS_CHARS),
  35710. !this.noAssert) {
  35711. if ("number" != typeof e || e % 1 != 0)
  35712. throw TypeError("Illegal length: " + e + " (not an integer)");
  35713. if (e |= 0,
  35714. "number" != typeof i || i % 1 != 0)
  35715. throw TypeError("Illegal offset: " + i + " (not an integer)");
  35716. if ((i >>>= 0) < 0 || i + 0 > this.buffer.byteLength)
  35717. throw RangeError("Illegal offset: 0 <= " + i + " (+0) <= " + this.buffer.byteLength)
  35718. }
  35719. var r, o = 0, a = i;
  35720. if (t === f.METRICS_CHARS) {
  35721. if (r = c(),
  35722. d.decodeUTF8(function() {
  35723. return o < e && i < this.limit ? this.view[i++] : null
  35724. }
  35725. .bind(this), function(e) {
  35726. ++o,
  35727. d.UTF8toUTF16(e, r)
  35728. }),
  35729. o !== e)
  35730. throw RangeError("Illegal range: Truncated data, " + o + " == " + e);
  35731. return n ? (this.offset = i,
  35732. r()) : {
  35733. string: r(),
  35734. length: i - a
  35735. }
  35736. }
  35737. if (t !== f.METRICS_BYTES)
  35738. throw TypeError("Unsupported metrics: " + t);
  35739. if (!this.noAssert) {
  35740. if ("number" != typeof i || i % 1 != 0)
  35741. throw TypeError("Illegal offset: " + i + " (not an integer)");
  35742. if ((i >>>= 0) < 0 || i + e > this.buffer.byteLength)
  35743. throw RangeError("Illegal offset: 0 <= " + i + " (+" + e + ") <= " + this.buffer.byteLength)
  35744. }
  35745. var s = i + e;
  35746. if (d.decodeUTF8toUTF16(function() {
  35747. return i < s ? this.view[i++] : null
  35748. }
  35749. .bind(this), r = c(), this.noAssert),
  35750. i !== s)
  35751. throw RangeError("Illegal range: Truncated data, " + i + " == " + s);
  35752. return n ? (this.offset = i,
  35753. r()) : {
  35754. string: r(),
  35755. length: i - a
  35756. }
  35757. }
  35758. ,
  35759. a.readString = a.readUTF8String,
  35760. a.writeVString = function(e, t) {
  35761. var i = void 0 === t;
  35762. if (i && (t = this.offset),
  35763. !this.noAssert) {
  35764. if ("string" != typeof e)
  35765. throw TypeError("Illegal str: Not a string");
  35766. if ("number" != typeof t || t % 1 != 0)
  35767. throw TypeError("Illegal offset: " + t + " (not an integer)");
  35768. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  35769. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  35770. }
  35771. var n, r, o = t;
  35772. n = d.calculateUTF16asUTF8(s(e), this.noAssert)[1],
  35773. r = f.calculateVarint32(n),
  35774. t += r + n;
  35775. var a = this.buffer.byteLength;
  35776. if (a < t && this.resize((a *= 2) > t ? a : t),
  35777. t -= r + n,
  35778. t += this.writeVarint32(n, t),
  35779. d.encodeUTF16toUTF8(s(e), function(e) {
  35780. this.view[t++] = e
  35781. }
  35782. .bind(this)),
  35783. t !== o + n + r)
  35784. throw RangeError("Illegal range: Truncated data, " + t + " == " + (t + n + r));
  35785. return i ? (this.offset = t,
  35786. this) : t - o
  35787. }
  35788. ,
  35789. a.readVString = function(e) {
  35790. var t = void 0 === e;
  35791. if (t && (e = this.offset),
  35792. !this.noAssert) {
  35793. if ("number" != typeof e || e % 1 != 0)
  35794. throw TypeError("Illegal offset: " + e + " (not an integer)");
  35795. if ((e >>>= 0) < 0 || e + 1 > this.buffer.byteLength)
  35796. throw RangeError("Illegal offset: 0 <= " + e + " (+1) <= " + this.buffer.byteLength)
  35797. }
  35798. var i = e
  35799. , n = this.readVarint32(e)
  35800. , r = this.readUTF8String(n.value, f.METRICS_BYTES, e += n.length);
  35801. return e += r.length,
  35802. t ? (this.offset = e,
  35803. r.string) : {
  35804. string: r.string,
  35805. length: e - i
  35806. }
  35807. }
  35808. ,
  35809. a.append = function(e, t, i) {
  35810. "number" != typeof t && "string" == typeof t || (i = t,
  35811. t = void 0);
  35812. var n = void 0 === i;
  35813. if (n && (i = this.offset),
  35814. !this.noAssert) {
  35815. if ("number" != typeof i || i % 1 != 0)
  35816. throw TypeError("Illegal offset: " + i + " (not an integer)");
  35817. if ((i >>>= 0) < 0 || i + 0 > this.buffer.byteLength)
  35818. throw RangeError("Illegal offset: 0 <= " + i + " (+0) <= " + this.buffer.byteLength)
  35819. }
  35820. e instanceof f || (e = f.wrap(e, t));
  35821. var r = e.limit - e.offset;
  35822. if (r <= 0)
  35823. return this;
  35824. i += r;
  35825. var o = this.buffer.byteLength;
  35826. return o < i && this.resize((o *= 2) > i ? o : i),
  35827. i -= r,
  35828. this.view.set(e.view.subarray(e.offset, e.limit), i),
  35829. e.offset += r,
  35830. n && (this.offset += r),
  35831. this
  35832. }
  35833. ,
  35834. a.appendTo = function(e, t) {
  35835. return e.append(this, t),
  35836. this
  35837. }
  35838. ,
  35839. a.assert = function(e) {
  35840. return this.noAssert = !e,
  35841. this
  35842. }
  35843. ,
  35844. a.capacity = function() {
  35845. return this.buffer.byteLength
  35846. }
  35847. ,
  35848. a.clear = function() {
  35849. return this.offset = 0,
  35850. this.limit = this.buffer.byteLength,
  35851. this.markedOffset = -1,
  35852. this
  35853. }
  35854. ,
  35855. a.clone = function(e) {
  35856. var t = new f(0,this.littleEndian,this.noAssert);
  35857. return e ? (t.buffer = new ArrayBuffer(this.buffer.byteLength),
  35858. t.view = new Uint8Array(t.buffer)) : (t.buffer = this.buffer,
  35859. t.view = this.view),
  35860. t.offset = this.offset,
  35861. t.markedOffset = this.markedOffset,
  35862. t.limit = this.limit,
  35863. t
  35864. }
  35865. ,
  35866. a.compact = function(e, t) {
  35867. if (void 0 === e && (e = this.offset),
  35868. void 0 === t && (t = this.limit),
  35869. !this.noAssert) {
  35870. if ("number" != typeof e || e % 1 != 0)
  35871. throw TypeError("Illegal begin: Not an integer");
  35872. if (e >>>= 0,
  35873. "number" != typeof t || t % 1 != 0)
  35874. throw TypeError("Illegal end: Not an integer");
  35875. if (t >>>= 0,
  35876. e < 0 || t < e || t > this.buffer.byteLength)
  35877. throw RangeError("Illegal range: 0 <= " + e + " <= " + t + " <= " + this.buffer.byteLength)
  35878. }
  35879. if (0 === e && t === this.buffer.byteLength)
  35880. return this;
  35881. var i = t - e;
  35882. if (0 == i)
  35883. return this.buffer = o,
  35884. this.view = null,
  35885. 0 <= this.markedOffset && (this.markedOffset -= e),
  35886. this.offset = 0,
  35887. this.limit = 0,
  35888. this;
  35889. var n = new ArrayBuffer(i)
  35890. , r = new Uint8Array(n);
  35891. return r.set(this.view.subarray(e, t)),
  35892. this.buffer = n,
  35893. this.view = r,
  35894. 0 <= this.markedOffset && (this.markedOffset -= e),
  35895. this.offset = 0,
  35896. this.limit = i,
  35897. this
  35898. }
  35899. ,
  35900. a.copy = function(e, t) {
  35901. if (void 0 === e && (e = this.offset),
  35902. void 0 === t && (t = this.limit),
  35903. !this.noAssert) {
  35904. if ("number" != typeof e || e % 1 != 0)
  35905. throw TypeError("Illegal begin: Not an integer");
  35906. if (e >>>= 0,
  35907. "number" != typeof t || t % 1 != 0)
  35908. throw TypeError("Illegal end: Not an integer");
  35909. if (t >>>= 0,
  35910. e < 0 || t < e || t > this.buffer.byteLength)
  35911. throw RangeError("Illegal range: 0 <= " + e + " <= " + t + " <= " + this.buffer.byteLength)
  35912. }
  35913. if (e === t)
  35914. return new f(0,this.littleEndian,this.noAssert);
  35915. var i = t - e
  35916. , n = new f(i,this.littleEndian,this.noAssert);
  35917. return n.offset = 0,
  35918. n.limit = i,
  35919. 0 <= n.markedOffset && (n.markedOffset -= e),
  35920. this.copyTo(n, 0, e, t),
  35921. n
  35922. }
  35923. ,
  35924. a.copyTo = function(e, t, i, n) {
  35925. var r, o;
  35926. if (!this.noAssert && !f.isByteBuffer(e))
  35927. throw TypeError("Illegal target: Not a ByteBuffer");
  35928. if (t = (o = void 0 === t) ? e.offset : 0 | t,
  35929. i = (r = void 0 === i) ? this.offset : 0 | i,
  35930. n = void 0 === n ? this.limit : 0 | n,
  35931. t < 0 || t > e.buffer.byteLength)
  35932. throw RangeError("Illegal target range: 0 <= " + t + " <= " + e.buffer.byteLength);
  35933. if (i < 0 || n > this.buffer.byteLength)
  35934. throw RangeError("Illegal source range: 0 <= " + i + " <= " + this.buffer.byteLength);
  35935. var a = n - i;
  35936. return 0 == a ? e : (e.ensureCapacity(t + a),
  35937. e.view.set(this.view.subarray(i, n), t),
  35938. r && (this.offset += a),
  35939. o && (e.offset += a),
  35940. this)
  35941. }
  35942. ,
  35943. a.ensureCapacity = function(e) {
  35944. var t = this.buffer.byteLength;
  35945. return t < e ? this.resize((t *= 2) > e ? t : e) : this
  35946. }
  35947. ,
  35948. a.fill = function(e, t, i) {
  35949. var n = void 0 === t;
  35950. if (n && (t = this.offset),
  35951. "string" == typeof e && 0 < e.length && (e = e.charCodeAt(0)),
  35952. void 0 === t && (t = this.offset),
  35953. void 0 === i && (i = this.limit),
  35954. !this.noAssert) {
  35955. if ("number" != typeof e || e % 1 != 0)
  35956. throw TypeError("Illegal value: " + e + " (not an integer)");
  35957. if (e |= 0,
  35958. "number" != typeof t || t % 1 != 0)
  35959. throw TypeError("Illegal begin: Not an integer");
  35960. if (t >>>= 0,
  35961. "number" != typeof i || i % 1 != 0)
  35962. throw TypeError("Illegal end: Not an integer");
  35963. if (i >>>= 0,
  35964. t < 0 || i < t || i > this.buffer.byteLength)
  35965. throw RangeError("Illegal range: 0 <= " + t + " <= " + i + " <= " + this.buffer.byteLength)
  35966. }
  35967. if (i <= t)
  35968. return this;
  35969. for (; t < i; )
  35970. this.view[t++] = e;
  35971. return n && (this.offset = t),
  35972. this
  35973. }
  35974. ,
  35975. a.flip = function() {
  35976. return this.limit = this.offset,
  35977. this.offset = 0,
  35978. this
  35979. }
  35980. ,
  35981. a.mark = function(e) {
  35982. if (e = void 0 === e ? this.offset : e,
  35983. !this.noAssert) {
  35984. if ("number" != typeof e || e % 1 != 0)
  35985. throw TypeError("Illegal offset: " + e + " (not an integer)");
  35986. if ((e >>>= 0) < 0 || e + 0 > this.buffer.byteLength)
  35987. throw RangeError("Illegal offset: 0 <= " + e + " (+0) <= " + this.buffer.byteLength)
  35988. }
  35989. return this.markedOffset = e,
  35990. this
  35991. }
  35992. ,
  35993. a.order = function(e) {
  35994. if (!this.noAssert && "boolean" != typeof e)
  35995. throw TypeError("Illegal littleEndian: Not a boolean");
  35996. return this.littleEndian = !!e,
  35997. this
  35998. }
  35999. ,
  36000. a.LE = function(e) {
  36001. return this.littleEndian = void 0 === e || !!e,
  36002. this
  36003. }
  36004. ,
  36005. a.BE = function(e) {
  36006. return this.littleEndian = void 0 !== e && !e,
  36007. this
  36008. }
  36009. ,
  36010. a.prepend = function(e, t, i) {
  36011. "number" != typeof t && "string" == typeof t || (i = t,
  36012. t = void 0);
  36013. var n = void 0 === i;
  36014. if (n && (i = this.offset),
  36015. !this.noAssert) {
  36016. if ("number" != typeof i || i % 1 != 0)
  36017. throw TypeError("Illegal offset: " + i + " (not an integer)");
  36018. if ((i >>>= 0) < 0 || i + 0 > this.buffer.byteLength)
  36019. throw RangeError("Illegal offset: 0 <= " + i + " (+0) <= " + this.buffer.byteLength)
  36020. }
  36021. e instanceof f || (e = f.wrap(e, t));
  36022. var r = e.limit - e.offset;
  36023. if (r <= 0)
  36024. return this;
  36025. var o = r - i;
  36026. if (0 < o) {
  36027. var a = new ArrayBuffer(this.buffer.byteLength + o)
  36028. , s = new Uint8Array(a);
  36029. s.set(this.view.subarray(i, this.buffer.byteLength), r),
  36030. this.buffer = a,
  36031. this.view = s,
  36032. this.offset += o,
  36033. 0 <= this.markedOffset && (this.markedOffset += o),
  36034. this.limit += o,
  36035. i += o
  36036. } else
  36037. new Uint8Array(this.buffer);
  36038. return this.view.set(e.view.subarray(e.offset, e.limit), i - r),
  36039. e.offset = e.limit,
  36040. n && (this.offset -= r),
  36041. this
  36042. }
  36043. ,
  36044. a.prependTo = function(e, t) {
  36045. return e.prepend(this, t),
  36046. this
  36047. }
  36048. ,
  36049. a.printDebug = function(e) {
  36050. "function" != typeof e && (e = console.log.bind(console)),
  36051. e(this.toString() + "\n-------------------------------------------------------------------\n" + this.toDebug(!0))
  36052. }
  36053. ,
  36054. a.remaining = function() {
  36055. return this.limit - this.offset
  36056. }
  36057. ,
  36058. a.reset = function() {
  36059. return 0 <= this.markedOffset ? (this.offset = this.markedOffset,
  36060. this.markedOffset = -1) : this.offset = 0,
  36061. this
  36062. }
  36063. ,
  36064. a.resize = function(e) {
  36065. if (!this.noAssert) {
  36066. if ("number" != typeof e || e % 1 != 0)
  36067. throw TypeError("Illegal capacity: " + e + " (not an integer)");
  36068. if ((e |= 0) < 0)
  36069. throw RangeError("Illegal capacity: 0 <= " + e)
  36070. }
  36071. if (this.buffer.byteLength < e) {
  36072. var t = new ArrayBuffer(e)
  36073. , i = new Uint8Array(t);
  36074. i.set(this.view),
  36075. this.buffer = t,
  36076. this.view = i
  36077. }
  36078. return this
  36079. }
  36080. ,
  36081. a.reverse = function(e, t) {
  36082. if (void 0 === e && (e = this.offset),
  36083. void 0 === t && (t = this.limit),
  36084. !this.noAssert) {
  36085. if ("number" != typeof e || e % 1 != 0)
  36086. throw TypeError("Illegal begin: Not an integer");
  36087. if (e >>>= 0,
  36088. "number" != typeof t || t % 1 != 0)
  36089. throw TypeError("Illegal end: Not an integer");
  36090. if (t >>>= 0,
  36091. e < 0 || t < e || t > this.buffer.byteLength)
  36092. throw RangeError("Illegal range: 0 <= " + e + " <= " + t + " <= " + this.buffer.byteLength)
  36093. }
  36094. return e === t || Array.prototype.reverse.call(this.view.subarray(e, t)),
  36095. this
  36096. }
  36097. ,
  36098. a.skip = function(e) {
  36099. if (!this.noAssert) {
  36100. if ("number" != typeof e || e % 1 != 0)
  36101. throw TypeError("Illegal length: " + e + " (not an integer)");
  36102. e |= 0
  36103. }
  36104. var t = this.offset + e;
  36105. if (!this.noAssert && (t < 0 || t > this.buffer.byteLength))
  36106. throw RangeError("Illegal length: 0 <= " + this.offset + " + " + e + " <= " + this.buffer.byteLength);
  36107. return this.offset = t,
  36108. this
  36109. }
  36110. ,
  36111. a.slice = function(e, t) {
  36112. if (void 0 === e && (e = this.offset),
  36113. void 0 === t && (t = this.limit),
  36114. !this.noAssert) {
  36115. if ("number" != typeof e || e % 1 != 0)
  36116. throw TypeError("Illegal begin: Not an integer");
  36117. if (e >>>= 0,
  36118. "number" != typeof t || t % 1 != 0)
  36119. throw TypeError("Illegal end: Not an integer");
  36120. if (t >>>= 0,
  36121. e < 0 || t < e || t > this.buffer.byteLength)
  36122. throw RangeError("Illegal range: 0 <= " + e + " <= " + t + " <= " + this.buffer.byteLength)
  36123. }
  36124. var i = this.clone();
  36125. return i.offset = e,
  36126. i.limit = t,
  36127. i
  36128. }
  36129. ,
  36130. a.toBuffer = function(e) {
  36131. var t = this.offset
  36132. , i = this.limit;
  36133. if (!this.noAssert) {
  36134. if ("number" != typeof t || t % 1 != 0)
  36135. throw TypeError("Illegal offset: Not an integer");
  36136. if (t >>>= 0,
  36137. "number" != typeof i || i % 1 != 0)
  36138. throw TypeError("Illegal limit: Not an integer");
  36139. if (i >>>= 0,
  36140. t < 0 || i < t || i > this.buffer.byteLength)
  36141. throw RangeError("Illegal range: 0 <= " + t + " <= " + i + " <= " + this.buffer.byteLength)
  36142. }
  36143. if (!e && 0 === t && i === this.buffer.byteLength)
  36144. return this.buffer;
  36145. if (t === i)
  36146. return o;
  36147. var n = new ArrayBuffer(i - t);
  36148. return new Uint8Array(n).set(new Uint8Array(this.buffer).subarray(t, i), 0),
  36149. n
  36150. }
  36151. ,
  36152. a.toArrayBuffer = a.toBuffer,
  36153. a.toString = function(e, t, i) {
  36154. if (void 0 === e)
  36155. return "ByteBufferAB(offset=" + this.offset + ",markedOffset=" + this.markedOffset + ",limit=" + this.limit + ",capacity=" + this.capacity() + ")";
  36156. switch ("number" == typeof e && (i = t = e = "utf8"),
  36157. e) {
  36158. case "utf8":
  36159. return this.toUTF8(t, i);
  36160. case "base64":
  36161. return this.toBase64(t, i);
  36162. case "hex":
  36163. return this.toHex(t, i);
  36164. case "binary":
  36165. return this.toBinary(t, i);
  36166. case "debug":
  36167. return this.toDebug();
  36168. case "columns":
  36169. return this.toColumns();
  36170. default:
  36171. throw Error("Unsupported encoding: " + e)
  36172. }
  36173. }
  36174. ;
  36175. var h = function() {
  36176. 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)
  36177. a[r[t]] = t;
  36178. return e.encode = function(e, t) {
  36179. for (var i, n; null !== (i = e()); )
  36180. t(r[i >> 2 & 63]),
  36181. n = (3 & i) << 4,
  36182. null !== (i = e()) ? (t(r[63 & ((n |= i >> 4 & 15) | i >> 4 & 15)]),
  36183. n = (15 & i) << 2,
  36184. null !== (i = e()) ? (t(r[63 & (n | i >> 6 & 3)]),
  36185. t(r[63 & i])) : (t(r[63 & n]),
  36186. t(61))) : (t(r[63 & n]),
  36187. t(61),
  36188. t(61))
  36189. }
  36190. ,
  36191. e.decode = function(e, t) {
  36192. function i(e) {
  36193. throw Error("Illegal character code: " + e)
  36194. }
  36195. for (var n, r, o; null !== (n = e()); )
  36196. if (void 0 === (r = a[n]) && i(n),
  36197. null !== (n = e()) && (void 0 === (o = a[n]) && i(n),
  36198. t(r << 2 >>> 0 | (48 & o) >> 4),
  36199. null !== (n = e()))) {
  36200. if (void 0 === (r = a[n])) {
  36201. if (61 === n)
  36202. break;
  36203. i(n)
  36204. }
  36205. if (t((15 & o) << 4 >>> 0 | (60 & r) >> 2),
  36206. null !== (n = e())) {
  36207. if (void 0 === (o = a[n])) {
  36208. if (61 === n)
  36209. break;
  36210. i(n)
  36211. }
  36212. t((3 & r) << 6 >>> 0 | o)
  36213. }
  36214. }
  36215. }
  36216. ,
  36217. e.test = function(e) {
  36218. return /^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/.test(e)
  36219. }
  36220. ,
  36221. e
  36222. }();
  36223. a.toBase64 = function(e, t) {
  36224. if (void 0 === e && (e = this.offset),
  36225. void 0 === t && (t = this.limit),
  36226. t |= 0,
  36227. (e |= 0) < 0 || t > this.capacity || t < e)
  36228. throw RangeError("begin, end");
  36229. var i;
  36230. return h.encode(function() {
  36231. return e < t ? this.view[e++] : null
  36232. }
  36233. .bind(this), i = c()),
  36234. i()
  36235. }
  36236. ,
  36237. f.fromBase64 = function(e, t) {
  36238. if ("string" != typeof e)
  36239. throw TypeError("str");
  36240. var i = new f(e.length / 4 * 3,t)
  36241. , n = 0;
  36242. return h.decode(s(e), function(e) {
  36243. i.view[n++] = e
  36244. }),
  36245. i.limit = n,
  36246. i
  36247. }
  36248. ,
  36249. f.btoa = function(e) {
  36250. return f.fromBinary(e).toBase64()
  36251. }
  36252. ,
  36253. f.atob = function(e) {
  36254. return f.fromBase64(e).toBinary()
  36255. }
  36256. ,
  36257. a.toBinary = function(e, t) {
  36258. if (void 0 === e && (e = this.offset),
  36259. void 0 === t && (t = this.limit),
  36260. t |= 0,
  36261. (e |= 0) < 0 || t > this.capacity() || t < e)
  36262. throw RangeError("begin, end");
  36263. if (e === t)
  36264. return "";
  36265. for (var i = [], n = []; e < t; )
  36266. i.push(this.view[e++]),
  36267. 1024 <= i.length && (n.push(String.fromCharCode.apply(String, i)),
  36268. i = []);
  36269. return n.join("") + String.fromCharCode.apply(String, i)
  36270. }
  36271. ,
  36272. f.fromBinary = function(e, t) {
  36273. if ("string" != typeof e)
  36274. throw TypeError("str");
  36275. for (var i, n = 0, r = e.length, o = new f(r,t); n < r; ) {
  36276. if (255 < (i = e.charCodeAt(n)))
  36277. throw RangeError("illegal char code: " + i);
  36278. o.view[n++] = i
  36279. }
  36280. return o.limit = r,
  36281. o
  36282. }
  36283. ,
  36284. a.toDebug = function(e) {
  36285. for (var t, i = -1, n = this.buffer.byteLength, r = "", o = "", a = ""; i < n; ) {
  36286. if (-1 !== i && (r += (t = this.view[i]) < 16 ? "0" + t.toString(16).toUpperCase() : t.toString(16).toUpperCase(),
  36287. e && (o += 32 < t && t < 127 ? String.fromCharCode(t) : ".")),
  36288. ++i,
  36289. e && 0 < i && i % 16 == 0 && i !== n) {
  36290. for (; r.length < 51; )
  36291. r += " ";
  36292. a += r + o + "\n",
  36293. r = o = ""
  36294. }
  36295. 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 ? " " : ""
  36296. }
  36297. if (e && " " !== r) {
  36298. for (; r.length < 51; )
  36299. r += " ";
  36300. a += r + o + "\n"
  36301. }
  36302. return e ? a : r
  36303. }
  36304. ,
  36305. f.fromDebug = function(e, t, i) {
  36306. 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; ) {
  36307. switch (n = e.charAt(s++)) {
  36308. case "!":
  36309. if (!i) {
  36310. if (h || u || d) {
  36311. p = !0;
  36312. break
  36313. }
  36314. h = u = d = !0
  36315. }
  36316. a.offset = a.markedOffset = a.limit = l,
  36317. c = !1;
  36318. break;
  36319. case "|":
  36320. if (!i) {
  36321. if (h || d) {
  36322. p = !0;
  36323. break
  36324. }
  36325. h = d = !0
  36326. }
  36327. a.offset = a.limit = l,
  36328. c = !1;
  36329. break;
  36330. case "[":
  36331. if (!i) {
  36332. if (h || u) {
  36333. p = !0;
  36334. break
  36335. }
  36336. h = u = !0
  36337. }
  36338. a.offset = a.markedOffset = l,
  36339. c = !1;
  36340. break;
  36341. case "<":
  36342. if (!i) {
  36343. if (h) {
  36344. p = !0;
  36345. break
  36346. }
  36347. h = !0
  36348. }
  36349. a.offset = l,
  36350. c = !1;
  36351. break;
  36352. case "]":
  36353. if (!i) {
  36354. if (d || u) {
  36355. p = !0;
  36356. break
  36357. }
  36358. d = u = !0
  36359. }
  36360. a.limit = a.markedOffset = l,
  36361. c = !1;
  36362. break;
  36363. case ">":
  36364. if (!i) {
  36365. if (d) {
  36366. p = !0;
  36367. break
  36368. }
  36369. d = !0
  36370. }
  36371. a.limit = l,
  36372. c = !1;
  36373. break;
  36374. case "'":
  36375. if (!i) {
  36376. if (u) {
  36377. p = !0;
  36378. break
  36379. }
  36380. u = !0
  36381. }
  36382. a.markedOffset = l,
  36383. c = !1;
  36384. break;
  36385. case " ":
  36386. c = !1;
  36387. break;
  36388. default:
  36389. if (!i && c) {
  36390. p = !0;
  36391. break
  36392. }
  36393. if (r = parseInt(n + e.charAt(s++), 16),
  36394. !i && (isNaN(r) || r < 0 || 255 < r))
  36395. throw TypeError("Illegal str: Not a debug encoded string");
  36396. a.view[l++] = r,
  36397. c = !0
  36398. }
  36399. if (p)
  36400. throw TypeError("Illegal str: Invalid symbol at " + s)
  36401. }
  36402. if (!i) {
  36403. if (!h || !d)
  36404. throw TypeError("Illegal str: Missing offset or limit");
  36405. if (l < a.buffer.byteLength)
  36406. throw TypeError("Illegal str: Not a debug encoded string (is it hex?) " + l + " < " + o)
  36407. }
  36408. return a
  36409. }
  36410. ,
  36411. a.toHex = function(e, t) {
  36412. if (e = void 0 === e ? this.offset : e,
  36413. t = void 0 === t ? this.limit : t,
  36414. !this.noAssert) {
  36415. if ("number" != typeof e || e % 1 != 0)
  36416. throw TypeError("Illegal begin: Not an integer");
  36417. if (e >>>= 0,
  36418. "number" != typeof t || t % 1 != 0)
  36419. throw TypeError("Illegal end: Not an integer");
  36420. if (t >>>= 0,
  36421. e < 0 || t < e || t > this.buffer.byteLength)
  36422. throw RangeError("Illegal range: 0 <= " + e + " <= " + t + " <= " + this.buffer.byteLength)
  36423. }
  36424. for (var i, n = new Array(t - e); e < t; )
  36425. (i = this.view[e++]) < 16 ? n.push("0", i.toString(16)) : n.push(i.toString(16));
  36426. return n.join("")
  36427. }
  36428. ,
  36429. f.fromHex = function(e, t, i) {
  36430. if (!i) {
  36431. if ("string" != typeof e)
  36432. throw TypeError("Illegal str: Not a string");
  36433. if (e.length % 2 != 0)
  36434. throw TypeError("Illegal str: Length not a multiple of 2")
  36435. }
  36436. for (var n, r = e.length, o = new f(r / 2 | 0,t), a = 0, s = 0; a < r; a += 2) {
  36437. if (n = parseInt(e.substring(a, a + 2), 16),
  36438. !i && (!isFinite(n) || n < 0 || 255 < n))
  36439. throw TypeError("Illegal str: Contains non-hex characters");
  36440. o.view[s++] = n
  36441. }
  36442. return o.limit = s,
  36443. o
  36444. }
  36445. ;
  36446. var u, d = u = {
  36447. MAX_CODEPOINT: 1114111,
  36448. encodeUTF8: function(e, t) {
  36449. var i = null;
  36450. for ("number" == typeof e && (i = e,
  36451. e = function() {
  36452. return null
  36453. }
  36454. ); null !== i || null !== (i = e()); )
  36455. i < 128 ? t(127 & i) : (i < 2048 ? t(i >> 6 & 31 | 192) : (i < 65536 ? t(i >> 12 & 15 | 224) : (t(i >> 18 & 7 | 240),
  36456. t(i >> 12 & 63 | 128)),
  36457. t(i >> 6 & 63 | 128)),
  36458. t(63 & i | 128)),
  36459. i = null
  36460. },
  36461. decodeUTF8: function(e, t) {
  36462. for (var i, n, r, o, a = function(e) {
  36463. e = e.slice(0, e.indexOf(null));
  36464. var t = Error(e.toString());
  36465. throw t.name = "TruncatedError",
  36466. t.bytes = e,
  36467. t
  36468. }; null !== (i = e()); )
  36469. if (0 == (128 & i))
  36470. t(i);
  36471. else if (192 == (224 & i))
  36472. null === (n = e()) && a([i, n]),
  36473. t((31 & i) << 6 | 63 & n);
  36474. else if (224 == (240 & i))
  36475. null !== (n = e()) && null !== (r = e()) || a([i, n, r]),
  36476. t((15 & i) << 12 | (63 & n) << 6 | 63 & r);
  36477. else {
  36478. if (240 != (248 & i))
  36479. throw RangeError("Illegal starting byte: " + i);
  36480. null !== (n = e()) && null !== (r = e()) && null !== (o = e()) || a([i, n, r, o]),
  36481. t((7 & i) << 18 | (63 & n) << 12 | (63 & r) << 6 | 63 & o)
  36482. }
  36483. },
  36484. UTF16toUTF8: function(e, t) {
  36485. for (var i, n = null; null !== (i = null !== n ? n : e()); )
  36486. 55296 <= i && i <= 57343 && null !== (n = e()) && 56320 <= n && n <= 57343 ? (t(1024 * (i - 55296) + n - 56320 + 65536),
  36487. n = null) : t(i);
  36488. null !== n && t(n)
  36489. },
  36490. UTF8toUTF16: function(e, t) {
  36491. var i = null;
  36492. for ("number" == typeof e && (i = e,
  36493. e = function() {
  36494. return null
  36495. }
  36496. ); null !== i || null !== (i = e()); )
  36497. i <= 65535 ? t(i) : (t(55296 + ((i -= 65536) >> 10)),
  36498. t(i % 1024 + 56320)),
  36499. i = null
  36500. },
  36501. encodeUTF16toUTF8: function(e, t) {
  36502. u.UTF16toUTF8(e, function(e) {
  36503. u.encodeUTF8(e, t)
  36504. })
  36505. },
  36506. decodeUTF8toUTF16: function(e, t) {
  36507. u.decodeUTF8(e, function(e) {
  36508. u.UTF8toUTF16(e, t)
  36509. })
  36510. },
  36511. calculateCodePoint: function(e) {
  36512. return e < 128 ? 1 : e < 2048 ? 2 : e < 65536 ? 3 : 4
  36513. },
  36514. calculateUTF8: function(e) {
  36515. for (var t, i = 0; null !== (t = e()); )
  36516. i += t < 128 ? 1 : t < 2048 ? 2 : t < 65536 ? 3 : 4;
  36517. return i
  36518. },
  36519. calculateUTF16asUTF8: function(e) {
  36520. var t = 0
  36521. , i = 0;
  36522. return u.UTF16toUTF8(e, function(e) {
  36523. ++t,
  36524. i += e < 128 ? 1 : e < 2048 ? 2 : e < 65536 ? 3 : 4
  36525. }),
  36526. [t, i]
  36527. }
  36528. };
  36529. return a.toUTF8 = function(t, i) {
  36530. if (void 0 === t && (t = this.offset),
  36531. void 0 === i && (i = this.limit),
  36532. !this.noAssert) {
  36533. if ("number" != typeof t || t % 1 != 0)
  36534. throw TypeError("Illegal begin: Not an integer");
  36535. if (t >>>= 0,
  36536. "number" != typeof i || i % 1 != 0)
  36537. throw TypeError("Illegal end: Not an integer");
  36538. if (i >>>= 0,
  36539. t < 0 || i < t || i > this.buffer.byteLength)
  36540. throw RangeError("Illegal range: 0 <= " + t + " <= " + i + " <= " + this.buffer.byteLength)
  36541. }
  36542. var e;
  36543. try {
  36544. d.decodeUTF8toUTF16(function() {
  36545. return t < i ? this.view[t++] : null
  36546. }
  36547. .bind(this), e = c())
  36548. } catch (e) {
  36549. if (t !== i)
  36550. throw RangeError("Illegal range: Truncated data, " + t + " != " + i)
  36551. }
  36552. return e()
  36553. }
  36554. ,
  36555. f.fromUTF8 = function(e, t, i) {
  36556. if (!i && "string" != typeof e)
  36557. throw TypeError("Illegal str: Not a string");
  36558. var n = new f(d.calculateUTF16asUTF8(s(e), !0)[1],t,i)
  36559. , r = 0;
  36560. return d.encodeUTF16toUTF8(s(e), function(e) {
  36561. n.view[r++] = e
  36562. }),
  36563. n.limit = r,
  36564. n
  36565. }
  36566. ,
  36567. f
  36568. }
  36569. ,
  36570. "function" == typeof define && define.amd ? define(["long"], r) : "function" == typeof t && "object" == typeof e && e && e.exports ? e.exports = function() {
  36571. var e;
  36572. try {
  36573. e = t("long")
  36574. } catch (e) {}
  36575. return r(e)
  36576. }() : (n.dcodeIO = n.dcodeIO || {}).ByteBuffer = r(n.dcodeIO.Long)
  36577. }
  36578. , {
  36579. long: 216
  36580. }],
  36581. 216: [function(e, t, i) {
  36582. var n, r;
  36583. n = this,
  36584. r = function() {
  36585. "use strict";
  36586. function n(e, t, i) {
  36587. this.low = 0 | e,
  36588. this.high = 0 | t,
  36589. this.unsigned = !!i
  36590. }
  36591. function p(e) {
  36592. return !0 === (e && e.__isLong__)
  36593. }
  36594. function e(e, t) {
  36595. var i, n, r;
  36596. return t ? (r = 0 <= (e >>>= 0) && e < 256) && (n = a[e]) ? n : (i = g(e, (0 | e) < 0 ? -1 : 0, !0),
  36597. r && (a[e] = i),
  36598. i) : (r = -128 <= (e |= 0) && e < 128) && (n = o[e]) ? n : (i = g(e, e < 0 ? -1 : 0, !1),
  36599. r && (o[e] = i),
  36600. i)
  36601. }
  36602. function f(e, t) {
  36603. if (isNaN(e) || !isFinite(e))
  36604. return t ? l : y;
  36605. if (t) {
  36606. if (e < 0)
  36607. return l;
  36608. if (r <= e)
  36609. return I
  36610. } else {
  36611. if (e <= -s)
  36612. return E;
  36613. if (s <= e + 1)
  36614. return C
  36615. }
  36616. return e < 0 ? f(-e, t).neg() : g(e % i | 0, e / i | 0, t)
  36617. }
  36618. function g(e, t, i) {
  36619. return new n(e,t,i)
  36620. }
  36621. function h(e, t, i) {
  36622. if (0 === e.length)
  36623. throw Error("empty string");
  36624. if ("NaN" === e || "Infinity" === e || "+Infinity" === e || "-Infinity" === e)
  36625. return y;
  36626. if (t = "number" == typeof t ? (i = t,
  36627. !1) : !!t,
  36628. (i = i || 10) < 2 || 36 < i)
  36629. throw RangeError("radix");
  36630. var n;
  36631. if (0 < (n = e.indexOf("-")))
  36632. throw Error("interior hyphen");
  36633. if (0 === n)
  36634. return h(e.substring(1), t, i).neg();
  36635. for (var r = f(u(i, 8)), o = y, a = 0; a < e.length; a += 8) {
  36636. var s = Math.min(8, e.length - a)
  36637. , l = parseInt(e.substring(a, a + s), i);
  36638. if (s < 8) {
  36639. var c = f(u(i, s));
  36640. o = o.mul(c).add(f(l))
  36641. } else
  36642. o = (o = o.mul(r)).add(f(l))
  36643. }
  36644. return o.unsigned = t,
  36645. o
  36646. }
  36647. function m(e) {
  36648. return e instanceof n ? e : "number" == typeof e ? f(e) : "string" == typeof e ? h(e) : g(e.low, e.high, e.unsigned)
  36649. }
  36650. Object.defineProperty(n.prototype, "__isLong__", {
  36651. value: !0,
  36652. enumerable: !1,
  36653. configurable: !1
  36654. }),
  36655. n.isLong = p;
  36656. var o = {}
  36657. , a = {};
  36658. n.fromInt = e,
  36659. n.fromNumber = f,
  36660. n.fromBits = g;
  36661. var u = Math.pow;
  36662. n.fromString = h,
  36663. n.fromValue = m;
  36664. var i = 4294967296
  36665. , r = 0x10000000000000000
  36666. , s = r / 2
  36667. , v = e(1 << 24)
  36668. , y = e(0);
  36669. n.ZERO = y;
  36670. var l = e(0, !0);
  36671. n.UZERO = l;
  36672. var c = e(1);
  36673. n.ONE = c;
  36674. var d = e(1, !0);
  36675. n.UONE = d;
  36676. var A = e(-1);
  36677. n.NEG_ONE = A;
  36678. var C = g(-1, 2147483647, !1);
  36679. n.MAX_VALUE = C;
  36680. var I = g(-1, -1, !0);
  36681. n.MAX_UNSIGNED_VALUE = I;
  36682. var E = g(0, -2147483648, !1);
  36683. n.MIN_VALUE = E;
  36684. var t = n.prototype;
  36685. return t.toInt = function() {
  36686. return this.unsigned ? this.low >>> 0 : this.low
  36687. }
  36688. ,
  36689. t.toNumber = function() {
  36690. return this.unsigned ? (this.high >>> 0) * i + (this.low >>> 0) : this.high * i + (this.low >>> 0)
  36691. }
  36692. ,
  36693. t.toString = function(e) {
  36694. if ((e = e || 10) < 2 || 36 < e)
  36695. throw RangeError("radix");
  36696. if (this.isZero())
  36697. return "0";
  36698. if (this.isNegative()) {
  36699. if (this.eq(E)) {
  36700. var t = f(e)
  36701. , i = this.div(t)
  36702. , n = i.mul(t).sub(this);
  36703. return i.toString(e) + n.toInt().toString(e)
  36704. }
  36705. return "-" + this.neg().toString(e)
  36706. }
  36707. for (var r = f(u(e, 6), this.unsigned), o = this, a = ""; ; ) {
  36708. var s = o.div(r)
  36709. , l = (o.sub(s.mul(r)).toInt() >>> 0).toString(e);
  36710. if ((o = s).isZero())
  36711. return l + a;
  36712. for (; l.length < 6; )
  36713. l = "0" + l;
  36714. a = "" + l + a
  36715. }
  36716. }
  36717. ,
  36718. t.getHighBits = function() {
  36719. return this.high
  36720. }
  36721. ,
  36722. t.getHighBitsUnsigned = function() {
  36723. return this.high >>> 0
  36724. }
  36725. ,
  36726. t.getLowBits = function() {
  36727. return this.low
  36728. }
  36729. ,
  36730. t.getLowBitsUnsigned = function() {
  36731. return this.low >>> 0
  36732. }
  36733. ,
  36734. t.getNumBitsAbs = function() {
  36735. if (this.isNegative())
  36736. return this.eq(E) ? 64 : this.neg().getNumBitsAbs();
  36737. for (var e = 0 != this.high ? this.high : this.low, t = 31; 0 < t && 0 == (e & 1 << t); t--)
  36738. ;
  36739. return 0 != this.high ? t + 33 : t + 1
  36740. }
  36741. ,
  36742. t.isZero = function() {
  36743. return 0 === this.high && 0 === this.low
  36744. }
  36745. ,
  36746. t.isNegative = function() {
  36747. return !this.unsigned && this.high < 0
  36748. }
  36749. ,
  36750. t.isPositive = function() {
  36751. return this.unsigned || 0 <= this.high
  36752. }
  36753. ,
  36754. t.isOdd = function() {
  36755. return 1 == (1 & this.low)
  36756. }
  36757. ,
  36758. t.isEven = function() {
  36759. return 0 == (1 & this.low)
  36760. }
  36761. ,
  36762. t.equals = function(e) {
  36763. return p(e) || (e = m(e)),
  36764. (this.unsigned === e.unsigned || this.high >>> 31 != 1 || e.high >>> 31 != 1) && this.high === e.high && this.low === e.low
  36765. }
  36766. ,
  36767. t.eq = t.equals,
  36768. t.notEquals = function(e) {
  36769. return !this.eq(e)
  36770. }
  36771. ,
  36772. t.neq = t.notEquals,
  36773. t.lessThan = function(e) {
  36774. return this.comp(e) < 0
  36775. }
  36776. ,
  36777. t.lt = t.lessThan,
  36778. t.lessThanOrEqual = function(e) {
  36779. return this.comp(e) <= 0
  36780. }
  36781. ,
  36782. t.lte = t.lessThanOrEqual,
  36783. t.greaterThan = function(e) {
  36784. return 0 < this.comp(e)
  36785. }
  36786. ,
  36787. t.gt = t.greaterThan,
  36788. t.greaterThanOrEqual = function(e) {
  36789. return 0 <= this.comp(e)
  36790. }
  36791. ,
  36792. t.gte = t.greaterThanOrEqual,
  36793. t.compare = function(e) {
  36794. if (p(e) || (e = m(e)),
  36795. this.eq(e))
  36796. return 0;
  36797. var t = this.isNegative()
  36798. , i = e.isNegative();
  36799. 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
  36800. }
  36801. ,
  36802. t.comp = t.compare,
  36803. t.negate = function() {
  36804. return !this.unsigned && this.eq(E) ? E : this.not().add(c)
  36805. }
  36806. ,
  36807. t.neg = t.negate,
  36808. t.add = function(e) {
  36809. p(e) || (e = m(e));
  36810. var t = this.high >>> 16
  36811. , i = 65535 & this.high
  36812. , n = this.low >>> 16
  36813. , r = 65535 & this.low
  36814. , o = e.high >>> 16
  36815. , a = 65535 & e.high
  36816. , s = e.low >>> 16
  36817. , l = 0
  36818. , c = 0
  36819. , h = 0
  36820. , u = 0;
  36821. return h += (u += r + (65535 & e.low)) >>> 16,
  36822. c += (h += n + s) >>> 16,
  36823. l += (c += i + a) >>> 16,
  36824. l += t + o,
  36825. g((h &= 65535) << 16 | (u &= 65535), (l &= 65535) << 16 | (c &= 65535), this.unsigned)
  36826. }
  36827. ,
  36828. t.subtract = function(e) {
  36829. return p(e) || (e = m(e)),
  36830. this.add(e.neg())
  36831. }
  36832. ,
  36833. t.sub = t.subtract,
  36834. t.multiply = function(e) {
  36835. if (this.isZero())
  36836. return y;
  36837. if (p(e) || (e = m(e)),
  36838. e.isZero())
  36839. return y;
  36840. if (this.eq(E))
  36841. return e.isOdd() ? E : y;
  36842. if (e.eq(E))
  36843. return this.isOdd() ? E : y;
  36844. if (this.isNegative())
  36845. return e.isNegative() ? this.neg().mul(e.neg()) : this.neg().mul(e).neg();
  36846. if (e.isNegative())
  36847. return this.mul(e.neg()).neg();
  36848. if (this.lt(v) && e.lt(v))
  36849. return f(this.toNumber() * e.toNumber(), this.unsigned);
  36850. var t = this.high >>> 16
  36851. , i = 65535 & this.high
  36852. , n = this.low >>> 16
  36853. , r = 65535 & this.low
  36854. , o = e.high >>> 16
  36855. , a = 65535 & e.high
  36856. , s = e.low >>> 16
  36857. , l = 65535 & e.low
  36858. , c = 0
  36859. , h = 0
  36860. , u = 0
  36861. , d = 0;
  36862. return u += (d += r * l) >>> 16,
  36863. h += (u += n * l) >>> 16,
  36864. u &= 65535,
  36865. h += (u += r * s) >>> 16,
  36866. c += (h += i * l) >>> 16,
  36867. h &= 65535,
  36868. c += (h += n * s) >>> 16,
  36869. h &= 65535,
  36870. c += (h += r * a) >>> 16,
  36871. c += t * l + i * s + n * a + r * o,
  36872. g((u &= 65535) << 16 | (d &= 65535), (c &= 65535) << 16 | (h &= 65535), this.unsigned)
  36873. }
  36874. ,
  36875. t.mul = t.multiply,
  36876. t.divide = function(e) {
  36877. if (p(e) || (e = m(e)),
  36878. e.isZero())
  36879. throw Error("division by zero");
  36880. if (this.isZero())
  36881. return this.unsigned ? l : y;
  36882. var t, i, n;
  36883. if (this.unsigned) {
  36884. if (e.unsigned || (e = e.toUnsigned()),
  36885. e.gt(this))
  36886. return l;
  36887. if (e.gt(this.shru(1)))
  36888. return d;
  36889. n = l
  36890. } else {
  36891. if (this.eq(E))
  36892. 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)),
  36893. n = t.add(i.div(e)));
  36894. if (e.eq(E))
  36895. return this.unsigned ? l : y;
  36896. if (this.isNegative())
  36897. return e.isNegative() ? this.neg().div(e.neg()) : this.neg().div(e).neg();
  36898. if (e.isNegative())
  36899. return this.div(e.neg()).neg();
  36900. n = y
  36901. }
  36902. for (i = this; i.gte(e); ) {
  36903. t = Math.max(1, Math.floor(i.toNumber() / e.toNumber()));
  36904. 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); )
  36905. s = (a = f(t -= o, this.unsigned)).mul(e);
  36906. a.isZero() && (a = c),
  36907. n = n.add(a),
  36908. i = i.sub(s)
  36909. }
  36910. return n
  36911. }
  36912. ,
  36913. t.div = t.divide,
  36914. t.modulo = function(e) {
  36915. return p(e) || (e = m(e)),
  36916. this.sub(this.div(e).mul(e))
  36917. }
  36918. ,
  36919. t.mod = t.modulo,
  36920. t.not = function() {
  36921. return g(~this.low, ~this.high, this.unsigned)
  36922. }
  36923. ,
  36924. t.and = function(e) {
  36925. return p(e) || (e = m(e)),
  36926. g(this.low & e.low, this.high & e.high, this.unsigned)
  36927. }
  36928. ,
  36929. t.or = function(e) {
  36930. return p(e) || (e = m(e)),
  36931. g(this.low | e.low, this.high | e.high, this.unsigned)
  36932. }
  36933. ,
  36934. t.xor = function(e) {
  36935. return p(e) || (e = m(e)),
  36936. g(this.low ^ e.low, this.high ^ e.high, this.unsigned)
  36937. }
  36938. ,
  36939. t.shiftLeft = function(e) {
  36940. return p(e) && (e = e.toInt()),
  36941. 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)
  36942. }
  36943. ,
  36944. t.shl = t.shiftLeft,
  36945. t.shiftRight = function(e) {
  36946. return p(e) && (e = e.toInt()),
  36947. 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)
  36948. }
  36949. ,
  36950. t.shr = t.shiftRight,
  36951. t.shiftRightUnsigned = function(e) {
  36952. if (p(e) && (e = e.toInt()),
  36953. 0 === (e &= 63))
  36954. return this;
  36955. var t = this.high;
  36956. return e < 32 ? g(this.low >>> e | t << 32 - e, t >>> e, this.unsigned) : g(32 === e ? t : t >>> e - 32, 0, this.unsigned)
  36957. }
  36958. ,
  36959. t.shru = t.shiftRightUnsigned,
  36960. t.toSigned = function() {
  36961. return this.unsigned ? g(this.low, this.high, !1) : this
  36962. }
  36963. ,
  36964. t.toUnsigned = function() {
  36965. return this.unsigned ? this : g(this.low, this.high, !0)
  36966. }
  36967. ,
  36968. t.toBytes = function(e) {
  36969. return e ? this.toBytesLE() : this.toBytesBE()
  36970. }
  36971. ,
  36972. t.toBytesLE = function() {
  36973. var e = this.high
  36974. , t = this.low;
  36975. return [255 & t, t >>> 8 & 255, t >>> 16 & 255, t >>> 24 & 255, 255 & e, e >>> 8 & 255, e >>> 16 & 255, e >>> 24 & 255]
  36976. }
  36977. ,
  36978. t.toBytesBE = function() {
  36979. var e = this.high
  36980. , t = this.low;
  36981. return [e >>> 24 & 255, e >>> 16 & 255, e >>> 8 & 255, 255 & e, t >>> 24 & 255, t >>> 16 & 255, t >>> 8 & 255, 255 & t]
  36982. }
  36983. ,
  36984. n
  36985. }
  36986. ,
  36987. "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()
  36988. }
  36989. , {}],
  36990. 217: [function(e, t, i) {
  36991. 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 = {
  36992. REVISION: "75"
  36993. };
  36994. function Ii(e, t) {
  36995. return e.distance - t.distance
  36996. }
  36997. function Ei(e, t, i, n) {
  36998. if (!1 !== e.visible && (e.raycast(t, i),
  36999. !0 === n))
  37000. for (var r = e.children, o = 0, a = r.length; o < a; o++)
  37001. Ei(r[o], t, i, !0)
  37002. }
  37003. function _i(e, t, i) {
  37004. return i < 0 && (i += 1),
  37005. 1 < i && (i -= 1),
  37006. i < 1 / 6 ? e + 6 * (t - e) * i : i < .5 ? t : i < 2 / 3 ? e + 6 * (t - e) * (2 / 3 - i) : e
  37007. }
  37008. function bi(e, t, i, n, r, o, a) {
  37009. return Ci.Triangle.barycoordFromPoint(e, t, i, n, Vt),
  37010. r.multiplyScalar(Vt.x),
  37011. o.multiplyScalar(Vt.y),
  37012. a.multiplyScalar(Vt.z),
  37013. r.add(o).add(a),
  37014. r.clone()
  37015. }
  37016. function wi(e, t, i, n, r, o, a) {
  37017. var s = e.material;
  37018. if (null === (s.side === Ci.BackSide ? i.intersectTriangle(o, r, n, !0, a) : i.intersectTriangle(n, r, o, s.side !== Ci.DoubleSide, a)))
  37019. return null;
  37020. Ut.copy(a),
  37021. Ut.applyMatrix4(e.matrixWorld);
  37022. var l = t.ray.origin.distanceTo(Ut);
  37023. return l < t.near || l > t.far ? null : {
  37024. distance: l,
  37025. point: Ut.clone(),
  37026. object: e
  37027. }
  37028. }
  37029. function Ti(e, t, i, n, r, o, a, s) {
  37030. Mt.fromArray(n, 3 * o),
  37031. Rt.fromArray(n, 3 * a),
  37032. Pt.fromArray(n, 3 * s);
  37033. var l = wi(e, t, i, Mt, Rt, Pt, kt);
  37034. return l && (r && (Nt.fromArray(r, 2 * o),
  37035. Ft.fromArray(r, 2 * a),
  37036. Bt.fromArray(r, 2 * s),
  37037. l.uv = bi(kt, Mt, Rt, Pt, Nt, Ft, Bt)),
  37038. l.face = new Ci.Face3(o,a,s,Ci.Triangle.normal(Mt, Rt, Pt)),
  37039. l.faceIndex = o),
  37040. l
  37041. }
  37042. function xi() {}
  37043. function Si(e, t, i, n, r, o) {
  37044. var a, s, l, c, h, u, d, p, f, g, m, v, y, A, C, I, E;
  37045. if (s = e[o[t]].x,
  37046. l = e[o[t]].y,
  37047. c = e[o[i]].x,
  37048. h = e[o[i]].y,
  37049. u = e[o[n]].x,
  37050. d = e[o[n]].y,
  37051. Number.EPSILON > (c - s) * (d - l) - (h - l) * (u - s))
  37052. return !1;
  37053. for (g = u - c,
  37054. m = d - h,
  37055. v = s - u,
  37056. y = l - d,
  37057. A = c - s,
  37058. C = h - l,
  37059. a = 0; a < r; a++)
  37060. if (p = e[o[a]].x,
  37061. f = e[o[a]].y,
  37062. !(p === s && f === l || p === c && f === h || p === u && f === d) && (I = A * (f - l) - C * (p - s),
  37063. E = v * (f - d) - y * (p - u),
  37064. g * (f - h) - m * (p - c) >= -Number.EPSILON && E >= -Number.EPSILON && I >= -Number.EPSILON))
  37065. return !1;
  37066. return !0
  37067. }
  37068. function Mi(e) {
  37069. switch (e) {
  37070. case Ci.LinearEncoding:
  37071. return ["Linear", "( value )"];
  37072. case Ci.sRGBEncoding:
  37073. return ["sRGB", "( value )"];
  37074. case Ci.RGBEEncoding:
  37075. return ["RGBE", "( value )"];
  37076. case Ci.RGBM7Encoding:
  37077. return ["RGBM", "( value, 7.0 )"];
  37078. case Ci.RGBM16Encoding:
  37079. return ["RGBM", "( value, 16.0 )"];
  37080. case Ci.RGBDEncoding:
  37081. return ["RGBD", "( value, 256.0 )"];
  37082. case Ci.GammaEncoding:
  37083. return ["Gamma", "( value, float( GAMMA_FACTOR ) )"];
  37084. default:
  37085. throw new Error("unsupported encoding: " + e)
  37086. }
  37087. }
  37088. function Ri(e, t) {
  37089. var i = Mi(t);
  37090. return "vec4 " + e + "( vec4 value ) { return " + i[0] + "ToLinear" + i[1] + "; }"
  37091. }
  37092. function Pi(e) {
  37093. return "" !== e
  37094. }
  37095. function Oi(e, t) {
  37096. 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)
  37097. }
  37098. function Li(e) {
  37099. return e.replace(/#include +<([\w\d.]+)>/g, function(e, t) {
  37100. var i = Ci.ShaderChunk[t];
  37101. if (void 0 === i)
  37102. throw new Error("Can not resolve #include <" + t + ">");
  37103. return Li(i)
  37104. })
  37105. }
  37106. function Di(e) {
  37107. return e.replace(/for \( int i \= (\d+)\; i < (\d+)\; i \+\+ \) \{([\s\S]+?)(?=\})\}/g, function(e, t, i, n) {
  37108. for (var r = "", o = parseInt(t); o < parseInt(i); o++)
  37109. r += n.replace(/\[ i \]/g, "[ " + o + " ]");
  37110. return r
  37111. })
  37112. }
  37113. function Ni(e, t, i, n) {
  37114. gi.set(t, i, n).unproject(mi);
  37115. var r = fi[e];
  37116. if (void 0 !== r)
  37117. for (var o = 0, a = r.length; o < a; o++)
  37118. pi.vertices[r[o]].copy(gi)
  37119. }
  37120. "function" == typeof define && define.amd ? define("three", Ci) : void 0 !== i && void 0 !== t && (t.exports = Ci),
  37121. void 0 === Number.EPSILON && (Number.EPSILON = Math.pow(2, -52)),
  37122. void 0 === Math.sign && (Math.sign = function(e) {
  37123. return e < 0 ? -1 : 0 < e ? 1 : +e
  37124. }
  37125. ),
  37126. void 0 === Function.prototype.name && void 0 !== Object.defineProperty && Object.defineProperty(Function.prototype, "name", {
  37127. get: function() {
  37128. return this.toString().match(/^\s*function\s*(\S*)\s*\(/)[1]
  37129. }
  37130. }),
  37131. void 0 === Object.assign && Object.defineProperty(Object, "assign", {
  37132. writable: !0,
  37133. configurable: !0,
  37134. value: function(e) {
  37135. "use strict";
  37136. if (null == e)
  37137. throw new TypeError("Cannot convert first argument to object");
  37138. for (var t = Object(e), i = 1, n = arguments.length; i !== n; ++i) {
  37139. var r = arguments[i];
  37140. if (null != r) {
  37141. r = Object(r);
  37142. for (var o = Object.keys(r), a = 0, s = o.length; a !== s; ++a) {
  37143. var l = o[a]
  37144. , c = Object.getOwnPropertyDescriptor(r, l);
  37145. void 0 !== c && c.enumerable && (t[l] = r[l])
  37146. }
  37147. }
  37148. }
  37149. return t
  37150. }
  37151. }),
  37152. Ci.MOUSE = {
  37153. LEFT: 0,
  37154. MIDDLE: 1,
  37155. RIGHT: 2
  37156. },
  37157. Ci.CullFaceNone = 0,
  37158. Ci.CullFaceBack = 1,
  37159. Ci.CullFaceFront = 2,
  37160. Ci.CullFaceFrontBack = 3,
  37161. Ci.FrontFaceDirectionCW = 0,
  37162. Ci.FrontFaceDirectionCCW = 1,
  37163. Ci.BasicShadowMap = 0,
  37164. Ci.PCFShadowMap = 1,
  37165. Ci.PCFSoftShadowMap = 2,
  37166. Ci.FrontSide = 0,
  37167. Ci.BackSide = 1,
  37168. Ci.DoubleSide = 2,
  37169. Ci.FlatShading = 1,
  37170. Ci.SmoothShading = 2,
  37171. Ci.NoColors = 0,
  37172. Ci.FaceColors = 1,
  37173. Ci.VertexColors = 2,
  37174. Ci.NoBlending = 0,
  37175. Ci.NormalBlending = 1,
  37176. Ci.AdditiveBlending = 2,
  37177. Ci.SubtractiveBlending = 3,
  37178. Ci.MultiplyBlending = 4,
  37179. Ci.CustomBlending = 5,
  37180. Ci.AddEquation = 100,
  37181. Ci.SubtractEquation = 101,
  37182. Ci.ReverseSubtractEquation = 102,
  37183. Ci.MinEquation = 103,
  37184. Ci.MaxEquation = 104,
  37185. Ci.ZeroFactor = 200,
  37186. Ci.OneFactor = 201,
  37187. Ci.SrcColorFactor = 202,
  37188. Ci.OneMinusSrcColorFactor = 203,
  37189. Ci.SrcAlphaFactor = 204,
  37190. Ci.OneMinusSrcAlphaFactor = 205,
  37191. Ci.DstAlphaFactor = 206,
  37192. Ci.OneMinusDstAlphaFactor = 207,
  37193. Ci.DstColorFactor = 208,
  37194. Ci.OneMinusDstColorFactor = 209,
  37195. Ci.SrcAlphaSaturateFactor = 210,
  37196. Ci.NeverDepth = 0,
  37197. Ci.AlwaysDepth = 1,
  37198. Ci.LessDepth = 2,
  37199. Ci.LessEqualDepth = 3,
  37200. Ci.EqualDepth = 4,
  37201. Ci.GreaterEqualDepth = 5,
  37202. Ci.GreaterDepth = 6,
  37203. Ci.NotEqualDepth = 7,
  37204. Ci.MultiplyOperation = 0,
  37205. Ci.MixOperation = 1,
  37206. Ci.AddOperation = 2,
  37207. Ci.NoToneMapping = 0,
  37208. Ci.LinearToneMapping = 1,
  37209. Ci.ReinhardToneMapping = 2,
  37210. Ci.Uncharted2ToneMapping = 3,
  37211. Ci.CineonToneMapping = 4,
  37212. Ci.UVMapping = 300,
  37213. Ci.CubeReflectionMapping = 301,
  37214. Ci.CubeRefractionMapping = 302,
  37215. Ci.EquirectangularReflectionMapping = 303,
  37216. Ci.EquirectangularRefractionMapping = 304,
  37217. Ci.SphericalReflectionMapping = 305,
  37218. Ci.CubeUVReflectionMapping = 306,
  37219. Ci.CubeUVRefractionMapping = 307,
  37220. Ci.RepeatWrapping = 1e3,
  37221. Ci.ClampToEdgeWrapping = 1001,
  37222. Ci.MirroredRepeatWrapping = 1002,
  37223. Ci.NearestFilter = 1003,
  37224. Ci.NearestMipMapNearestFilter = 1004,
  37225. Ci.NearestMipMapLinearFilter = 1005,
  37226. Ci.LinearFilter = 1006,
  37227. Ci.LinearMipMapNearestFilter = 1007,
  37228. Ci.LinearMipMapLinearFilter = 1008,
  37229. Ci.UnsignedByteType = 1009,
  37230. Ci.ByteType = 1010,
  37231. Ci.ShortType = 1011,
  37232. Ci.UnsignedShortType = 1012,
  37233. Ci.IntType = 1013,
  37234. Ci.UnsignedIntType = 1014,
  37235. Ci.FloatType = 1015,
  37236. Ci.HalfFloatType = 1025,
  37237. Ci.UnsignedShort4444Type = 1016,
  37238. Ci.UnsignedShort5551Type = 1017,
  37239. Ci.UnsignedShort565Type = 1018,
  37240. Ci.AlphaFormat = 1019,
  37241. Ci.RGBFormat = 1020,
  37242. Ci.RGBAFormat = 1021,
  37243. Ci.LuminanceFormat = 1022,
  37244. Ci.LuminanceAlphaFormat = 1023,
  37245. Ci.RGBEFormat = Ci.RGBAFormat,
  37246. Ci.RGB_S3TC_DXT1_Format = 2001,
  37247. Ci.RGBA_S3TC_DXT1_Format = 2002,
  37248. Ci.RGBA_S3TC_DXT3_Format = 2003,
  37249. Ci.RGBA_S3TC_DXT5_Format = 2004,
  37250. Ci.RGB_PVRTC_4BPPV1_Format = 2100,
  37251. Ci.RGB_PVRTC_2BPPV1_Format = 2101,
  37252. Ci.RGBA_PVRTC_4BPPV1_Format = 2102,
  37253. Ci.RGBA_PVRTC_2BPPV1_Format = 2103,
  37254. Ci.RGB_ETC1_Format = 2151,
  37255. Ci.LoopOnce = 2200,
  37256. Ci.LoopRepeat = 2201,
  37257. Ci.LoopPingPong = 2202,
  37258. Ci.InterpolateDiscrete = 2300,
  37259. Ci.InterpolateLinear = 2301,
  37260. Ci.InterpolateSmooth = 2302,
  37261. Ci.ZeroCurvatureEnding = 2400,
  37262. Ci.ZeroSlopeEnding = 2401,
  37263. Ci.WrapAroundEnding = 2402,
  37264. Ci.TrianglesDrawMode = 0,
  37265. Ci.TriangleStripDrawMode = 1,
  37266. Ci.TriangleFanDrawMode = 2,
  37267. Ci.LinearEncoding = 3e3,
  37268. Ci.sRGBEncoding = 3001,
  37269. Ci.GammaEncoding = 3007,
  37270. Ci.RGBEEncoding = 3002,
  37271. Ci.LogLuvEncoding = 3003,
  37272. Ci.RGBM7Encoding = 3004,
  37273. Ci.RGBM16Encoding = 3005,
  37274. Ci.RGBDEncoding = 3006,
  37275. Ci.Color = function(e) {
  37276. return 3 === arguments.length ? this.fromArray(arguments) : this.set(e)
  37277. }
  37278. ,
  37279. Ci.Color.prototype = {
  37280. constructor: Ci.Color,
  37281. r: 1,
  37282. g: 1,
  37283. b: 1,
  37284. set: function(e) {
  37285. return e instanceof Ci.Color ? this.copy(e) : "number" == typeof e ? this.setHex(e) : "string" == typeof e && this.setStyle(e),
  37286. this
  37287. },
  37288. setScalar: function(e) {
  37289. this.r = e,
  37290. this.g = e,
  37291. this.b = e
  37292. },
  37293. setHex: function(e) {
  37294. return e = Math.floor(e),
  37295. this.r = (e >> 16 & 255) / 255,
  37296. this.g = (e >> 8 & 255) / 255,
  37297. this.b = (255 & e) / 255,
  37298. this
  37299. },
  37300. setRGB: function(e, t, i) {
  37301. return this.r = e,
  37302. this.g = t,
  37303. this.b = i,
  37304. this
  37305. },
  37306. setHSL: function(e, t, i) {
  37307. if (e = Ci.Math.euclideanModulo(e, 1),
  37308. t = Ci.Math.clamp(t, 0, 1),
  37309. i = Ci.Math.clamp(i, 0, 1),
  37310. 0 === t)
  37311. this.r = this.g = this.b = i;
  37312. else {
  37313. var n = i <= .5 ? i * (1 + t) : i + t - i * t
  37314. , r = 2 * i - n;
  37315. this.r = _i(r, n, e + 1 / 3),
  37316. this.g = _i(r, n, e),
  37317. this.b = _i(r, n, e - 1 / 3)
  37318. }
  37319. return this
  37320. },
  37321. setStyle: function(t) {
  37322. function e(e) {
  37323. void 0 !== e && parseFloat(e) < 1 && console.warn("THREE.Color: Alpha component of " + t + " will be ignored.")
  37324. }
  37325. var i;
  37326. if (i = /^((?:rgb|hsl)a?)\(\s*([^\)]*)\)/.exec(t)) {
  37327. var n, r = i[1], o = i[2];
  37328. switch (r) {
  37329. case "rgb":
  37330. case "rgba":
  37331. if (n = /^(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(o))
  37332. return this.r = Math.min(255, parseInt(n[1], 10)) / 255,
  37333. this.g = Math.min(255, parseInt(n[2], 10)) / 255,
  37334. this.b = Math.min(255, parseInt(n[3], 10)) / 255,
  37335. e(n[5]),
  37336. this;
  37337. if (n = /^(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(o))
  37338. return this.r = Math.min(100, parseInt(n[1], 10)) / 100,
  37339. this.g = Math.min(100, parseInt(n[2], 10)) / 100,
  37340. this.b = Math.min(100, parseInt(n[3], 10)) / 100,
  37341. e(n[5]),
  37342. this;
  37343. break;
  37344. case "hsl":
  37345. case "hsla":
  37346. if (n = /^([0-9]*\.?[0-9]+)\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(o)) {
  37347. var a = parseFloat(n[1]) / 360
  37348. , s = parseInt(n[2], 10) / 100
  37349. , l = parseInt(n[3], 10) / 100;
  37350. return e(n[5]),
  37351. this.setHSL(a, s, l)
  37352. }
  37353. }
  37354. } else if (i = /^\#([A-Fa-f0-9]+)$/.exec(t)) {
  37355. var c, h = (c = i[1]).length;
  37356. if (3 === h)
  37357. return this.r = parseInt(c.charAt(0) + c.charAt(0), 16) / 255,
  37358. this.g = parseInt(c.charAt(1) + c.charAt(1), 16) / 255,
  37359. this.b = parseInt(c.charAt(2) + c.charAt(2), 16) / 255,
  37360. this;
  37361. if (6 === h)
  37362. return this.r = parseInt(c.charAt(0) + c.charAt(1), 16) / 255,
  37363. this.g = parseInt(c.charAt(2) + c.charAt(3), 16) / 255,
  37364. this.b = parseInt(c.charAt(4) + c.charAt(5), 16) / 255,
  37365. this
  37366. }
  37367. t && 0 < t.length && (void 0 !== (c = Ci.ColorKeywords[t]) ? this.setHex(c) : console.warn("THREE.Color: Unknown color " + t));
  37368. return this
  37369. },
  37370. clone: function() {
  37371. return new this.constructor(this.r,this.g,this.b)
  37372. },
  37373. copy: function(e) {
  37374. return this.r = e.r,
  37375. this.g = e.g,
  37376. this.b = e.b,
  37377. this
  37378. },
  37379. copyGammaToLinear: function(e, t) {
  37380. return void 0 === t && (t = 2),
  37381. this.r = Math.pow(e.r, t),
  37382. this.g = Math.pow(e.g, t),
  37383. this.b = Math.pow(e.b, t),
  37384. this
  37385. },
  37386. copyLinearToGamma: function(e, t) {
  37387. void 0 === t && (t = 2);
  37388. var i = 0 < t ? 1 / t : 1;
  37389. return this.r = Math.pow(e.r, i),
  37390. this.g = Math.pow(e.g, i),
  37391. this.b = Math.pow(e.b, i),
  37392. this
  37393. },
  37394. convertGammaToLinear: function() {
  37395. var e = this.r
  37396. , t = this.g
  37397. , i = this.b;
  37398. return this.r = e * e,
  37399. this.g = t * t,
  37400. this.b = i * i,
  37401. this
  37402. },
  37403. convertLinearToGamma: function() {
  37404. return this.r = Math.sqrt(this.r),
  37405. this.g = Math.sqrt(this.g),
  37406. this.b = Math.sqrt(this.b),
  37407. this
  37408. },
  37409. getHex: function() {
  37410. return 255 * this.r << 16 ^ 255 * this.g << 8 ^ 255 * this.b << 0
  37411. },
  37412. getHexString: function() {
  37413. return ("000000" + this.getHex().toString(16)).slice(-6)
  37414. },
  37415. getHSL: function(e) {
  37416. var t, i, n = e || {
  37417. h: 0,
  37418. s: 0,
  37419. l: 0
  37420. }, 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;
  37421. if (l === s)
  37422. i = t = 0;
  37423. else {
  37424. var h = s - l;
  37425. switch (i = c <= .5 ? h / (s + l) : h / (2 - s - l),
  37426. s) {
  37427. case r:
  37428. t = (o - a) / h + (o < a ? 6 : 0);
  37429. break;
  37430. case o:
  37431. t = (a - r) / h + 2;
  37432. break;
  37433. case a:
  37434. t = (r - o) / h + 4
  37435. }
  37436. t /= 6
  37437. }
  37438. return n.h = t,
  37439. n.s = i,
  37440. n.l = c,
  37441. n
  37442. },
  37443. getStyle: function() {
  37444. return "rgb(" + (255 * this.r | 0) + "," + (255 * this.g | 0) + "," + (255 * this.b | 0) + ")"
  37445. },
  37446. offsetHSL: function(e, t, i) {
  37447. var n = this.getHSL();
  37448. return n.h += e,
  37449. n.s += t,
  37450. n.l += i,
  37451. this.setHSL(n.h, n.s, n.l),
  37452. this
  37453. },
  37454. add: function(e) {
  37455. return this.r += e.r,
  37456. this.g += e.g,
  37457. this.b += e.b,
  37458. this
  37459. },
  37460. addColors: function(e, t) {
  37461. return this.r = e.r + t.r,
  37462. this.g = e.g + t.g,
  37463. this.b = e.b + t.b,
  37464. this
  37465. },
  37466. addScalar: function(e) {
  37467. return this.r += e,
  37468. this.g += e,
  37469. this.b += e,
  37470. this
  37471. },
  37472. multiply: function(e) {
  37473. return this.r *= e.r,
  37474. this.g *= e.g,
  37475. this.b *= e.b,
  37476. this
  37477. },
  37478. multiplyScalar: function(e) {
  37479. return this.r *= e,
  37480. this.g *= e,
  37481. this.b *= e,
  37482. this
  37483. },
  37484. lerp: function(e, t) {
  37485. return this.r += (e.r - this.r) * t,
  37486. this.g += (e.g - this.g) * t,
  37487. this.b += (e.b - this.b) * t,
  37488. this
  37489. },
  37490. equals: function(e) {
  37491. return e.r === this.r && e.g === this.g && e.b === this.b
  37492. },
  37493. fromArray: function(e, t) {
  37494. return void 0 === t && (t = 0),
  37495. this.r = e[t],
  37496. this.g = e[t + 1],
  37497. this.b = e[t + 2],
  37498. this
  37499. },
  37500. toArray: function(e, t) {
  37501. return void 0 === e && (e = []),
  37502. void 0 === t && (t = 0),
  37503. e[t] = this.r,
  37504. e[t + 1] = this.g,
  37505. e[t + 2] = this.b,
  37506. e
  37507. }
  37508. },
  37509. Ci.ColorKeywords = {
  37510. aliceblue: 15792383,
  37511. antiquewhite: 16444375,
  37512. aqua: 65535,
  37513. aquamarine: 8388564,
  37514. azure: 15794175,
  37515. beige: 16119260,
  37516. bisque: 16770244,
  37517. black: 0,
  37518. blanchedalmond: 16772045,
  37519. blue: 255,
  37520. blueviolet: 9055202,
  37521. brown: 10824234,
  37522. burlywood: 14596231,
  37523. cadetblue: 6266528,
  37524. chartreuse: 8388352,
  37525. chocolate: 13789470,
  37526. coral: 16744272,
  37527. cornflowerblue: 6591981,
  37528. cornsilk: 16775388,
  37529. crimson: 14423100,
  37530. cyan: 65535,
  37531. darkblue: 139,
  37532. darkcyan: 35723,
  37533. darkgoldenrod: 12092939,
  37534. darkgray: 11119017,
  37535. darkgreen: 25600,
  37536. darkgrey: 11119017,
  37537. darkkhaki: 12433259,
  37538. darkmagenta: 9109643,
  37539. darkolivegreen: 5597999,
  37540. darkorange: 16747520,
  37541. darkorchid: 10040012,
  37542. darkred: 9109504,
  37543. darksalmon: 15308410,
  37544. darkseagreen: 9419919,
  37545. darkslateblue: 4734347,
  37546. darkslategray: 3100495,
  37547. darkslategrey: 3100495,
  37548. darkturquoise: 52945,
  37549. darkviolet: 9699539,
  37550. deeppink: 16716947,
  37551. deepskyblue: 49151,
  37552. dimgray: 6908265,
  37553. dimgrey: 6908265,
  37554. dodgerblue: 2003199,
  37555. firebrick: 11674146,
  37556. floralwhite: 16775920,
  37557. forestgreen: 2263842,
  37558. fuchsia: 16711935,
  37559. gainsboro: 14474460,
  37560. ghostwhite: 16316671,
  37561. gold: 16766720,
  37562. goldenrod: 14329120,
  37563. gray: 8421504,
  37564. green: 32768,
  37565. greenyellow: 11403055,
  37566. grey: 8421504,
  37567. honeydew: 15794160,
  37568. hotpink: 16738740,
  37569. indianred: 13458524,
  37570. indigo: 4915330,
  37571. ivory: 16777200,
  37572. khaki: 15787660,
  37573. lavender: 15132410,
  37574. lavenderblush: 16773365,
  37575. lawngreen: 8190976,
  37576. lemonchiffon: 16775885,
  37577. lightblue: 11393254,
  37578. lightcoral: 15761536,
  37579. lightcyan: 14745599,
  37580. lightgoldenrodyellow: 16448210,
  37581. lightgray: 13882323,
  37582. lightgreen: 9498256,
  37583. lightgrey: 13882323,
  37584. lightpink: 16758465,
  37585. lightsalmon: 16752762,
  37586. lightseagreen: 2142890,
  37587. lightskyblue: 8900346,
  37588. lightslategray: 7833753,
  37589. lightslategrey: 7833753,
  37590. lightsteelblue: 11584734,
  37591. lightyellow: 16777184,
  37592. lime: 65280,
  37593. limegreen: 3329330,
  37594. linen: 16445670,
  37595. magenta: 16711935,
  37596. maroon: 8388608,
  37597. mediumaquamarine: 6737322,
  37598. mediumblue: 205,
  37599. mediumorchid: 12211667,
  37600. mediumpurple: 9662683,
  37601. mediumseagreen: 3978097,
  37602. mediumslateblue: 8087790,
  37603. mediumspringgreen: 64154,
  37604. mediumturquoise: 4772300,
  37605. mediumvioletred: 13047173,
  37606. midnightblue: 1644912,
  37607. mintcream: 16121850,
  37608. mistyrose: 16770273,
  37609. moccasin: 16770229,
  37610. navajowhite: 16768685,
  37611. navy: 128,
  37612. oldlace: 16643558,
  37613. olive: 8421376,
  37614. olivedrab: 7048739,
  37615. orange: 16753920,
  37616. orangered: 16729344,
  37617. orchid: 14315734,
  37618. palegoldenrod: 15657130,
  37619. palegreen: 10025880,
  37620. paleturquoise: 11529966,
  37621. palevioletred: 14381203,
  37622. papayawhip: 16773077,
  37623. peachpuff: 16767673,
  37624. peru: 13468991,
  37625. pink: 16761035,
  37626. plum: 14524637,
  37627. powderblue: 11591910,
  37628. purple: 8388736,
  37629. red: 16711680,
  37630. rosybrown: 12357519,
  37631. royalblue: 4286945,
  37632. saddlebrown: 9127187,
  37633. salmon: 16416882,
  37634. sandybrown: 16032864,
  37635. seagreen: 3050327,
  37636. seashell: 16774638,
  37637. sienna: 10506797,
  37638. silver: 12632256,
  37639. skyblue: 8900331,
  37640. slateblue: 6970061,
  37641. slategray: 7372944,
  37642. slategrey: 7372944,
  37643. snow: 16775930,
  37644. springgreen: 65407,
  37645. steelblue: 4620980,
  37646. tan: 13808780,
  37647. teal: 32896,
  37648. thistle: 14204888,
  37649. tomato: 16737095,
  37650. turquoise: 4251856,
  37651. violet: 15631086,
  37652. wheat: 16113331,
  37653. white: 16777215,
  37654. whitesmoke: 16119285,
  37655. yellow: 16776960,
  37656. yellowgreen: 10145074
  37657. },
  37658. Ci.Quaternion = function(e, t, i, n) {
  37659. this._x = e || 0,
  37660. this._y = t || 0,
  37661. this._z = i || 0,
  37662. this._w = void 0 !== n ? n : 1
  37663. }
  37664. ,
  37665. Ci.Quaternion.prototype = {
  37666. constructor: Ci.Quaternion,
  37667. get x() {
  37668. return this._x
  37669. },
  37670. set x(e) {
  37671. this._x = e,
  37672. this.onChangeCallback()
  37673. },
  37674. get y() {
  37675. return this._y
  37676. },
  37677. set y(e) {
  37678. this._y = e,
  37679. this.onChangeCallback()
  37680. },
  37681. get z() {
  37682. return this._z
  37683. },
  37684. set z(e) {
  37685. this._z = e,
  37686. this.onChangeCallback()
  37687. },
  37688. get w() {
  37689. return this._w
  37690. },
  37691. set w(e) {
  37692. this._w = e,
  37693. this.onChangeCallback()
  37694. },
  37695. set: function(e, t, i, n) {
  37696. return this._x = e,
  37697. this._y = t,
  37698. this._z = i,
  37699. this._w = n,
  37700. this.onChangeCallback(),
  37701. this
  37702. },
  37703. clone: function() {
  37704. return new this.constructor(this._x,this._y,this._z,this._w)
  37705. },
  37706. toObject:function(){//add
  37707. return {x:this.x, y:this.y,z:this.z, w:this.w};
  37708. },
  37709. copy: function(e) {
  37710. return this._x = e.x,
  37711. this._y = e.y,
  37712. this._z = e.z,
  37713. this._w = e.w,
  37714. this.onChangeCallback(),
  37715. this
  37716. },
  37717. setFromEuler: function(e, t) {
  37718. if (e instanceof Ci.Euler == 0)
  37719. throw new Error("THREE.Quaternion: .setFromEuler() now expects a Euler rotation rather than a Vector3 and order.");
  37720. var i = Math.cos(e._x / 2)
  37721. , n = Math.cos(e._y / 2)
  37722. , r = Math.cos(e._z / 2)
  37723. , o = Math.sin(e._x / 2)
  37724. , a = Math.sin(e._y / 2)
  37725. , s = Math.sin(e._z / 2)
  37726. , l = e.order;
  37727. return "XYZ" === l ? (this._x = o * n * r + i * a * s,
  37728. this._y = i * a * r - o * n * s,
  37729. this._z = i * n * s + o * a * r,
  37730. this._w = i * n * r - o * a * s) : "YXZ" === l ? (this._x = o * n * r + i * a * s,
  37731. this._y = i * a * r - o * n * s,
  37732. this._z = i * n * s - o * a * r,
  37733. this._w = i * n * r + o * a * s) : "ZXY" === l ? (this._x = o * n * r - i * a * s,
  37734. this._y = i * a * r + o * n * s,
  37735. this._z = i * n * s + o * a * r,
  37736. this._w = i * n * r - o * a * s) : "ZYX" === l ? (this._x = o * n * r - i * a * s,
  37737. this._y = i * a * r + o * n * s,
  37738. this._z = i * n * s - o * a * r,
  37739. this._w = i * n * r + o * a * s) : "YZX" === l ? (this._x = o * n * r + i * a * s,
  37740. this._y = i * a * r + o * n * s,
  37741. this._z = i * n * s - o * a * r,
  37742. this._w = i * n * r - o * a * s) : "XZY" === l && (this._x = o * n * r - i * a * s,
  37743. this._y = i * a * r - o * n * s,
  37744. this._z = i * n * s + o * a * r,
  37745. this._w = i * n * r + o * a * s),
  37746. !1 !== t && this.onChangeCallback(),
  37747. this
  37748. },
  37749. setFromAxisAngle: function(e, t) {
  37750. var i = t / 2
  37751. , n = Math.sin(i);
  37752. return this._x = e.x * n,
  37753. this._y = e.y * n,
  37754. this._z = e.z * n,
  37755. this._w = Math.cos(i),
  37756. this.onChangeCallback(),
  37757. this
  37758. },
  37759. setFromRotationMatrix: function(e) {
  37760. 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;
  37761. return 0 < d ? (t = .5 / Math.sqrt(d + 1),
  37762. this._w = .25 / t,
  37763. this._x = (h - l) * t,
  37764. this._y = (o - c) * t,
  37765. this._z = (a - r) * t) : s < n && u < n ? (t = 2 * Math.sqrt(1 + n - s - u),
  37766. this._w = (h - l) / t,
  37767. this._x = .25 * t,
  37768. this._y = (r + a) / t,
  37769. this._z = (o + c) / t) : u < s ? (t = 2 * Math.sqrt(1 + s - n - u),
  37770. this._w = (o - c) / t,
  37771. this._x = (r + a) / t,
  37772. this._y = .25 * t,
  37773. this._z = (l + h) / t) : (t = 2 * Math.sqrt(1 + u - n - s),
  37774. this._w = (a - r) / t,
  37775. this._x = (o + c) / t,
  37776. this._y = (l + h) / t,
  37777. this._z = .25 * t),
  37778. this.onChangeCallback(),
  37779. this
  37780. },
  37781. setFromUnitVectors: function(e, t) {
  37782. return void 0 === Be && (Be = new Ci.Vector3),
  37783. (Ve = e.dot(t) + 1) < 1e-6 ? (Ve = 0,
  37784. 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),
  37785. this._x = Be.x,
  37786. this._y = Be.y,
  37787. this._z = Be.z,
  37788. this._w = Ve,
  37789. this.normalize(),
  37790. this
  37791. },
  37792. inverse: function() {
  37793. return this.conjugate().normalize(),
  37794. this
  37795. },
  37796. conjugate: function() {
  37797. return this._x *= -1,
  37798. this._y *= -1,
  37799. this._z *= -1,
  37800. this.onChangeCallback(),
  37801. this
  37802. },
  37803. dot: function(e) {
  37804. return this._x * e._x + this._y * e._y + this._z * e._z + this._w * e._w
  37805. },
  37806. lengthSq: function() {
  37807. return this._x * this._x + this._y * this._y + this._z * this._z + this._w * this._w
  37808. },
  37809. length: function() {
  37810. return Math.sqrt(this._x * this._x + this._y * this._y + this._z * this._z + this._w * this._w)
  37811. },
  37812. normalize: function() {
  37813. var e = this.length();
  37814. return 0 === e ? (this._x = 0,
  37815. this._y = 0,
  37816. this._z = 0,
  37817. this._w = 1) : (e = 1 / e,
  37818. this._x = this._x * e,
  37819. this._y = this._y * e,
  37820. this._z = this._z * e,
  37821. this._w = this._w * e),
  37822. this.onChangeCallback(),
  37823. this
  37824. },
  37825. multiply: function(e, t) {
  37826. return void 0 !== t ? (console.warn("THREE.Quaternion: .multiply() now only accepts one argument. Use .multiplyQuaternions( a, b ) instead."),
  37827. this.multiplyQuaternions(e, t)) : this.multiplyQuaternions(this, e)
  37828. },
  37829. multiplyQuaternions: function(e, t) {
  37830. var i = e._x
  37831. , n = e._y
  37832. , r = e._z
  37833. , o = e._w
  37834. , a = t._x
  37835. , s = t._y
  37836. , l = t._z
  37837. , c = t._w;
  37838. return this._x = i * c + o * a + n * l - r * s,
  37839. this._y = n * c + o * s + r * a - i * l,
  37840. this._z = r * c + o * l + i * s - n * a,
  37841. this._w = o * c - i * a - n * s - r * l,
  37842. this.onChangeCallback(),
  37843. this
  37844. },
  37845. slerp: function(e, t) {
  37846. if (0 === t)
  37847. return this;
  37848. if (1 === t)
  37849. return this.copy(e);
  37850. var i = this._x
  37851. , n = this._y
  37852. , r = this._z
  37853. , o = this._w
  37854. , a = o * e._w + i * e._x + n * e._y + r * e._z;
  37855. if (a < 0 ? (this._w = -e._w,
  37856. this._x = -e._x,
  37857. this._y = -e._y,
  37858. this._z = -e._z,
  37859. a = -a) : this.copy(e),
  37860. 1 <= a)
  37861. return this._w = o,
  37862. this._x = i,
  37863. this._y = n,
  37864. this._z = r,
  37865. this;
  37866. var s = Math.sqrt(1 - a * a);
  37867. if (Math.abs(s) < .001)
  37868. return this._w = .5 * (o + this._w),
  37869. this._x = .5 * (i + this._x),
  37870. this._y = .5 * (n + this._y),
  37871. this._z = .5 * (r + this._z),
  37872. this;
  37873. var l = Math.atan2(s, a)
  37874. , c = Math.sin((1 - t) * l) / s
  37875. , h = Math.sin(t * l) / s;
  37876. return this._w = o * c + this._w * h,
  37877. this._x = i * c + this._x * h,
  37878. this._y = n * c + this._y * h,
  37879. this._z = r * c + this._z * h,
  37880. this.onChangeCallback(),
  37881. this
  37882. },
  37883. equals: function(e) {
  37884. return e._x === this._x && e._y === this._y && e._z === this._z && e._w === this._w
  37885. },
  37886. fromArray: function(e, t) {
  37887. return void 0 === t && (t = 0),
  37888. this._x = e[t],
  37889. this._y = e[t + 1],
  37890. this._z = e[t + 2],
  37891. this._w = e[t + 3],
  37892. this.onChangeCallback(),
  37893. this
  37894. },
  37895. toArray: function(e, t) {
  37896. return void 0 === e && (e = []),
  37897. void 0 === t && (t = 0),
  37898. e[t] = this._x,
  37899. e[t + 1] = this._y,
  37900. e[t + 2] = this._z,
  37901. e[t + 3] = this._w,
  37902. e
  37903. },
  37904. onChange: function(e) {
  37905. return this.onChangeCallback = e,
  37906. this
  37907. },
  37908. onChangeCallback: function() {}
  37909. },
  37910. Object.assign(Ci.Quaternion, {
  37911. slerp: function(e, t, i, n) {
  37912. return i.copy(e).slerp(t, n)
  37913. },
  37914. slerpFlat: function(e, t, i, n, r, o, a) {
  37915. var s = i[n + 0]
  37916. , l = i[n + 1]
  37917. , c = i[n + 2]
  37918. , h = i[n + 3]
  37919. , u = r[o + 0]
  37920. , d = r[o + 1]
  37921. , p = r[o + 2]
  37922. , f = r[o + 3];
  37923. if (h !== f || s !== u || l !== d || c !== p) {
  37924. var g = 1 - a
  37925. , m = s * u + l * d + c * p + h * f
  37926. , v = 0 <= m ? 1 : -1
  37927. , y = 1 - m * m;
  37928. if (y > Number.EPSILON) {
  37929. var A = Math.sqrt(y)
  37930. , C = Math.atan2(A, m * v);
  37931. g = Math.sin(g * C) / A,
  37932. a = Math.sin(a * C) / A
  37933. }
  37934. var I = a * v;
  37935. if (s = s * g + u * I,
  37936. l = l * g + d * I,
  37937. c = c * g + p * I,
  37938. h = h * g + f * I,
  37939. g === 1 - a) {
  37940. var E = 1 / Math.sqrt(s * s + l * l + c * c + h * h);
  37941. s *= E,
  37942. l *= E,
  37943. c *= E,
  37944. h *= E
  37945. }
  37946. }
  37947. e[t] = s,
  37948. e[t + 1] = l,
  37949. e[t + 2] = c,
  37950. e[t + 3] = h
  37951. }
  37952. }),
  37953. Ci.Vector2 = function(e, t) {
  37954. this.x = e || 0,
  37955. this.y = t || 0
  37956. }
  37957. ,
  37958. Ci.Vector2.prototype = {
  37959. constructor: Ci.Vector2,
  37960. get width() {
  37961. return this.x
  37962. },
  37963. set width(e) {
  37964. this.x = e
  37965. },
  37966. get height() {
  37967. return this.y
  37968. },
  37969. set height(e) {
  37970. this.y = e
  37971. },
  37972. set: function(e, t) {
  37973. return this.x = e,
  37974. this.y = t,
  37975. this
  37976. },
  37977. setScalar: function(e) {
  37978. return this.x = e,
  37979. this.y = e,
  37980. this
  37981. },
  37982. setX: function(e) {
  37983. return this.x = e,
  37984. this
  37985. },
  37986. setY: function(e) {
  37987. return this.y = e,
  37988. this
  37989. },
  37990. setComponent: function(e, t) {
  37991. switch (e) {
  37992. case 0:
  37993. this.x = t;
  37994. break;
  37995. case 1:
  37996. this.y = t;
  37997. break;
  37998. default:
  37999. throw new Error("index is out of range: " + e)
  38000. }
  38001. },
  38002. getComponent: function(e) {
  38003. switch (e) {
  38004. case 0:
  38005. return this.x;
  38006. case 1:
  38007. return this.y;
  38008. default:
  38009. throw new Error("index is out of range: " + e)
  38010. }
  38011. },
  38012. clone: function() {
  38013. return new this.constructor(this.x,this.y)
  38014. },
  38015. copy: function(e) {
  38016. return this.x = e.x,
  38017. this.y = e.y,
  38018. this
  38019. },
  38020. add: function(e, t) {
  38021. return void 0 !== t ? (console.warn("THREE.Vector2: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),
  38022. this.addVectors(e, t)) : (this.x += e.x,
  38023. this.y += e.y,
  38024. this)
  38025. },
  38026. addScalar: function(e) {
  38027. return this.x += e,
  38028. this.y += e,
  38029. this
  38030. },
  38031. addVectors: function(e, t) {
  38032. return this.x = e.x + t.x,
  38033. this.y = e.y + t.y,
  38034. this
  38035. },
  38036. addScaledVector: function(e, t) {
  38037. return this.x += e.x * t,
  38038. this.y += e.y * t,
  38039. this
  38040. },
  38041. sub: function(e, t) {
  38042. return void 0 !== t ? (console.warn("THREE.Vector2: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),
  38043. this.subVectors(e, t)) : (this.x -= e.x,
  38044. this.y -= e.y,
  38045. this)
  38046. },
  38047. subScalar: function(e) {
  38048. return this.x -= e,
  38049. this.y -= e,
  38050. this
  38051. },
  38052. subVectors: function(e, t) {
  38053. return this.x = e.x - t.x,
  38054. this.y = e.y - t.y,
  38055. this
  38056. },
  38057. multiply: function(e) {
  38058. return this.x *= e.x,
  38059. this.y *= e.y,
  38060. this
  38061. },
  38062. multiplyScalar: function(e) {
  38063. return isFinite(e) ? (this.x *= e,
  38064. this.y *= e) : (this.x = 0,
  38065. this.y = 0),
  38066. this
  38067. },
  38068. divide: function(e) {
  38069. return this.x /= e.x,
  38070. this.y /= e.y,
  38071. this
  38072. },
  38073. divideScalar: function(e) {
  38074. return this.multiplyScalar(1 / e)
  38075. },
  38076. min: function(e) {
  38077. return this.x = Math.min(this.x, e.x),
  38078. this.y = Math.min(this.y, e.y),
  38079. this
  38080. },
  38081. max: function(e) {
  38082. return this.x = Math.max(this.x, e.x),
  38083. this.y = Math.max(this.y, e.y),
  38084. this
  38085. },
  38086. clamp: function(e, t) {
  38087. return this.x = Math.max(e.x, Math.min(t.x, this.x)),
  38088. this.y = Math.max(e.y, Math.min(t.y, this.y)),
  38089. this
  38090. },
  38091. clampScalar: function(e, t) {
  38092. return void 0 === Ne && (Ne = new Ci.Vector2,
  38093. Fe = new Ci.Vector2),
  38094. Ne.set(e, e),
  38095. Fe.set(t, t),
  38096. this.clamp(Ne, Fe)
  38097. },
  38098. clampLength: function(e, t) {
  38099. var i = this.length();
  38100. return this.multiplyScalar(Math.max(e, Math.min(t, i)) / i),
  38101. this
  38102. },
  38103. floor: function() {
  38104. return this.x = Math.floor(this.x),
  38105. this.y = Math.floor(this.y),
  38106. this
  38107. },
  38108. ceil: function() {
  38109. return this.x = Math.ceil(this.x),
  38110. this.y = Math.ceil(this.y),
  38111. this
  38112. },
  38113. round: function() {
  38114. return this.x = Math.round(this.x),
  38115. this.y = Math.round(this.y),
  38116. this
  38117. },
  38118. roundToZero: function() {
  38119. return this.x = this.x < 0 ? Math.ceil(this.x) : Math.floor(this.x),
  38120. this.y = this.y < 0 ? Math.ceil(this.y) : Math.floor(this.y),
  38121. this
  38122. },
  38123. negate: function() {
  38124. return this.x = -this.x,
  38125. this.y = -this.y,
  38126. this
  38127. },
  38128. dot: function(e) {
  38129. return this.x * e.x + this.y * e.y
  38130. },
  38131. lengthSq: function() {
  38132. return this.x * this.x + this.y * this.y
  38133. },
  38134. length: function() {
  38135. return Math.sqrt(this.x * this.x + this.y * this.y)
  38136. },
  38137. lengthManhattan: function() {
  38138. return Math.abs(this.x) + Math.abs(this.y)
  38139. },
  38140. normalize: function() {
  38141. return this.divideScalar(this.length())
  38142. },
  38143. angle: function() {
  38144. var e = Math.atan2(this.y, this.x);
  38145. return e < 0 && (e += 2 * Math.PI),
  38146. e
  38147. },
  38148. distanceTo: function(e) {
  38149. return Math.sqrt(this.distanceToSquared(e))
  38150. },
  38151. distanceToSquared: function(e) {
  38152. var t = this.x - e.x
  38153. , i = this.y - e.y;
  38154. return t * t + i * i
  38155. },
  38156. setLength: function(e) {
  38157. return this.multiplyScalar(e / this.length())
  38158. },
  38159. lerp: function(e, t) {
  38160. return this.x += (e.x - this.x) * t,
  38161. this.y += (e.y - this.y) * t,
  38162. this
  38163. },
  38164. lerpVectors: function(e, t, i) {
  38165. return this.subVectors(t, e).multiplyScalar(i).add(e),
  38166. this
  38167. },
  38168. equals: function(e) {
  38169. return e.x === this.x && e.y === this.y
  38170. },
  38171. fromArray: function(e, t) {
  38172. return void 0 === t && (t = 0),
  38173. this.x = e[t],
  38174. this.y = e[t + 1],
  38175. this
  38176. },
  38177. toArray: function(e, t) {
  38178. return void 0 === e && (e = []),
  38179. void 0 === t && (t = 0),
  38180. e[t] = this.x,
  38181. e[t + 1] = this.y,
  38182. e
  38183. },
  38184. fromAttribute: function(e, t, i) {
  38185. return void 0 === i && (i = 0),
  38186. t = t * e.itemSize + i,
  38187. this.x = e.array[t],
  38188. this.y = e.array[t + 1],
  38189. this
  38190. },
  38191. rotateAround: function(e, t) {
  38192. var i = Math.cos(t)
  38193. , n = Math.sin(t)
  38194. , r = this.x - e.x
  38195. , o = this.y - e.y;
  38196. return this.x = r * i - o * n + e.x,
  38197. this.y = r * n + o * i + e.y,
  38198. this
  38199. }
  38200. },
  38201. Ci.Vector3 = function(e, t, i) {
  38202. this.x = e || 0,
  38203. this.y = t || 0,
  38204. this.z = i || 0
  38205. }
  38206. ,
  38207. Ci.Vector3.prototype = {
  38208. constructor: Ci.Vector3,
  38209. set: function(e, t, i) {
  38210. return this.x = e,
  38211. this.y = t,
  38212. this.z = i,
  38213. this
  38214. },
  38215. setScalar: function(e) {
  38216. return this.x = e,
  38217. this.y = e,
  38218. this.z = e,
  38219. this
  38220. },
  38221. setX: function(e) {
  38222. return this.x = e,
  38223. this
  38224. },
  38225. setY: function(e) {
  38226. return this.y = e,
  38227. this
  38228. },
  38229. setZ: function(e) {
  38230. return this.z = e,
  38231. this
  38232. },
  38233. setComponent: function(e, t) {
  38234. switch (e) {
  38235. case 0:
  38236. this.x = t;
  38237. break;
  38238. case 1:
  38239. this.y = t;
  38240. break;
  38241. case 2:
  38242. this.z = t;
  38243. break;
  38244. default:
  38245. throw new Error("index is out of range: " + e)
  38246. }
  38247. },
  38248. getComponent: function(e) {
  38249. switch (e) {
  38250. case 0:
  38251. return this.x;
  38252. case 1:
  38253. return this.y;
  38254. case 2:
  38255. return this.z;
  38256. default:
  38257. throw new Error("index is out of range: " + e)
  38258. }
  38259. },
  38260. clone: function() {
  38261. return new this.constructor(this.x,this.y,this.z)
  38262. },
  38263. copy: function(e) {
  38264. return this.x = e.x,
  38265. this.y = e.y,
  38266. this.z = e.z,
  38267. this
  38268. },
  38269. add: function(e, t) {
  38270. return void 0 !== t ? (console.warn("THREE.Vector3: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),
  38271. this.addVectors(e, t)) : (this.x += e.x,
  38272. this.y += e.y,
  38273. this.z += e.z,
  38274. this)
  38275. },
  38276. addScalar: function(e) {
  38277. return this.x += e,
  38278. this.y += e,
  38279. this.z += e,
  38280. this
  38281. },
  38282. addVectors: function(e, t) {
  38283. return this.x = e.x + t.x,
  38284. this.y = e.y + t.y,
  38285. this.z = e.z + t.z,
  38286. this
  38287. },
  38288. addScaledVector: function(e, t) {
  38289. return this.x += e.x * t,
  38290. this.y += e.y * t,
  38291. this.z += e.z * t,
  38292. this
  38293. },
  38294. sub: function(e, t) {
  38295. return void 0 !== t ? (console.warn("THREE.Vector3: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),
  38296. this.subVectors(e, t)) : (this.x -= e.x,
  38297. this.y -= e.y,
  38298. this.z -= e.z,
  38299. this)
  38300. },
  38301. subScalar: function(e) {
  38302. return this.x -= e,
  38303. this.y -= e,
  38304. this.z -= e,
  38305. this
  38306. },
  38307. subVectors: function(e, t) {
  38308. return this.x = e.x - t.x,
  38309. this.y = e.y - t.y,
  38310. this.z = e.z - t.z,
  38311. this
  38312. },
  38313. multiply: function(e, t) {
  38314. return void 0 !== t ? (console.warn("THREE.Vector3: .multiply() now only accepts one argument. Use .multiplyVectors( a, b ) instead."),
  38315. this.multiplyVectors(e, t)) : (this.x *= e.x,
  38316. this.y *= e.y,
  38317. this.z *= e.z,
  38318. this)
  38319. },
  38320. multiplyScalar: function(e) {
  38321. return isFinite(e) ? (this.x *= e,
  38322. this.y *= e,
  38323. this.z *= e) : (this.x = 0,
  38324. this.y = 0,
  38325. this.z = 0),
  38326. this
  38327. },
  38328. multiplyVectors: function(e, t) {
  38329. return this.x = e.x * t.x,
  38330. this.y = e.y * t.y,
  38331. this.z = e.z * t.z,
  38332. this
  38333. },
  38334. applyEuler: function(e) {
  38335. return e instanceof Ci.Euler == 0 && console.error("THREE.Vector3: .applyEuler() now expects an Euler rotation rather than a Vector3 and order."),
  38336. void 0 === De && (De = new Ci.Quaternion),
  38337. this.applyQuaternion(De.setFromEuler(e)),
  38338. this
  38339. },
  38340. applyAxisAngle: function(e, t) {
  38341. return void 0 === Le && (Le = new Ci.Quaternion),
  38342. this.applyQuaternion(Le.setFromAxisAngle(e, t)),
  38343. this
  38344. },
  38345. applyMatrix3: function(e) {
  38346. var t = this.x
  38347. , i = this.y
  38348. , n = this.z
  38349. , r = e.elements;
  38350. return this.x = r[0] * t + r[3] * i + r[6] * n,
  38351. this.y = r[1] * t + r[4] * i + r[7] * n,
  38352. this.z = r[2] * t + r[5] * i + r[8] * n,
  38353. this
  38354. },
  38355. applyMatrix4: function(e) {
  38356. var t = this.x
  38357. , i = this.y
  38358. , n = this.z
  38359. , r = e.elements;
  38360. return this.x = r[0] * t + r[4] * i + r[8] * n + r[12],
  38361. this.y = r[1] * t + r[5] * i + r[9] * n + r[13],
  38362. this.z = r[2] * t + r[6] * i + r[10] * n + r[14],
  38363. this
  38364. },
  38365. applyProjection: function(e) {
  38366. var t = this.x
  38367. , i = this.y
  38368. , n = this.z
  38369. , r = e.elements
  38370. , o = 1 / (r[3] * t + r[7] * i + r[11] * n + r[15]);
  38371. return this.x = (r[0] * t + r[4] * i + r[8] * n + r[12]) * o,
  38372. this.y = (r[1] * t + r[5] * i + r[9] * n + r[13]) * o,
  38373. this.z = (r[2] * t + r[6] * i + r[10] * n + r[14]) * o,
  38374. this
  38375. },
  38376. applyQuaternion: function(e) {
  38377. var t = this.x
  38378. , i = this.y
  38379. , n = this.z
  38380. , r = e.x
  38381. , o = e.y
  38382. , a = e.z
  38383. , s = e.w
  38384. , l = s * t + o * n - a * i
  38385. , c = s * i + a * t - r * n
  38386. , h = s * n + r * i - o * t
  38387. , u = -r * t - o * i - a * n;
  38388. return this.x = l * s + u * -r + c * -a - h * -o,
  38389. this.y = c * s + u * -o + h * -r - l * -a,
  38390. this.z = h * s + u * -a + l * -o - c * -r,
  38391. this
  38392. },
  38393. project: function(e) {
  38394. return void 0 === Oe && (Oe = new Ci.Matrix4),
  38395. Oe.multiplyMatrices(e.projectionMatrix, Oe.getInverse(e.matrixWorld)),
  38396. this.applyProjection(Oe)
  38397. },
  38398. unproject: function(e) {
  38399. return void 0 === Pe && (Pe = new Ci.Matrix4),
  38400. Pe.multiplyMatrices(e.matrixWorld, Pe.getInverse(e.projectionMatrix)),
  38401. this.applyProjection(Pe)
  38402. },
  38403. transformDirection: function(e) {
  38404. var t = this.x
  38405. , i = this.y
  38406. , n = this.z
  38407. , r = e.elements;
  38408. return this.x = r[0] * t + r[4] * i + r[8] * n,
  38409. this.y = r[1] * t + r[5] * i + r[9] * n,
  38410. this.z = r[2] * t + r[6] * i + r[10] * n,
  38411. this.normalize(),
  38412. this
  38413. },
  38414. divide: function(e) {
  38415. return this.x /= e.x,
  38416. this.y /= e.y,
  38417. this.z /= e.z,
  38418. this
  38419. },
  38420. divideScalar: function(e) {
  38421. return this.multiplyScalar(1 / e)
  38422. },
  38423. min: function(e) {
  38424. return this.x = Math.min(this.x, e.x),
  38425. this.y = Math.min(this.y, e.y),
  38426. this.z = Math.min(this.z, e.z),
  38427. this
  38428. },
  38429. max: function(e) {
  38430. return this.x = Math.max(this.x, e.x),
  38431. this.y = Math.max(this.y, e.y),
  38432. this.z = Math.max(this.z, e.z),
  38433. this
  38434. },
  38435. clamp: function(e, t) {
  38436. return this.x = Math.max(e.x, Math.min(t.x, this.x)),
  38437. this.y = Math.max(e.y, Math.min(t.y, this.y)),
  38438. this.z = Math.max(e.z, Math.min(t.z, this.z)),
  38439. this
  38440. },
  38441. clampScalar: function(e, t) {
  38442. return void 0 === Me && (Me = new Ci.Vector3,
  38443. Re = new Ci.Vector3),
  38444. Me.set(e, e, e),
  38445. Re.set(t, t, t),
  38446. this.clamp(Me, Re)
  38447. },
  38448. clampLength: function(e, t) {
  38449. var i = this.length();
  38450. return this.multiplyScalar(Math.max(e, Math.min(t, i)) / i),
  38451. this
  38452. },
  38453. floor: function() {
  38454. return this.x = Math.floor(this.x),
  38455. this.y = Math.floor(this.y),
  38456. this.z = Math.floor(this.z),
  38457. this
  38458. },
  38459. ceil: function() {
  38460. return this.x = Math.ceil(this.x),
  38461. this.y = Math.ceil(this.y),
  38462. this.z = Math.ceil(this.z),
  38463. this
  38464. },
  38465. round: function() {
  38466. return this.x = Math.round(this.x),
  38467. this.y = Math.round(this.y),
  38468. this.z = Math.round(this.z),
  38469. this
  38470. },
  38471. roundToZero: function() {
  38472. return this.x = this.x < 0 ? Math.ceil(this.x) : Math.floor(this.x),
  38473. this.y = this.y < 0 ? Math.ceil(this.y) : Math.floor(this.y),
  38474. this.z = this.z < 0 ? Math.ceil(this.z) : Math.floor(this.z),
  38475. this
  38476. },
  38477. negate: function() {
  38478. return this.x = -this.x,
  38479. this.y = -this.y,
  38480. this.z = -this.z,
  38481. this
  38482. },
  38483. dot: function(e) {
  38484. return this.x * e.x + this.y * e.y + this.z * e.z
  38485. },
  38486. lengthSq: function() {
  38487. return this.x * this.x + this.y * this.y + this.z * this.z
  38488. },
  38489. length: function() {
  38490. return Math.sqrt(this.x * this.x + this.y * this.y + this.z * this.z)
  38491. },
  38492. lengthManhattan: function() {
  38493. return Math.abs(this.x) + Math.abs(this.y) + Math.abs(this.z)
  38494. },
  38495. normalize: function() {
  38496. return this.divideScalar(this.length())
  38497. },
  38498. setLength: function(e) {
  38499. return this.multiplyScalar(e / this.length())
  38500. },
  38501. lerp: function(e, t) {
  38502. return this.x += (e.x - this.x) * t,
  38503. this.y += (e.y - this.y) * t,
  38504. this.z += (e.z - this.z) * t,
  38505. this
  38506. },
  38507. lerpVectors: function(e, t, i) {
  38508. return this.subVectors(t, e).multiplyScalar(i).add(e),
  38509. this
  38510. },
  38511. cross: function(e, t) {
  38512. if (void 0 !== t)
  38513. return console.warn("THREE.Vector3: .cross() now only accepts one argument. Use .crossVectors( a, b ) instead."),
  38514. this.crossVectors(e, t);
  38515. var i = this.x
  38516. , n = this.y
  38517. , r = this.z;
  38518. return this.x = n * e.z - r * e.y,
  38519. this.y = r * e.x - i * e.z,
  38520. this.z = i * e.y - n * e.x,
  38521. this
  38522. },
  38523. crossVectors: function(e, t) {
  38524. var i = e.x
  38525. , n = e.y
  38526. , r = e.z
  38527. , o = t.x
  38528. , a = t.y
  38529. , s = t.z;
  38530. return this.x = n * s - r * a,
  38531. this.y = r * o - i * s,
  38532. this.z = i * a - n * o,
  38533. this
  38534. },
  38535. projectOnVector: function(e) {
  38536. return void 0 === xe && (xe = new Ci.Vector3),
  38537. xe.copy(e).normalize(),
  38538. Se = this.dot(xe),
  38539. this.copy(xe).multiplyScalar(Se)
  38540. },
  38541. projectOnPlane: function(e) {
  38542. return void 0 === Te && (Te = new Ci.Vector3),
  38543. Te.copy(this).projectOnVector(e),
  38544. this.sub(Te)
  38545. },
  38546. reflect: function(e) {
  38547. return void 0 === we && (we = new Ci.Vector3),
  38548. this.sub(we.copy(e).multiplyScalar(2 * this.dot(e)))
  38549. },
  38550. angleTo: function(e) {
  38551. var t = this.dot(e) / Math.sqrt(this.lengthSq() * e.lengthSq());
  38552. return Math.acos(Ci.Math.clamp(t, -1, 1))
  38553. },
  38554. distanceTo: function(e) {
  38555. return Math.sqrt(this.distanceToSquared(e))
  38556. },
  38557. distanceToSquared: function(e) {
  38558. var t = this.x - e.x
  38559. , i = this.y - e.y
  38560. , n = this.z - e.z;
  38561. return t * t + i * i + n * n
  38562. },
  38563. setFromSpherical: function(e) {
  38564. var t = Math.sin(e.phi) * e.radius;
  38565. return this.x = t * Math.sin(e.theta),
  38566. this.y = Math.cos(e.phi) * e.radius,
  38567. this.z = t * Math.cos(e.theta),
  38568. this
  38569. },
  38570. setFromMatrixPosition: function(e) {
  38571. return this.setFromMatrixColumn(e, 3)
  38572. },
  38573. setFromMatrixScale: function(e) {
  38574. var t = this.setFromMatrixColumn(e, 0).length()
  38575. , i = this.setFromMatrixColumn(e, 1).length()
  38576. , n = this.setFromMatrixColumn(e, 2).length();
  38577. return this.x = t,
  38578. this.y = i,
  38579. this.z = n,
  38580. this
  38581. },
  38582. setFromMatrixColumn: function(e, t) {
  38583. return "number" == typeof e && (console.warn("THREE.Vector3: setFromMatrixColumn now expects ( matrix, index )."),
  38584. t = e = t),
  38585. this.fromArray(e.elements, 4 * t)
  38586. },
  38587. equals: function(e) {
  38588. return e.x === this.x && e.y === this.y && e.z === this.z
  38589. },
  38590. fromArray: function(e, t) {
  38591. return void 0 === t && (t = 0),
  38592. this.x = e[t],
  38593. this.y = e[t + 1],
  38594. this.z = e[t + 2],
  38595. this
  38596. },
  38597. toArray: function(e, t) {
  38598. return void 0 === e && (e = []),
  38599. void 0 === t && (t = 0),
  38600. e[t] = this.x,
  38601. e[t + 1] = this.y,
  38602. e[t + 2] = this.z,
  38603. e
  38604. },
  38605. fromAttribute: function(e, t, i) {
  38606. return void 0 === i && (i = 0),
  38607. t = t * e.itemSize + i,
  38608. this.x = e.array[t],
  38609. this.y = e.array[t + 1],
  38610. this.z = e.array[t + 2],
  38611. this
  38612. }
  38613. },
  38614. Ci.Vector4 = function(e, t, i, n) {
  38615. this.x = e || 0,
  38616. this.y = t || 0,
  38617. this.z = i || 0,
  38618. this.w = void 0 !== n ? n : 1
  38619. }
  38620. ,
  38621. Ci.Vector4.prototype = {
  38622. constructor: Ci.Vector4,
  38623. set: function(e, t, i, n) {
  38624. return this.x = e,
  38625. this.y = t,
  38626. this.z = i,
  38627. this.w = n,
  38628. this
  38629. },
  38630. setScalar: function(e) {
  38631. return this.x = e,
  38632. this.y = e,
  38633. this.z = e,
  38634. this.w = e,
  38635. this
  38636. },
  38637. setX: function(e) {
  38638. return this.x = e,
  38639. this
  38640. },
  38641. setY: function(e) {
  38642. return this.y = e,
  38643. this
  38644. },
  38645. setZ: function(e) {
  38646. return this.z = e,
  38647. this
  38648. },
  38649. setW: function(e) {
  38650. return this.w = e,
  38651. this
  38652. },
  38653. setComponent: function(e, t) {
  38654. switch (e) {
  38655. case 0:
  38656. this.x = t;
  38657. break;
  38658. case 1:
  38659. this.y = t;
  38660. break;
  38661. case 2:
  38662. this.z = t;
  38663. break;
  38664. case 3:
  38665. this.w = t;
  38666. break;
  38667. default:
  38668. throw new Error("index is out of range: " + e)
  38669. }
  38670. },
  38671. getComponent: function(e) {
  38672. switch (e) {
  38673. case 0:
  38674. return this.x;
  38675. case 1:
  38676. return this.y;
  38677. case 2:
  38678. return this.z;
  38679. case 3:
  38680. return this.w;
  38681. default:
  38682. throw new Error("index is out of range: " + e)
  38683. }
  38684. },
  38685. clone: function() {
  38686. return new this.constructor(this.x,this.y,this.z,this.w)
  38687. },
  38688. copy: function(e) {
  38689. return this.x = e.x,
  38690. this.y = e.y,
  38691. this.z = e.z,
  38692. this.w = void 0 !== e.w ? e.w : 1,
  38693. this
  38694. },
  38695. add: function(e, t) {
  38696. return void 0 !== t ? (console.warn("THREE.Vector4: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),
  38697. this.addVectors(e, t)) : (this.x += e.x,
  38698. this.y += e.y,
  38699. this.z += e.z,
  38700. this.w += e.w,
  38701. this)
  38702. },
  38703. addScalar: function(e) {
  38704. return this.x += e,
  38705. this.y += e,
  38706. this.z += e,
  38707. this.w += e,
  38708. this
  38709. },
  38710. addVectors: function(e, t) {
  38711. return this.x = e.x + t.x,
  38712. this.y = e.y + t.y,
  38713. this.z = e.z + t.z,
  38714. this.w = e.w + t.w,
  38715. this
  38716. },
  38717. addScaledVector: function(e, t) {
  38718. return this.x += e.x * t,
  38719. this.y += e.y * t,
  38720. this.z += e.z * t,
  38721. this.w += e.w * t,
  38722. this
  38723. },
  38724. sub: function(e, t) {
  38725. return void 0 !== t ? (console.warn("THREE.Vector4: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),
  38726. this.subVectors(e, t)) : (this.x -= e.x,
  38727. this.y -= e.y,
  38728. this.z -= e.z,
  38729. this.w -= e.w,
  38730. this)
  38731. },
  38732. subScalar: function(e) {
  38733. return this.x -= e,
  38734. this.y -= e,
  38735. this.z -= e,
  38736. this.w -= e,
  38737. this
  38738. },
  38739. subVectors: function(e, t) {
  38740. return this.x = e.x - t.x,
  38741. this.y = e.y - t.y,
  38742. this.z = e.z - t.z,
  38743. this.w = e.w - t.w,
  38744. this
  38745. },
  38746. multiplyScalar: function(e) {
  38747. return isFinite(e) ? (this.x *= e,
  38748. this.y *= e,
  38749. this.z *= e,
  38750. this.w *= e) : (this.x = 0,
  38751. this.y = 0,
  38752. this.z = 0,
  38753. this.w = 0),
  38754. this
  38755. },
  38756. applyMatrix4: function(e) {
  38757. var t = this.x
  38758. , i = this.y
  38759. , n = this.z
  38760. , r = this.w
  38761. , o = e.elements;
  38762. return this.x = o[0] * t + o[4] * i + o[8] * n + o[12] * r,
  38763. this.y = o[1] * t + o[5] * i + o[9] * n + o[13] * r,
  38764. this.z = o[2] * t + o[6] * i + o[10] * n + o[14] * r,
  38765. this.w = o[3] * t + o[7] * i + o[11] * n + o[15] * r,
  38766. this
  38767. },
  38768. divideScalar: function(e) {
  38769. return this.multiplyScalar(1 / e)
  38770. },
  38771. setAxisAngleFromQuaternion: function(e) {
  38772. this.w = 2 * Math.acos(e.w);
  38773. var t = Math.sqrt(1 - e.w * e.w);
  38774. return t < 1e-4 ? (this.x = 1,
  38775. this.y = 0,
  38776. this.z = 0) : (this.x = e.x / t,
  38777. this.y = e.y / t,
  38778. this.z = e.z / t),
  38779. this
  38780. },
  38781. setAxisAngleFromRotationMatrix: function(e) {
  38782. 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];
  38783. if (Math.abs(s - c) < .01 && Math.abs(l - d) < .01 && Math.abs(u - p) < .01) {
  38784. if (Math.abs(s + c) < .1 && Math.abs(l + d) < .1 && Math.abs(u + p) < .1 && Math.abs(a + h + f - 3) < .1)
  38785. return this.set(1, 0, 0, 0),
  38786. this;
  38787. t = Math.PI;
  38788. var g = (a + 1) / 2
  38789. , m = (h + 1) / 2
  38790. , v = (f + 1) / 2
  38791. , y = (s + c) / 4
  38792. , A = (l + d) / 4
  38793. , C = (u + p) / 4;
  38794. return m < g && v < g ? r = g < .01 ? (i = 0,
  38795. n = .707106781) : (n = y / (i = Math.sqrt(g)),
  38796. A / i) : v < m ? r = m < .01 ? (n = 0,
  38797. i = .707106781) : (i = y / (n = Math.sqrt(m)),
  38798. C / n) : v < .01 ? (n = i = .707106781,
  38799. r = 0) : (i = A / (r = Math.sqrt(v)),
  38800. n = C / r),
  38801. this.set(i, n, r, t),
  38802. this
  38803. }
  38804. var I = Math.sqrt((p - u) * (p - u) + (l - d) * (l - d) + (c - s) * (c - s));
  38805. return Math.abs(I) < .001 && (I = 1),
  38806. this.x = (p - u) / I,
  38807. this.y = (l - d) / I,
  38808. this.z = (c - s) / I,
  38809. this.w = Math.acos((a + h + f - 1) / 2),
  38810. this
  38811. },
  38812. min: function(e) {
  38813. return this.x = Math.min(this.x, e.x),
  38814. this.y = Math.min(this.y, e.y),
  38815. this.z = Math.min(this.z, e.z),
  38816. this.w = Math.min(this.w, e.w),
  38817. this
  38818. },
  38819. max: function(e) {
  38820. return this.x = Math.max(this.x, e.x),
  38821. this.y = Math.max(this.y, e.y),
  38822. this.z = Math.max(this.z, e.z),
  38823. this.w = Math.max(this.w, e.w),
  38824. this
  38825. },
  38826. clamp: function(e, t) {
  38827. return this.x = Math.max(e.x, Math.min(t.x, this.x)),
  38828. this.y = Math.max(e.y, Math.min(t.y, this.y)),
  38829. this.z = Math.max(e.z, Math.min(t.z, this.z)),
  38830. this.w = Math.max(e.w, Math.min(t.w, this.w)),
  38831. this
  38832. },
  38833. clampScalar: function(e, t) {
  38834. return void 0 === _e && (_e = new Ci.Vector4,
  38835. be = new Ci.Vector4),
  38836. _e.set(e, e, e, e),
  38837. be.set(t, t, t, t),
  38838. this.clamp(_e, be)
  38839. },
  38840. floor: function() {
  38841. return this.x = Math.floor(this.x),
  38842. this.y = Math.floor(this.y),
  38843. this.z = Math.floor(this.z),
  38844. this.w = Math.floor(this.w),
  38845. this
  38846. },
  38847. ceil: function() {
  38848. return this.x = Math.ceil(this.x),
  38849. this.y = Math.ceil(this.y),
  38850. this.z = Math.ceil(this.z),
  38851. this.w = Math.ceil(this.w),
  38852. this
  38853. },
  38854. round: function() {
  38855. return this.x = Math.round(this.x),
  38856. this.y = Math.round(this.y),
  38857. this.z = Math.round(this.z),
  38858. this.w = Math.round(this.w),
  38859. this
  38860. },
  38861. roundToZero: function() {
  38862. return this.x = this.x < 0 ? Math.ceil(this.x) : Math.floor(this.x),
  38863. this.y = this.y < 0 ? Math.ceil(this.y) : Math.floor(this.y),
  38864. this.z = this.z < 0 ? Math.ceil(this.z) : Math.floor(this.z),
  38865. this.w = this.w < 0 ? Math.ceil(this.w) : Math.floor(this.w),
  38866. this
  38867. },
  38868. negate: function() {
  38869. return this.x = -this.x,
  38870. this.y = -this.y,
  38871. this.z = -this.z,
  38872. this.w = -this.w,
  38873. this
  38874. },
  38875. dot: function(e) {
  38876. return this.x * e.x + this.y * e.y + this.z * e.z + this.w * e.w
  38877. },
  38878. lengthSq: function() {
  38879. return this.x * this.x + this.y * this.y + this.z * this.z + this.w * this.w
  38880. },
  38881. length: function() {
  38882. return Math.sqrt(this.x * this.x + this.y * this.y + this.z * this.z + this.w * this.w)
  38883. },
  38884. lengthManhattan: function() {
  38885. return Math.abs(this.x) + Math.abs(this.y) + Math.abs(this.z) + Math.abs(this.w)
  38886. },
  38887. normalize: function() {
  38888. return this.divideScalar(this.length())
  38889. },
  38890. setLength: function(e) {
  38891. return this.multiplyScalar(e / this.length())
  38892. },
  38893. lerp: function(e, t) {
  38894. return this.x += (e.x - this.x) * t,
  38895. this.y += (e.y - this.y) * t,
  38896. this.z += (e.z - this.z) * t,
  38897. this.w += (e.w - this.w) * t,
  38898. this
  38899. },
  38900. lerpVectors: function(e, t, i) {
  38901. return this.subVectors(t, e).multiplyScalar(i).add(e),
  38902. this
  38903. },
  38904. equals: function(e) {
  38905. return e.x === this.x && e.y === this.y && e.z === this.z && e.w === this.w
  38906. },
  38907. fromArray: function(e, t) {
  38908. return void 0 === t && (t = 0),
  38909. this.x = e[t],
  38910. this.y = e[t + 1],
  38911. this.z = e[t + 2],
  38912. this.w = e[t + 3],
  38913. this
  38914. },
  38915. toArray: function(e, t) {
  38916. return void 0 === e && (e = []),
  38917. void 0 === t && (t = 0),
  38918. e[t] = this.x,
  38919. e[t + 1] = this.y,
  38920. e[t + 2] = this.z,
  38921. e[t + 3] = this.w,
  38922. e
  38923. },
  38924. fromAttribute: function(e, t, i) {
  38925. return void 0 === i && (i = 0),
  38926. t = t * e.itemSize + i,
  38927. this.x = e.array[t],
  38928. this.y = e.array[t + 1],
  38929. this.z = e.array[t + 2],
  38930. this.w = e.array[t + 3],
  38931. this
  38932. }
  38933. },
  38934. Ci.Euler = function(e, t, i, n) {
  38935. this._x = e || 0,
  38936. this._y = t || 0,
  38937. this._z = i || 0,
  38938. this._order = n || Ci.Euler.DefaultOrder
  38939. }
  38940. ,
  38941. Ci.Euler.RotationOrders = ["XYZ", "YZX", "ZXY", "XZY", "YXZ", "ZYX"],
  38942. Ci.Euler.DefaultOrder = "XYZ",
  38943. Ci.Euler.prototype = {
  38944. constructor: Ci.Euler,
  38945. get x() {
  38946. return this._x
  38947. },
  38948. set x(e) {
  38949. this._x = e,
  38950. this.onChangeCallback()
  38951. },
  38952. get y() {
  38953. return this._y
  38954. },
  38955. set y(e) {
  38956. this._y = e,
  38957. this.onChangeCallback()
  38958. },
  38959. get z() {
  38960. return this._z
  38961. },
  38962. set z(e) {
  38963. this._z = e,
  38964. this.onChangeCallback()
  38965. },
  38966. get order() {
  38967. return this._order
  38968. },
  38969. set order(e) {
  38970. this._order = e,
  38971. this.onChangeCallback()
  38972. },
  38973. set: function(e, t, i, n) {
  38974. return this._x = e,
  38975. this._y = t,
  38976. this._z = i,
  38977. this._order = n || this._order,
  38978. this.onChangeCallback(),
  38979. this
  38980. },
  38981. clone: function() {
  38982. return new this.constructor(this._x,this._y,this._z,this._order)
  38983. },
  38984. copy: function(e) {
  38985. return this._x = e._x,
  38986. this._y = e._y,
  38987. this._z = e._z,
  38988. this._order = e._order,
  38989. this.onChangeCallback(),
  38990. this
  38991. },
  38992. toObject: function() {//xzw
  38993. return {x:this.x,y:this.y,z:this.z}
  38994. },
  38995. setFromRotationMatrix: function(e, t, i) {
  38996. var n = Ci.Math.clamp
  38997. , r = e.elements
  38998. , o = r[0]
  38999. , a = r[4]
  39000. , s = r[8]
  39001. , l = r[1]
  39002. , c = r[5]
  39003. , h = r[9]
  39004. , u = r[2]
  39005. , d = r[6]
  39006. , p = r[10];
  39007. return "XYZ" === (t = t || this._order) ? (this._y = Math.asin(n(s, -1, 1)),
  39008. Math.abs(s) < .99999 ? (this._x = Math.atan2(-h, p),
  39009. this._z = Math.atan2(-a, o)) : (this._x = Math.atan2(d, c),
  39010. this._z = 0)) : "YXZ" === t ? (this._x = Math.asin(-n(h, -1, 1)),
  39011. Math.abs(h) < .99999 ? (this._y = Math.atan2(s, p),
  39012. this._z = Math.atan2(l, c)) : (this._y = Math.atan2(-u, o),
  39013. this._z = 0)) : "ZXY" === t ? (this._x = Math.asin(n(d, -1, 1)),
  39014. Math.abs(d) < .99999 ? (this._y = Math.atan2(-u, p),
  39015. this._z = Math.atan2(-a, c)) : (this._y = 0,
  39016. this._z = Math.atan2(l, o))) : "ZYX" === t ? (this._y = Math.asin(-n(u, -1, 1)),
  39017. Math.abs(u) < .99999 ? (this._x = Math.atan2(d, p),
  39018. this._z = Math.atan2(l, o)) : (this._x = 0,
  39019. this._z = Math.atan2(-a, c))) : "YZX" === t ? (this._z = Math.asin(n(l, -1, 1)),
  39020. Math.abs(l) < .99999 ? (this._x = Math.atan2(-h, c),
  39021. this._y = Math.atan2(-u, o)) : (this._x = 0,
  39022. this._y = Math.atan2(s, p))) : "XZY" === t ? (this._z = Math.asin(-n(a, -1, 1)),
  39023. Math.abs(a) < .99999 ? (this._x = Math.atan2(d, c),
  39024. this._y = Math.atan2(s, o)) : (this._x = Math.atan2(-h, p),
  39025. this._y = 0)) : console.warn("THREE.Euler: .setFromRotationMatrix() given unsupported order: " + t),
  39026. this._order = t,
  39027. !1 !== i && this.onChangeCallback(),
  39028. this
  39029. },
  39030. setFromQuaternion: function(e, t, i) {
  39031. return void 0 === Ee && (Ee = new Ci.Matrix4),
  39032. Ee.makeRotationFromQuaternion(e),
  39033. this.setFromRotationMatrix(Ee, t, i),
  39034. this
  39035. },
  39036. setFromVector3: function(e, t) {
  39037. return this.set(e.x, e.y, e.z, t || this._order)
  39038. },
  39039. reorder: (Ie = new Ci.Quaternion,
  39040. function(e) {
  39041. Ie.setFromEuler(this),
  39042. this.setFromQuaternion(Ie, e)
  39043. }
  39044. ),
  39045. equals: function(e) {
  39046. return e._x === this._x && e._y === this._y && e._z === this._z && e._order === this._order
  39047. },
  39048. fromArray: function(e) {
  39049. return this._x = e[0],
  39050. this._y = e[1],
  39051. this._z = e[2],
  39052. void 0 !== e[3] && (this._order = e[3]),
  39053. this.onChangeCallback(),
  39054. this
  39055. },
  39056. toArray: function(e, t) {
  39057. return void 0 === e && (e = []),
  39058. void 0 === t && (t = 0),
  39059. e[t] = this._x,
  39060. e[t + 1] = this._y,
  39061. e[t + 2] = this._z,
  39062. e[t + 3] = this._order,
  39063. e
  39064. },
  39065. toVector3: function(e) {
  39066. return e ? e.set(this._x, this._y, this._z) : new Ci.Vector3(this._x,this._y,this._z)
  39067. },
  39068. onChange: function(e) {
  39069. return this.onChangeCallback = e,
  39070. this
  39071. },
  39072. onChangeCallback: function() {}
  39073. },
  39074. Ci.Line3 = function(e, t) {
  39075. this.start = void 0 !== e ? e : new Ci.Vector3,
  39076. this.end = void 0 !== t ? t : new Ci.Vector3
  39077. }
  39078. ,
  39079. Ci.Line3.prototype = {
  39080. constructor: Ci.Line3,
  39081. set: function(e, t) {
  39082. return this.start.copy(e),
  39083. this.end.copy(t),
  39084. this
  39085. },
  39086. clone: function() {
  39087. return (new this.constructor).copy(this)
  39088. },
  39089. copy: function(e) {
  39090. return this.start.copy(e.start),
  39091. this.end.copy(e.end),
  39092. this
  39093. },
  39094. center: function(e) {
  39095. return (e || new Ci.Vector3).addVectors(this.start, this.end).multiplyScalar(.5)
  39096. },
  39097. delta: function(e) {
  39098. return (e || new Ci.Vector3).subVectors(this.end, this.start)
  39099. },
  39100. distanceSq: function() {
  39101. return this.start.distanceToSquared(this.end)
  39102. },
  39103. distance: function() {
  39104. return this.start.distanceTo(this.end)
  39105. },
  39106. at: function(e, t) {
  39107. var i = t || new Ci.Vector3;
  39108. return this.delta(i).multiplyScalar(e).add(this.start)
  39109. },
  39110. closestPointToPointParameter: (Ae = new Ci.Vector3,
  39111. Ce = new Ci.Vector3,
  39112. function(e, t) {
  39113. Ae.subVectors(e, this.start),
  39114. Ce.subVectors(this.end, this.start);
  39115. var i = Ce.dot(Ce)
  39116. , n = Ce.dot(Ae) / i;
  39117. return t && (n = Ci.Math.clamp(n, 0, 1)),
  39118. n
  39119. }
  39120. ),
  39121. closestPointToPoint: function(e, t, i) {
  39122. var n = this.closestPointToPointParameter(e, t)
  39123. , r = i || new Ci.Vector3;
  39124. return this.delta(r).multiplyScalar(n).add(this.start)
  39125. },
  39126. applyMatrix4: function(e) {
  39127. return this.start.applyMatrix4(e),
  39128. this.end.applyMatrix4(e),
  39129. this
  39130. },
  39131. equals: function(e) {
  39132. return e.start.equals(this.start) && e.end.equals(this.end)
  39133. }
  39134. },
  39135. Ci.Box2 = function(e, t) {
  39136. this.min = void 0 !== e ? e : new Ci.Vector2(1 / 0,1 / 0),
  39137. this.max = void 0 !== t ? t : new Ci.Vector2(-1 / 0,-1 / 0)
  39138. }
  39139. ,
  39140. Ci.Box2.prototype = {
  39141. constructor: Ci.Box2,
  39142. set: function(e, t) {
  39143. return this.min.copy(e),
  39144. this.max.copy(t),
  39145. this
  39146. },
  39147. setFromPoints: function(e) {
  39148. this.makeEmpty();
  39149. for (var t = 0, i = e.length; t < i; t++)
  39150. this.expandByPoint(e[t]);
  39151. return this
  39152. },
  39153. setFromCenterAndSize: (ye = new Ci.Vector2,
  39154. function(e, t) {
  39155. var i = ye.copy(t).multiplyScalar(.5);
  39156. return this.min.copy(e).sub(i),
  39157. this.max.copy(e).add(i),
  39158. this
  39159. }
  39160. ),
  39161. clone: function() {
  39162. return (new this.constructor).copy(this)
  39163. },
  39164. copy: function(e) {
  39165. return this.min.copy(e.min),
  39166. this.max.copy(e.max),
  39167. this
  39168. },
  39169. makeEmpty: function() {
  39170. return this.min.x = this.min.y = 1 / 0,
  39171. this.max.x = this.max.y = -1 / 0,
  39172. this
  39173. },
  39174. isEmpty: function() {
  39175. return this.max.x < this.min.x || this.max.y < this.min.y
  39176. },
  39177. center: function(e) {
  39178. return (e || new Ci.Vector2).addVectors(this.min, this.max).multiplyScalar(.5)
  39179. },
  39180. size: function(e) {
  39181. return (e || new Ci.Vector2).subVectors(this.max, this.min)
  39182. },
  39183. expandByPoint: function(e) {
  39184. return this.min.min(e),
  39185. this.max.max(e),
  39186. this
  39187. },
  39188. expandByVector: function(e) {
  39189. return this.min.sub(e),
  39190. this.max.add(e),
  39191. this
  39192. },
  39193. expandByScalar: function(e) {
  39194. return this.min.addScalar(-e),
  39195. this.max.addScalar(e),
  39196. this
  39197. },
  39198. containsPoint: function(e) {
  39199. return !(e.x < this.min.x || e.x > this.max.x || e.y < this.min.y || e.y > this.max.y)
  39200. },
  39201. containsBox: function(e) {
  39202. 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
  39203. },
  39204. getParameter: function(e, t) {
  39205. 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))
  39206. },
  39207. intersectsBox: function(e) {
  39208. 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)
  39209. },
  39210. clampPoint: function(e, t) {
  39211. return (t || new Ci.Vector2).copy(e).clamp(this.min, this.max)
  39212. },
  39213. distanceToPoint: (ve = new Ci.Vector2,
  39214. function(e) {
  39215. return ve.copy(e).clamp(this.min, this.max).sub(e).length()
  39216. }
  39217. ),
  39218. intersect: function(e) {
  39219. return this.min.max(e.min),
  39220. this.max.min(e.max),
  39221. this
  39222. },
  39223. union: function(e) {
  39224. return this.min.min(e.min),
  39225. this.max.max(e.max),
  39226. this
  39227. },
  39228. translate: function(e) {
  39229. return this.min.add(e),
  39230. this.max.add(e),
  39231. this
  39232. },
  39233. equals: function(e) {
  39234. return e.min.equals(this.min) && e.max.equals(this.max)
  39235. }
  39236. },
  39237. Ci.Box3 = function(e, t) {
  39238. this.min = void 0 !== e ? e : new Ci.Vector3(1 / 0,1 / 0,1 / 0),
  39239. this.max = void 0 !== t ? t : new Ci.Vector3(-1 / 0,-1 / 0,-1 / 0)
  39240. }
  39241. ,
  39242. Ci.Box3.prototype = {
  39243. constructor: Ci.Box3,
  39244. set: function(e, t) {
  39245. return this.min.copy(e),
  39246. this.max.copy(t),
  39247. this
  39248. },
  39249. setFromArray: function(e) {
  39250. this.makeEmpty();
  39251. 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) {
  39252. var c = e[s]
  39253. , h = e[s + 1]
  39254. , u = e[s + 2];
  39255. c < t && (t = c),
  39256. h < i && (i = h),
  39257. u < n && (n = u),
  39258. r < c && (r = c),
  39259. o < h && (o = h),
  39260. a < u && (a = u)
  39261. }
  39262. this.min.set(t, i, n),
  39263. this.max.set(r, o, a)
  39264. },
  39265. setFromPoints: function(e) {
  39266. this.makeEmpty();
  39267. for (var t = 0, i = e.length; t < i; t++)
  39268. this.expandByPoint(e[t]);
  39269. return this
  39270. },
  39271. setFromCenterAndSize: (me = new Ci.Vector3,
  39272. function(e, t) {
  39273. var i = me.copy(t).multiplyScalar(.5);
  39274. return this.min.copy(e).sub(i),
  39275. this.max.copy(e).add(i),
  39276. this
  39277. }
  39278. ),
  39279. setFromObject: function(e) {
  39280. void 0 === ge && (ge = new Ci.Box3);
  39281. var i = this;
  39282. return this.makeEmpty(),
  39283. e.updateMatrixWorld(!0),
  39284. e.traverse(function(e) {
  39285. var t = e.geometry;
  39286. void 0 !== t && (null === t.boundingBox && t.computeBoundingBox(),
  39287. !1 === t.boundingBox.isEmpty() && (ge.copy(t.boundingBox),
  39288. ge.applyMatrix4(e.matrixWorld),
  39289. i.union(ge)))
  39290. }),
  39291. this
  39292. },
  39293. clone: function() {
  39294. return (new this.constructor).copy(this)
  39295. },
  39296. copy: function(e) {
  39297. return this.min.copy(e.min),
  39298. this.max.copy(e.max),
  39299. this
  39300. },
  39301. makeEmpty: function() {
  39302. return this.min.x = this.min.y = this.min.z = 1 / 0,
  39303. this.max.x = this.max.y = this.max.z = -1 / 0,
  39304. this
  39305. },
  39306. isEmpty: function() {
  39307. return this.max.x < this.min.x || this.max.y < this.min.y || this.max.z < this.min.z
  39308. },
  39309. center: function(e) {
  39310. return (e || new Ci.Vector3).addVectors(this.min, this.max).multiplyScalar(.5)
  39311. },
  39312. size: function(e) {
  39313. return (e || new Ci.Vector3).subVectors(this.max, this.min)
  39314. },
  39315. expandByPoint: function(e) {
  39316. return this.min.min(e),
  39317. this.max.max(e),
  39318. this
  39319. },
  39320. expandByVector: function(e) {
  39321. return this.min.sub(e),
  39322. this.max.add(e),
  39323. this
  39324. },
  39325. expandByScalar: function(e) {
  39326. return this.min.addScalar(-e),
  39327. this.max.addScalar(e),
  39328. this
  39329. },
  39330. containsPoint: function(e) {
  39331. 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)
  39332. },
  39333. containsBox: function(e) {
  39334. 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
  39335. },
  39336. getParameter: function(e, t) {
  39337. 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))
  39338. },
  39339. intersectsBox: function(e) {
  39340. 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)
  39341. },
  39342. intersectsSphere: function(e) {
  39343. return void 0 === fe && (fe = new Ci.Vector3),
  39344. this.clampPoint(e.center, fe),
  39345. fe.distanceToSquared(e.center) <= e.radius * e.radius
  39346. },
  39347. intersectsPlane: function(e) {
  39348. var t, i;
  39349. return i = 0 < e.normal.x ? (t = e.normal.x * this.min.x,
  39350. e.normal.x * this.max.x) : (t = e.normal.x * this.max.x,
  39351. e.normal.x * this.min.x),
  39352. 0 < e.normal.y ? (t += e.normal.y * this.min.y,
  39353. i += e.normal.y * this.max.y) : (t += e.normal.y * this.max.y,
  39354. i += e.normal.y * this.min.y),
  39355. 0 < e.normal.z ? (t += e.normal.z * this.min.z,
  39356. i += e.normal.z * this.max.z) : (t += e.normal.z * this.max.z,
  39357. i += e.normal.z * this.min.z),
  39358. t <= e.constant && i >= e.constant
  39359. },
  39360. clampPoint: function(e, t) {
  39361. return (t || new Ci.Vector3).copy(e).clamp(this.min, this.max)
  39362. },
  39363. distanceToPoint: (pe = new Ci.Vector3,
  39364. function(e) {
  39365. return pe.copy(e).clamp(this.min, this.max).sub(e).length()
  39366. }
  39367. ),
  39368. getBoundingSphere: (de = new Ci.Vector3,
  39369. function(e) {
  39370. var t = e || new Ci.Sphere;
  39371. return t.center = this.center(),
  39372. t.radius = .5 * this.size(de).length(),
  39373. t
  39374. }
  39375. ),
  39376. intersect: function(e) {
  39377. return this.min.max(e.min),
  39378. this.max.min(e.max),
  39379. this
  39380. },
  39381. union: function(e) {
  39382. return this.min.min(e.min),
  39383. this.max.max(e.max),
  39384. this
  39385. },
  39386. 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],
  39387. function(e) {
  39388. return ue[0].set(this.min.x, this.min.y, this.min.z).applyMatrix4(e),
  39389. ue[1].set(this.min.x, this.min.y, this.max.z).applyMatrix4(e),
  39390. ue[2].set(this.min.x, this.max.y, this.min.z).applyMatrix4(e),
  39391. ue[3].set(this.min.x, this.max.y, this.max.z).applyMatrix4(e),
  39392. ue[4].set(this.max.x, this.min.y, this.min.z).applyMatrix4(e),
  39393. ue[5].set(this.max.x, this.min.y, this.max.z).applyMatrix4(e),
  39394. ue[6].set(this.max.x, this.max.y, this.min.z).applyMatrix4(e),
  39395. ue[7].set(this.max.x, this.max.y, this.max.z).applyMatrix4(e),
  39396. this.makeEmpty(),
  39397. this.setFromPoints(ue),
  39398. this
  39399. }
  39400. ),
  39401. translate: function(e) {
  39402. return this.min.add(e),
  39403. this.max.add(e),
  39404. this
  39405. },
  39406. equals: function(e) {
  39407. return e.min.equals(this.min) && e.max.equals(this.max)
  39408. }
  39409. },
  39410. Ci.Matrix3 = function() {
  39411. this.elements = new Float32Array([1, 0, 0, 0, 1, 0, 0, 0, 1]),
  39412. 0 < arguments.length && console.error("THREE.Matrix3: the constructor no longer reads arguments. use .set() instead.")
  39413. }
  39414. ,
  39415. Ci.Matrix3.prototype = {
  39416. constructor: Ci.Matrix3,
  39417. set: function(e, t, i, n, r, o, a, s, l) {
  39418. var c = this.elements;
  39419. return c[0] = e,
  39420. c[1] = n,
  39421. c[2] = a,
  39422. c[3] = t,
  39423. c[4] = r,
  39424. c[5] = s,
  39425. c[6] = i,
  39426. c[7] = o,
  39427. c[8] = l,
  39428. this
  39429. },
  39430. identity: function() {
  39431. return this.set(1, 0, 0, 0, 1, 0, 0, 0, 1),
  39432. this
  39433. },
  39434. clone: function() {
  39435. return (new this.constructor).fromArray(this.elements)
  39436. },
  39437. copy: function(e) {
  39438. var t = e.elements;
  39439. return this.set(t[0], t[3], t[6], t[1], t[4], t[7], t[2], t[5], t[8]),
  39440. this
  39441. },
  39442. setFromMatrix4: function(e) {
  39443. var t = e.elements;
  39444. return this.set(t[0], t[4], t[8], t[1], t[5], t[9], t[2], t[6], t[10]),
  39445. this
  39446. },
  39447. applyToVector3Array: function(e, t, i) {
  39448. void 0 === he && (he = new Ci.Vector3),
  39449. void 0 === t && (t = 0),
  39450. void 0 === i && (i = e.length);
  39451. for (var n = 0, r = t; n < i; n += 3,
  39452. r += 3)
  39453. he.fromArray(e, r),
  39454. he.applyMatrix3(this),
  39455. he.toArray(e, r);
  39456. return e
  39457. },
  39458. applyToBuffer: function(e, t, i) {
  39459. void 0 === ce && (ce = new Ci.Vector3),
  39460. void 0 === t && (t = 0),
  39461. void 0 === i && (i = e.length / e.itemSize);
  39462. for (var n = 0, r = t; n < i; n++,
  39463. r++)
  39464. ce.x = e.getX(r),
  39465. ce.y = e.getY(r),
  39466. ce.z = e.getZ(r),
  39467. ce.applyMatrix3(this),
  39468. e.setXYZ(ce.x, ce.y, ce.z);
  39469. return e
  39470. },
  39471. multiplyScalar: function(e) {
  39472. var t = this.elements;
  39473. return t[0] *= e,
  39474. t[3] *= e,
  39475. t[6] *= e,
  39476. t[1] *= e,
  39477. t[4] *= e,
  39478. t[7] *= e,
  39479. t[2] *= e,
  39480. t[5] *= e,
  39481. t[8] *= e,
  39482. this
  39483. },
  39484. determinant: function() {
  39485. var e = this.elements
  39486. , t = e[0]
  39487. , i = e[1]
  39488. , n = e[2]
  39489. , r = e[3]
  39490. , o = e[4]
  39491. , a = e[5]
  39492. , s = e[6]
  39493. , l = e[7]
  39494. , c = e[8];
  39495. return t * o * c - t * a * l - i * r * c + i * a * s + n * r * l - n * o * s
  39496. },
  39497. getInverse: function(e, t) {
  39498. e instanceof Ci.Matrix4 && console.warn("THREE.Matrix3.getInverse no longer takes a Matrix4 argument.");
  39499. var i = e.elements
  39500. , n = this.elements
  39501. , r = i[0]
  39502. , o = i[1]
  39503. , a = i[2]
  39504. , s = i[3]
  39505. , l = i[4]
  39506. , c = i[5]
  39507. , h = i[6]
  39508. , u = i[7]
  39509. , d = i[8]
  39510. , p = d * l - c * u
  39511. , f = c * h - d * s
  39512. , g = u * s - l * h
  39513. , m = r * p + o * f + a * g;
  39514. if (0 != m)
  39515. return n[0] = p,
  39516. n[1] = a * u - d * o,
  39517. n[2] = c * o - a * l,
  39518. n[3] = f,
  39519. n[4] = d * r - a * h,
  39520. n[5] = a * s - c * r,
  39521. n[6] = g,
  39522. n[7] = o * h - u * r,
  39523. n[8] = l * r - o * s,
  39524. this.multiplyScalar(1 / m);
  39525. var v = "THREE.Matrix3.getInverse(): can't invert matrix, determinant is 0";
  39526. if (t)
  39527. throw new Error(v);
  39528. return this.identity()/* console.warn(v), *///许钟文删 boxHelper报的
  39529. },
  39530. transpose: function() {
  39531. var e, t = this.elements;
  39532. return e = t[1],
  39533. t[1] = t[3],
  39534. t[3] = e,
  39535. e = t[2],
  39536. t[2] = t[6],
  39537. t[6] = e,
  39538. e = t[5],
  39539. t[5] = t[7],
  39540. t[7] = e,
  39541. this
  39542. },
  39543. flattenToArrayOffset: function(e, t) {
  39544. var i = this.elements;
  39545. return e[t] = i[0],
  39546. e[t + 1] = i[1],
  39547. e[t + 2] = i[2],
  39548. e[t + 3] = i[3],
  39549. e[t + 4] = i[4],
  39550. e[t + 5] = i[5],
  39551. e[t + 6] = i[6],
  39552. e[t + 7] = i[7],
  39553. e[t + 8] = i[8],
  39554. e
  39555. },
  39556. getNormalMatrix: function(e) {
  39557. return this.setFromMatrix4(e).getInverse(this).transpose()
  39558. },
  39559. transposeIntoArray: function(e) {
  39560. var t = this.elements;
  39561. return e[0] = t[0],
  39562. e[1] = t[3],
  39563. e[2] = t[6],
  39564. e[3] = t[1],
  39565. e[4] = t[4],
  39566. e[5] = t[7],
  39567. e[6] = t[2],
  39568. e[7] = t[5],
  39569. e[8] = t[8],
  39570. this
  39571. },
  39572. fromArray: function(e) {
  39573. return this.elements.set(e),
  39574. this
  39575. },
  39576. toArray: function() {
  39577. var e = this.elements;
  39578. return [e[0], e[1], e[2], e[3], e[4], e[5], e[6], e[7], e[8]]
  39579. }
  39580. },
  39581. Ci.Matrix4 = function() {
  39582. this.elements = new Float32Array([1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1]),
  39583. 0 < arguments.length && console.error("THREE.Matrix4: the constructor no longer reads arguments. use .set() instead.")
  39584. }
  39585. ,
  39586. Ci.Matrix4.prototype = {
  39587. constructor: Ci.Matrix4,
  39588. set: function(e, t, i, n, r, o, a, s, l, c, h, u, d, p, f, g) {
  39589. var m = this.elements;
  39590. return m[0] = e,
  39591. m[4] = t,
  39592. m[8] = i,
  39593. m[12] = n,
  39594. m[1] = r,
  39595. m[5] = o,
  39596. m[9] = a,
  39597. m[13] = s,
  39598. m[2] = l,
  39599. m[6] = c,
  39600. m[10] = h,
  39601. m[14] = u,
  39602. m[3] = d,
  39603. m[7] = p,
  39604. m[11] = f,
  39605. m[15] = g,
  39606. this
  39607. },
  39608. identity: function() {
  39609. return this.set(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1),
  39610. this
  39611. },
  39612. clone: function() {
  39613. return (new Ci.Matrix4).fromArray(this.elements)
  39614. },
  39615. copy: function(e) {
  39616. return this.elements.set(e.elements),
  39617. this
  39618. },
  39619. copyPosition: function(e) {
  39620. var t = this.elements
  39621. , i = e.elements;
  39622. return t[12] = i[12],
  39623. t[13] = i[13],
  39624. t[14] = i[14],
  39625. this
  39626. },
  39627. extractBasis: function(e, t, i) {
  39628. return e.setFromMatrixColumn(this, 0),
  39629. t.setFromMatrixColumn(this, 1),
  39630. i.setFromMatrixColumn(this, 2),
  39631. this
  39632. },
  39633. makeBasis: function(e, t, i) {
  39634. 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),
  39635. this
  39636. },
  39637. extractRotation: function(e) {
  39638. void 0 === le && (le = new Ci.Vector3);
  39639. var t = this.elements
  39640. , i = e.elements
  39641. , n = 1 / le.setFromMatrixColumn(e, 0).length()
  39642. , r = 1 / le.setFromMatrixColumn(e, 1).length()
  39643. , o = 1 / le.setFromMatrixColumn(e, 2).length();
  39644. return t[0] = i[0] * n,
  39645. t[1] = i[1] * n,
  39646. t[2] = i[2] * n,
  39647. t[4] = i[4] * r,
  39648. t[5] = i[5] * r,
  39649. t[6] = i[6] * r,
  39650. t[8] = i[8] * o,
  39651. t[9] = i[9] * o,
  39652. t[10] = i[10] * o,
  39653. this
  39654. },
  39655. makeRotationFromEuler: function(e) {
  39656. e instanceof Ci.Euler == 0 && console.error("THREE.Matrix: .makeRotationFromEuler() now expects a Euler rotation rather than a Vector3 and order.");
  39657. var t = this.elements
  39658. , i = e.x
  39659. , n = e.y
  39660. , r = e.z
  39661. , o = Math.cos(i)
  39662. , a = Math.sin(i)
  39663. , s = Math.cos(n)
  39664. , l = Math.sin(n)
  39665. , c = Math.cos(r)
  39666. , h = Math.sin(r);
  39667. if ("XYZ" === e.order) {
  39668. var u = o * c
  39669. , d = o * h
  39670. , p = a * c
  39671. , f = a * h;
  39672. t[0] = s * c,
  39673. t[4] = -s * h,
  39674. t[8] = l,
  39675. t[1] = d + p * l,
  39676. t[5] = u - f * l,
  39677. t[9] = -a * s,
  39678. t[2] = f - u * l,
  39679. t[6] = p + d * l,
  39680. t[10] = o * s
  39681. } else if ("YXZ" === e.order) {
  39682. var g = s * c
  39683. , m = s * h
  39684. , v = l * c
  39685. , y = l * h;
  39686. t[0] = g + y * a,
  39687. t[4] = v * a - m,
  39688. t[8] = o * l,
  39689. t[1] = o * h,
  39690. t[5] = o * c,
  39691. t[9] = -a,
  39692. t[2] = m * a - v,
  39693. t[6] = y + g * a,
  39694. t[10] = o * s
  39695. } else if ("ZXY" === e.order) {
  39696. g = s * c,
  39697. m = s * h,
  39698. v = l * c,
  39699. y = l * h;
  39700. t[0] = g - y * a,
  39701. t[4] = -o * h,
  39702. t[8] = v + m * a,
  39703. t[1] = m + v * a,
  39704. t[5] = o * c,
  39705. t[9] = y - g * a,
  39706. t[2] = -o * l,
  39707. t[6] = a,
  39708. t[10] = o * s
  39709. } else if ("ZYX" === e.order) {
  39710. u = o * c,
  39711. d = o * h,
  39712. p = a * c,
  39713. f = a * h;
  39714. t[0] = s * c,
  39715. t[4] = p * l - d,
  39716. t[8] = u * l + f,
  39717. t[1] = s * h,
  39718. t[5] = f * l + u,
  39719. t[9] = d * l - p,
  39720. t[2] = -l,
  39721. t[6] = a * s,
  39722. t[10] = o * s
  39723. } else if ("YZX" === e.order) {
  39724. var A = o * s
  39725. , C = o * l
  39726. , I = a * s
  39727. , E = a * l;
  39728. t[0] = s * c,
  39729. t[4] = E - A * h,
  39730. t[8] = I * h + C,
  39731. t[1] = h,
  39732. t[5] = o * c,
  39733. t[9] = -a * c,
  39734. t[2] = -l * c,
  39735. t[6] = C * h + I,
  39736. t[10] = A - E * h
  39737. } else if ("XZY" === e.order) {
  39738. A = o * s,
  39739. C = o * l,
  39740. I = a * s,
  39741. E = a * l;
  39742. t[0] = s * c,
  39743. t[4] = -h,
  39744. t[8] = l * c,
  39745. t[1] = A * h + E,
  39746. t[5] = o * c,
  39747. t[9] = C * h - I,
  39748. t[2] = I * h - C,
  39749. t[6] = a * c,
  39750. t[10] = E * h + A
  39751. }
  39752. return t[3] = 0,
  39753. t[7] = 0,
  39754. t[11] = 0,
  39755. t[12] = 0,
  39756. t[13] = 0,
  39757. t[14] = 0,
  39758. t[15] = 1,
  39759. this
  39760. },
  39761. makeRotationFromQuaternion: function(e) {
  39762. var t = this.elements
  39763. , i = e.x
  39764. , n = e.y
  39765. , r = e.z
  39766. , o = e.w
  39767. , a = i + i
  39768. , s = n + n
  39769. , l = r + r
  39770. , c = i * a
  39771. , h = i * s
  39772. , u = i * l
  39773. , d = n * s
  39774. , p = n * l
  39775. , f = r * l
  39776. , g = o * a
  39777. , m = o * s
  39778. , v = o * l;
  39779. return t[0] = 1 - (d + f),
  39780. t[4] = h - v,
  39781. t[8] = u + m,
  39782. t[1] = h + v,
  39783. t[5] = 1 - (c + f),
  39784. t[9] = p - g,
  39785. t[2] = u - m,
  39786. t[6] = p + g,
  39787. t[10] = 1 - (c + d),
  39788. t[3] = 0,
  39789. t[7] = 0,
  39790. t[11] = 0,
  39791. t[12] = 0,
  39792. t[13] = 0,
  39793. t[14] = 0,
  39794. t[15] = 1,
  39795. this
  39796. },
  39797. lookAt: function(e, t, i) {
  39798. void 0 === oe && (oe = new Ci.Vector3),
  39799. void 0 === ae && (ae = new Ci.Vector3),
  39800. void 0 === se && (se = new Ci.Vector3);
  39801. var n = this.elements;
  39802. return se.subVectors(e, t).normalize(),
  39803. 0 === se.lengthSq() && (se.z = 1),
  39804. oe.crossVectors(i, se).normalize(),
  39805. 0 === oe.lengthSq() && (se.x += 1e-4,
  39806. oe.crossVectors(i, se).normalize()),
  39807. ae.crossVectors(se, oe),
  39808. n[0] = oe.x,
  39809. n[4] = ae.x,
  39810. n[8] = se.x,
  39811. n[1] = oe.y,
  39812. n[5] = ae.y,
  39813. n[9] = se.y,
  39814. n[2] = oe.z,
  39815. n[6] = ae.z,
  39816. n[10] = se.z,
  39817. this
  39818. },
  39819. multiply: function(e, t) {
  39820. return void 0 !== t ? (console.warn("THREE.Matrix4: .multiply() now only accepts one argument. Use .multiplyMatrices( a, b ) instead."),
  39821. this.multiplyMatrices(e, t)) : this.multiplyMatrices(this, e)
  39822. },
  39823. multiplyMatrices: function(e, t) {
  39824. var i = e.elements
  39825. , n = t.elements
  39826. , r = this.elements
  39827. , o = i[0]
  39828. , a = i[4]
  39829. , s = i[8]
  39830. , l = i[12]
  39831. , c = i[1]
  39832. , h = i[5]
  39833. , u = i[9]
  39834. , d = i[13]
  39835. , p = i[2]
  39836. , f = i[6]
  39837. , g = i[10]
  39838. , m = i[14]
  39839. , v = i[3]
  39840. , y = i[7]
  39841. , A = i[11]
  39842. , C = i[15]
  39843. , I = n[0]
  39844. , E = n[4]
  39845. , _ = n[8]
  39846. , b = n[12]
  39847. , w = n[1]
  39848. , T = n[5]
  39849. , x = n[9]
  39850. , S = n[13]
  39851. , M = n[2]
  39852. , R = n[6]
  39853. , P = n[10]
  39854. , O = n[14]
  39855. , L = n[3]
  39856. , D = n[7]
  39857. , N = n[11]
  39858. , F = n[15];
  39859. return r[0] = o * I + a * w + s * M + l * L,
  39860. r[4] = o * E + a * T + s * R + l * D,
  39861. r[8] = o * _ + a * x + s * P + l * N,
  39862. r[12] = o * b + a * S + s * O + l * F,
  39863. r[1] = c * I + h * w + u * M + d * L,
  39864. r[5] = c * E + h * T + u * R + d * D,
  39865. r[9] = c * _ + h * x + u * P + d * N,
  39866. r[13] = c * b + h * S + u * O + d * F,
  39867. r[2] = p * I + f * w + g * M + m * L,
  39868. r[6] = p * E + f * T + g * R + m * D,
  39869. r[10] = p * _ + f * x + g * P + m * N,
  39870. r[14] = p * b + f * S + g * O + m * F,
  39871. r[3] = v * I + y * w + A * M + C * L,
  39872. r[7] = v * E + y * T + A * R + C * D,
  39873. r[11] = v * _ + y * x + A * P + C * N,
  39874. r[15] = v * b + y * S + A * O + C * F,
  39875. this
  39876. },
  39877. multiplyToArray: function(e, t, i) {
  39878. var n = this.elements;
  39879. return this.multiplyMatrices(e, t),
  39880. i[0] = n[0],
  39881. i[1] = n[1],
  39882. i[2] = n[2],
  39883. i[3] = n[3],
  39884. i[4] = n[4],
  39885. i[5] = n[5],
  39886. i[6] = n[6],
  39887. i[7] = n[7],
  39888. i[8] = n[8],
  39889. i[9] = n[9],
  39890. i[10] = n[10],
  39891. i[11] = n[11],
  39892. i[12] = n[12],
  39893. i[13] = n[13],
  39894. i[14] = n[14],
  39895. i[15] = n[15],
  39896. this
  39897. },
  39898. multiplyScalar: function(e) {
  39899. var t = this.elements;
  39900. return t[0] *= e,
  39901. t[4] *= e,
  39902. t[8] *= e,
  39903. t[12] *= e,
  39904. t[1] *= e,
  39905. t[5] *= e,
  39906. t[9] *= e,
  39907. t[13] *= e,
  39908. t[2] *= e,
  39909. t[6] *= e,
  39910. t[10] *= e,
  39911. t[14] *= e,
  39912. t[3] *= e,
  39913. t[7] *= e,
  39914. t[11] *= e,
  39915. t[15] *= e,
  39916. this
  39917. },
  39918. applyToVector3Array: function(e, t, i) {
  39919. void 0 === re && (re = new Ci.Vector3),
  39920. void 0 === t && (t = 0),
  39921. void 0 === i && (i = e.length);
  39922. for (var n = 0, r = t; n < i; n += 3,
  39923. r += 3)
  39924. re.fromArray(e, r),
  39925. re.applyMatrix4(this),
  39926. re.toArray(e, r);
  39927. return e
  39928. },
  39929. applyToBuffer: function(e, t, i) {
  39930. void 0 === ne && (ne = new Ci.Vector3),
  39931. void 0 === t && (t = 0),
  39932. void 0 === i && (i = e.length / e.itemSize);
  39933. for (var n = 0, r = t; n < i; n++,
  39934. r++)
  39935. ne.x = e.getX(r),
  39936. ne.y = e.getY(r),
  39937. ne.z = e.getZ(r),
  39938. ne.applyMatrix4(this),
  39939. e.setXYZ(ne.x, ne.y, ne.z);
  39940. return e
  39941. },
  39942. determinant: function() {
  39943. var e = this.elements
  39944. , t = e[0]
  39945. , i = e[4]
  39946. , n = e[8]
  39947. , r = e[12]
  39948. , o = e[1]
  39949. , a = e[5]
  39950. , s = e[9]
  39951. , l = e[13]
  39952. , c = e[2]
  39953. , h = e[6]
  39954. , u = e[10]
  39955. , d = e[14];
  39956. 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)
  39957. },
  39958. transpose: function() {
  39959. var e, t = this.elements;
  39960. return e = t[1],
  39961. t[1] = t[4],
  39962. t[4] = e,
  39963. e = t[2],
  39964. t[2] = t[8],
  39965. t[8] = e,
  39966. e = t[6],
  39967. t[6] = t[9],
  39968. t[9] = e,
  39969. e = t[3],
  39970. t[3] = t[12],
  39971. t[12] = e,
  39972. e = t[7],
  39973. t[7] = t[13],
  39974. t[13] = e,
  39975. e = t[11],
  39976. t[11] = t[14],
  39977. t[14] = e,
  39978. this
  39979. },
  39980. flattenToArrayOffset: function(e, t) {
  39981. var i = this.elements;
  39982. return e[t] = i[0],
  39983. e[t + 1] = i[1],
  39984. e[t + 2] = i[2],
  39985. e[t + 3] = i[3],
  39986. e[t + 4] = i[4],
  39987. e[t + 5] = i[5],
  39988. e[t + 6] = i[6],
  39989. e[t + 7] = i[7],
  39990. e[t + 8] = i[8],
  39991. e[t + 9] = i[9],
  39992. e[t + 10] = i[10],
  39993. e[t + 11] = i[11],
  39994. e[t + 12] = i[12],
  39995. e[t + 13] = i[13],
  39996. e[t + 14] = i[14],
  39997. e[t + 15] = i[15],
  39998. e
  39999. },
  40000. getPosition: function() {
  40001. return void 0 === ie && (ie = new Ci.Vector3),
  40002. console.warn("THREE.Matrix4: .getPosition() has been removed. Use Vector3.setFromMatrixPosition( matrix ) instead."),
  40003. ie.setFromMatrixColumn(this, 3)
  40004. },
  40005. setPosition: function(e) {
  40006. var t = this.elements;
  40007. return t[12] = e.x,
  40008. t[13] = e.y,
  40009. t[14] = e.z,
  40010. this
  40011. },
  40012. getInverse: function(e, t) {
  40013. var i = this.elements
  40014. , n = e.elements
  40015. , r = n[0]
  40016. , o = n[1]
  40017. , a = n[2]
  40018. , s = n[3]
  40019. , l = n[4]
  40020. , c = n[5]
  40021. , h = n[6]
  40022. , u = n[7]
  40023. , d = n[8]
  40024. , p = n[9]
  40025. , f = n[10]
  40026. , g = n[11]
  40027. , m = n[12]
  40028. , v = n[13]
  40029. , y = n[14]
  40030. , A = n[15]
  40031. , C = p * y * u - v * f * u + v * h * g - c * y * g - p * h * A + c * f * A
  40032. , I = m * f * u - d * y * u - m * h * g + l * y * g + d * h * A - l * f * A
  40033. , E = d * v * u - m * p * u + m * c * g - l * v * g - d * c * A + l * p * A
  40034. , _ = m * p * h - d * v * h - m * c * f + l * v * f + d * c * y - l * p * y
  40035. , b = r * C + o * I + a * E + s * _;
  40036. if (0 != b)
  40037. return i[0] = C,
  40038. i[1] = v * f * s - p * y * s - v * a * g + o * y * g + p * a * A - o * f * A,
  40039. i[2] = c * y * s - v * h * s + v * a * u - o * y * u - c * a * A + o * h * A,
  40040. i[3] = p * h * s - c * f * s - p * a * u + o * f * u + c * a * g - o * h * g,
  40041. i[4] = I,
  40042. i[5] = d * y * s - m * f * s + m * a * g - r * y * g - d * a * A + r * f * A,
  40043. i[6] = m * h * s - l * y * s - m * a * u + r * y * u + l * a * A - r * h * A,
  40044. i[7] = l * f * s - d * h * s + d * a * u - r * f * u - l * a * g + r * h * g,
  40045. i[8] = E,
  40046. i[9] = m * p * s - d * v * s - m * o * g + r * v * g + d * o * A - r * p * A,
  40047. i[10] = l * v * s - m * c * s + m * o * u - r * v * u - l * o * A + r * c * A,
  40048. i[11] = d * c * s - l * p * s - d * o * u + r * p * u + l * o * g - r * c * g,
  40049. i[12] = _,
  40050. i[13] = d * v * a - m * p * a + m * o * f - r * v * f - d * o * y + r * p * y,
  40051. i[14] = m * c * a - l * v * a - m * o * h + r * v * h + l * o * y - r * c * y,
  40052. i[15] = l * p * a - d * c * a + d * o * h - r * p * h - l * o * f + r * c * f,
  40053. this.multiplyScalar(1 / b);
  40054. var w = "THREE.Matrix4.getInverse(): can't invert matrix, determinant is 0";
  40055. if (t)
  40056. throw new Error(w);
  40057. return console.warn(w),
  40058. this.identity()
  40059. },
  40060. scale: function(e) {
  40061. var t = this.elements
  40062. , i = e.x
  40063. , n = e.y
  40064. , r = e.z;
  40065. return t[0] *= i,
  40066. t[4] *= n,
  40067. t[8] *= r,
  40068. t[1] *= i,
  40069. t[5] *= n,
  40070. t[9] *= r,
  40071. t[2] *= i,
  40072. t[6] *= n,
  40073. t[10] *= r,
  40074. t[3] *= i,
  40075. t[7] *= n,
  40076. t[11] *= r,
  40077. this
  40078. },
  40079. getMaxScaleOnAxis: function() {
  40080. var e = this.elements
  40081. , t = e[0] * e[0] + e[1] * e[1] + e[2] * e[2]
  40082. , i = e[4] * e[4] + e[5] * e[5] + e[6] * e[6]
  40083. , n = e[8] * e[8] + e[9] * e[9] + e[10] * e[10];
  40084. return Math.sqrt(Math.max(t, i, n))
  40085. },
  40086. makeTranslation: function(e, t, i) {
  40087. return this.set(1, 0, 0, e, 0, 1, 0, t, 0, 0, 1, i, 0, 0, 0, 1),
  40088. this
  40089. },
  40090. makeRotationX: function(e) {
  40091. var t = Math.cos(e)
  40092. , i = Math.sin(e);
  40093. return this.set(1, 0, 0, 0, 0, t, -i, 0, 0, i, t, 0, 0, 0, 0, 1),
  40094. this
  40095. },
  40096. makeRotationY: function(e) {
  40097. var t = Math.cos(e)
  40098. , i = Math.sin(e);
  40099. return this.set(t, 0, i, 0, 0, 1, 0, 0, -i, 0, t, 0, 0, 0, 0, 1),
  40100. this
  40101. },
  40102. makeRotationZ: function(e) {
  40103. var t = Math.cos(e)
  40104. , i = Math.sin(e);
  40105. return this.set(t, -i, 0, 0, i, t, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1),
  40106. this
  40107. },
  40108. makeRotationAxis: function(e, t) {
  40109. var i = Math.cos(t)
  40110. , n = Math.sin(t)
  40111. , r = 1 - i
  40112. , o = e.x
  40113. , a = e.y
  40114. , s = e.z
  40115. , l = r * o
  40116. , c = r * a;
  40117. 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),
  40118. this
  40119. },
  40120. makeScale: function(e, t, i) {
  40121. return this.set(e, 0, 0, 0, 0, t, 0, 0, 0, 0, i, 0, 0, 0, 0, 1),
  40122. this
  40123. },
  40124. compose: function(e, t, i) {
  40125. return this.makeRotationFromQuaternion(t),
  40126. this.scale(i),
  40127. this.setPosition(e),
  40128. this
  40129. },
  40130. decompose: function(e, t, i) {
  40131. void 0 === ee && (ee = new Ci.Vector3),
  40132. void 0 === te && (te = new Ci.Matrix4);
  40133. var n = this.elements
  40134. , r = ee.set(n[0], n[1], n[2]).length()
  40135. , o = ee.set(n[4], n[5], n[6]).length()
  40136. , a = ee.set(n[8], n[9], n[10]).length();
  40137. this.determinant() < 0 && (r = -r),
  40138. e.x = n[12],
  40139. e.y = n[13],
  40140. e.z = n[14],
  40141. te.elements.set(this.elements);
  40142. var s = 1 / r
  40143. , l = 1 / o
  40144. , c = 1 / a;
  40145. return te.elements[0] *= s,
  40146. te.elements[1] *= s,
  40147. te.elements[2] *= s,
  40148. te.elements[4] *= l,
  40149. te.elements[5] *= l,
  40150. te.elements[6] *= l,
  40151. te.elements[8] *= c,
  40152. te.elements[9] *= c,
  40153. te.elements[10] *= c,
  40154. t.setFromRotationMatrix(te),
  40155. i.x = r,
  40156. i.y = o,
  40157. i.z = a,
  40158. this
  40159. },
  40160. makeFrustum: function(e, t, i, n, r, o) {
  40161. var a = this.elements
  40162. , s = 2 * r / (t - e)
  40163. , l = 2 * r / (n - i)
  40164. , c = (t + e) / (t - e)
  40165. , h = (n + i) / (n - i)
  40166. , u = -(o + r) / (o - r)
  40167. , d = -2 * o * r / (o - r);
  40168. return a[0] = s,
  40169. a[4] = 0,
  40170. a[8] = c,
  40171. a[12] = 0,
  40172. a[1] = 0,
  40173. a[5] = l,
  40174. a[9] = h,
  40175. a[13] = 0,
  40176. a[2] = 0,
  40177. a[6] = 0,
  40178. a[10] = u,
  40179. a[14] = d,
  40180. a[3] = 0,
  40181. a[7] = 0,
  40182. a[11] = -1,
  40183. a[15] = 0,
  40184. this
  40185. },
  40186. makePerspective: function(e, t, i, n) {
  40187. var r = i * Math.tan(Ci.Math.degToRad(.5 * e))
  40188. , o = -r
  40189. , a = o * t
  40190. , s = r * t;
  40191. return this.makeFrustum(a, s, o, r, i, n)
  40192. },
  40193. makeOrthographic: function(e, t, i, n, r, o) {
  40194. var a = this.elements
  40195. , s = 1 / (t - e)
  40196. , l = 1 / (i - n)
  40197. , c = 1 / (o - r)
  40198. , h = (t + e) * s
  40199. , u = (i + n) * l
  40200. , d = (o + r) * c;
  40201. return a[0] = 2 * s,
  40202. a[4] = 0,
  40203. a[8] = 0,
  40204. a[12] = -h,
  40205. a[1] = 0,
  40206. a[5] = 2 * l,
  40207. a[9] = 0,
  40208. a[13] = -u,
  40209. a[2] = 0,
  40210. a[6] = 0,
  40211. a[10] = -2 * c,
  40212. a[14] = -d,
  40213. a[3] = 0,
  40214. a[7] = 0,
  40215. a[11] = 0,
  40216. a[15] = 1,
  40217. this
  40218. },
  40219. equals: function(e) {
  40220. for (var t = this.elements, i = e.elements, n = 0; n < 16; n++)
  40221. if (t[n] !== i[n])
  40222. return !1;
  40223. return !0
  40224. },
  40225. fromArray: function(e) {
  40226. return this.elements.set(e),
  40227. this
  40228. },
  40229. toArray: function() {
  40230. var e = this.elements;
  40231. 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]]
  40232. }
  40233. },
  40234. Ci.Ray = function(e, t) {
  40235. this.origin = void 0 !== e ? e : new Ci.Vector3,
  40236. this.direction = void 0 !== t ? t : new Ci.Vector3
  40237. }
  40238. ,
  40239. Ci.Ray.prototype = {
  40240. constructor: Ci.Ray,
  40241. set: function(e, t) {
  40242. return this.origin.copy(e),
  40243. this.direction.copy(t),
  40244. this
  40245. },
  40246. clone: function() {
  40247. return (new this.constructor).copy(this)
  40248. },
  40249. copy: function(e) {
  40250. return this.origin.copy(e.origin),
  40251. this.direction.copy(e.direction),
  40252. this
  40253. },
  40254. at: function(e, t) {
  40255. return (t || new Ci.Vector3).copy(this.direction).multiplyScalar(e).add(this.origin)
  40256. },
  40257. lookAt: function(e) {
  40258. this.direction.copy(e).sub(this.origin).normalize()
  40259. },
  40260. recast: ($ = new Ci.Vector3,
  40261. function(e) {
  40262. return this.origin.copy(this.at(e, $)),
  40263. this
  40264. }
  40265. ),
  40266. closestPointToPoint: function(e, t) {
  40267. var i = t || new Ci.Vector3;
  40268. i.subVectors(e, this.origin);
  40269. var n = i.dot(this.direction);
  40270. return n < 0 ? i.copy(this.origin) : i.copy(this.direction).multiplyScalar(n).add(this.origin)
  40271. },
  40272. distanceToPoint: function(e) {
  40273. return Math.sqrt(this.distanceSqToPoint(e))
  40274. },
  40275. distanceSqToPoint: (J = new Ci.Vector3,
  40276. function(e) {
  40277. var t = J.subVectors(e, this.origin).dot(this.direction);
  40278. return t < 0 ? this.origin.distanceToSquared(e) : (J.copy(this.direction).multiplyScalar(t).add(this.origin),
  40279. J.distanceToSquared(e))
  40280. }
  40281. ),
  40282. distanceSqToSegment: (Z = new Ci.Vector3,
  40283. K = new Ci.Vector3,
  40284. Q = new Ci.Vector3,
  40285. function(e, t, i, n) {
  40286. Z.copy(e).add(t).multiplyScalar(.5),
  40287. K.copy(t).sub(e).normalize(),
  40288. Q.copy(this.origin).sub(Z);
  40289. 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);
  40290. if (0 < p)
  40291. if (o = c * h - u,
  40292. s = l * p,
  40293. 0 <= (r = c * u - h))
  40294. if (-s <= o)
  40295. if (o <= s) {
  40296. var f = 1 / p;
  40297. a = (r *= f) * (r + c * (o *= f) + 2 * h) + o * (c * r + o + 2 * u) + d
  40298. } else
  40299. o = l,
  40300. a = -(r = Math.max(0, -(c * o + h))) * r + o * (o + 2 * u) + d;
  40301. else
  40302. o = -l,
  40303. a = -(r = Math.max(0, -(c * o + h))) * r + o * (o + 2 * u) + d;
  40304. else
  40305. 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,
  40306. (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;
  40307. else
  40308. o = 0 < c ? -l : l,
  40309. a = -(r = Math.max(0, -(c * o + h))) * r + o * (o + 2 * u) + d;
  40310. return i && i.copy(this.direction).multiplyScalar(r).add(this.origin),
  40311. n && n.copy(K).multiplyScalar(o).add(Z),
  40312. a
  40313. }
  40314. ),
  40315. intersectSphere: (X = new Ci.Vector3,
  40316. function(e, t) {
  40317. X.subVectors(e.center, this.origin);
  40318. var i = X.dot(this.direction)
  40319. , n = X.dot(X) - i * i
  40320. , r = e.radius * e.radius;
  40321. if (r < n)
  40322. return null;
  40323. var o = Math.sqrt(r - n)
  40324. , a = i - o
  40325. , s = i + o;
  40326. return a < 0 && s < 0 ? null : a < 0 ? this.at(s, t) : this.at(a, t)
  40327. }
  40328. ),
  40329. intersectsSphere: function(e) {
  40330. return this.distanceToPoint(e.center) <= e.radius
  40331. },
  40332. distanceToPlane: function(e) {
  40333. var t = e.normal.dot(this.direction);
  40334. if (0 === t)
  40335. return 0 === e.distanceToPoint(this.origin) ? 0 : null;
  40336. var i = -(this.origin.dot(e.normal) + e.constant) / t;
  40337. return 0 <= i ? i : null
  40338. },
  40339. intersectPlane: function(e, t) {
  40340. var i = this.distanceToPlane(e);
  40341. return null === i ? null : this.at(i, t)
  40342. },
  40343. intersectsPlane: function(e) {
  40344. var t = e.distanceToPoint(this.origin);
  40345. return 0 === t || e.normal.dot(this.direction) * t < 0
  40346. },
  40347. intersectBox: function(e, t) {
  40348. 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;
  40349. return n = 0 <= l ? (i = (e.min.x - u.x) * l,
  40350. (e.max.x - u.x) * l) : (i = (e.max.x - u.x) * l,
  40351. (e.min.x - u.x) * l),
  40352. (o = 0 <= c ? (r = (e.min.y - u.y) * c,
  40353. (e.max.y - u.y) * c) : (r = (e.max.y - u.y) * c,
  40354. (e.min.y - u.y) * c)) < i || n < r ? null : ((i < r || i != i) && (i = r),
  40355. (o < n || n != n) && (n = o),
  40356. (s = 0 <= h ? (a = (e.min.z - u.z) * h,
  40357. (e.max.z - u.z) * h) : (a = (e.max.z - u.z) * h,
  40358. (e.min.z - u.z) * h)) < i || n < a ? null : ((i < a || i != i) && (i = a),
  40359. (s < n || n != n) && (n = s),
  40360. n < 0 ? null : this.at(0 <= i ? i : n, t)))
  40361. },
  40362. intersectsBox: (q = new Ci.Vector3,
  40363. function(e) {
  40364. return null !== this.intersectBox(e, q)
  40365. }
  40366. ),
  40367. intersectTriangle: (G = new Ci.Vector3,
  40368. W = new Ci.Vector3,
  40369. j = new Ci.Vector3,
  40370. Y = new Ci.Vector3,
  40371. function(e, t, i, n, r) {
  40372. W.subVectors(t, e),
  40373. j.subVectors(i, e),
  40374. Y.crossVectors(W, j);
  40375. var o, a = this.direction.dot(Y);
  40376. if (0 < a) {
  40377. if (n)
  40378. return null;
  40379. o = 1
  40380. } else {
  40381. if (!(a < 0))
  40382. return null;
  40383. o = -1,
  40384. a = -a
  40385. }
  40386. G.subVectors(this.origin, e);
  40387. var s = o * this.direction.dot(j.crossVectors(G, j));
  40388. if (s < 0)
  40389. return null;
  40390. var l = o * this.direction.dot(W.cross(G));
  40391. if (l < 0)
  40392. return null;
  40393. if (a < s + l)
  40394. return null;
  40395. var c = -o * G.dot(Y);
  40396. return c < 0 ? null : this.at(c / a, r)
  40397. }
  40398. ),
  40399. applyMatrix4: function(e) {
  40400. return this.direction.add(this.origin).applyMatrix4(e),
  40401. this.origin.applyMatrix4(e),
  40402. this.direction.sub(this.origin),
  40403. this.direction.normalize(),
  40404. this
  40405. },
  40406. equals: function(e) {
  40407. return e.origin.equals(this.origin) && e.direction.equals(this.direction)
  40408. }
  40409. },
  40410. Ci.Sphere = function(e, t) {
  40411. this.center = void 0 !== e ? e : new Ci.Vector3,
  40412. this.radius = void 0 !== t ? t : 0
  40413. }
  40414. ,
  40415. Ci.Sphere.prototype = {
  40416. constructor: Ci.Sphere,
  40417. set: function(e, t) {
  40418. return this.center.copy(e),
  40419. this.radius = t,
  40420. this
  40421. },
  40422. setFromPoints: (z = new Ci.Box3,
  40423. function(e, t) {
  40424. var i = this.center;
  40425. void 0 !== t ? i.copy(t) : z.setFromPoints(e).center(i);
  40426. for (var n = 0, r = 0, o = e.length; r < o; r++)
  40427. n = Math.max(n, i.distanceToSquared(e[r]));
  40428. return this.radius = Math.sqrt(n),
  40429. this
  40430. }
  40431. ),
  40432. clone: function() {
  40433. return (new this.constructor).copy(this)
  40434. },
  40435. copy: function(e) {
  40436. return this.center.copy(e.center),
  40437. this.radius = e.radius,
  40438. this
  40439. },
  40440. empty: function() {
  40441. return this.radius <= 0
  40442. },
  40443. containsPoint: function(e) {
  40444. return e.distanceToSquared(this.center) <= this.radius * this.radius
  40445. },
  40446. distanceToPoint: function(e) {
  40447. return e.distanceTo(this.center) - this.radius
  40448. },
  40449. intersectsSphere: function(e) {
  40450. var t = this.radius + e.radius;
  40451. return e.center.distanceToSquared(this.center) <= t * t
  40452. },
  40453. intersectsBox: function(e) {
  40454. return e.intersectsSphere(this)
  40455. },
  40456. intersectsPlane: function(e) {
  40457. return Math.abs(this.center.dot(e.normal) - e.constant) <= this.radius
  40458. },
  40459. clampPoint: function(e, t) {
  40460. var i = this.center.distanceToSquared(e)
  40461. , n = t || new Ci.Vector3;
  40462. return n.copy(e),
  40463. i > this.radius * this.radius && (n.sub(this.center).normalize(),
  40464. n.multiplyScalar(this.radius).add(this.center)),
  40465. n
  40466. },
  40467. getBoundingBox: function(e) {
  40468. var t = e || new Ci.Box3;
  40469. return t.set(this.center, this.center),
  40470. t.expandByScalar(this.radius),
  40471. t
  40472. },
  40473. applyMatrix4: function(e) {
  40474. return this.center.applyMatrix4(e),
  40475. this.radius = this.radius * e.getMaxScaleOnAxis(),
  40476. this
  40477. },
  40478. translate: function(e) {
  40479. return this.center.add(e),
  40480. this
  40481. },
  40482. equals: function(e) {
  40483. return e.center.equals(this.center) && e.radius === this.radius
  40484. }
  40485. },
  40486. Ci.Frustum = function(e, t, i, n, r, o) {
  40487. 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]
  40488. }
  40489. ,
  40490. Ci.Frustum.prototype = {
  40491. constructor: Ci.Frustum,
  40492. set: function(e, t, i, n, r, o) {
  40493. var a = this.planes;
  40494. return a[0].copy(e),
  40495. a[1].copy(t),
  40496. a[2].copy(i),
  40497. a[3].copy(n),
  40498. a[4].copy(r),
  40499. a[5].copy(o),
  40500. this
  40501. },
  40502. clone: function() {
  40503. return (new this.constructor).copy(this)
  40504. },
  40505. copy: function(e) {
  40506. for (var t = this.planes, i = 0; i < 6; i++)
  40507. t[i].copy(e.planes[i]);
  40508. return this
  40509. },
  40510. setFromMatrix: function(e) {
  40511. var t = this.planes
  40512. , i = e.elements
  40513. , n = i[0]
  40514. , r = i[1]
  40515. , o = i[2]
  40516. , a = i[3]
  40517. , s = i[4]
  40518. , l = i[5]
  40519. , c = i[6]
  40520. , h = i[7]
  40521. , u = i[8]
  40522. , d = i[9]
  40523. , p = i[10]
  40524. , f = i[11]
  40525. , g = i[12]
  40526. , m = i[13]
  40527. , v = i[14]
  40528. , y = i[15];
  40529. return t[0].setComponents(a - n, h - s, f - u, y - g).normalize(),
  40530. t[1].setComponents(a + n, h + s, f + u, y + g).normalize(),
  40531. t[2].setComponents(a + r, h + l, f + d, y + m).normalize(),
  40532. t[3].setComponents(a - r, h - l, f - d, y - m).normalize(),
  40533. t[4].setComponents(a - o, h - c, f - p, y - v).normalize(),
  40534. t[5].setComponents(a + o, h + c, f + p, y + v).normalize(),
  40535. this
  40536. },
  40537. intersectsObject: (H = new Ci.Sphere,
  40538. function(e) {
  40539. var t = e.geometry;
  40540. return null === t.boundingSphere && t.computeBoundingSphere(),
  40541. H.copy(t.boundingSphere),
  40542. H.applyMatrix4(e.matrixWorld),
  40543. this.intersectsSphere(H)
  40544. }
  40545. ),
  40546. intersectsSphere: function(e) {
  40547. for (var t = this.planes, i = e.center, n = -e.radius, r = 0; r < 6; r++) {
  40548. if (t[r].distanceToPoint(i) < n)
  40549. return !1
  40550. }
  40551. return !0
  40552. },
  40553. intersectsBox: (k = new Ci.Vector3,
  40554. U = new Ci.Vector3,
  40555. function(e) {
  40556. for (var t = this.planes, i = 0; i < 6; i++) {
  40557. var n = t[i];
  40558. k.x = 0 < n.normal.x ? e.min.x : e.max.x,
  40559. U.x = 0 < n.normal.x ? e.max.x : e.min.x,
  40560. k.y = 0 < n.normal.y ? e.min.y : e.max.y,
  40561. U.y = 0 < n.normal.y ? e.max.y : e.min.y,
  40562. k.z = 0 < n.normal.z ? e.min.z : e.max.z,
  40563. U.z = 0 < n.normal.z ? e.max.z : e.min.z;
  40564. var r = n.distanceToPoint(k)
  40565. , o = n.distanceToPoint(U);
  40566. if (r < 0 && o < 0)
  40567. return !1
  40568. }
  40569. return !0
  40570. }
  40571. ),
  40572. containsPoint: function(e) {
  40573. for (var t = this.planes, i = 0; i < 6; i++)
  40574. if (t[i].distanceToPoint(e) < 0)
  40575. return !1;
  40576. return !0
  40577. }
  40578. },
  40579. Ci.Plane = function(e, t) {
  40580. this.normal = void 0 !== e ? e : new Ci.Vector3(1,0,0),
  40581. this.constant = void 0 !== t ? t : 0
  40582. }
  40583. ,
  40584. Ci.Plane.prototype = {
  40585. constructor: Ci.Plane,
  40586. set: function(e, t) {
  40587. return this.normal.copy(e),
  40588. this.constant = t,
  40589. this
  40590. },
  40591. setComponents: function(e, t, i, n) {
  40592. return this.normal.set(e, t, i),
  40593. this.constant = n,
  40594. this
  40595. },
  40596. setFromNormalAndCoplanarPoint: function(e, t) {
  40597. return this.normal.copy(e),
  40598. this.constant = -t.dot(this.normal),
  40599. this
  40600. },
  40601. setFromCoplanarPoints: (B = new Ci.Vector3,
  40602. V = new Ci.Vector3,
  40603. function(e, t, i) {
  40604. var n = B.subVectors(i, t).cross(V.subVectors(e, t)).normalize();
  40605. return this.setFromNormalAndCoplanarPoint(n, e),
  40606. this
  40607. }
  40608. ),
  40609. clone: function() {
  40610. return (new this.constructor).copy(this)
  40611. },
  40612. copy: function(e) {
  40613. return this.normal.copy(e.normal),
  40614. this.constant = e.constant,
  40615. this
  40616. },
  40617. normalize: function() {
  40618. var e = 1 / this.normal.length();
  40619. return this.normal.multiplyScalar(e),
  40620. this.constant *= e,
  40621. this
  40622. },
  40623. negate: function() {
  40624. return this.constant *= -1,
  40625. this.normal.negate(),
  40626. this
  40627. },
  40628. distanceToPoint: function(e) {
  40629. return this.normal.dot(e) + this.constant
  40630. },
  40631. distanceToSphere: function(e) {
  40632. return this.distanceToPoint(e.center) - e.radius
  40633. },
  40634. projectPoint: function(e, t) {
  40635. return this.orthoPoint(e, t).sub(e).negate()
  40636. },
  40637. orthoPoint: function(e, t) {
  40638. var i = this.distanceToPoint(e);
  40639. return (t || new Ci.Vector3).copy(this.normal).multiplyScalar(i)
  40640. },
  40641. intersectLine: (F = new Ci.Vector3,
  40642. function(e, t) {
  40643. var i = t || new Ci.Vector3
  40644. , n = e.delta(F)
  40645. , r = this.normal.dot(n);
  40646. if (0 !== r) {
  40647. var o = -(e.start.dot(this.normal) + this.constant) / r;
  40648. if (!(o < 0 || 1 < o))
  40649. return i.copy(n).multiplyScalar(o).add(e.start)
  40650. } else if (0 === this.distanceToPoint(e.start))
  40651. return i.copy(e.start)
  40652. }
  40653. ),
  40654. intersectsLine: function(e) {
  40655. var t = this.distanceToPoint(e.start)
  40656. , i = this.distanceToPoint(e.end);
  40657. return t < 0 && 0 < i || i < 0 && 0 < t
  40658. },
  40659. intersectsBox: function(e) {
  40660. return e.intersectsPlane(this)
  40661. },
  40662. intersectsSphere: function(e) {
  40663. return e.intersectsPlane(this)
  40664. },
  40665. coplanarPoint: function(e) {
  40666. return (e || new Ci.Vector3).copy(this.normal).multiplyScalar(-this.constant)
  40667. },
  40668. applyMatrix4: (L = new Ci.Vector3,
  40669. D = new Ci.Vector3,
  40670. N = new Ci.Matrix3,
  40671. function(e, t) {
  40672. var i = t || N.getNormalMatrix(e)
  40673. , n = L.copy(this.normal).applyMatrix3(i)
  40674. , r = this.coplanarPoint(D);
  40675. return r.applyMatrix4(e),
  40676. this.setFromNormalAndCoplanarPoint(n, r),
  40677. this
  40678. }
  40679. ),
  40680. translate: function(e) {
  40681. return this.constant = this.constant - e.dot(this.normal),
  40682. this
  40683. },
  40684. equals: function(e) {
  40685. return e.normal.equals(this.normal) && e.constant === this.constant
  40686. }
  40687. },
  40688. Ci.Spherical = function(e, t, i) {
  40689. return this.radius = void 0 !== e ? e : 1,
  40690. this.phi = void 0 !== t ? t : 0,
  40691. this.theta = void 0 !== i ? i : 0,
  40692. this
  40693. }
  40694. ,
  40695. Ci.Spherical.prototype = {
  40696. constructor: Ci.Spherical,
  40697. set: function(e, t, i) {
  40698. this.radius = e,
  40699. this.phi = t,
  40700. this.theta = i
  40701. },
  40702. clone: function() {
  40703. return (new this.constructor).copy(this)
  40704. },
  40705. copy: function(e) {
  40706. return this.radius.copy(e.radius),
  40707. this.phi.copy(e.phi),
  40708. this.theta.copy(e.theta),
  40709. this
  40710. },
  40711. makeSafe: function() {
  40712. this.phi = Math.max(1e-6, Math.min(Math.PI - 1e-6, this.phi))
  40713. },
  40714. setFromVector3: function(e) {
  40715. return this.radius = e.length(),
  40716. 0 === this.radius ? (this.theta = 0,
  40717. this.phi = 0) : (this.theta = Math.atan2(e.x, e.z),
  40718. this.phi = Math.acos(Ci.Math.clamp(e.y / this.radius, -1, 1))),
  40719. this
  40720. }
  40721. },
  40722. Ci.Math = {
  40723. generateUUID: (R = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split(""),
  40724. P = new Array(36),
  40725. O = 0,
  40726. function() {
  40727. for (var e = 0; e < 36; e++)
  40728. 8 === e || 13 === e || 18 === e || 23 === e ? P[e] = "-" : 14 === e ? P[e] = "4" : (O <= 2 && (O = 33554432 + 16777216 * Math.random() | 0),
  40729. M = 15 & O,
  40730. O >>= 4,
  40731. P[e] = R[19 === e ? 3 & M | 8 : M]);
  40732. return P.join("")
  40733. }
  40734. ),
  40735. clamp: function(e, t, i) {
  40736. return Math.max(t, Math.min(i, e))
  40737. },
  40738. euclideanModulo: function(e, t) {
  40739. return (e % t + t) % t
  40740. },
  40741. mapLinear: function(e, t, i, n, r) {
  40742. return n + (e - t) * (r - n) / (i - t)
  40743. },
  40744. smoothstep: function(e, t, i) {
  40745. return e <= t ? 0 : i <= e ? 1 : (e = (e - t) / (i - t)) * e * (3 - 2 * e)
  40746. },
  40747. smootherstep: function(e, t, i) {
  40748. return e <= t ? 0 : i <= e ? 1 : (e = (e - t) / (i - t)) * e * e * (e * (6 * e - 15) + 10)
  40749. },
  40750. random16: function() {
  40751. return console.warn("THREE.Math.random16() has been deprecated. Use Math.random() instead."),
  40752. Math.random()
  40753. },
  40754. randInt: function(e, t) {
  40755. return e + Math.floor(Math.random() * (t - e + 1))
  40756. },
  40757. randFloat: function(e, t) {
  40758. return e + Math.random() * (t - e)
  40759. },
  40760. randFloatSpread: function(e) {
  40761. return e * (.5 - Math.random())
  40762. },
  40763. degToRad: (S = Math.PI / 180,
  40764. function(e) {
  40765. return e * S
  40766. }
  40767. ),
  40768. radToDeg: (x = 180 / Math.PI,
  40769. function(e) {
  40770. return e * x
  40771. }
  40772. ),
  40773. isPowerOfTwo: function(e) {
  40774. return 0 == (e & e - 1) && 0 !== e
  40775. },
  40776. nearestPowerOfTwo: function(e) {
  40777. return Math.pow(2, Math.round(Math.log(e) / Math.LN2))
  40778. },
  40779. nextPowerOfTwo: function(e) {
  40780. return e--,
  40781. e |= e >> 1,
  40782. e |= e >> 2,
  40783. e |= e >> 4,
  40784. e |= e >> 8,
  40785. e |= e >> 16,
  40786. ++e
  40787. }
  40788. },
  40789. Ci.Spline = function(e) {
  40790. function t(e, t, i, n, r, o, a) {
  40791. var s = .5 * (i - e)
  40792. , l = .5 * (n - t);
  40793. return (2 * (t - i) + s + l) * a + (-3 * (t - i) - 2 * s - l) * o + s * r + t
  40794. }
  40795. this.points = e;
  40796. var i, n, r, o, a, s, l, c, h, u = [], d = {
  40797. x: 0,
  40798. y: 0,
  40799. z: 0
  40800. };
  40801. this.initFromArray = function(e) {
  40802. this.points = [];
  40803. for (var t = 0; t < e.length; t++)
  40804. this.points[t] = {
  40805. x: e[t][0],
  40806. y: e[t][1],
  40807. z: e[t][2]
  40808. }
  40809. }
  40810. ,
  40811. this.getPoint = function(e) {
  40812. return i = (this.points.length - 1) * e,
  40813. n = Math.floor(i),
  40814. r = i - n,
  40815. u[0] = 0 === n ? n : n - 1,
  40816. u[1] = n,
  40817. u[2] = n > this.points.length - 2 ? this.points.length - 1 : n + 1,
  40818. u[3] = n > this.points.length - 3 ? this.points.length - 1 : n + 2,
  40819. s = this.points[u[0]],
  40820. l = this.points[u[1]],
  40821. c = this.points[u[2]],
  40822. h = this.points[u[3]],
  40823. a = r * (o = r * r),
  40824. d.x = t(s.x, l.x, c.x, h.x, r, o, a),
  40825. d.y = t(s.y, l.y, c.y, h.y, r, o, a),
  40826. d.z = t(s.z, l.z, c.z, h.z, r, o, a),
  40827. d
  40828. }
  40829. ,
  40830. this.getControlPointsArray = function() {
  40831. var e, t, i = this.points.length, n = [];
  40832. for (e = 0; e < i; e++)
  40833. t = this.points[e],
  40834. n[e] = [t.x, t.y, t.z];
  40835. return n
  40836. }
  40837. ,
  40838. this.getLength = function(e) {
  40839. var t, i, n, r, o = 0, a = 0, s = 0, l = new Ci.Vector3, c = new Ci.Vector3, h = [], u = 0;
  40840. for (h[0] = 0,
  40841. e = e || 100,
  40842. n = this.points.length * e,
  40843. l.copy(this.points[0]),
  40844. t = 1; t < n; t++)
  40845. i = t / n,
  40846. r = this.getPoint(i),
  40847. c.copy(r),
  40848. u += c.distanceTo(l),
  40849. l.copy(r),
  40850. o = (this.points.length - 1) * i,
  40851. (a = Math.floor(o)) !== s && (h[a] = u,
  40852. s = a);
  40853. return h[h.length] = u,
  40854. {
  40855. chunks: h,
  40856. total: u
  40857. }
  40858. }
  40859. ,
  40860. this.reparametrizeByArcLength = function(e) {
  40861. var t, i, n, r, o, a, s, l, c = [], h = new Ci.Vector3, u = this.getLength();
  40862. for (c.push(h.copy(this.points[0]).clone()),
  40863. t = 1; t < this.points.length; t++) {
  40864. for (a = u.chunks[t] - u.chunks[t - 1],
  40865. s = Math.ceil(e * a / u.total),
  40866. r = (t - 1) / (this.points.length - 1),
  40867. o = t / (this.points.length - 1),
  40868. i = 1; i < s - 1; i++)
  40869. n = r + i * (1 / s) * (o - r),
  40870. l = this.getPoint(n),
  40871. c.push(h.copy(l).clone());
  40872. c.push(h.copy(this.points[t]).clone())
  40873. }
  40874. this.points = c
  40875. }
  40876. }
  40877. ,
  40878. Ci.Triangle = function(e, t, i) {
  40879. this.a = void 0 !== e ? e : new Ci.Vector3,
  40880. this.b = void 0 !== t ? t : new Ci.Vector3,
  40881. this.c = void 0 !== i ? i : new Ci.Vector3
  40882. }
  40883. ,
  40884. Ci.Triangle.normal = (T = new Ci.Vector3,
  40885. function(e, t, i, n) {
  40886. var r = n || new Ci.Vector3;
  40887. r.subVectors(i, t),
  40888. T.subVectors(e, t),
  40889. r.cross(T);
  40890. var o = r.lengthSq();
  40891. return 0 < o ? r.multiplyScalar(1 / Math.sqrt(o)) : r.set(0, 0, 0)
  40892. }
  40893. ),
  40894. Ci.Triangle.barycoordFromPoint = (_ = new Ci.Vector3,
  40895. b = new Ci.Vector3,
  40896. w = new Ci.Vector3,
  40897. function(e, t, i, n, r) {
  40898. _.subVectors(n, t),
  40899. b.subVectors(i, t),
  40900. w.subVectors(e, t);
  40901. var o = _.dot(_)
  40902. , a = _.dot(b)
  40903. , s = _.dot(w)
  40904. , l = b.dot(b)
  40905. , c = b.dot(w)
  40906. , h = o * l - a * a
  40907. , u = r || new Ci.Vector3;
  40908. if (0 == h)
  40909. return u.set(-2, -1, -1);
  40910. var d = 1 / h
  40911. , p = (l * s - a * c) * d
  40912. , f = (o * c - a * s) * d;
  40913. return u.set(1 - p - f, f, p)
  40914. }
  40915. ),
  40916. Ci.Triangle.containsPoint = (E = new Ci.Vector3,
  40917. function(e, t, i, n) {
  40918. var r = Ci.Triangle.barycoordFromPoint(e, t, i, n, E);
  40919. return 0 <= r.x && 0 <= r.y && r.x + r.y <= 1
  40920. }
  40921. ),
  40922. Ci.Triangle.prototype = {
  40923. constructor: Ci.Triangle,
  40924. set: function(e, t, i) {
  40925. return this.a.copy(e),
  40926. this.b.copy(t),
  40927. this.c.copy(i),
  40928. this
  40929. },
  40930. setFromPointsAndIndices: function(e, t, i, n) {
  40931. return this.a.copy(e[t]),
  40932. this.b.copy(e[i]),
  40933. this.c.copy(e[n]),
  40934. this
  40935. },
  40936. clone: function() {
  40937. return (new this.constructor).copy(this)
  40938. },
  40939. copy: function(e) {
  40940. return this.a.copy(e.a),
  40941. this.b.copy(e.b),
  40942. this.c.copy(e.c),
  40943. this
  40944. },
  40945. area: (C = new Ci.Vector3,
  40946. I = new Ci.Vector3,
  40947. function() {
  40948. return C.subVectors(this.c, this.b),
  40949. I.subVectors(this.a, this.b),
  40950. .5 * C.cross(I).length()
  40951. }
  40952. ),
  40953. midpoint: function(e) {
  40954. return (e || new Ci.Vector3).addVectors(this.a, this.b).add(this.c).multiplyScalar(1 / 3)
  40955. },
  40956. normal: function(e) {
  40957. return Ci.Triangle.normal(this.a, this.b, this.c, e)
  40958. },
  40959. plane: function(e) {
  40960. return (e || new Ci.Plane).setFromCoplanarPoints(this.a, this.b, this.c)
  40961. },
  40962. barycoordFromPoint: function(e, t) {
  40963. return Ci.Triangle.barycoordFromPoint(e, this.a, this.b, this.c, t)
  40964. },
  40965. containsPoint: function(e) {
  40966. return Ci.Triangle.containsPoint(e, this.a, this.b, this.c)
  40967. },
  40968. equals: function(e) {
  40969. return e.a.equals(this.a) && e.b.equals(this.b) && e.c.equals(this.c)
  40970. }
  40971. },
  40972. Ci.Interpolant = function(e, t, i, n) {
  40973. this.parameterPositions = e,
  40974. this._cachedIndex = 0,
  40975. this.resultBuffer = void 0 !== n ? n : new t.constructor(i),
  40976. this.sampleValues = t,
  40977. this.valueSize = i
  40978. }
  40979. ,
  40980. Ci.Interpolant.prototype = {
  40981. constructor: Ci.Interpolant,
  40982. evaluate: function(e) {
  40983. var t = this.parameterPositions
  40984. , i = this._cachedIndex
  40985. , n = t[i]
  40986. , r = t[i - 1];
  40987. e: {
  40988. t: {
  40989. var o;
  40990. i: {
  40991. n: if (!(e < n)) {
  40992. for (var a = i + 2; ; ) {
  40993. if (void 0 === n) {
  40994. if (e < r)
  40995. break n;
  40996. return i = t.length,
  40997. this._cachedIndex = i,
  40998. this.afterEnd_(i - 1, e, r)
  40999. }
  41000. if (i === a)
  41001. break;
  41002. if (r = n,
  41003. e < (n = t[++i]))
  41004. break t
  41005. }
  41006. o = t.length;
  41007. break i
  41008. }
  41009. if (r <= e)
  41010. break e;
  41011. var s = t[1];
  41012. e < s && (i = 2,
  41013. r = s);
  41014. for (a = i - 2; ; ) {
  41015. if (void 0 === r)
  41016. return this._cachedIndex = 0,
  41017. this.beforeStart_(0, e, n);
  41018. if (i === a)
  41019. break;
  41020. if (n = r,
  41021. (r = t[--i - 1]) <= e)
  41022. break t
  41023. }
  41024. o = i,
  41025. i = 0
  41026. }
  41027. for (; i < o; ) {
  41028. var l = i + o >>> 1;
  41029. e < t[l] ? o = l : i = 1 + l
  41030. }
  41031. if (n = t[i],
  41032. void 0 === (r = t[i - 1]))
  41033. return this._cachedIndex = 0,
  41034. this.beforeStart_(0, e, n);
  41035. if (void 0 === n)
  41036. return i = t.length,
  41037. this._cachedIndex = i,
  41038. this.afterEnd_(i - 1, r, e)
  41039. }
  41040. this._cachedIndex = i,
  41041. this.intervalChanged_(i, r, n)
  41042. }
  41043. return this.interpolate_(i, r, e, n)
  41044. },
  41045. settings: null,
  41046. DefaultSettings_: {},
  41047. getSettings_: function() {
  41048. return this.settings || this.DefaultSettings_
  41049. },
  41050. copySampleValue_: function(e) {
  41051. for (var t = this.resultBuffer, i = this.sampleValues, n = this.valueSize, r = e * n, o = 0; o !== n; ++o)
  41052. t[o] = i[r + o];
  41053. return t
  41054. },
  41055. interpolate_: function(e, t, i, n) {
  41056. throw new Error("call to abstract method")
  41057. },
  41058. intervalChanged_: function(e, t, i) {}
  41059. },
  41060. Object.assign(Ci.Interpolant.prototype, {
  41061. beforeStart_: Ci.Interpolant.prototype.copySampleValue_,
  41062. afterEnd_: Ci.Interpolant.prototype.copySampleValue_
  41063. }),
  41064. Ci.CubicInterpolant = function(e, t, i, n) {
  41065. Ci.Interpolant.call(this, e, t, i, n),
  41066. this._weightPrev = -0,
  41067. this._offsetPrev = -0,
  41068. this._weightNext = -0,
  41069. this._offsetNext = -0
  41070. }
  41071. ,
  41072. Ci.CubicInterpolant.prototype = Object.assign(Object.create(Ci.Interpolant.prototype), {
  41073. constructor: Ci.CubicInterpolant,
  41074. DefaultSettings_: {
  41075. endingStart: Ci.ZeroCurvatureEnding,
  41076. endingEnd: Ci.ZeroCurvatureEnding
  41077. },
  41078. intervalChanged_: function(e, t, i) {
  41079. var n = this.parameterPositions
  41080. , r = e - 2
  41081. , o = e + 1
  41082. , a = n[r]
  41083. , s = n[o];
  41084. if (void 0 === a)
  41085. switch (this.getSettings_().endingStart) {
  41086. case Ci.ZeroSlopeEnding:
  41087. r = e,
  41088. a = 2 * t - i;
  41089. break;
  41090. case Ci.WrapAroundEnding:
  41091. a = t + n[r = n.length - 2] - n[r + 1];
  41092. break;
  41093. default:
  41094. r = e,
  41095. a = i
  41096. }
  41097. if (void 0 === s)
  41098. switch (this.getSettings_().endingEnd) {
  41099. case Ci.ZeroSlopeEnding:
  41100. o = e,
  41101. s = 2 * i - t;
  41102. break;
  41103. case Ci.WrapAroundEnding:
  41104. s = i + n[o = 1] - n[0];
  41105. break;
  41106. default:
  41107. o = e - 1,
  41108. s = t
  41109. }
  41110. var l = .5 * (i - t)
  41111. , c = this.valueSize;
  41112. this._weightPrev = l / (t - a),
  41113. this._weightNext = l / (s - i),
  41114. this._offsetPrev = r * c,
  41115. this._offsetNext = o * c
  41116. },
  41117. interpolate_: function(e, t, i, n) {
  41118. 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)
  41119. r[C] = m * o[c + C] + v * o[l + C] + y * o[s + C] + A * o[h + C];
  41120. return r
  41121. }
  41122. }),
  41123. Ci.DiscreteInterpolant = function(e, t, i, n) {
  41124. Ci.Interpolant.call(this, e, t, i, n)
  41125. }
  41126. ,
  41127. Ci.DiscreteInterpolant.prototype = Object.assign(Object.create(Ci.Interpolant.prototype), {
  41128. constructor: Ci.DiscreteInterpolant,
  41129. interpolate_: function(e, t, i, n) {
  41130. return this.copySampleValue_(e - 1)
  41131. }
  41132. }),
  41133. Ci.LinearInterpolant = function(e, t, i, n) {
  41134. Ci.Interpolant.call(this, e, t, i, n)
  41135. }
  41136. ,
  41137. Ci.LinearInterpolant.prototype = Object.assign(Object.create(Ci.Interpolant.prototype), {
  41138. constructor: Ci.LinearInterpolant,
  41139. interpolate_: function(e, t, i, n) {
  41140. 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)
  41141. r[u] = o[l + u] * h + o[s + u] * c;
  41142. return r
  41143. }
  41144. }),
  41145. Ci.QuaternionLinearInterpolant = function(e, t, i, n) {
  41146. Ci.Interpolant.call(this, e, t, i, n)
  41147. }
  41148. ,
  41149. Ci.QuaternionLinearInterpolant.prototype = Object.assign(Object.create(Ci.Interpolant.prototype), {
  41150. constructor: Ci.QuaternionLinearInterpolant,
  41151. interpolate_: function(e, t, i, n) {
  41152. 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)
  41153. Ci.Quaternion.slerpFlat(r, 0, o, s - a, o, s, l);
  41154. return r
  41155. }
  41156. }),
  41157. Ci.Clock = function(e) {
  41158. this.autoStart = void 0 === e || e,
  41159. this.startTime = 0,
  41160. this.oldTime = 0,
  41161. this.elapsedTime = 0,
  41162. this.running = !1
  41163. }
  41164. ,
  41165. Ci.Clock.prototype = {
  41166. constructor: Ci.Clock,
  41167. start: function() {
  41168. this.startTime = performance.now(),
  41169. this.oldTime = this.startTime,
  41170. this.running = !0
  41171. },
  41172. stop: function() {
  41173. this.getElapsedTime(),
  41174. this.running = !1
  41175. },
  41176. getElapsedTime: function() {
  41177. return this.getDelta(),
  41178. this.elapsedTime
  41179. },
  41180. getDelta: function() {
  41181. var e = 0;
  41182. if (this.autoStart && !this.running && this.start(),
  41183. this.running) {
  41184. var t = performance.now();
  41185. e = .001 * (t - this.oldTime),
  41186. this.oldTime = t,
  41187. this.elapsedTime += e
  41188. }
  41189. return e
  41190. }
  41191. },
  41192. Ci.EventDispatcher = function() {}
  41193. ,
  41194. Ci.EventDispatcher.prototype = {
  41195. constructor: Ci.EventDispatcher,
  41196. apply: function(e) {
  41197. e.addEventListener = Ci.EventDispatcher.prototype.addEventListener,
  41198. e.hasEventListener = Ci.EventDispatcher.prototype.hasEventListener,
  41199. e.removeEventListener = Ci.EventDispatcher.prototype.removeEventListener,
  41200. e.dispatchEvent = Ci.EventDispatcher.prototype.dispatchEvent
  41201. },
  41202. addEventListener: function(e, t) {
  41203. void 0 === this._listeners && (this._listeners = {});
  41204. var i = this._listeners;
  41205. void 0 === i[e] && (i[e] = []),
  41206. -1 === i[e].indexOf(t) && i[e].push(t)
  41207. },
  41208. hasEventListener: function(e, t) {
  41209. if (void 0 === this._listeners)
  41210. return !1;
  41211. var i = this._listeners;
  41212. return void 0 !== i[e] && -1 !== i[e].indexOf(t)
  41213. },
  41214. removeEventListener: function(e, t) {
  41215. if (void 0 !== this._listeners) {
  41216. var i = this._listeners[e];
  41217. if (void 0 !== i) {
  41218. var n = i.indexOf(t);
  41219. -1 !== n && i.splice(n, 1)
  41220. }
  41221. }
  41222. },
  41223. dispatchEvent: function(e) {
  41224. if (void 0 !== this._listeners) {
  41225. var t = this._listeners[e.type];
  41226. if (void 0 !== t) {
  41227. e.target = this;
  41228. for (var i = [], n = t.length, r = 0; r < n; r++)
  41229. i[r] = t[r];
  41230. for (r = 0; r < n; r++)
  41231. i[r].call(this, e)
  41232. }
  41233. }
  41234. }
  41235. },
  41236. Ci.Layers = function() {
  41237. this.mask = 1
  41238. }
  41239. ,
  41240. Ci.Layers.prototype = {
  41241. constructor: Ci.Layers,
  41242. set: function(e) {
  41243. this.mask = 1 << e
  41244. },
  41245. enable: function(e) {
  41246. this.mask |= 1 << e
  41247. },
  41248. toggle: function(e) {
  41249. this.mask ^= 1 << e
  41250. },
  41251. disable: function(e) {
  41252. this.mask &= ~(1 << e)
  41253. },
  41254. test: function(e) {
  41255. return 0 != (this.mask & e.mask)
  41256. }
  41257. },
  41258. (A = Ci).Raycaster = function(e, t, i, n) {
  41259. this.ray = new A.Ray(e,t),
  41260. this.near = i || 0,
  41261. this.far = n || 1 / 0,
  41262. this.params = {
  41263. Mesh: {},
  41264. Line: {},
  41265. LOD: {},
  41266. Points: {
  41267. threshold: 1
  41268. },
  41269. Sprite: {}
  41270. },
  41271. Object.defineProperties(this.params, {
  41272. PointCloud: {
  41273. get: function() {
  41274. return console.warn("THREE.Raycaster: params.PointCloud has been renamed to params.Points."),
  41275. this.Points
  41276. }
  41277. }
  41278. })
  41279. }
  41280. ,
  41281. A.Raycaster.prototype = {
  41282. constructor: A.Raycaster,
  41283. linePrecision: 1,
  41284. set: function(e, t) {
  41285. this.ray.set(e, t)
  41286. },
  41287. setFromCamera: function(e, t) {
  41288. t instanceof A.PerspectiveCamera ? (this.ray.origin.setFromMatrixPosition(t.matrixWorld),
  41289. 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),
  41290. this.ray.direction.set(0, 0, -1).transformDirection(t.matrixWorld)) : console.error("THREE.Raycaster: Unsupported camera type.")
  41291. },
  41292. intersectObject: function(e, t) {
  41293. var i = [];
  41294. return Ei(e, this, i, t),
  41295. i.sort(Ii),
  41296. i
  41297. },
  41298. intersectObjects: function(e, t) {
  41299. var i = [];
  41300. if (!1 === Array.isArray(e))
  41301. return console.warn("THREE.Raycaster.intersectObjects: objects is not an Array."),
  41302. i;
  41303. for (var n = 0, r = e.length; n < r; n++)
  41304. Ei(e[n], this, i, t);
  41305. return i.sort(Ii),
  41306. i
  41307. }
  41308. },
  41309. Ci.Object3D = function() {
  41310. Object.defineProperty(this, "id", {
  41311. value: Ci.Object3DIdCount++
  41312. }),
  41313. this.uuid = Ci.Math.generateUUID(),
  41314. this.name = "",
  41315. this.type = "Object3D",
  41316. this.parent = null,
  41317. this.children = [],
  41318. this.up = Ci.Object3D.DefaultUp.clone();
  41319. var e = new Ci.Vector3
  41320. , t = new Ci.Euler
  41321. , i = new Ci.Quaternion
  41322. , n = new Ci.Vector3(1,1,1);
  41323. t.onChange(function() {
  41324. i.setFromEuler(t, !1)
  41325. }),
  41326. i.onChange(function() {
  41327. t.setFromQuaternion(i, void 0, !1)
  41328. }),
  41329. Object.defineProperties(this, {
  41330. position: {
  41331. enumerable: !0,
  41332. value: e
  41333. },
  41334. rotation: {
  41335. enumerable: !0,
  41336. value: t
  41337. },
  41338. quaternion: {
  41339. enumerable: !0,
  41340. value: i
  41341. },
  41342. scale: {
  41343. enumerable: !0,
  41344. value: n
  41345. },
  41346. modelViewMatrix: {
  41347. value: new Ci.Matrix4
  41348. },
  41349. normalMatrix: {
  41350. value: new Ci.Matrix3
  41351. }
  41352. }),
  41353. this.rotationAutoUpdate = !0,
  41354. this.matrix = new Ci.Matrix4,
  41355. this.matrixWorld = new Ci.Matrix4,
  41356. this.matrixAutoUpdate = Ci.Object3D.DefaultMatrixAutoUpdate,
  41357. this.matrixWorldNeedsUpdate = !1,
  41358. this.layers = new Ci.Layers,
  41359. this.visible = !0,
  41360. this.castShadow = !1,
  41361. this.receiveShadow = !1,
  41362. this.frustumCulled = !0,
  41363. this.renderOrder = 0,
  41364. this.userData = {}
  41365. }
  41366. ,
  41367. Ci.Object3D.DefaultUp = new Ci.Vector3(0,1,0),
  41368. Ci.Object3D.DefaultMatrixAutoUpdate = !0,
  41369. Ci.Object3D.prototype = {
  41370. constructor: Ci.Object3D,
  41371. applyMatrix: function(e) {
  41372. this.matrix.multiplyMatrices(e, this.matrix),
  41373. this.matrix.decompose(this.position, this.quaternion, this.scale)
  41374. },
  41375. setRotationFromAxisAngle: function(e, t) {
  41376. this.quaternion.setFromAxisAngle(e, t)
  41377. },
  41378. setRotationFromEuler: function(e) {
  41379. this.quaternion.setFromEuler(e, !0)
  41380. },
  41381. setRotationFromMatrix: function(e) {
  41382. this.quaternion.setFromRotationMatrix(e)
  41383. },
  41384. setRotationFromQuaternion: function(e) {
  41385. this.quaternion.copy(e)
  41386. },
  41387. rotateOnAxis: (y = new Ci.Quaternion,
  41388. function(e, t) {
  41389. return y.setFromAxisAngle(e, t),
  41390. this.quaternion.multiply(y),
  41391. this
  41392. }
  41393. ),
  41394. rotateX: (v = new Ci.Vector3(1,0,0),
  41395. function(e) {
  41396. return this.rotateOnAxis(v, e)
  41397. }
  41398. ),
  41399. rotateY: (m = new Ci.Vector3(0,1,0),
  41400. function(e) {
  41401. return this.rotateOnAxis(m, e)
  41402. }
  41403. ),
  41404. rotateZ: (g = new Ci.Vector3(0,0,1),
  41405. function(e) {
  41406. return this.rotateOnAxis(g, e)
  41407. }
  41408. ),
  41409. translateOnAxis: (f = new Ci.Vector3,
  41410. function(e, t) {
  41411. return f.copy(e).applyQuaternion(this.quaternion),
  41412. this.position.add(f.multiplyScalar(t)),
  41413. this
  41414. }
  41415. ),
  41416. translateX: (p = new Ci.Vector3(1,0,0),
  41417. function(e) {
  41418. return this.translateOnAxis(p, e)
  41419. }
  41420. ),
  41421. translateY: (d = new Ci.Vector3(0,1,0),
  41422. function(e) {
  41423. return this.translateOnAxis(d, e)
  41424. }
  41425. ),
  41426. translateZ: (u = new Ci.Vector3(0,0,1),
  41427. function(e) {
  41428. return this.translateOnAxis(u, e)
  41429. }
  41430. ),
  41431. localToWorld: function(e) {
  41432. return e.applyMatrix4(this.matrixWorld)
  41433. },
  41434. worldToLocal: (h = new Ci.Matrix4,
  41435. function(e) {
  41436. return e.applyMatrix4(h.getInverse(this.matrixWorld))
  41437. }
  41438. ),
  41439. lookAt: (c = new Ci.Matrix4,
  41440. function(e) {
  41441. c.lookAt(e, this.position, this.up),
  41442. this.quaternion.setFromRotationMatrix(c)
  41443. }
  41444. ),
  41445. add: function(e) {
  41446. if (1 < arguments.length) {
  41447. for (var t = 0; t < arguments.length; t++)
  41448. this.add(arguments[t]);
  41449. return this
  41450. }
  41451. 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),
  41452. e.parent = this,
  41453. e.dispatchEvent({
  41454. type: "added"
  41455. }),
  41456. this.children.push(e)) : console.error("THREE.Object3D.add: object not an instance of THREE.Object3D.", e),
  41457. this
  41458. },
  41459. remove: function(e) {
  41460. if (1 < arguments.length)
  41461. for (var t = 0; t < arguments.length; t++)
  41462. this.remove(arguments[t]);
  41463. var i = this.children.indexOf(e);
  41464. -1 !== i && (e.parent = null,
  41465. e.dispatchEvent({
  41466. type: "removed"
  41467. }),
  41468. this.children.splice(i, 1))
  41469. },
  41470. getObjectById: function(e) {
  41471. return this.getObjectByProperty("id", e)
  41472. },
  41473. getObjectByName: function(e) {
  41474. return this.getObjectByProperty("name", e)
  41475. },
  41476. getObjectByProperty: function(e, t) {
  41477. if (this[e] === t)
  41478. return this;
  41479. for (var i = 0, n = this.children.length; i < n; i++) {
  41480. var r = this.children[i].getObjectByProperty(e, t);
  41481. if (void 0 !== r)
  41482. return r
  41483. }
  41484. },
  41485. getWorldPosition: function(e) {
  41486. var t = e || new Ci.Vector3;
  41487. return this.updateMatrixWorld(!0),
  41488. t.setFromMatrixPosition(this.matrixWorld)
  41489. },
  41490. getWorldQuaternion: (s = new Ci.Vector3,
  41491. l = new Ci.Vector3,
  41492. function(e) {
  41493. var t = e || new Ci.Quaternion;
  41494. return this.updateMatrixWorld(!0),
  41495. this.matrixWorld.decompose(s, t, l),
  41496. t
  41497. }
  41498. ),
  41499. getWorldRotation: (a = new Ci.Quaternion,
  41500. function(e) {
  41501. var t = e || new Ci.Euler;
  41502. return this.getWorldQuaternion(a),
  41503. t.setFromQuaternion(a, this.rotation.order, !1)
  41504. }
  41505. ),
  41506. getWorldScale: (r = new Ci.Vector3,
  41507. o = new Ci.Quaternion,
  41508. function(e) {
  41509. var t = e || new Ci.Vector3;
  41510. return this.updateMatrixWorld(!0),
  41511. this.matrixWorld.decompose(r, o, t),
  41512. t
  41513. }
  41514. ),
  41515. getWorldDirection: (n = new Ci.Quaternion,
  41516. function(e) {
  41517. var t = e || new Ci.Vector3;
  41518. return this.getWorldQuaternion(n),
  41519. t.set(0, 0, 1).applyQuaternion(n)
  41520. }
  41521. ),
  41522. raycast: function() {},
  41523. traverse: function(e) {
  41524. e(this);
  41525. for (var t = this.children, i = 0, n = t.length; i < n; i++)
  41526. t[i].traverse(e)
  41527. },
  41528. traverseVisible: function(e) {
  41529. if (!1 !== this.visible) {
  41530. e(this);
  41531. for (var t = this.children, i = 0, n = t.length; i < n; i++)
  41532. t[i].traverseVisible(e)
  41533. }
  41534. },
  41535. traverseAncestors: function(e) {
  41536. var t = this.parent;
  41537. null !== t && (e(t),
  41538. t.traverseAncestors(e))
  41539. },
  41540. updateMatrix: function() {
  41541. this.matrix.compose(this.position, this.quaternion, this.scale),
  41542. this.matrixWorldNeedsUpdate = !0
  41543. },
  41544. updateMatrixWorld: function(e) {
  41545. !0 === this.matrixAutoUpdate && this.updateMatrix(),
  41546. !0 !== this.matrixWorldNeedsUpdate && !0 !== e || (null === this.parent ? this.matrixWorld.copy(this.matrix) : this.matrixWorld.multiplyMatrices(this.parent.matrixWorld, this.matrix),
  41547. e = !(this.matrixWorldNeedsUpdate = !1));
  41548. for (var t = 0, i = this.children.length; t < i; t++)
  41549. this.children[t].updateMatrixWorld(e)
  41550. },
  41551. toJSON: function(e) {
  41552. function t(e) {
  41553. var t = [];
  41554. for (var i in e) {
  41555. var n = e[i];
  41556. delete n.metadata,
  41557. t.push(n)
  41558. }
  41559. return t
  41560. }
  41561. var i = void 0 === e
  41562. , n = {};
  41563. i && (e = {
  41564. geometries: {},
  41565. materials: {},
  41566. textures: {},
  41567. images: {}
  41568. },
  41569. n.metadata = {
  41570. version: 4.4,
  41571. type: "Object",
  41572. generator: "Object3D.toJSON"
  41573. });
  41574. var r = {};
  41575. if (r.uuid = this.uuid,
  41576. r.type = this.type,
  41577. "" !== this.name && (r.name = this.name),
  41578. "{}" !== JSON.stringify(this.userData) && (r.userData = this.userData),
  41579. !0 === this.castShadow && (r.castShadow = !0),
  41580. !0 === this.receiveShadow && (r.receiveShadow = !0),
  41581. !1 === this.visible && (r.visible = !1),
  41582. r.matrix = this.matrix.toArray(),
  41583. void 0 !== this.geometry && (void 0 === e.geometries[this.geometry.uuid] && (e.geometries[this.geometry.uuid] = this.geometry.toJSON(e)),
  41584. r.geometry = this.geometry.uuid),
  41585. void 0 !== this.material && (void 0 === e.materials[this.material.uuid] && (e.materials[this.material.uuid] = this.material.toJSON(e)),
  41586. r.material = this.material.uuid),
  41587. 0 < this.children.length) {
  41588. r.children = [];
  41589. for (var o = 0; o < this.children.length; o++)
  41590. r.children.push(this.children[o].toJSON(e).object)
  41591. }
  41592. if (i) {
  41593. var a = t(e.geometries)
  41594. , s = t(e.materials)
  41595. , l = t(e.textures)
  41596. , c = t(e.images);
  41597. 0 < a.length && (n.geometries = a),
  41598. 0 < s.length && (n.materials = s),
  41599. 0 < l.length && (n.textures = l),
  41600. 0 < c.length && (n.images = c)
  41601. }
  41602. return n.object = r,
  41603. n
  41604. },
  41605. clone: function(e) {
  41606. return (new this.constructor).copy(this, e)
  41607. },
  41608. copy: function(e, t) {
  41609. if (void 0 === t && (t = !0),
  41610. this.name = e.name,
  41611. this.up.copy(e.up),
  41612. this.position.copy(e.position),
  41613. this.quaternion.copy(e.quaternion),
  41614. this.scale.copy(e.scale),
  41615. this.rotationAutoUpdate = e.rotationAutoUpdate,
  41616. this.matrix.copy(e.matrix),
  41617. this.matrixWorld.copy(e.matrixWorld),
  41618. this.matrixAutoUpdate = e.matrixAutoUpdate,
  41619. this.matrixWorldNeedsUpdate = e.matrixWorldNeedsUpdate,
  41620. this.visible = e.visible,
  41621. this.castShadow = e.castShadow,
  41622. this.receiveShadow = e.receiveShadow,
  41623. this.frustumCulled = e.frustumCulled,
  41624. this.renderOrder = e.renderOrder,
  41625. this.userData = JSON.parse(JSON.stringify(e.userData)),
  41626. !0 === t)
  41627. for (var i = 0; i < e.children.length; i++) {
  41628. var n = e.children[i];
  41629. this.add(n.clone())
  41630. }
  41631. return this
  41632. }
  41633. },
  41634. Ci.EventDispatcher.prototype.apply(Ci.Object3D.prototype),
  41635. Ci.Object3DIdCount = 0,
  41636. Ci.Face3 = function(e, t, i, n, r, o) {
  41637. this.a = e,
  41638. this.b = t,
  41639. this.c = i,
  41640. this.normal = n instanceof Ci.Vector3 ? n : new Ci.Vector3,
  41641. this.vertexNormals = Array.isArray(n) ? n : [],
  41642. this.color = r instanceof Ci.Color ? r : new Ci.Color,
  41643. this.vertexColors = Array.isArray(r) ? r : [],
  41644. this.materialIndex = void 0 !== o ? o : 0
  41645. }
  41646. ,
  41647. Ci.Face3.prototype = {
  41648. constructor: Ci.Face3,
  41649. clone: function() {
  41650. return (new this.constructor).copy(this)
  41651. },
  41652. copy: function(e) {
  41653. this.a = e.a,
  41654. this.b = e.b,
  41655. this.c = e.c,
  41656. this.normal.copy(e.normal),
  41657. this.color.copy(e.color),
  41658. this.materialIndex = e.materialIndex;
  41659. for (var t = 0, i = e.vertexNormals.length; t < i; t++)
  41660. this.vertexNormals[t] = e.vertexNormals[t].clone();
  41661. for (t = 0,
  41662. i = e.vertexColors.length; t < i; t++)
  41663. this.vertexColors[t] = e.vertexColors[t].clone();
  41664. return this
  41665. }
  41666. },
  41667. Ci.BufferAttribute = function(e, t) {
  41668. this.uuid = Ci.Math.generateUUID(),
  41669. this.array = e,
  41670. this.itemSize = t,
  41671. this.dynamic = !1,
  41672. this.updateRange = {
  41673. offset: 0,
  41674. count: -1
  41675. },
  41676. this.version = 0
  41677. }
  41678. ,
  41679. Ci.BufferAttribute.prototype = {
  41680. constructor: Ci.BufferAttribute,
  41681. get count() {
  41682. return this.array.length / this.itemSize
  41683. },
  41684. set needsUpdate(e) {
  41685. !0 === e && this.version++
  41686. },
  41687. setDynamic: function(e) {
  41688. return this.dynamic = e,
  41689. this
  41690. },
  41691. copy: function(e) {
  41692. return this.array = new e.array.constructor(e.array),
  41693. this.itemSize = e.itemSize,
  41694. this.dynamic = e.dynamic,
  41695. this
  41696. },
  41697. copyAt: function(e, t, i) {
  41698. e *= this.itemSize,
  41699. i *= t.itemSize;
  41700. for (var n = 0, r = this.itemSize; n < r; n++)
  41701. this.array[e + n] = t.array[i + n];
  41702. return this
  41703. },
  41704. copyArray: function(e) {
  41705. return this.array.set(e),
  41706. this
  41707. },
  41708. copyColorsArray: function(e) {
  41709. for (var t = this.array, i = 0, n = 0, r = e.length; n < r; n++) {
  41710. var o = e[n];
  41711. void 0 === o && (console.warn("THREE.BufferAttribute.copyColorsArray(): color is undefined", n),
  41712. o = new Ci.Color),
  41713. t[i++] = o.r,
  41714. t[i++] = o.g,
  41715. t[i++] = o.b
  41716. }
  41717. return this
  41718. },
  41719. copyIndicesArray: function(e) {
  41720. for (var t = this.array, i = 0, n = 0, r = e.length; n < r; n++) {
  41721. var o = e[n];
  41722. t[i++] = o.a,
  41723. t[i++] = o.b,
  41724. t[i++] = o.c
  41725. }
  41726. return this
  41727. },
  41728. copyVector2sArray: function(e) {
  41729. for (var t = this.array, i = 0, n = 0, r = e.length; n < r; n++) {
  41730. var o = e[n];
  41731. void 0 === o && (console.warn("THREE.BufferAttribute.copyVector2sArray(): vector is undefined", n),
  41732. o = new Ci.Vector2),
  41733. t[i++] = o.x,
  41734. t[i++] = o.y
  41735. }
  41736. return this
  41737. },
  41738. copyVector3sArray: function(e) {
  41739. for (var t = this.array, i = 0, n = 0, r = e.length; n < r; n++) {
  41740. var o = e[n];
  41741. void 0 === o && (console.warn("THREE.BufferAttribute.copyVector3sArray(): vector is undefined", n),
  41742. o = new Ci.Vector3),
  41743. t[i++] = o.x,
  41744. t[i++] = o.y,
  41745. t[i++] = o.z
  41746. }
  41747. return this
  41748. },
  41749. copyVector4sArray: function(e) {
  41750. for (var t = this.array, i = 0, n = 0, r = e.length; n < r; n++) {
  41751. var o = e[n];
  41752. void 0 === o && (console.warn("THREE.BufferAttribute.copyVector4sArray(): vector is undefined", n),
  41753. o = new Ci.Vector4),
  41754. t[i++] = o.x,
  41755. t[i++] = o.y,
  41756. t[i++] = o.z,
  41757. t[i++] = o.w
  41758. }
  41759. return this
  41760. },
  41761. set: function(e, t) {
  41762. return void 0 === t && (t = 0),
  41763. this.array.set(e, t),
  41764. this
  41765. },
  41766. getX: function(e) {
  41767. return this.array[e * this.itemSize]
  41768. },
  41769. setX: function(e, t) {
  41770. return this.array[e * this.itemSize] = t,
  41771. this
  41772. },
  41773. getY: function(e) {
  41774. return this.array[e * this.itemSize + 1]
  41775. },
  41776. setY: function(e, t) {
  41777. return this.array[e * this.itemSize + 1] = t,
  41778. this
  41779. },
  41780. getZ: function(e) {
  41781. return this.array[e * this.itemSize + 2]
  41782. },
  41783. setZ: function(e, t) {
  41784. return this.array[e * this.itemSize + 2] = t,
  41785. this
  41786. },
  41787. getW: function(e) {
  41788. return this.array[e * this.itemSize + 3]
  41789. },
  41790. setW: function(e, t) {
  41791. return this.array[e * this.itemSize + 3] = t,
  41792. this
  41793. },
  41794. setXY: function(e, t, i) {
  41795. return e *= this.itemSize,
  41796. this.array[e + 0] = t,
  41797. this.array[e + 1] = i,
  41798. this
  41799. },
  41800. setXYZ: function(e, t, i, n) {
  41801. return e *= this.itemSize,
  41802. this.array[e + 0] = t,
  41803. this.array[e + 1] = i,
  41804. this.array[e + 2] = n,
  41805. this
  41806. },
  41807. setXYZW: function(e, t, i, n, r) {
  41808. return e *= this.itemSize,
  41809. this.array[e + 0] = t,
  41810. this.array[e + 1] = i,
  41811. this.array[e + 2] = n,
  41812. this.array[e + 3] = r,
  41813. this
  41814. },
  41815. clone: function() {
  41816. return (new this.constructor).copy(this)
  41817. }
  41818. },
  41819. Ci.Int8Attribute = function(e, t) {
  41820. return new Ci.BufferAttribute(new Int8Array(e),t)
  41821. }
  41822. ,
  41823. Ci.Uint8Attribute = function(e, t) {
  41824. return new Ci.BufferAttribute(new Uint8Array(e),t)
  41825. }
  41826. ,
  41827. Ci.Uint8ClampedAttribute = function(e, t) {
  41828. return new Ci.BufferAttribute(new Uint8ClampedArray(e),t)
  41829. }
  41830. ,
  41831. Ci.Int16Attribute = function(e, t) {
  41832. return new Ci.BufferAttribute(new Int16Array(e),t)
  41833. }
  41834. ,
  41835. Ci.Uint16Attribute = function(e, t) {
  41836. return new Ci.BufferAttribute(new Uint16Array(e),t)
  41837. }
  41838. ,
  41839. Ci.Int32Attribute = function(e, t) {
  41840. return new Ci.BufferAttribute(new Int32Array(e),t)
  41841. }
  41842. ,
  41843. Ci.Uint32Attribute = function(e, t) {
  41844. return new Ci.BufferAttribute(new Uint32Array(e),t)
  41845. }
  41846. ,
  41847. Ci.Float32Attribute = function(e, t) {
  41848. return new Ci.BufferAttribute(new Float32Array(e),t)
  41849. }
  41850. ,
  41851. Ci.Float64Attribute = function(e, t) {
  41852. return new Ci.BufferAttribute(new Float64Array(e),t)
  41853. }
  41854. ,
  41855. Ci.DynamicBufferAttribute = function(e, t) {
  41856. return console.warn("THREE.DynamicBufferAttribute has been removed. Use new THREE.BufferAttribute().setDynamic( true ) instead."),
  41857. new Ci.BufferAttribute(e,t).setDynamic(!0)
  41858. }
  41859. ,
  41860. Ci.InstancedBufferAttribute = function(e, t, i) {
  41861. Ci.BufferAttribute.call(this, e, t),
  41862. this.meshPerAttribute = i || 1
  41863. }
  41864. ,
  41865. Ci.InstancedBufferAttribute.prototype = Object.create(Ci.BufferAttribute.prototype),
  41866. Ci.InstancedBufferAttribute.prototype.constructor = Ci.InstancedBufferAttribute,
  41867. Ci.InstancedBufferAttribute.prototype.copy = function(e) {
  41868. return Ci.BufferAttribute.prototype.copy.call(this, e),
  41869. this.meshPerAttribute = e.meshPerAttribute,
  41870. this
  41871. }
  41872. ,
  41873. Ci.InterleavedBuffer = function(e, t) {
  41874. this.uuid = Ci.Math.generateUUID(),
  41875. this.array = e,
  41876. this.stride = t,
  41877. this.dynamic = !1,
  41878. this.updateRange = {
  41879. offset: 0,
  41880. count: -1
  41881. },
  41882. this.version = 0
  41883. }
  41884. ,
  41885. Ci.InterleavedBuffer.prototype = {
  41886. constructor: Ci.InterleavedBuffer,
  41887. get length() {
  41888. return this.array.length
  41889. },
  41890. get count() {
  41891. return this.array.length / this.stride
  41892. },
  41893. set needsUpdate(e) {
  41894. !0 === e && this.version++
  41895. },
  41896. setDynamic: function(e) {
  41897. return this.dynamic = e,
  41898. this
  41899. },
  41900. copy: function(e) {
  41901. return this.array = new e.array.constructor(e.array),
  41902. this.stride = e.stride,
  41903. this.dynamic = e.dynamic,
  41904. this
  41905. },
  41906. copyAt: function(e, t, i) {
  41907. e *= this.stride,
  41908. i *= t.stride;
  41909. for (var n = 0, r = this.stride; n < r; n++)
  41910. this.array[e + n] = t.array[i + n];
  41911. return this
  41912. },
  41913. set: function(e, t) {
  41914. return void 0 === t && (t = 0),
  41915. this.array.set(e, t),
  41916. this
  41917. },
  41918. clone: function() {
  41919. return (new this.constructor).copy(this)
  41920. }
  41921. },
  41922. Ci.InstancedInterleavedBuffer = function(e, t, i) {
  41923. Ci.InterleavedBuffer.call(this, e, t),
  41924. this.meshPerAttribute = i || 1
  41925. }
  41926. ,
  41927. Ci.InstancedInterleavedBuffer.prototype = Object.create(Ci.InterleavedBuffer.prototype),
  41928. Ci.InstancedInterleavedBuffer.prototype.constructor = Ci.InstancedInterleavedBuffer,
  41929. Ci.InstancedInterleavedBuffer.prototype.copy = function(e) {
  41930. return Ci.InterleavedBuffer.prototype.copy.call(this, e),
  41931. this.meshPerAttribute = e.meshPerAttribute,
  41932. this
  41933. }
  41934. ,
  41935. Ci.InterleavedBufferAttribute = function(e, t, i) {
  41936. this.uuid = Ci.Math.generateUUID(),
  41937. this.data = e,
  41938. this.itemSize = t,
  41939. this.offset = i
  41940. }
  41941. ,
  41942. Ci.InterleavedBufferAttribute.prototype = {
  41943. constructor: Ci.InterleavedBufferAttribute,
  41944. get length() {
  41945. return console.warn("THREE.BufferAttribute: .length has been deprecated. Please use .count."),
  41946. this.array.length
  41947. },
  41948. get count() {
  41949. return this.data.count
  41950. },
  41951. setX: function(e, t) {
  41952. return this.data.array[e * this.data.stride + this.offset] = t,
  41953. this
  41954. },
  41955. setY: function(e, t) {
  41956. return this.data.array[e * this.data.stride + this.offset + 1] = t,
  41957. this
  41958. },
  41959. setZ: function(e, t) {
  41960. return this.data.array[e * this.data.stride + this.offset + 2] = t,
  41961. this
  41962. },
  41963. setW: function(e, t) {
  41964. return this.data.array[e * this.data.stride + this.offset + 3] = t,
  41965. this
  41966. },
  41967. getX: function(e) {
  41968. return this.data.array[e * this.data.stride + this.offset]
  41969. },
  41970. getY: function(e) {
  41971. return this.data.array[e * this.data.stride + this.offset + 1]
  41972. },
  41973. getZ: function(e) {
  41974. return this.data.array[e * this.data.stride + this.offset + 2]
  41975. },
  41976. getW: function(e) {
  41977. return this.data.array[e * this.data.stride + this.offset + 3]
  41978. },
  41979. setXY: function(e, t, i) {
  41980. return e = e * this.data.stride + this.offset,
  41981. this.data.array[e + 0] = t,
  41982. this.data.array[e + 1] = i,
  41983. this
  41984. },
  41985. setXYZ: function(e, t, i, n) {
  41986. return e = e * this.data.stride + this.offset,
  41987. this.data.array[e + 0] = t,
  41988. this.data.array[e + 1] = i,
  41989. this.data.array[e + 2] = n,
  41990. this
  41991. },
  41992. setXYZW: function(e, t, i, n, r) {
  41993. return e = e * this.data.stride + this.offset,
  41994. this.data.array[e + 0] = t,
  41995. this.data.array[e + 1] = i,
  41996. this.data.array[e + 2] = n,
  41997. this.data.array[e + 3] = r,
  41998. this
  41999. }
  42000. },
  42001. Ci.Geometry = function() {
  42002. Object.defineProperty(this, "id", {
  42003. value: Ci.GeometryIdCount++
  42004. }),
  42005. this.uuid = Ci.Math.generateUUID(),
  42006. this.name = "",
  42007. this.type = "Geometry",
  42008. this.vertices = [],
  42009. this.colors = [],
  42010. this.faces = [],
  42011. this.faceVertexUvs = [[]],
  42012. this.morphTargets = [],
  42013. this.morphNormals = [],
  42014. this.skinWeights = [],
  42015. this.skinIndices = [],
  42016. this.lineDistances = [],
  42017. this.boundingBox = null,
  42018. this.boundingSphere = null,
  42019. this.verticesNeedUpdate = !1,
  42020. this.elementsNeedUpdate = !1,
  42021. this.uvsNeedUpdate = !1,
  42022. this.normalsNeedUpdate = !1,
  42023. this.colorsNeedUpdate = !1,
  42024. this.lineDistancesNeedUpdate = !1,
  42025. this.groupsNeedUpdate = !1
  42026. }
  42027. ,
  42028. Ci.Geometry.prototype = {
  42029. constructor: Ci.Geometry,
  42030. applyMatrix: function(e) {
  42031. for (var t = (new Ci.Matrix3).getNormalMatrix(e), i = 0, n = this.vertices.length; i < n; i++) {
  42032. this.vertices[i].applyMatrix4(e)
  42033. }
  42034. for (i = 0,
  42035. n = this.faces.length; i < n; i++) {
  42036. var r = this.faces[i];
  42037. r.normal.applyMatrix3(t).normalize();
  42038. for (var o = 0, a = r.vertexNormals.length; o < a; o++)
  42039. r.vertexNormals[o].applyMatrix3(t).normalize()
  42040. }
  42041. return null !== this.boundingBox && this.computeBoundingBox(),
  42042. null !== this.boundingSphere && this.computeBoundingSphere(),
  42043. this.verticesNeedUpdate = !0,
  42044. this.normalsNeedUpdate = !0,
  42045. this
  42046. },
  42047. rotateX: function(e) {
  42048. return void 0 === mt && (mt = new Ci.Matrix4),
  42049. mt.makeRotationX(e),
  42050. this.applyMatrix(mt),
  42051. this
  42052. },
  42053. rotateY: function(e) {
  42054. return void 0 === gt && (gt = new Ci.Matrix4),
  42055. gt.makeRotationY(e),
  42056. this.applyMatrix(gt),
  42057. this
  42058. },
  42059. rotateZ: function(e) {
  42060. return void 0 === ft && (ft = new Ci.Matrix4),
  42061. ft.makeRotationZ(e),
  42062. this.applyMatrix(ft),
  42063. this
  42064. },
  42065. translate: function(e, t, i) {
  42066. return void 0 === pt && (pt = new Ci.Matrix4),
  42067. pt.makeTranslation(e, t, i),
  42068. this.applyMatrix(pt),
  42069. this
  42070. },
  42071. scale: function(e, t, i) {
  42072. return void 0 === dt && (dt = new Ci.Matrix4),
  42073. dt.makeScale(e, t, i),
  42074. this.applyMatrix(dt),
  42075. this
  42076. },
  42077. lookAt: function(e) {
  42078. void 0 === ut && (ut = new Ci.Object3D),
  42079. ut.lookAt(e),
  42080. ut.updateMatrix(),
  42081. this.applyMatrix(ut.matrix)
  42082. },
  42083. fromBufferGeometry: function(e) {
  42084. function t(e, t, i, n) {
  42085. var r = void 0 !== l ? [d[e].clone(), d[t].clone(), d[i].clone()] : []
  42086. , o = void 0 !== c ? [s.colors[e].clone(), s.colors[t].clone(), s.colors[i].clone()] : []
  42087. , a = new Ci.Face3(e,t,i,r,o,n);
  42088. s.faces.push(a),
  42089. void 0 !== h && s.faceVertexUvs[0].push([p[e].clone(), p[t].clone(), p[i].clone()]),
  42090. void 0 !== u && s.faceVertexUvs[1].push([f[e].clone(), f[t].clone(), f[i].clone()])
  42091. }
  42092. var s = this
  42093. , i = null !== e.index ? e.index.array : void 0
  42094. , n = e.attributes
  42095. , r = n.position.array
  42096. , l = void 0 !== n.normal ? n.normal.array : void 0
  42097. , c = void 0 !== n.color ? n.color.array : void 0
  42098. , h = void 0 !== n.uv ? n.uv.array : void 0
  42099. , u = void 0 !== n.uv2 ? n.uv2.array : void 0;
  42100. void 0 !== u && (this.faceVertexUvs[1] = []);
  42101. for (var d = [], p = [], f = [], o = 0, a = 0; o < r.length; o += 3,
  42102. a += 2)
  42103. s.vertices.push(new Ci.Vector3(r[o],r[o + 1],r[o + 2])),
  42104. void 0 !== l && d.push(new Ci.Vector3(l[o],l[o + 1],l[o + 2])),
  42105. void 0 !== c && s.colors.push(new Ci.Color(c[o],c[o + 1],c[o + 2])),
  42106. void 0 !== h && p.push(new Ci.Vector2(h[a],h[a + 1])),
  42107. void 0 !== u && f.push(new Ci.Vector2(u[a],u[a + 1]));
  42108. if (void 0 !== i) {
  42109. var g = e.groups;
  42110. if (0 < g.length)
  42111. for (o = 0; o < g.length; o++)
  42112. for (var m = g[o], v = m.start, y = (a = v,
  42113. v + m.count); a < y; a += 3)
  42114. t(i[a], i[a + 1], i[a + 2], m.materialIndex);
  42115. else
  42116. for (o = 0; o < i.length; o += 3)
  42117. t(i[o], i[o + 1], i[o + 2])
  42118. } else
  42119. for (o = 0; o < r.length / 3; o += 3)
  42120. t(o, o + 1, o + 2);
  42121. return this.computeFaceNormals(),
  42122. null !== e.boundingBox && (this.boundingBox = e.boundingBox.clone()),
  42123. null !== e.boundingSphere && (this.boundingSphere = e.boundingSphere.clone()),
  42124. this
  42125. },
  42126. center: function() {
  42127. this.computeBoundingBox();
  42128. var e = this.boundingBox.center().negate();
  42129. return this.translate(e.x, e.y, e.z),
  42130. e
  42131. },
  42132. normalize: function() {
  42133. this.computeBoundingSphere();
  42134. var e = this.boundingSphere.center
  42135. , t = this.boundingSphere.radius
  42136. , i = 0 === t ? 1 : 1 / t
  42137. , n = new Ci.Matrix4;
  42138. 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),
  42139. this.applyMatrix(n),
  42140. this
  42141. },
  42142. computeFaceNormals: function() {
  42143. for (var e = new Ci.Vector3, t = new Ci.Vector3, i = 0, n = this.faces.length; i < n; i++) {
  42144. var r = this.faces[i]
  42145. , o = this.vertices[r.a]
  42146. , a = this.vertices[r.b]
  42147. , s = this.vertices[r.c];
  42148. e.subVectors(s, a),
  42149. t.subVectors(o, a),
  42150. e.cross(t),
  42151. e.normalize(),
  42152. r.normal.copy(e)
  42153. }
  42154. },
  42155. computeVertexNormals: function(e) {
  42156. var t, i, n, r, o, a;
  42157. for (void 0 === e && (e = !0),
  42158. a = new Array(this.vertices.length),
  42159. t = 0,
  42160. i = this.vertices.length; t < i; t++)
  42161. a[t] = new Ci.Vector3;
  42162. if (e) {
  42163. var s, l, c, h = new Ci.Vector3, u = new Ci.Vector3;
  42164. for (n = 0,
  42165. r = this.faces.length; n < r; n++)
  42166. o = this.faces[n],
  42167. s = this.vertices[o.a],
  42168. l = this.vertices[o.b],
  42169. c = this.vertices[o.c],
  42170. h.subVectors(c, l),
  42171. u.subVectors(s, l),
  42172. h.cross(u),
  42173. a[o.a].add(h),
  42174. a[o.b].add(h),
  42175. a[o.c].add(h)
  42176. } else
  42177. for (n = 0,
  42178. r = this.faces.length; n < r; n++)
  42179. a[(o = this.faces[n]).a].add(o.normal),
  42180. a[o.b].add(o.normal),
  42181. a[o.c].add(o.normal);
  42182. for (t = 0,
  42183. i = this.vertices.length; t < i; t++)
  42184. a[t].normalize();
  42185. for (n = 0,
  42186. r = this.faces.length; n < r; n++) {
  42187. var d = (o = this.faces[n]).vertexNormals;
  42188. 3 === d.length ? (d[0].copy(a[o.a]),
  42189. d[1].copy(a[o.b]),
  42190. d[2].copy(a[o.c])) : (d[0] = a[o.a].clone(),
  42191. d[1] = a[o.b].clone(),
  42192. d[2] = a[o.c].clone())
  42193. }
  42194. 0 < this.faces.length && (this.normalsNeedUpdate = !0)
  42195. },
  42196. computeMorphNormals: function() {
  42197. var e, t, i, n, r;
  42198. for (i = 0,
  42199. n = this.faces.length; i < n; i++)
  42200. for ((r = this.faces[i]).__originalFaceNormal ? r.__originalFaceNormal.copy(r.normal) : r.__originalFaceNormal = r.normal.clone(),
  42201. r.__originalVertexNormals || (r.__originalVertexNormals = []),
  42202. e = 0,
  42203. t = r.vertexNormals.length; e < t; e++)
  42204. r.__originalVertexNormals[e] ? r.__originalVertexNormals[e].copy(r.vertexNormals[e]) : r.__originalVertexNormals[e] = r.vertexNormals[e].clone();
  42205. var o = new Ci.Geometry;
  42206. for (o.faces = this.faces,
  42207. e = 0,
  42208. t = this.morphTargets.length; e < t; e++) {
  42209. if (!this.morphNormals[e]) {
  42210. this.morphNormals[e] = {},
  42211. this.morphNormals[e].faceNormals = [],
  42212. this.morphNormals[e].vertexNormals = [];
  42213. var a = this.morphNormals[e].faceNormals
  42214. , s = this.morphNormals[e].vertexNormals;
  42215. for (i = 0,
  42216. n = this.faces.length; i < n; i++)
  42217. l = new Ci.Vector3,
  42218. c = {
  42219. a: new Ci.Vector3,
  42220. b: new Ci.Vector3,
  42221. c: new Ci.Vector3
  42222. },
  42223. a.push(l),
  42224. s.push(c)
  42225. }
  42226. var l, c, h = this.morphNormals[e];
  42227. for (o.vertices = this.morphTargets[e].vertices,
  42228. o.computeFaceNormals(),
  42229. o.computeVertexNormals(),
  42230. i = 0,
  42231. n = this.faces.length; i < n; i++)
  42232. r = this.faces[i],
  42233. l = h.faceNormals[i],
  42234. c = h.vertexNormals[i],
  42235. l.copy(r.normal),
  42236. c.a.copy(r.vertexNormals[0]),
  42237. c.b.copy(r.vertexNormals[1]),
  42238. c.c.copy(r.vertexNormals[2])
  42239. }
  42240. for (i = 0,
  42241. n = this.faces.length; i < n; i++)
  42242. (r = this.faces[i]).normal = r.__originalFaceNormal,
  42243. r.vertexNormals = r.__originalVertexNormals
  42244. },
  42245. computeTangents: function() {
  42246. console.warn("THREE.Geometry: .computeTangents() has been removed.")
  42247. },
  42248. computeLineDistances: function() {
  42249. for (var e = 0, t = this.vertices, i = 0, n = t.length; i < n; i++)
  42250. 0 < i && (e += t[i].distanceTo(t[i - 1])),
  42251. this.lineDistances[i] = e
  42252. },
  42253. computeBoundingBox: function() {
  42254. null === this.boundingBox && (this.boundingBox = new Ci.Box3),
  42255. this.boundingBox.setFromPoints(this.vertices)
  42256. },
  42257. computeBoundingSphere: function() {
  42258. null === this.boundingSphere && (this.boundingSphere = new Ci.Sphere),
  42259. this.boundingSphere.setFromPoints(this.vertices)
  42260. },
  42261. merge: function(e, t, i) {
  42262. if (e instanceof Ci.Geometry != 0) {
  42263. 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];
  42264. void 0 === i && (i = 0),
  42265. void 0 !== t && (n = (new Ci.Matrix3).getNormalMatrix(t));
  42266. for (var u = 0, d = a.length; u < d; u++) {
  42267. var p = a[u].clone();
  42268. void 0 !== t && p.applyMatrix4(t),
  42269. o.push(p)
  42270. }
  42271. for (u = 0,
  42272. d = l.length; u < d; u++) {
  42273. var f, g, m, v = l[u], y = v.vertexNormals, A = v.vertexColors;
  42274. (f = new Ci.Face3(v.a + r,v.b + r,v.c + r)).normal.copy(v.normal),
  42275. void 0 !== n && f.normal.applyMatrix3(n).normalize();
  42276. for (var C = 0, I = y.length; C < I; C++)
  42277. g = y[C].clone(),
  42278. void 0 !== n && g.applyMatrix3(n).normalize(),
  42279. f.vertexNormals.push(g);
  42280. f.color.copy(v.color);
  42281. for (C = 0,
  42282. I = A.length; C < I; C++)
  42283. m = A[C],
  42284. f.vertexColors.push(m.clone());
  42285. f.materialIndex = v.materialIndex + i,
  42286. s.push(f)
  42287. }
  42288. for (u = 0,
  42289. d = h.length; u < d; u++) {
  42290. var E = h[u]
  42291. , _ = [];
  42292. if (void 0 !== E) {
  42293. for (C = 0,
  42294. I = E.length; C < I; C++)
  42295. _.push(E[C].clone());
  42296. c.push(_)
  42297. }
  42298. }
  42299. } else
  42300. console.error("THREE.Geometry.merge(): geometry not an instance of THREE.Geometry.", e)
  42301. },
  42302. mergeMesh: function(e) {
  42303. return e instanceof Ci.Mesh == 0 ? void console.error("THREE.Geometry.mergeMesh(): mesh not an instance of THREE.Mesh.", e) : (e.matrixAutoUpdate && e.updateMatrix(),
  42304. void this.merge(e.geometry, e.matrix))
  42305. },
  42306. mergeVertices: function() {
  42307. var e, t, i, n, r, o, a, s, l = {}, c = [], h = [], u = Math.pow(10, 4);
  42308. for (i = 0,
  42309. n = this.vertices.length; i < n; i++)
  42310. e = this.vertices[i],
  42311. void 0 === l[t = Math.round(e.x * u) + "_" + Math.round(e.y * u) + "_" + Math.round(e.z * u)] ? (l[t] = i,
  42312. c.push(this.vertices[i]),
  42313. h[i] = c.length - 1) : h[i] = h[l[t]];
  42314. var d = [];
  42315. for (i = 0,
  42316. n = this.faces.length; i < n; i++) {
  42317. (r = this.faces[i]).a = h[r.a],
  42318. r.b = h[r.b],
  42319. r.c = h[r.c],
  42320. o = [r.a, r.b, r.c];
  42321. for (var p = 0; p < 3; p++)
  42322. if (o[p] === o[(p + 1) % 3]) {
  42323. p,
  42324. d.push(i);
  42325. break
  42326. }
  42327. }
  42328. for (i = d.length - 1; 0 <= i; i--) {
  42329. var f = d[i];
  42330. for (this.faces.splice(f, 1),
  42331. a = 0,
  42332. s = this.faceVertexUvs.length; a < s; a++)
  42333. this.faceVertexUvs[a].splice(f, 1)
  42334. }
  42335. var g = this.vertices.length - c.length;
  42336. return this.vertices = c,
  42337. g
  42338. },
  42339. sortFacesByMaterialIndex: function() {
  42340. for (var e = this.faces, t = e.length, i = 0; i < t; i++)
  42341. e[i]._id = i;
  42342. e.sort(function(e, t) {
  42343. return e.materialIndex - t.materialIndex
  42344. });
  42345. var n, r, o = this.faceVertexUvs[0], a = this.faceVertexUvs[1];
  42346. o && o.length === t && (n = []),
  42347. a && a.length === t && (r = []);
  42348. for (i = 0; i < t; i++) {
  42349. var s = e[i]._id;
  42350. n && n.push(o[s]),
  42351. r && r.push(a[s])
  42352. }
  42353. n && (this.faceVertexUvs[0] = n),
  42354. r && (this.faceVertexUvs[1] = r)
  42355. },
  42356. toJSON: function() {
  42357. function e(e, t, i) {
  42358. return i ? e | 1 << t : e & ~(1 << t)
  42359. }
  42360. function t(e) {
  42361. var t = e.x.toString() + e.y.toString() + e.z.toString();
  42362. return void 0 !== d[t] || (d[t] = u.length / 3,
  42363. u.push(e.x, e.y, e.z)),
  42364. d[t]
  42365. }
  42366. function i(e) {
  42367. var t = e.r.toString() + e.g.toString() + e.b.toString();
  42368. return void 0 !== f[t] || (f[t] = p.length,
  42369. p.push(e.getHex())),
  42370. f[t]
  42371. }
  42372. function n(e) {
  42373. var t = e.x.toString() + e.y.toString();
  42374. return void 0 !== m[t] || (m[t] = g.length / 2,
  42375. g.push(e.x, e.y)),
  42376. m[t]
  42377. }
  42378. var r = {
  42379. metadata: {
  42380. version: 4.4,
  42381. type: "Geometry",
  42382. generator: "Geometry.toJSON"
  42383. }
  42384. };
  42385. if (r.uuid = this.uuid,
  42386. r.type = this.type,
  42387. "" !== this.name && (r.name = this.name),
  42388. void 0 !== this.parameters) {
  42389. var o = this.parameters;
  42390. for (var a in o)
  42391. void 0 !== o[a] && (r[a] = o[a]);
  42392. return r
  42393. }
  42394. for (var s = [], l = 0; l < this.vertices.length; l++) {
  42395. var c = this.vertices[l];
  42396. s.push(c.x, c.y, c.z)
  42397. }
  42398. var h = []
  42399. , u = []
  42400. , d = {}
  42401. , p = []
  42402. , f = {}
  42403. , g = []
  42404. , m = {};
  42405. for (l = 0; l < this.faces.length; l++) {
  42406. var v = this.faces[l]
  42407. , y = void 0 !== this.faceVertexUvs[0][l]
  42408. , A = 0 < v.normal.length()
  42409. , C = 0 < v.vertexNormals.length
  42410. , I = 1 !== v.color.r || 1 !== v.color.g || 1 !== v.color.b
  42411. , E = 0 < v.vertexColors.length
  42412. , _ = 0;
  42413. 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),
  42414. h.push(_),
  42415. h.push(v.a, v.b, v.c),
  42416. h.push(v.materialIndex),
  42417. y) {
  42418. var b = this.faceVertexUvs[0][l];
  42419. h.push(n(b[0]), n(b[1]), n(b[2]))
  42420. }
  42421. if (A && h.push(t(v.normal)),
  42422. C) {
  42423. var w = v.vertexNormals;
  42424. h.push(t(w[0]), t(w[1]), t(w[2]))
  42425. }
  42426. if (I && h.push(i(v.color)),
  42427. E) {
  42428. var T = v.vertexColors;
  42429. h.push(i(T[0]), i(T[1]), i(T[2]))
  42430. }
  42431. }
  42432. return r.data = {},
  42433. r.data.vertices = s,
  42434. r.data.normals = u,
  42435. 0 < p.length && (r.data.colors = p),
  42436. 0 < g.length && (r.data.uvs = [g]),
  42437. r.data.faces = h,
  42438. r
  42439. },
  42440. clone: function() {
  42441. return (new Ci.Geometry).copy(this)
  42442. },
  42443. copy: function(e) {
  42444. this.vertices = [],
  42445. this.faces = [],
  42446. this.faceVertexUvs = [[]];
  42447. for (var t = e.vertices, i = 0, n = t.length; i < n; i++)
  42448. this.vertices.push(t[i].clone());
  42449. var r = e.faces;
  42450. for (i = 0,
  42451. n = r.length; i < n; i++)
  42452. this.faces.push(r[i].clone());
  42453. for (i = 0,
  42454. n = e.faceVertexUvs.length; i < n; i++) {
  42455. var o = e.faceVertexUvs[i];
  42456. void 0 === this.faceVertexUvs[i] && (this.faceVertexUvs[i] = []);
  42457. for (var a = 0, s = o.length; a < s; a++) {
  42458. for (var l = o[a], c = [], h = 0, u = l.length; h < u; h++) {
  42459. var d = l[h];
  42460. c.push(d.clone())
  42461. }
  42462. this.faceVertexUvs[i].push(c)
  42463. }
  42464. }
  42465. return this
  42466. },
  42467. dispose: function() {
  42468. this.dispatchEvent({
  42469. type: "dispose"
  42470. })
  42471. }
  42472. },
  42473. Ci.EventDispatcher.prototype.apply(Ci.Geometry.prototype),
  42474. Ci.GeometryIdCount = 0,
  42475. Ci.DirectGeometry = function() {
  42476. Object.defineProperty(this, "id", {
  42477. value: Ci.GeometryIdCount++
  42478. }),
  42479. this.uuid = Ci.Math.generateUUID(),
  42480. this.name = "",
  42481. this.type = "DirectGeometry",
  42482. this.indices = [],
  42483. this.vertices = [],
  42484. this.normals = [],
  42485. this.colors = [],
  42486. this.uvs = [],
  42487. this.uvs2 = [],
  42488. this.groups = [],
  42489. this.morphTargets = {},
  42490. this.skinWeights = [],
  42491. this.skinIndices = [],
  42492. this.boundingBox = null,
  42493. this.boundingSphere = null,
  42494. this.verticesNeedUpdate = !1,
  42495. this.normalsNeedUpdate = !1,
  42496. this.colorsNeedUpdate = !1,
  42497. this.uvsNeedUpdate = !1,
  42498. this.groupsNeedUpdate = !1
  42499. }
  42500. ,
  42501. Ci.DirectGeometry.prototype = {
  42502. constructor: Ci.DirectGeometry,
  42503. computeBoundingBox: Ci.Geometry.prototype.computeBoundingBox,
  42504. computeBoundingSphere: Ci.Geometry.prototype.computeBoundingSphere,
  42505. computeFaceNormals: function() {
  42506. console.warn("THREE.DirectGeometry: computeFaceNormals() is not a method of this type of geometry.")
  42507. },
  42508. computeVertexNormals: function() {
  42509. console.warn("THREE.DirectGeometry: computeVertexNormals() is not a method of this type of geometry.")
  42510. },
  42511. computeGroups: function(e) {
  42512. for (var t, i, n = [], r = e.faces, o = 0; o < r.length; o++) {
  42513. var a = r[o];
  42514. a.materialIndex !== i && (i = a.materialIndex,
  42515. void 0 !== t && (t.count = 3 * o - t.start,
  42516. n.push(t)),
  42517. t = {
  42518. start: 3 * o,
  42519. materialIndex: i
  42520. })
  42521. }
  42522. void 0 !== t && (t.count = 3 * o - t.start,
  42523. n.push(t)),
  42524. this.groups = n
  42525. },
  42526. fromGeometry: function(e) {
  42527. 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;
  42528. if (0 < l) {
  42529. t = [];
  42530. for (var c = 0; c < l; c++)
  42531. t[c] = [];
  42532. this.morphTargets.position = t
  42533. }
  42534. var h, u = e.morphNormals, d = u.length;
  42535. if (0 < d) {
  42536. h = [];
  42537. for (c = 0; c < d; c++)
  42538. h[c] = [];
  42539. this.morphTargets.normal = h
  42540. }
  42541. var p = e.skinIndices
  42542. , f = e.skinWeights
  42543. , g = p.length === n.length
  42544. , m = f.length === n.length;
  42545. for (c = 0; c < i.length; c++) {
  42546. var v = i[c];
  42547. this.vertices.push(n[v.a], n[v.b], n[v.c]);
  42548. var y = v.vertexNormals;
  42549. if (3 === y.length)
  42550. this.normals.push(y[0], y[1], y[2]);
  42551. else {
  42552. var A = v.normal;
  42553. this.normals.push(A, A, A)
  42554. }
  42555. var C, I = v.vertexColors;
  42556. if (3 === I.length)
  42557. this.colors.push(I[0], I[1], I[2]);
  42558. else {
  42559. var E = v.color;
  42560. this.colors.push(E, E, E)
  42561. }
  42562. if (!0 === o)
  42563. void 0 !== (C = r[0][c]) ? this.uvs.push(C[0], C[1], C[2]) : (console.warn("THREE.DirectGeometry.fromGeometry(): Undefined vertexUv ", c),
  42564. this.uvs.push(new Ci.Vector2, new Ci.Vector2, new Ci.Vector2));
  42565. if (!0 === a)
  42566. void 0 !== (C = r[1][c]) ? this.uvs2.push(C[0], C[1], C[2]) : (console.warn("THREE.DirectGeometry.fromGeometry(): Undefined vertexUv2 ", c),
  42567. this.uvs2.push(new Ci.Vector2, new Ci.Vector2, new Ci.Vector2));
  42568. for (var _ = 0; _ < l; _++) {
  42569. var b = s[_].vertices;
  42570. t[_].push(b[v.a], b[v.b], b[v.c])
  42571. }
  42572. for (_ = 0; _ < d; _++) {
  42573. var w = u[_].vertexNormals[c];
  42574. h[_].push(w.a, w.b, w.c)
  42575. }
  42576. g && this.skinIndices.push(p[v.a], p[v.b], p[v.c]),
  42577. m && this.skinWeights.push(f[v.a], f[v.b], f[v.c])
  42578. }
  42579. return this.computeGroups(e),
  42580. this.verticesNeedUpdate = e.verticesNeedUpdate,
  42581. this.normalsNeedUpdate = e.normalsNeedUpdate,
  42582. this.colorsNeedUpdate = e.colorsNeedUpdate,
  42583. this.uvsNeedUpdate = e.uvsNeedUpdate,
  42584. this.groupsNeedUpdate = e.groupsNeedUpdate,
  42585. this
  42586. },
  42587. dispose: function() {
  42588. this.dispatchEvent({
  42589. type: "dispose"
  42590. })
  42591. }
  42592. },
  42593. Ci.EventDispatcher.prototype.apply(Ci.DirectGeometry.prototype),
  42594. Ci.BufferGeometry = function() {
  42595. Object.defineProperty(this, "id", {
  42596. value: Ci.GeometryIdCount++
  42597. }),
  42598. this.uuid = Ci.Math.generateUUID(),
  42599. this.name = "",
  42600. this.type = "BufferGeometry",
  42601. this.index = null,
  42602. this.attributes = {},
  42603. this.morphAttributes = {},
  42604. this.groups = [],
  42605. this.boundingBox = null,
  42606. this.boundingSphere = null,
  42607. this.drawRange = {
  42608. start: 0,
  42609. count: 1 / 0
  42610. }
  42611. }
  42612. ,
  42613. Ci.BufferGeometry.prototype = {
  42614. constructor: Ci.BufferGeometry,
  42615. getIndex: function() {
  42616. return this.index
  42617. },
  42618. setIndex: function(e) {
  42619. this.index = e
  42620. },
  42621. addAttribute: function(e, t) {
  42622. return t instanceof Ci.BufferAttribute == 0 && t instanceof Ci.InterleavedBufferAttribute == 0 ? (console.warn("THREE.BufferGeometry: .addAttribute() now expects ( name, attribute )."),
  42623. void this.addAttribute(e, new Ci.BufferAttribute(t,arguments[2]))) : "index" === e ? (console.warn("THREE.BufferGeometry.addAttribute: Use .setIndex() for index attribute."),
  42624. void this.setIndex(t)) : (this.attributes[e] = t,
  42625. this)
  42626. },
  42627. getAttribute: function(e) {
  42628. return this.attributes[e]
  42629. },
  42630. removeAttribute: function(e) {
  42631. return delete this.attributes[e],
  42632. this
  42633. },
  42634. addGroup: function(e, t, i) {
  42635. this.groups.push({
  42636. start: e,
  42637. count: t,
  42638. materialIndex: void 0 !== i ? i : 0
  42639. })
  42640. },
  42641. clearGroups: function() {
  42642. this.groups = []
  42643. },
  42644. setDrawRange: function(e, t) {
  42645. this.drawRange.start = e,
  42646. this.drawRange.count = t
  42647. },
  42648. applyMatrix: function(e) {
  42649. var t = this.attributes.position;
  42650. void 0 !== t && (e.applyToVector3Array(t.array),
  42651. t.needsUpdate = !0);
  42652. var i = this.attributes.normal;
  42653. void 0 !== i && ((new Ci.Matrix3).getNormalMatrix(e).applyToVector3Array(i.array),
  42654. i.needsUpdate = !0);
  42655. return null !== this.boundingBox && this.computeBoundingBox(),
  42656. null !== this.boundingSphere && this.computeBoundingSphere(),
  42657. this
  42658. },
  42659. rotateX: function(e) {
  42660. return void 0 === ht && (ht = new Ci.Matrix4),
  42661. ht.makeRotationX(e),
  42662. this.applyMatrix(ht),
  42663. this
  42664. },
  42665. rotateY: function(e) {
  42666. return void 0 === ct && (ct = new Ci.Matrix4),
  42667. ct.makeRotationY(e),
  42668. this.applyMatrix(ct),
  42669. this
  42670. },
  42671. rotateZ: function(e) {
  42672. return void 0 === lt && (lt = new Ci.Matrix4),
  42673. lt.makeRotationZ(e),
  42674. this.applyMatrix(lt),
  42675. this
  42676. },
  42677. translate: function(e, t, i) {
  42678. return void 0 === st && (st = new Ci.Matrix4),
  42679. st.makeTranslation(e, t, i),
  42680. this.applyMatrix(st),
  42681. this
  42682. },
  42683. scale: function(e, t, i) {
  42684. return void 0 === at && (at = new Ci.Matrix4),
  42685. at.makeScale(e, t, i),
  42686. this.applyMatrix(at),
  42687. this
  42688. },
  42689. lookAt: function(e) {
  42690. void 0 === ot && (ot = new Ci.Object3D),
  42691. ot.lookAt(e),
  42692. ot.updateMatrix(),
  42693. this.applyMatrix(ot.matrix)
  42694. },
  42695. center: function() {
  42696. this.computeBoundingBox();
  42697. var e = this.boundingBox.center().negate();
  42698. return this.translate(e.x, e.y, e.z),
  42699. e
  42700. },
  42701. setFromObject: function(e) {
  42702. var t = e.geometry;
  42703. if (e instanceof Ci.Points || e instanceof Ci.Line) {
  42704. var i = new Ci.Float32Attribute(3 * t.vertices.length,3)
  42705. , n = new Ci.Float32Attribute(3 * t.colors.length,3);
  42706. if (this.addAttribute("position", i.copyVector3sArray(t.vertices)),
  42707. this.addAttribute("color", n.copyColorsArray(t.colors)),
  42708. t.lineDistances && t.lineDistances.length === t.vertices.length) {
  42709. var r = new Ci.Float32Attribute(t.lineDistances.length,1);
  42710. this.addAttribute("lineDistance", r.copyArray(t.lineDistances))
  42711. }
  42712. null !== t.boundingSphere && (this.boundingSphere = t.boundingSphere.clone()),
  42713. null !== t.boundingBox && (this.boundingBox = t.boundingBox.clone())
  42714. } else
  42715. e instanceof Ci.Mesh && t instanceof Ci.Geometry && this.fromGeometry(t);
  42716. return this
  42717. },
  42718. updateFromObject: function(e) {
  42719. var t, i = e.geometry;
  42720. if (e instanceof Ci.Mesh) {
  42721. var n = i.__directGeometry;
  42722. if (void 0 === n)
  42723. return this.fromGeometry(i);
  42724. n.verticesNeedUpdate = i.verticesNeedUpdate,
  42725. n.normalsNeedUpdate = i.normalsNeedUpdate,
  42726. n.colorsNeedUpdate = i.colorsNeedUpdate,
  42727. n.uvsNeedUpdate = i.uvsNeedUpdate,
  42728. n.groupsNeedUpdate = i.groupsNeedUpdate,
  42729. i.verticesNeedUpdate = !1,
  42730. i.normalsNeedUpdate = !1,
  42731. i.colorsNeedUpdate = !1,
  42732. i.uvsNeedUpdate = !1,
  42733. i.groupsNeedUpdate = !1,
  42734. i = n
  42735. }
  42736. !0 === i.verticesNeedUpdate && (void 0 !== (t = this.attributes.position) && (t.copyVector3sArray(i.vertices),
  42737. t.needsUpdate = !0),
  42738. i.verticesNeedUpdate = !1);
  42739. !0 === i.normalsNeedUpdate && (void 0 !== (t = this.attributes.normal) && (t.copyVector3sArray(i.normals),
  42740. t.needsUpdate = !0),
  42741. i.normalsNeedUpdate = !1);
  42742. !0 === i.colorsNeedUpdate && (void 0 !== (t = this.attributes.color) && (t.copyColorsArray(i.colors),
  42743. t.needsUpdate = !0),
  42744. i.colorsNeedUpdate = !1);
  42745. i.uvsNeedUpdate && (void 0 !== (t = this.attributes.uv) && (t.copyVector2sArray(i.uvs),
  42746. t.needsUpdate = !0),
  42747. i.uvsNeedUpdate = !1);
  42748. i.lineDistancesNeedUpdate && (void 0 !== (t = this.attributes.lineDistance) && (t.copyArray(i.lineDistances),
  42749. t.needsUpdate = !0),
  42750. i.lineDistancesNeedUpdate = !1);
  42751. return i.groupsNeedUpdate && (i.computeGroups(e.geometry),
  42752. this.groups = i.groups,
  42753. i.groupsNeedUpdate = !1),
  42754. this
  42755. },
  42756. fromGeometry: function(e) {
  42757. return e.__directGeometry = (new Ci.DirectGeometry).fromGeometry(e),
  42758. this.fromDirectGeometry(e.__directGeometry)
  42759. },
  42760. fromDirectGeometry: function(e) {
  42761. var t = new Float32Array(3 * e.vertices.length);
  42762. if (this.addAttribute("position", new Ci.BufferAttribute(t,3).copyVector3sArray(e.vertices)),
  42763. 0 < e.normals.length) {
  42764. var i = new Float32Array(3 * e.normals.length);
  42765. this.addAttribute("normal", new Ci.BufferAttribute(i,3).copyVector3sArray(e.normals))
  42766. }
  42767. if (0 < e.colors.length) {
  42768. var n = new Float32Array(3 * e.colors.length);
  42769. this.addAttribute("color", new Ci.BufferAttribute(n,3).copyColorsArray(e.colors))
  42770. }
  42771. if (0 < e.uvs.length) {
  42772. var r = new Float32Array(2 * e.uvs.length);
  42773. this.addAttribute("uv", new Ci.BufferAttribute(r,2).copyVector2sArray(e.uvs))
  42774. }
  42775. if (0 < e.uvs2.length) {
  42776. var o = new Float32Array(2 * e.uvs2.length);
  42777. this.addAttribute("uv2", new Ci.BufferAttribute(o,2).copyVector2sArray(e.uvs2))
  42778. }
  42779. if (0 < e.indices.length) {
  42780. var a = new (65535 < e.vertices.length ? Uint32Array : Uint16Array)(3 * e.indices.length);
  42781. this.setIndex(new Ci.BufferAttribute(a,1).copyIndicesArray(e.indices))
  42782. }
  42783. for (var s in this.groups = e.groups,
  42784. e.morphTargets) {
  42785. for (var l = [], c = e.morphTargets[s], h = 0, u = c.length; h < u; h++) {
  42786. var d = c[h]
  42787. , p = new Ci.Float32Attribute(3 * d.length,3);
  42788. l.push(p.copyVector3sArray(d))
  42789. }
  42790. this.morphAttributes[s] = l
  42791. }
  42792. if (0 < e.skinIndices.length) {
  42793. var f = new Ci.Float32Attribute(4 * e.skinIndices.length,4);
  42794. this.addAttribute("skinIndex", f.copyVector4sArray(e.skinIndices))
  42795. }
  42796. if (0 < e.skinWeights.length) {
  42797. var g = new Ci.Float32Attribute(4 * e.skinWeights.length,4);
  42798. this.addAttribute("skinWeight", g.copyVector4sArray(e.skinWeights))
  42799. }
  42800. return null !== e.boundingSphere && (this.boundingSphere = e.boundingSphere.clone()),
  42801. null !== e.boundingBox && (this.boundingBox = e.boundingBox.clone()),
  42802. this
  42803. },
  42804. computeBoundingBox: (new Ci.Vector3,
  42805. function() {
  42806. null === this.boundingBox && (this.boundingBox = new Ci.Box3);
  42807. var e = this.attributes.position.array;
  42808. e && this.boundingBox.setFromArray(e),
  42809. void 0 !== e && 0 !== e.length || (this.boundingBox.min.set(0, 0, 0),
  42810. this.boundingBox.max.set(0, 0, 0)),
  42811. (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)
  42812. }
  42813. ),
  42814. computeBoundingSphere: (nt = new Ci.Box3,
  42815. rt = new Ci.Vector3,
  42816. function() {
  42817. null === this.boundingSphere && (this.boundingSphere = new Ci.Sphere);
  42818. var e = this.attributes.position.array;
  42819. if (e) {
  42820. var t = this.boundingSphere.center;
  42821. nt.setFromArray(e),
  42822. nt.center(t);
  42823. for (var i = 0, n = 0, r = e.length; n < r; n += 3)
  42824. rt.fromArray(e, n),
  42825. i = Math.max(i, t.distanceToSquared(rt));
  42826. this.boundingSphere.radius = Math.sqrt(i),
  42827. isNaN(this.boundingSphere.radius) && console.error('THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.', this)
  42828. }
  42829. }
  42830. ),
  42831. computeFaceNormals: function() {},
  42832. computeVertexNormals: function() {
  42833. var e = this.index
  42834. , t = this.attributes
  42835. , i = this.groups;
  42836. if (t.position) {
  42837. var n = t.position.array;
  42838. if (void 0 === t.normal)
  42839. this.addAttribute("normal", new Ci.BufferAttribute(new Float32Array(n.length),3));
  42840. else
  42841. for (var r = t.normal.array, o = 0, a = r.length; o < a; o++)
  42842. r[o] = 0;
  42843. 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;
  42844. if (e) {
  42845. var m = e.array;
  42846. 0 === i.length && this.addGroup(0, m.length);
  42847. for (var v = 0, y = i.length; v < y; ++v) {
  42848. var A = i[v]
  42849. , C = A.start;
  42850. for (o = C,
  42851. a = C + A.count; o < a; o += 3)
  42852. s = 3 * m[o + 0],
  42853. l = 3 * m[o + 1],
  42854. c = 3 * m[o + 2],
  42855. u.fromArray(n, s),
  42856. d.fromArray(n, l),
  42857. p.fromArray(n, c),
  42858. f.subVectors(p, d),
  42859. g.subVectors(u, d),
  42860. f.cross(g),
  42861. h[s] += f.x,
  42862. h[1 + s] += f.y,
  42863. h[2 + s] += f.z,
  42864. h[l] += f.x,
  42865. h[1 + l] += f.y,
  42866. h[2 + l] += f.z,
  42867. h[c] += f.x,
  42868. h[1 + c] += f.y,
  42869. h[2 + c] += f.z
  42870. }
  42871. } else
  42872. for (o = 0,
  42873. a = n.length; o < a; o += 9)
  42874. u.fromArray(n, o),
  42875. d.fromArray(n, o + 3),
  42876. p.fromArray(n, o + 6),
  42877. f.subVectors(p, d),
  42878. g.subVectors(u, d),
  42879. f.cross(g),
  42880. h[o] = f.x,
  42881. h[o + 1] = f.y,
  42882. h[o + 2] = f.z,
  42883. h[o + 3] = f.x,
  42884. h[o + 4] = f.y,
  42885. h[o + 5] = f.z,
  42886. h[o + 6] = f.x,
  42887. h[o + 7] = f.y,
  42888. h[o + 8] = f.z;
  42889. this.normalizeNormals(),
  42890. t.normal.needsUpdate = !0
  42891. }
  42892. },
  42893. merge: function(e, t) {
  42894. if (e instanceof Ci.BufferGeometry != 0) {
  42895. void 0 === t && (t = 0);
  42896. var i = this.attributes;
  42897. for (var n in i)
  42898. if (void 0 !== e.attributes[n])
  42899. for (var r = i[n].array, o = e.attributes[n], a = o.array, s = 0, l = o.itemSize * t; s < a.length; s++,
  42900. l++)
  42901. r[l] = a[s];
  42902. return this
  42903. }
  42904. console.error("THREE.BufferGeometry.merge(): geometry not an instance of THREE.BufferGeometry.", e)
  42905. },
  42906. normalizeNormals: function() {
  42907. for (var e, t, i, n, r = this.attributes.normal.array, o = 0, a = r.length; o < a; o += 3)
  42908. e = r[o],
  42909. t = r[o + 1],
  42910. i = r[o + 2],
  42911. n = 1 / Math.sqrt(e * e + t * t + i * i),
  42912. r[o] *= n,
  42913. r[o + 1] *= n,
  42914. r[o + 2] *= n
  42915. },
  42916. toNonIndexed: function() {
  42917. if (null === this.index)
  42918. return console.warn("THREE.BufferGeometry.toNonIndexed(): Geometry is already non-indexed."),
  42919. this;
  42920. var e = new Ci.BufferGeometry
  42921. , t = this.index.array
  42922. , i = this.attributes;
  42923. for (var n in i) {
  42924. 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++) {
  42925. l = t[h] * a;
  42926. for (var d = 0; d < a; d++)
  42927. s[c++] = o[l++]
  42928. }
  42929. e.addAttribute(n, new Ci.BufferAttribute(s,a))
  42930. }
  42931. return e
  42932. },
  42933. toJSON: function() {
  42934. var e = {
  42935. metadata: {
  42936. version: 4.4,
  42937. type: "BufferGeometry",
  42938. generator: "BufferGeometry.toJSON"
  42939. }
  42940. };
  42941. if (e.uuid = this.uuid,
  42942. e.type = this.type,
  42943. "" !== this.name && (e.name = this.name),
  42944. void 0 !== this.parameters) {
  42945. var t = this.parameters;
  42946. for (var i in t)
  42947. void 0 !== t[i] && (e[i] = t[i]);
  42948. return e
  42949. }
  42950. e.data = {
  42951. attributes: {}
  42952. };
  42953. var n = this.index;
  42954. if (null !== n) {
  42955. var r = Array.prototype.slice.call(n.array);
  42956. e.data.index = {
  42957. type: n.array.constructor.name,
  42958. array: r
  42959. }
  42960. }
  42961. var o = this.attributes;
  42962. for (var i in o) {
  42963. var a = o[i];
  42964. r = Array.prototype.slice.call(a.array);
  42965. e.data.attributes[i] = {
  42966. itemSize: a.itemSize,
  42967. type: a.array.constructor.name,
  42968. array: r
  42969. }
  42970. }
  42971. var s = this.groups;
  42972. 0 < s.length && (e.data.groups = JSON.parse(JSON.stringify(s)));
  42973. var l = this.boundingSphere;
  42974. return null !== l && (e.data.boundingSphere = {
  42975. center: l.center.toArray(),
  42976. radius: l.radius
  42977. }),
  42978. e
  42979. },
  42980. clone: function() {
  42981. return (new Ci.BufferGeometry).copy(this)
  42982. },
  42983. copy: function(e) {
  42984. var t = e.index;
  42985. null !== t && this.setIndex(t.clone());
  42986. var i = e.attributes;
  42987. for (var n in i) {
  42988. var r = i[n];
  42989. this.addAttribute(n, r.clone())
  42990. }
  42991. for (var o = e.groups, a = 0, s = o.length; a < s; a++) {
  42992. var l = o[a];
  42993. this.addGroup(l.start, l.count)
  42994. }
  42995. return this
  42996. },
  42997. dispose: function() {
  42998. this.dispatchEvent({
  42999. type: "dispose"
  43000. })
  43001. }
  43002. },
  43003. Ci.EventDispatcher.prototype.apply(Ci.BufferGeometry.prototype),
  43004. Ci.BufferGeometry.MaxIndex = 65535,
  43005. Ci.InstancedBufferGeometry = function() {
  43006. Ci.BufferGeometry.call(this),
  43007. this.type = "InstancedBufferGeometry",
  43008. this.maxInstancedCount = void 0
  43009. }
  43010. ,
  43011. Ci.InstancedBufferGeometry.prototype = Object.create(Ci.BufferGeometry.prototype),
  43012. Ci.InstancedBufferGeometry.prototype.constructor = Ci.InstancedBufferGeometry,
  43013. Ci.InstancedBufferGeometry.prototype.addGroup = function(e, t, i) {
  43014. this.groups.push({
  43015. start: e,
  43016. count: t,
  43017. instances: i
  43018. })
  43019. }
  43020. ,
  43021. Ci.InstancedBufferGeometry.prototype.copy = function(e) {
  43022. var t = e.index;
  43023. null !== t && this.setIndex(t.clone());
  43024. var i = e.attributes;
  43025. for (var n in i) {
  43026. var r = i[n];
  43027. this.addAttribute(n, r.clone())
  43028. }
  43029. for (var o = e.groups, a = 0, s = o.length; a < s; a++) {
  43030. var l = o[a];
  43031. this.addGroup(l.start, l.count, l.instances)
  43032. }
  43033. return this
  43034. }
  43035. ,
  43036. Ci.EventDispatcher.prototype.apply(Ci.InstancedBufferGeometry.prototype),
  43037. Ci.Uniform = function(e, t) {
  43038. this.type = e,
  43039. this.value = t,
  43040. this.dynamic = !1
  43041. }
  43042. ,
  43043. Ci.Uniform.prototype = {
  43044. constructor: Ci.Uniform,
  43045. onUpdate: function(e) {
  43046. return this.dynamic = !0,
  43047. this.onUpdateCallback = e,
  43048. this
  43049. }
  43050. },
  43051. Ci.AnimationClip = function(e, t, i) {
  43052. this.name = e || Ci.Math.generateUUID(),
  43053. this.tracks = i,
  43054. this.duration = void 0 !== t ? t : -1,
  43055. this.duration < 0 && this.resetDuration(),
  43056. this.trim(),
  43057. this.optimize()
  43058. }
  43059. ,
  43060. Ci.AnimationClip.prototype = {
  43061. constructor: Ci.AnimationClip,
  43062. resetDuration: function() {
  43063. for (var e = 0, t = 0, i = this.tracks.length; t !== i; ++t) {
  43064. var n = this.tracks[t];
  43065. e = Math.max(e, n.times[n.times.length - 1])
  43066. }
  43067. this.duration = e
  43068. },
  43069. trim: function() {
  43070. for (var e = 0; e < this.tracks.length; e++)
  43071. this.tracks[e].trim(0, this.duration);
  43072. return this
  43073. },
  43074. optimize: function() {
  43075. for (var e = 0; e < this.tracks.length; e++)
  43076. this.tracks[e].optimize();
  43077. return this
  43078. }
  43079. },
  43080. Object.assign(Ci.AnimationClip, {
  43081. parse: function(e) {
  43082. for (var t = [], i = e.tracks, n = 1 / (e.fps || 1), r = 0, o = i.length; r !== o; ++r)
  43083. t.push(Ci.KeyframeTrack.parse(i[r]).scale(n));
  43084. return new Ci.AnimationClip(e.name,e.duration,t)
  43085. },
  43086. toJSON: function(e) {
  43087. for (var t = [], i = e.tracks, n = {
  43088. name: e.name,
  43089. duration: e.duration,
  43090. tracks: t
  43091. }, r = 0, o = i.length; r !== o; ++r)
  43092. t.push(Ci.KeyframeTrack.toJSON(i[r]));
  43093. return n
  43094. },
  43095. CreateFromMorphTargetSequence: function(e, t, i) {
  43096. for (var n = t.length, r = [], o = 0; o < n; o++) {
  43097. var a = []
  43098. , s = [];
  43099. a.push((o + n - 1) % n, o, (o + 1) % n),
  43100. s.push(0, 1, 0);
  43101. var l = Ci.AnimationUtils.getKeyframeOrder(a);
  43102. a = Ci.AnimationUtils.sortedArray(a, 1, l),
  43103. s = Ci.AnimationUtils.sortedArray(s, 1, l),
  43104. 0 === a[0] && (a.push(n),
  43105. s.push(s[0])),
  43106. r.push(new Ci.NumberKeyframeTrack(".morphTargetInfluences[" + t[o].name + "]",a,s).scale(1 / i))
  43107. }
  43108. return new Ci.AnimationClip(e,-1,r)
  43109. },
  43110. findByName: function(e, t) {
  43111. for (var i = 0; i < e.length; i++)
  43112. if (e[i].name === t)
  43113. return e[i];
  43114. return null
  43115. },
  43116. CreateClipsFromMorphTargetSequences: function(e, t) {
  43117. for (var i = {}, n = /^([\w-]*?)([\d]+)$/, r = 0, o = e.length; r < o; r++) {
  43118. var a = e[r]
  43119. , s = a.name.match(n);
  43120. if (s && 1 < s.length) {
  43121. var l = i[h = s[1]];
  43122. l || (i[h] = l = []),
  43123. l.push(a)
  43124. }
  43125. }
  43126. var c = [];
  43127. for (var h in i)
  43128. c.push(Ci.AnimationClip.CreateFromMorphTargetSequence(h, i[h], t));
  43129. return c
  43130. },
  43131. parseAnimation: function(e, t, i) {
  43132. if (!e)
  43133. return console.error(" no animation in JSONLoader data"),
  43134. null;
  43135. function n(e, t, i, n, r) {
  43136. if (0 !== i.length) {
  43137. var o = []
  43138. , a = [];
  43139. Ci.AnimationUtils.flattenJSON(i, o, a, n),
  43140. 0 !== o.length && r.push(new e(t,o,a))
  43141. }
  43142. }
  43143. for (var r = [], o = e.name || "default", a = e.length || -1, s = e.fps || 30, l = e.hierarchy || [], c = 0; c < l.length; c++) {
  43144. var h = l[c].keys;
  43145. if (h && 0 != h.length)
  43146. if (h[0].morphTargets) {
  43147. for (var u = {}, d = 0; d < h.length; d++)
  43148. if (h[d].morphTargets)
  43149. for (var p = 0; p < h[d].morphTargets.length; p++)
  43150. u[h[d].morphTargets[p]] = -1;
  43151. for (var f in u) {
  43152. var g = []
  43153. , m = [];
  43154. for (p = 0; p !== h[d].morphTargets.length; ++p) {
  43155. var v = h[d];
  43156. g.push(v.time),
  43157. m.push(v.morphTarget === f ? 1 : 0)
  43158. }
  43159. r.push(new Ci.NumberKeyframeTrack(".morphTargetInfluence[" + f + "]",g,m))
  43160. }
  43161. a = u.length * (s || 1)
  43162. } else {
  43163. var y = ".bones[" + t[c].name + "]";
  43164. n(Ci.VectorKeyframeTrack, y + ".position", h, "pos", r),
  43165. n(Ci.QuaternionKeyframeTrack, y + ".quaternion", h, "rot", r),
  43166. n(Ci.VectorKeyframeTrack, y + ".scale", h, "scl", r)
  43167. }
  43168. }
  43169. return 0 === r.length ? null : new Ci.AnimationClip(o,a,r)
  43170. }
  43171. }),
  43172. Ci.AnimationMixer = function(e) {
  43173. this._root = e,
  43174. this._initMemoryManager(),
  43175. this._accuIndex = 0,
  43176. this.time = 0,
  43177. this.timeScale = 1
  43178. }
  43179. ,
  43180. Ci.AnimationMixer.prototype = {
  43181. constructor: Ci.AnimationMixer,
  43182. clipAction: function(e, t) {
  43183. var i, n = (t || this._root).uuid, r = "string" == typeof e ? e : e.name, o = e !== r ? e : null, a = this._actionsByClip[r];
  43184. if (void 0 !== a) {
  43185. var s = a.actionByRoot[n];
  43186. if (void 0 !== s)
  43187. return s;
  43188. if (o = (i = a.knownActions[0])._clip,
  43189. e !== r && e !== o)
  43190. throw new Error("Different clips with the same name detected!")
  43191. }
  43192. if (null === o)
  43193. return null;
  43194. var l = new Ci.AnimationMixer._Action(this,o,t);
  43195. return this._bindAction(l, i),
  43196. this._addInactiveAction(l, r, n),
  43197. l
  43198. },
  43199. existingAction: function(e, t) {
  43200. var i = (t || this._root).uuid
  43201. , n = "string" == typeof e ? e : e.name
  43202. , r = this._actionsByClip[n];
  43203. return void 0 !== r && r.actionByRoot[i] || null
  43204. },
  43205. stopAllAction: function() {
  43206. var e = this._actions
  43207. , t = this._nActiveActions
  43208. , i = this._bindings
  43209. , n = this._nActiveBindings;
  43210. this._nActiveActions = 0;
  43211. for (var r = this._nActiveBindings = 0; r !== t; ++r)
  43212. e[r].reset();
  43213. for (r = 0; r !== n; ++r)
  43214. i[r].useCount = 0;
  43215. return this
  43216. },
  43217. update: function(e) {
  43218. e *= this.timeScale;
  43219. 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) {
  43220. var s = t[a];
  43221. s.enabled && s._update(n, e, r, o)
  43222. }
  43223. var l = this._bindings
  43224. , c = this._nActiveBindings;
  43225. for (a = 0; a !== c; ++a)
  43226. l[a].apply(o);
  43227. return this
  43228. },
  43229. getRoot: function() {
  43230. return this._root
  43231. },
  43232. uncacheClip: function(e) {
  43233. var t = this._actions
  43234. , i = e.name
  43235. , n = this._actionsByClip
  43236. , r = n[i];
  43237. if (void 0 !== r) {
  43238. for (var o = r.knownActions, a = 0, s = o.length; a !== s; ++a) {
  43239. var l = o[a];
  43240. this._deactivateAction(l);
  43241. var c = l._cacheIndex
  43242. , h = t[t.length - 1];
  43243. l._cacheIndex = null,
  43244. l._byClipCacheIndex = null,
  43245. t[h._cacheIndex = c] = h,
  43246. t.pop(),
  43247. this._removeInactiveBindingsForAction(l)
  43248. }
  43249. delete n[i]
  43250. }
  43251. },
  43252. uncacheRoot: function(e) {
  43253. var t = e.uuid
  43254. , i = this._actionsByClip;
  43255. for (var n in i) {
  43256. var r = i[n].actionByRoot[t];
  43257. void 0 !== r && (this._deactivateAction(r),
  43258. this._removeInactiveAction(r))
  43259. }
  43260. var o = this._bindingsByRootAndName[t];
  43261. if (void 0 !== o)
  43262. for (var a in o) {
  43263. var s = o[a];
  43264. s.restoreOriginalState(),
  43265. this._removeInactiveBinding(s)
  43266. }
  43267. },
  43268. uncacheAction: function(e, t) {
  43269. var i = this.existingAction(e, t);
  43270. null !== i && (this._deactivateAction(i),
  43271. this._removeInactiveAction(i))
  43272. }
  43273. },
  43274. Ci.EventDispatcher.prototype.apply(Ci.AnimationMixer.prototype),
  43275. Ci.AnimationMixer._Action = function(e, t, i) {
  43276. this._mixer = e,
  43277. this._clip = t,
  43278. this._localRoot = i || null;
  43279. for (var n = t.tracks, r = n.length, o = new Array(r), a = {
  43280. endingStart: Ci.ZeroCurvatureEnding,
  43281. endingEnd: Ci.ZeroCurvatureEnding
  43282. }, s = 0; s !== r; ++s) {
  43283. var l = n[s].createInterpolant(null);
  43284. (o[s] = l).settings = a
  43285. }
  43286. this._interpolantSettings = a,
  43287. this._interpolants = o,
  43288. this._propertyBindings = new Array(r),
  43289. this._cacheIndex = null,
  43290. this._byClipCacheIndex = null,
  43291. this._timeScaleInterpolant = null,
  43292. this._weightInterpolant = null,
  43293. this.loop = Ci.LoopRepeat,
  43294. this._loopCount = -1,
  43295. this._startTime = null,
  43296. this.time = 0,
  43297. this.timeScale = 1,
  43298. this._effectiveTimeScale = 1,
  43299. this.weight = 1,
  43300. this._effectiveWeight = 1,
  43301. this.repetitions = 1 / 0,
  43302. this.paused = !1,
  43303. this.enabled = !0,
  43304. this.clampWhenFinished = !1,
  43305. this.zeroSlopeAtStart = !0,
  43306. this.zeroSlopeAtEnd = !0
  43307. }
  43308. ,
  43309. Ci.AnimationMixer._Action.prototype = {
  43310. constructor: Ci.AnimationMixer._Action,
  43311. play: function() {
  43312. return this._mixer._activateAction(this),
  43313. this
  43314. },
  43315. stop: function() {
  43316. return this._mixer._deactivateAction(this),
  43317. this.reset()
  43318. },
  43319. reset: function() {
  43320. return this.paused = !1,
  43321. this.enabled = !0,
  43322. this.time = 0,
  43323. this._loopCount = -1,
  43324. this._startTime = null,
  43325. this.stopFading().stopWarping()
  43326. },
  43327. isRunning: function() {
  43328. return this._startTime,
  43329. this.enabled && !this.paused && 0 !== this.timeScale && null === this._startTime && this._mixer._isActiveAction(this)
  43330. },
  43331. isScheduled: function() {
  43332. return this._mixer._isActiveAction(this)
  43333. },
  43334. startAt: function(e) {
  43335. return this._startTime = e,
  43336. this
  43337. },
  43338. setLoop: function(e, t) {
  43339. return this.loop = e,
  43340. this.repetitions = t,
  43341. this
  43342. },
  43343. setEffectiveWeight: function(e) {
  43344. return this.weight = e,
  43345. this._effectiveWeight = this.enabled ? e : 0,
  43346. this.stopFading()
  43347. },
  43348. getEffectiveWeight: function() {
  43349. return this._effectiveWeight
  43350. },
  43351. fadeIn: function(e) {
  43352. return this._scheduleFading(e, 0, 1)
  43353. },
  43354. fadeOut: function(e) {
  43355. return this._scheduleFading(e, 1, 0)
  43356. },
  43357. crossFadeFrom: function(e, t, i) {
  43358. if (this._mixer,
  43359. e.fadeOut(t),
  43360. this.fadeIn(t),
  43361. i) {
  43362. var n = this._clip.duration
  43363. , r = e._clip.duration
  43364. , o = r / n
  43365. , a = n / r;
  43366. e.warp(1, o, t),
  43367. this.warp(a, 1, t)
  43368. }
  43369. return this
  43370. },
  43371. crossFadeTo: function(e, t, i) {
  43372. return e.crossFadeFrom(this, t, i)
  43373. },
  43374. stopFading: function() {
  43375. var e = this._weightInterpolant;
  43376. return null !== e && (this._weightInterpolant = null,
  43377. this._mixer._takeBackControlInterpolant(e)),
  43378. this
  43379. },
  43380. setEffectiveTimeScale: function(e) {
  43381. return this.timeScale = e,
  43382. this._effectiveTimeScale = this.paused ? 0 : e,
  43383. this.stopWarping()
  43384. },
  43385. getEffectiveTimeScale: function() {
  43386. return this._effectiveTimeScale
  43387. },
  43388. setDuration: function(e) {
  43389. return this.timeScale = this._clip.duration / e,
  43390. this.stopWarping()
  43391. },
  43392. syncWith: function(e) {
  43393. return this.time = e.time,
  43394. this.timeScale = e.timeScale,
  43395. this.stopWarping()
  43396. },
  43397. halt: function(e) {
  43398. return this.warp(this._currentTimeScale, 0, e)
  43399. },
  43400. warp: function(e, t, i) {
  43401. var n = this._mixer
  43402. , r = n.time
  43403. , o = this._timeScaleInterpolant
  43404. , a = this.timeScale;
  43405. null === o && (o = n._lendControlInterpolant(),
  43406. this._timeScaleInterpolant = o);
  43407. var s = o.parameterPositions
  43408. , l = o.sampleValues;
  43409. return s[0] = r,
  43410. s[1] = r + i,
  43411. l[0] = e / a,
  43412. l[1] = t / a,
  43413. this
  43414. },
  43415. stopWarping: function() {
  43416. var e = this._timeScaleInterpolant;
  43417. return null !== e && (this._timeScaleInterpolant = null,
  43418. this._mixer._takeBackControlInterpolant(e)),
  43419. this
  43420. },
  43421. getMixer: function() {
  43422. return this._mixer
  43423. },
  43424. getClip: function() {
  43425. return this._clip
  43426. },
  43427. getRoot: function() {
  43428. return this._localRoot || this._mixer._root
  43429. },
  43430. _update: function(e, t, i, n) {
  43431. var r = this._startTime;
  43432. if (null !== r) {
  43433. var o = (e - r) * i;
  43434. if (o < 0 || 0 === i)
  43435. return;
  43436. this._startTime = null,
  43437. t = i * o
  43438. }
  43439. t *= this._updateTimeScale(e);
  43440. var a = this._updateTime(t)
  43441. , s = this._updateWeight(e);
  43442. if (0 < s)
  43443. for (var l = this._interpolants, c = this._propertyBindings, h = 0, u = l.length; h !== u; ++h)
  43444. l[h].evaluate(a),
  43445. c[h].accumulate(n, s)
  43446. },
  43447. _updateWeight: function(e) {
  43448. var t = 0;
  43449. if (this.enabled) {
  43450. t = this.weight;
  43451. var i = this._weightInterpolant;
  43452. if (null !== i) {
  43453. var n = i.evaluate(e)[0];
  43454. t *= n,
  43455. e > i.parameterPositions[1] && (this.stopFading(),
  43456. 0 === n && (this.enabled = !1))
  43457. }
  43458. }
  43459. return this._effectiveWeight = t
  43460. },
  43461. _updateTimeScale: function(e) {
  43462. var t = 0;
  43463. if (!this.paused) {
  43464. t = this.timeScale;
  43465. var i = this._timeScaleInterpolant;
  43466. if (null !== i)
  43467. t *= i.evaluate(e)[0],
  43468. e > i.parameterPositions[1] && (this.stopWarping(),
  43469. 0 === t ? this.pause = !0 : this.timeScale = t)
  43470. }
  43471. return this._effectiveTimeScale = t
  43472. },
  43473. _updateTime: function(e) {
  43474. var t = this.time + e;
  43475. if (0 === e)
  43476. return t;
  43477. var i = this._clip.duration
  43478. , n = this.loop
  43479. , r = this._loopCount
  43480. , o = !1;
  43481. switch (n) {
  43482. case Ci.LoopOnce:
  43483. if (-1 === r && (this.loopCount = 0,
  43484. this._setEndings(!0, !0, !1)),
  43485. i <= t)
  43486. t = i;
  43487. else {
  43488. if (!(t < 0))
  43489. break;
  43490. t = 0
  43491. }
  43492. this.clampWhenFinished ? this.pause = !0 : this.enabled = !1,
  43493. this._mixer.dispatchEvent({
  43494. type: "finished",
  43495. action: this,
  43496. direction: e < 0 ? -1 : 1
  43497. });
  43498. break;
  43499. case Ci.LoopPingPong:
  43500. o = !0;
  43501. case Ci.LoopRepeat:
  43502. if (-1 === r && (0 < e ? (r = 0,
  43503. this._setEndings(!0, 0 === this.repetitions, o)) : this._setEndings(0 === this.repetitions, !0, o)),
  43504. i <= t || t < 0) {
  43505. var a = Math.floor(t / i);
  43506. t -= i * a,
  43507. r += Math.abs(a);
  43508. var s = this.repetitions - r;
  43509. if (s < 0) {
  43510. this.clampWhenFinished ? this.paused = !0 : this.enabled = !1,
  43511. t = 0 < e ? i : 0,
  43512. this._mixer.dispatchEvent({
  43513. type: "finished",
  43514. action: this,
  43515. direction: 0 < e ? 1 : -1
  43516. });
  43517. break
  43518. }
  43519. if (0 == s) {
  43520. var l = e < 0;
  43521. this._setEndings(l, !l, o)
  43522. } else
  43523. this._setEndings(!1, !1, o);
  43524. this._loopCount = r,
  43525. this._mixer.dispatchEvent({
  43526. type: "loop",
  43527. action: this,
  43528. loopDelta: a
  43529. })
  43530. }
  43531. if (n === Ci.LoopPingPong && 1 == (1 & r))
  43532. return i - (this.time = t)
  43533. }
  43534. return this.time = t
  43535. },
  43536. _setEndings: function(e, t, i) {
  43537. var n = this._interpolantSettings;
  43538. i ? (n.endingStart = Ci.ZeroSlopeEnding,
  43539. n.endingEnd = Ci.ZeroSlopeEnding) : (n.endingStart = e ? this.zeroSlopeAtStart ? Ci.ZeroSlopeEnding : Ci.ZeroCurvatureEnding : Ci.WrapAroundEnding,
  43540. n.endingEnd = t ? this.zeroSlopeAtEnd ? Ci.ZeroSlopeEnding : Ci.ZeroCurvatureEnding : Ci.WrapAroundEnding)
  43541. },
  43542. _scheduleFading: function(e, t, i) {
  43543. var n = this._mixer
  43544. , r = n.time
  43545. , o = this._weightInterpolant;
  43546. null === o && (o = n._lendControlInterpolant(),
  43547. this._weightInterpolant = o);
  43548. var a = o.parameterPositions
  43549. , s = o.sampleValues;
  43550. return a[0] = r,
  43551. s[0] = t,
  43552. a[1] = r + e,
  43553. s[1] = i,
  43554. this
  43555. }
  43556. },
  43557. Object.assign(Ci.AnimationMixer.prototype, {
  43558. _bindAction: function(e, t) {
  43559. var i = e._localRoot || this._root
  43560. , n = e._clip.tracks
  43561. , r = n.length
  43562. , o = e._propertyBindings
  43563. , a = e._interpolants
  43564. , s = i.uuid
  43565. , l = this._bindingsByRootAndName
  43566. , c = l[s];
  43567. void 0 === c && (c = {},
  43568. l[s] = c);
  43569. for (var h = 0; h !== r; ++h) {
  43570. var u = n[h]
  43571. , d = u.name
  43572. , p = c[d];
  43573. if (void 0 !== p)
  43574. o[h] = p;
  43575. else {
  43576. if (void 0 !== (p = o[h])) {
  43577. null === p._cacheIndex && (++p.referenceCount,
  43578. this._addInactiveBinding(p, s, d));
  43579. continue
  43580. }
  43581. var f = t && t._propertyBindings[h].binding.parsedPath;
  43582. ++(p = new Ci.PropertyMixer(Ci.PropertyBinding.create(i, d, f),u.ValueTypeName,u.getValueSize())).referenceCount,
  43583. this._addInactiveBinding(p, s, d),
  43584. o[h] = p
  43585. }
  43586. a[h].resultBuffer = p.buffer
  43587. }
  43588. },
  43589. _activateAction: function(e) {
  43590. if (!this._isActiveAction(e)) {
  43591. if (null === e._cacheIndex) {
  43592. var t = (e._localRoot || this._root).uuid
  43593. , i = e._clip.name
  43594. , n = this._actionsByClip[i];
  43595. this._bindAction(e, n && n.knownActions[0]),
  43596. this._addInactiveAction(e, i, t)
  43597. }
  43598. for (var r = e._propertyBindings, o = 0, a = r.length; o !== a; ++o) {
  43599. var s = r[o];
  43600. 0 == s.useCount++ && (this._lendBinding(s),
  43601. s.saveOriginalState())
  43602. }
  43603. this._lendAction(e)
  43604. }
  43605. },
  43606. _deactivateAction: function(e) {
  43607. if (this._isActiveAction(e)) {
  43608. for (var t = e._propertyBindings, i = 0, n = t.length; i !== n; ++i) {
  43609. var r = t[i];
  43610. 0 == --r.useCount && (r.restoreOriginalState(),
  43611. this._takeBackBinding(r))
  43612. }
  43613. this._takeBackAction(e)
  43614. }
  43615. },
  43616. _initMemoryManager: function() {
  43617. this._actions = [],
  43618. this._nActiveActions = 0,
  43619. this._actionsByClip = {},
  43620. this._bindings = [],
  43621. this._nActiveBindings = 0,
  43622. this._bindingsByRootAndName = {},
  43623. this._controlInterpolants = [],
  43624. this._nActiveControlInterpolants = 0;
  43625. var e = this;
  43626. this.stats = {
  43627. actions: {
  43628. get total() {
  43629. return e._actions.length
  43630. },
  43631. get inUse() {
  43632. return e._nActiveActions
  43633. }
  43634. },
  43635. bindings: {
  43636. get total() {
  43637. return e._bindings.length
  43638. },
  43639. get inUse() {
  43640. return e._nActiveBindings
  43641. }
  43642. },
  43643. controlInterpolants: {
  43644. get total() {
  43645. return e._controlInterpolants.length
  43646. },
  43647. get inUse() {
  43648. return e._nActiveControlInterpolants
  43649. }
  43650. }
  43651. }
  43652. },
  43653. _isActiveAction: function(e) {
  43654. var t = e._cacheIndex;
  43655. return null !== t && t < this._nActiveActions
  43656. },
  43657. _addInactiveAction: function(e, t, i) {
  43658. var n = this._actions
  43659. , r = this._actionsByClip
  43660. , o = r[t];
  43661. if (void 0 === o)
  43662. o = {
  43663. knownActions: [e],
  43664. actionByRoot: {}
  43665. },
  43666. e._byClipCacheIndex = 0,
  43667. r[t] = o;
  43668. else {
  43669. var a = o.knownActions;
  43670. e._byClipCacheIndex = a.length,
  43671. a.push(e)
  43672. }
  43673. e._cacheIndex = n.length,
  43674. n.push(e),
  43675. o.actionByRoot[i] = e
  43676. },
  43677. _removeInactiveAction: function(e) {
  43678. var t = this._actions
  43679. , i = t[t.length - 1]
  43680. , n = e._cacheIndex;
  43681. t[i._cacheIndex = n] = i,
  43682. t.pop(),
  43683. e._cacheIndex = null;
  43684. var r = e._clip.name
  43685. , o = this._actionsByClip
  43686. , a = o[r]
  43687. , s = a.knownActions
  43688. , l = s[s.length - 1]
  43689. , c = e._byClipCacheIndex;
  43690. s[l._byClipCacheIndex = c] = l,
  43691. s.pop(),
  43692. e._byClipCacheIndex = null,
  43693. delete a.actionByRoot[(t._localRoot || this._root).uuid],
  43694. 0 === s.length && delete o[r],
  43695. this._removeInactiveBindingsForAction(e)
  43696. },
  43697. _removeInactiveBindingsForAction: function(e) {
  43698. for (var t = e._propertyBindings, i = 0, n = t.length; i !== n; ++i) {
  43699. var r = t[i];
  43700. 0 == --r.referenceCount && this._removeInactiveBinding(r)
  43701. }
  43702. },
  43703. _lendAction: function(e) {
  43704. var t = this._actions
  43705. , i = e._cacheIndex
  43706. , n = this._nActiveActions++
  43707. , r = t[n];
  43708. t[e._cacheIndex = n] = e,
  43709. t[r._cacheIndex = i] = r
  43710. },
  43711. _takeBackAction: function(e) {
  43712. var t = this._actions
  43713. , i = e._cacheIndex
  43714. , n = --this._nActiveActions
  43715. , r = t[n];
  43716. t[e._cacheIndex = n] = e,
  43717. t[r._cacheIndex = i] = r
  43718. },
  43719. _addInactiveBinding: function(e, t, i) {
  43720. var n = this._bindingsByRootAndName
  43721. , r = n[t]
  43722. , o = this._bindings;
  43723. void 0 === r && (r = {},
  43724. n[t] = r),
  43725. (r[i] = e)._cacheIndex = o.length,
  43726. o.push(e)
  43727. },
  43728. _removeInactiveBinding: function(e) {
  43729. var t = this._bindings
  43730. , i = e.binding
  43731. , n = i.rootNode.uuid
  43732. , r = i.path
  43733. , o = this._bindingsByRootAndName
  43734. , a = o[n]
  43735. , s = t[t.length - 1]
  43736. , l = e._cacheIndex;
  43737. t[s._cacheIndex = l] = s,
  43738. t.pop(),
  43739. delete a[r];
  43740. e: {
  43741. for (var c in a)
  43742. break e;
  43743. delete o[n]
  43744. }
  43745. },
  43746. _lendBinding: function(e) {
  43747. var t = this._bindings
  43748. , i = e._cacheIndex
  43749. , n = this._nActiveBindings++
  43750. , r = t[n];
  43751. t[e._cacheIndex = n] = e,
  43752. t[r._cacheIndex = i] = r
  43753. },
  43754. _takeBackBinding: function(e) {
  43755. var t = this._bindings
  43756. , i = e._cacheIndex
  43757. , n = --this._nActiveBindings
  43758. , r = t[n];
  43759. t[e._cacheIndex = n] = e,
  43760. t[r._cacheIndex = i] = r
  43761. },
  43762. _lendControlInterpolant: function() {
  43763. var e = this._controlInterpolants
  43764. , t = this._nActiveControlInterpolants++
  43765. , i = e[t];
  43766. return void 0 === i && (e[(i = new Ci.LinearInterpolant(new Float32Array(2),new Float32Array(2),1,this._controlInterpolantsResultBuffer)).__cacheIndex = t] = i),
  43767. i
  43768. },
  43769. _takeBackControlInterpolant: function(e) {
  43770. var t = this._controlInterpolants
  43771. , i = e.__cacheIndex
  43772. , n = --this._nActiveControlInterpolants
  43773. , r = t[n];
  43774. t[e.__cacheIndex = n] = e,
  43775. t[r.__cacheIndex = i] = r
  43776. },
  43777. _controlInterpolantsResultBuffer: new Float32Array(1)
  43778. }),
  43779. Ci.AnimationObjectGroup = function(e) {
  43780. this.uuid = Ci.Math.generateUUID(),
  43781. this._objects = Array.prototype.slice.call(arguments),
  43782. this.nCachedObjects_ = 0;
  43783. var t = {};
  43784. this._indicesByUUID = t;
  43785. for (var i = 0, n = arguments.length; i !== n; ++i)
  43786. t[arguments[i].uuid] = i;
  43787. this._paths = [],
  43788. this._parsedPaths = [],
  43789. this._bindings = [],
  43790. this._bindingsIndicesByPath = {};
  43791. var r = this;
  43792. this.stats = {
  43793. objects: {
  43794. get total() {
  43795. return r._objects.length
  43796. },
  43797. get inUse() {
  43798. return this.total - r.nCachedObjects_
  43799. }
  43800. },
  43801. get bindingsPerObject() {
  43802. return r._bindings.length
  43803. }
  43804. }
  43805. }
  43806. ,
  43807. Ci.AnimationObjectGroup.prototype = {
  43808. constructor: Ci.AnimationObjectGroup,
  43809. add: function(e) {
  43810. 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) {
  43811. var u = arguments[c]
  43812. , d = u.uuid
  43813. , p = r[d];
  43814. if (void 0 === p) {
  43815. p = i++,
  43816. r[d] = p,
  43817. t.push(u);
  43818. for (var f = 0, g = l; f !== g; ++f)
  43819. s[f].push(new Ci.PropertyBinding(u,o[f],a[f]))
  43820. } else if (p < n) {
  43821. var m = t[p]
  43822. , v = --n
  43823. , y = t[v];
  43824. t[r[y.uuid] = p] = y,
  43825. t[r[d] = v] = u;
  43826. for (f = 0,
  43827. g = l; f !== g; ++f) {
  43828. var A = s[f]
  43829. , C = A[v]
  43830. , I = A[p];
  43831. A[p] = C,
  43832. void 0 === I && (I = new Ci.PropertyBinding(u,o[f],a[f])),
  43833. A[v] = I
  43834. }
  43835. } else
  43836. t[p] !== m && console.error("Different objects with the same UUID detected. Clean the caches or recreate your infrastructure when reloading scenes...")
  43837. }
  43838. this.nCachedObjects_ = n
  43839. },
  43840. remove: function(e) {
  43841. for (var t = this._objects, i = (t.length,
  43842. this.nCachedObjects_), n = this._indicesByUUID, r = this._bindings, o = r.length, a = 0, s = arguments.length; a !== s; ++a) {
  43843. var l = arguments[a]
  43844. , c = l.uuid
  43845. , h = n[c];
  43846. if (void 0 !== h && i <= h) {
  43847. var u = i++
  43848. , d = t[u];
  43849. t[n[d.uuid] = h] = d,
  43850. t[n[c] = u] = l;
  43851. for (var p = 0, f = o; p !== f; ++p) {
  43852. var g = r[p]
  43853. , m = g[u]
  43854. , v = g[h];
  43855. g[h] = m,
  43856. g[u] = v
  43857. }
  43858. }
  43859. }
  43860. this.nCachedObjects_ = i
  43861. },
  43862. uncache: function(e) {
  43863. 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) {
  43864. var c = arguments[s].uuid
  43865. , h = r[c];
  43866. if (void 0 !== h)
  43867. if (delete r[c],
  43868. h < n) {
  43869. var u = --n
  43870. , d = t[u]
  43871. , p = t[y = --i];
  43872. t[r[d.uuid] = h] = d,
  43873. t[r[p.uuid] = u] = p,
  43874. t.pop();
  43875. for (var f = 0, g = a; f !== g; ++f) {
  43876. var m = (A = o[f])[u]
  43877. , v = A[y];
  43878. A[h] = m,
  43879. A[u] = v,
  43880. A.pop()
  43881. }
  43882. } else {
  43883. var y;
  43884. t[r[(p = t[y = --i]).uuid] = h] = p,
  43885. t.pop();
  43886. for (f = 0,
  43887. g = a; f !== g; ++f) {
  43888. var A;
  43889. (A = o[f])[h] = A[y],
  43890. A.pop()
  43891. }
  43892. }
  43893. }
  43894. this.nCachedObjects_ = n
  43895. },
  43896. subscribe_: function(e, t) {
  43897. var i = this._bindingsIndicesByPath
  43898. , n = i[e]
  43899. , r = this._bindings;
  43900. if (void 0 !== n)
  43901. return r[n];
  43902. var o = this._paths
  43903. , a = this._parsedPaths
  43904. , s = this._objects
  43905. , l = s.length
  43906. , c = this.nCachedObjects_
  43907. , h = new Array(l);
  43908. n = r.length,
  43909. i[e] = n,
  43910. o.push(e),
  43911. a.push(t),
  43912. r.push(h);
  43913. for (var u = c, d = s.length; u !== d; ++u) {
  43914. var p = s[u];
  43915. h[u] = new Ci.PropertyBinding(p,e,t)
  43916. }
  43917. return h
  43918. },
  43919. unsubscribe_: function(e) {
  43920. var t = this._bindingsIndicesByPath
  43921. , i = t[e];
  43922. if (void 0 !== i) {
  43923. var n = this._paths
  43924. , r = this._parsedPaths
  43925. , o = this._bindings
  43926. , a = o.length - 1
  43927. , s = o[a];
  43928. o[t[e[a]] = i] = s,
  43929. o.pop(),
  43930. r[i] = r[a],
  43931. r.pop(),
  43932. n[i] = n[a],
  43933. n.pop()
  43934. }
  43935. }
  43936. },
  43937. Ci.AnimationUtils = {
  43938. arraySlice: function(e, t, i) {
  43939. return Ci.AnimationUtils.isTypedArray(e) ? new e.constructor(e.subarray(t, i)) : e.slice(t, i)
  43940. },
  43941. convertArray: function(e, t, i) {
  43942. return !e || !i && e.constructor === t ? e : "number" == typeof t.BYTES_PER_ELEMENT ? new t(e) : Array.prototype.slice.call(e)
  43943. },
  43944. isTypedArray: function(e) {
  43945. return ArrayBuffer.isView(e) && !(e instanceof DataView)
  43946. },
  43947. getKeyframeOrder: function(i) {
  43948. for (var e = i.length, t = new Array(e), n = 0; n !== e; ++n)
  43949. t[n] = n;
  43950. return t.sort(function(e, t) {
  43951. return i[e] - i[t]
  43952. }),
  43953. t
  43954. },
  43955. sortedArray: function(e, t, i) {
  43956. for (var n = e.length, r = new e.constructor(n), o = 0, a = 0; a !== n; ++o)
  43957. for (var s = i[o] * t, l = 0; l !== t; ++l)
  43958. r[a++] = e[s + l];
  43959. return r
  43960. },
  43961. flattenJSON: function(e, t, i, n) {
  43962. for (var r = 1, o = e[0]; void 0 !== o && void 0 === o[n]; )
  43963. o = e[r++];
  43964. if (void 0 !== o) {
  43965. var a = o[n];
  43966. if (void 0 !== a)
  43967. if (Array.isArray(a))
  43968. for (; void 0 !== (a = o[n]) && (t.push(o.time),
  43969. i.push.apply(i, a)),
  43970. void 0 !== (o = e[r++]); )
  43971. ;
  43972. else if (void 0 !== a.toArray)
  43973. for (; void 0 !== (a = o[n]) && (t.push(o.time),
  43974. a.toArray(i, i.length)),
  43975. void 0 !== (o = e[r++]); )
  43976. ;
  43977. else
  43978. for (; void 0 !== (a = o[n]) && (t.push(o.time),
  43979. i.push(a)),
  43980. void 0 !== (o = e[r++]); )
  43981. ;
  43982. }
  43983. }
  43984. },
  43985. Ci.KeyframeTrack = function(e, t, i, n) {
  43986. if (void 0 === e)
  43987. throw new Error("track name is undefined");
  43988. if (void 0 === t || 0 === t.length)
  43989. throw new Error("no keyframes in track named " + e);
  43990. this.name = e,
  43991. this.times = Ci.AnimationUtils.convertArray(t, this.TimeBufferType),
  43992. this.values = Ci.AnimationUtils.convertArray(i, this.ValueBufferType),
  43993. this.setInterpolation(n || this.DefaultInterpolation),
  43994. this.validate(),
  43995. this.optimize()
  43996. }
  43997. ,
  43998. Ci.KeyframeTrack.prototype = {
  43999. constructor: Ci.KeyframeTrack,
  44000. TimeBufferType: Float32Array,
  44001. ValueBufferType: Float32Array,
  44002. DefaultInterpolation: Ci.InterpolateLinear,
  44003. InterpolantFactoryMethodDiscrete: function(e) {
  44004. return new Ci.DiscreteInterpolant(this.times,this.values,this.getValueSize(),e)
  44005. },
  44006. InterpolantFactoryMethodLinear: function(e) {
  44007. return new Ci.LinearInterpolant(this.times,this.values,this.getValueSize(),e)
  44008. },
  44009. InterpolantFactoryMethodSmooth: function(e) {
  44010. return new Ci.CubicInterpolant(this.times,this.values,this.getValueSize(),e)
  44011. },
  44012. setInterpolation: function(e) {
  44013. var t = void 0;
  44014. switch (e) {
  44015. case Ci.InterpolateDiscrete:
  44016. t = this.InterpolantFactoryMethodDiscrete;
  44017. break;
  44018. case Ci.InterpolateLinear:
  44019. t = this.InterpolantFactoryMethodLinear;
  44020. break;
  44021. case Ci.InterpolateSmooth:
  44022. t = this.InterpolantFactoryMethodSmooth
  44023. }
  44024. if (void 0 !== t)
  44025. this.createInterpolant = t;
  44026. else {
  44027. var i = "unsupported interpolation for " + this.ValueTypeName + " keyframe track named " + this.name;
  44028. if (void 0 === this.createInterpolant) {
  44029. if (e === this.DefaultInterpolation)
  44030. throw new Error(i);
  44031. this.setInterpolation(this.DefaultInterpolation)
  44032. }
  44033. console.warn(i)
  44034. }
  44035. },
  44036. getInterpolation: function() {
  44037. switch (this.createInterpolant) {
  44038. case this.InterpolantFactoryMethodDiscrete:
  44039. return Ci.InterpolateDiscrete;
  44040. case this.InterpolantFactoryMethodLinear:
  44041. return Ci.InterpolateLinear;
  44042. case this.InterpolantFactoryMethodSmooth:
  44043. return Ci.InterpolateSmooth
  44044. }
  44045. },
  44046. getValueSize: function() {
  44047. return this.values.length / this.times.length
  44048. },
  44049. shift: function(e) {
  44050. if (0 !== e)
  44051. for (var t = this.times, i = 0, n = t.length; i !== n; ++i)
  44052. t[i] += e;
  44053. return this
  44054. },
  44055. scale: function(e) {
  44056. if (1 !== e)
  44057. for (var t = this.times, i = 0, n = t.length; i !== n; ++i)
  44058. t[i] *= e;
  44059. return this
  44060. },
  44061. trim: function(e, t) {
  44062. for (var i = this.times, n = i.length, r = 0, o = n - 1; r !== n && i[r] < e; )
  44063. ++r;
  44064. for (; -1 !== o && i[o] > t; )
  44065. --o;
  44066. if (++o,
  44067. 0 !== r || o !== n) {
  44068. o <= r && (r = (o = Math.max(o, 1)) - 1);
  44069. var a = this.getValueSize();
  44070. this.times = Ci.AnimationUtils.arraySlice(i, r, o),
  44071. this.values = Ci.AnimationUtils.arraySlice(this.values, r * a, o * a)
  44072. }
  44073. return this
  44074. },
  44075. validate: function() {
  44076. var e = !0
  44077. , t = this.getValueSize();
  44078. t - Math.floor(t) != 0 && (console.error("invalid value size in track", this),
  44079. e = !1);
  44080. var i = this.times
  44081. , n = this.values
  44082. , r = i.length;
  44083. 0 === r && (console.error("track is empty", this),
  44084. e = !1);
  44085. for (var o = null, a = 0; a !== r; a++) {
  44086. var s = i[a];
  44087. if ("number" == typeof s && isNaN(s)) {
  44088. console.error("time is not a valid number", this, a, s),
  44089. e = !1;
  44090. break
  44091. }
  44092. if (null !== o && s < o) {
  44093. console.error("out of order keys", this, a, s, o),
  44094. e = !1;
  44095. break
  44096. }
  44097. o = s
  44098. }
  44099. if (void 0 !== n && Ci.AnimationUtils.isTypedArray(n)) {
  44100. a = 0;
  44101. for (var l = n.length; a !== l; ++a) {
  44102. var c = n[a];
  44103. if (isNaN(c)) {
  44104. console.error("value is not a valid number", this, a, c),
  44105. e = !1;
  44106. break
  44107. }
  44108. }
  44109. }
  44110. return e
  44111. },
  44112. optimize: function() {
  44113. for (var e = this.times, t = this.values, i = this.getValueSize(), n = 1, r = 1, o = e.length - 1; r <= o; ++r) {
  44114. var a = !1
  44115. , s = e[r];
  44116. if (s !== e[r + 1] && (1 !== r || s !== s[0]))
  44117. for (var l = r * i, c = l - i, h = l + i, u = 0; u !== i; ++u) {
  44118. var d = t[l + u];
  44119. if (d !== t[c + u] || d !== t[h + u]) {
  44120. a = !0;
  44121. break
  44122. }
  44123. }
  44124. if (a) {
  44125. if (r !== n) {
  44126. e[n] = e[r];
  44127. var p = r * i
  44128. , f = n * i;
  44129. for (u = 0; u !== i; ++u)
  44130. t[f + u] = t[p + u]
  44131. }
  44132. ++n
  44133. }
  44134. }
  44135. return n !== e.length && (this.times = Ci.AnimationUtils.arraySlice(e, 0, n),
  44136. this.values = Ci.AnimationUtils.arraySlice(t, 0, n * i)),
  44137. this
  44138. }
  44139. },
  44140. Object.assign(Ci.KeyframeTrack, {
  44141. parse: function(e) {
  44142. if (void 0 === e.type)
  44143. throw new Error("track type undefined, can not parse");
  44144. var t = Ci.KeyframeTrack._getTrackTypeForValueTypeName(e.type);
  44145. if (void 0 === e.times) {
  44146. console.warn("legacy JSON format detected, converting");
  44147. var i = []
  44148. , n = [];
  44149. Ci.AnimationUtils.flattenJSON(e.keys, i, n, "value"),
  44150. e.times = i,
  44151. e.values = n
  44152. }
  44153. return void 0 !== t.parse ? t.parse(e) : new t(e.name,e.times,e.values,e.interpolation)
  44154. },
  44155. toJSON: function(e) {
  44156. var t, i = e.constructor;
  44157. if (void 0 !== i.toJSON)
  44158. t = i.toJSON(e);
  44159. else {
  44160. t = {
  44161. name: e.name,
  44162. times: Ci.AnimationUtils.convertArray(e.times, Array),
  44163. values: Ci.AnimationUtils.convertArray(e.values, Array)
  44164. };
  44165. var n = e.getInterpolation();
  44166. n !== e.DefaultInterpolation && (t.interpolation = n)
  44167. }
  44168. return t.type = e.ValueTypeName,
  44169. t
  44170. },
  44171. _getTrackTypeForValueTypeName: function(e) {
  44172. switch (e.toLowerCase()) {
  44173. case "scalar":
  44174. case "double":
  44175. case "float":
  44176. case "number":
  44177. case "integer":
  44178. return Ci.NumberKeyframeTrack;
  44179. case "vector":
  44180. case "vector2":
  44181. case "vector3":
  44182. case "vector4":
  44183. return Ci.VectorKeyframeTrack;
  44184. case "color":
  44185. return Ci.ColorKeyframeTrack;
  44186. case "quaternion":
  44187. return Ci.QuaternionKeyframeTrack;
  44188. case "bool":
  44189. case "boolean":
  44190. return Ci.BooleanKeyframeTrack;
  44191. case "string":
  44192. return Ci.StringKeyframeTrack
  44193. }
  44194. throw new Error("Unsupported typeName: " + e)
  44195. }
  44196. }),
  44197. Ci.PropertyBinding = function(e, t, i) {
  44198. this.path = t,
  44199. this.parsedPath = i || Ci.PropertyBinding.parseTrackName(t),
  44200. this.node = Ci.PropertyBinding.findNode(e, this.parsedPath.nodeName) || e,
  44201. this.rootNode = e
  44202. }
  44203. ,
  44204. Ci.PropertyBinding.prototype = {
  44205. constructor: Ci.PropertyBinding,
  44206. getValue: function(e, t) {
  44207. this.bind(),
  44208. this.getValue(e, t)
  44209. },
  44210. setValue: function(e, t) {
  44211. this.bind(),
  44212. this.setValue(e, t)
  44213. },
  44214. bind: function() {
  44215. var e = this.node
  44216. , t = this.parsedPath
  44217. , i = t.objectName
  44218. , n = t.propertyName
  44219. , r = t.propertyIndex;
  44220. if (e || (e = Ci.PropertyBinding.findNode(this.rootNode, t.nodeName) || this.rootNode,
  44221. this.node = e),
  44222. this.getValue = this._getValue_unavailable,
  44223. this.setValue = this._setValue_unavailable,
  44224. e) {
  44225. if (i) {
  44226. var o = t.objectIndex;
  44227. switch (i) {
  44228. case "materials":
  44229. if (!e.material)
  44230. return void console.error(" can not bind to material as node does not have a material", this);
  44231. if (!e.material.materials)
  44232. return void console.error(" can not bind to material.materials as node.material does not have a materials array", this);
  44233. e = e.material.materials;
  44234. break;
  44235. case "bones":
  44236. if (!e.skeleton)
  44237. return void console.error(" can not bind to bones as node does not have a skeleton", this);
  44238. e = e.skeleton.bones;
  44239. for (var a = 0; a < e.length; a++)
  44240. if (e[a].name === o) {
  44241. o = a;
  44242. break
  44243. }
  44244. break;
  44245. default:
  44246. if (void 0 === e[i])
  44247. return void console.error(" can not bind to objectName of node, undefined", this);
  44248. e = e[i]
  44249. }
  44250. if (void 0 !== o) {
  44251. if (void 0 === e[o])
  44252. return void console.error(" trying to bind to objectIndex of objectName, but is undefined:", this, e);
  44253. e = e[o]
  44254. }
  44255. }
  44256. var s = e[n];
  44257. if (s) {
  44258. var l = this.Versioning.None;
  44259. void 0 !== e.needsUpdate ? (l = this.Versioning.NeedsUpdate,
  44260. this.targetObject = e) : void 0 !== e.matrixWorldNeedsUpdate && (l = this.Versioning.MatrixWorldNeedsUpdate,
  44261. this.targetObject = e);
  44262. var c = this.BindingType.Direct;
  44263. if (void 0 !== r) {
  44264. if ("morphTargetInfluences" === n) {
  44265. if (!e.geometry)
  44266. return void console.error(" can not bind to morphTargetInfluences becasuse node does not have a geometry", this);
  44267. if (!e.geometry.morphTargets)
  44268. return void console.error(" can not bind to morphTargetInfluences becasuse node does not have a geometry.morphTargets", this);
  44269. for (a = 0; a < this.node.geometry.morphTargets.length; a++)
  44270. if (e.geometry.morphTargets[a].name === r) {
  44271. r = a;
  44272. break
  44273. }
  44274. }
  44275. c = this.BindingType.ArrayElement,
  44276. this.resolvedProperty = s,
  44277. this.propertyIndex = r
  44278. } else
  44279. void 0 !== s.fromArray && void 0 !== s.toArray ? (c = this.BindingType.HasFromToArray,
  44280. this.resolvedProperty = s) : void 0 !== s.length ? (c = this.BindingType.EntireArray,
  44281. this.resolvedProperty = s) : this.propertyName = n;
  44282. this.getValue = this.GetterByBindingType[c],
  44283. this.setValue = this.SetterByBindingTypeAndVersioning[c][l]
  44284. } else {
  44285. var h = t.nodeName;
  44286. console.error(" trying to update property for track: " + h + "." + n + " but it wasn't found.", e)
  44287. }
  44288. } else
  44289. console.error(" trying to update node for track: " + this.path + " but it wasn't found.")
  44290. },
  44291. unbind: function() {
  44292. this.node = null,
  44293. this.getValue = this._getValue_unbound,
  44294. this.setValue = this._setValue_unbound
  44295. }
  44296. },
  44297. Object.assign(Ci.PropertyBinding.prototype, {
  44298. _getValue_unavailable: function() {},
  44299. _setValue_unavailable: function() {},
  44300. _getValue_unbound: Ci.PropertyBinding.prototype.getValue,
  44301. _setValue_unbound: Ci.PropertyBinding.prototype.setValue,
  44302. BindingType: {
  44303. Direct: 0,
  44304. EntireArray: 1,
  44305. ArrayElement: 2,
  44306. HasFromToArray: 3
  44307. },
  44308. Versioning: {
  44309. None: 0,
  44310. NeedsUpdate: 1,
  44311. MatrixWorldNeedsUpdate: 2
  44312. },
  44313. GetterByBindingType: [function(e, t) {
  44314. e[t] = this.node[this.propertyName]
  44315. }
  44316. , function(e, t) {
  44317. for (var i = this.resolvedProperty, n = 0, r = i.length; n !== r; ++n)
  44318. e[t++] = i[n]
  44319. }
  44320. , function(e, t) {
  44321. e[t] = this.resolvedProperty[this.propertyIndex]
  44322. }
  44323. , function(e, t) {
  44324. this.resolvedProperty.toArray(e, t)
  44325. }
  44326. ],
  44327. SetterByBindingTypeAndVersioning: [[function(e, t) {
  44328. this.node[this.propertyName] = e[t]
  44329. }
  44330. , function(e, t) {
  44331. this.node[this.propertyName] = e[t],
  44332. this.targetObject.needsUpdate = !0
  44333. }
  44334. , function(e, t) {
  44335. this.node[this.propertyName] = e[t],
  44336. this.targetObject.matrixWorldNeedsUpdate = !0
  44337. }
  44338. ], [function(e, t) {
  44339. for (var i = this.resolvedProperty, n = 0, r = i.length; n !== r; ++n)
  44340. i[n] = e[t++]
  44341. }
  44342. , function(e, t) {
  44343. for (var i = this.resolvedProperty, n = 0, r = i.length; n !== r; ++n)
  44344. i[n] = e[t++];
  44345. this.targetObject.needsUpdate = !0
  44346. }
  44347. , function(e, t) {
  44348. for (var i = this.resolvedProperty, n = 0, r = i.length; n !== r; ++n)
  44349. i[n] = e[t++];
  44350. this.targetObject.matrixWorldNeedsUpdate = !0
  44351. }
  44352. ], [function(e, t) {
  44353. this.resolvedProperty[this.propertyIndex] = e[t]
  44354. }
  44355. , function(e, t) {
  44356. this.resolvedProperty[this.propertyIndex] = e[t],
  44357. this.targetObject.needsUpdate = !0
  44358. }
  44359. , function(e, t) {
  44360. this.resolvedProperty[this.propertyIndex] = e[t],
  44361. this.targetObject.matrixWorldNeedsUpdate = !0
  44362. }
  44363. ], [function(e, t) {
  44364. this.resolvedProperty.fromArray(e, t)
  44365. }
  44366. , function(e, t) {
  44367. this.resolvedProperty.fromArray(e, t),
  44368. this.targetObject.needsUpdate = !0
  44369. }
  44370. , function(e, t) {
  44371. this.resolvedProperty.fromArray(e, t),
  44372. this.targetObject.matrixWorldNeedsUpdate = !0
  44373. }
  44374. ]]
  44375. }),
  44376. Ci.PropertyBinding.Composite = function(e, t, i) {
  44377. var n = i || Ci.PropertyBinding.parseTrackName(t);
  44378. this._targetGroup = e,
  44379. this._bindings = e.subscribe_(t, n)
  44380. }
  44381. ,
  44382. Ci.PropertyBinding.Composite.prototype = {
  44383. constructor: Ci.PropertyBinding.Composite,
  44384. getValue: function(e, t) {
  44385. this.bind();
  44386. var i = this._targetGroup.nCachedObjects_
  44387. , n = this._bindings[i];
  44388. void 0 !== n && n.getValue(e, t)
  44389. },
  44390. setValue: function(e, t) {
  44391. for (var i = this._bindings, n = this._targetGroup.nCachedObjects_, r = i.length; n !== r; ++n)
  44392. i[n].setValue(e, t)
  44393. },
  44394. bind: function() {
  44395. for (var e = this._bindings, t = this._targetGroup.nCachedObjects_, i = e.length; t !== i; ++t)
  44396. e[t].bind()
  44397. },
  44398. unbind: function() {
  44399. for (var e = this._bindings, t = this._targetGroup.nCachedObjects_, i = e.length; t !== i; ++t)
  44400. e[t].unbind()
  44401. }
  44402. },
  44403. Ci.PropertyBinding.create = function(e, t, i) {
  44404. return e instanceof Ci.AnimationObjectGroup ? new Ci.PropertyBinding.Composite(e,t,i) : new Ci.PropertyBinding(e,t,i)
  44405. }
  44406. ,
  44407. Ci.PropertyBinding.parseTrackName = function(e) {
  44408. var t = /^(([\w]+\/)*)([\w-\d]+)?(\.([\w]+)(\[([\w\d\[\]\_.:\- ]+)\])?)?(\.([\w.]+)(\[([\w\d\[\]\_. ]+)\])?)$/
  44409. , i = t.exec(e);
  44410. if (!i)
  44411. throw new Error("cannot parse trackName at all: " + e);
  44412. i.index === t.lastIndex && t.lastIndex++;
  44413. var n = {
  44414. nodeName: i[3],
  44415. objectName: i[5],
  44416. objectIndex: i[7],
  44417. propertyName: i[9],
  44418. propertyIndex: i[11]
  44419. };
  44420. if (null === n.propertyName || 0 === n.propertyName.length)
  44421. throw new Error("can not parse propertyName from trackName: " + e);
  44422. return n
  44423. }
  44424. ,
  44425. Ci.PropertyBinding.findNode = function(e, r) {
  44426. if (!r || "" === r || "root" === r || "." === r || -1 === r || r === e.name || r === e.uuid)
  44427. return e;
  44428. if (e.skeleton) {
  44429. var t = function(e) {
  44430. for (var t = 0; t < e.bones.length; t++) {
  44431. var i = e.bones[t];
  44432. if (i.name === r)
  44433. return i
  44434. }
  44435. return null
  44436. }(e.skeleton);
  44437. if (t)
  44438. return t
  44439. }
  44440. if (e.children) {
  44441. var o = function(e) {
  44442. for (var t = 0; t < e.length; t++) {
  44443. var i = e[t];
  44444. if (i.name === r || i.uuid === r)
  44445. return i;
  44446. var n = o(i.children);
  44447. if (n)
  44448. return n
  44449. }
  44450. return null
  44451. }
  44452. , i = o(e.children);
  44453. if (i)
  44454. return i
  44455. }
  44456. return null
  44457. }
  44458. ,
  44459. Ci.PropertyMixer = function(e, t, i) {
  44460. this.binding = e,
  44461. this.valueSize = i;
  44462. var n, r = Float64Array;
  44463. switch (t) {
  44464. case "quaternion":
  44465. n = this._slerp;
  44466. break;
  44467. case "string":
  44468. case "bool":
  44469. r = Array,
  44470. n = this._select;
  44471. break;
  44472. default:
  44473. n = this._lerp
  44474. }
  44475. this.buffer = new r(4 * i),
  44476. this._mixBufferRegion = n,
  44477. this.cumulativeWeight = 0,
  44478. this.useCount = 0,
  44479. this.referenceCount = 0
  44480. }
  44481. ,
  44482. Ci.PropertyMixer.prototype = {
  44483. constructor: Ci.PropertyMixer,
  44484. accumulate: function(e, t) {
  44485. var i = this.buffer
  44486. , n = this.valueSize
  44487. , r = e * n + n
  44488. , o = this.cumulativeWeight;
  44489. if (0 === o) {
  44490. for (var a = 0; a !== n; ++a)
  44491. i[r + a] = i[a];
  44492. o = t
  44493. } else {
  44494. var s = t / (o += t);
  44495. this._mixBufferRegion(i, r, 0, s, n)
  44496. }
  44497. this.cumulativeWeight = o
  44498. },
  44499. apply: function(e) {
  44500. var t = this.valueSize
  44501. , i = this.buffer
  44502. , n = e * t + t
  44503. , r = this.cumulativeWeight
  44504. , o = this.binding;
  44505. if (this.cumulativeWeight = 0,
  44506. r < 1) {
  44507. var a = 3 * t;
  44508. this._mixBufferRegion(i, n, a, 1 - r, t)
  44509. }
  44510. for (var s = t, l = t + t; s !== l; ++s)
  44511. if (i[s] !== i[s + t]) {
  44512. o.setValue(i, n);
  44513. break
  44514. }
  44515. },
  44516. saveOriginalState: function() {
  44517. var e = this.binding
  44518. , t = this.buffer
  44519. , i = this.valueSize
  44520. , n = 3 * i;
  44521. e.getValue(t, n);
  44522. for (var r = i, o = n; r !== o; ++r)
  44523. t[r] = t[n + r % i];
  44524. this.cumulativeWeight = 0
  44525. },
  44526. restoreOriginalState: function() {
  44527. var e = 3 * this.valueSize;
  44528. this.binding.setValue(this.buffer, e)
  44529. },
  44530. _select: function(e, t, i, n, r) {
  44531. if (.5 <= n)
  44532. for (var o = 0; o !== r; ++o)
  44533. e[t + o] = e[i + o]
  44534. },
  44535. _slerp: function(e, t, i, n, r) {
  44536. Ci.Quaternion.slerpFlat(e, t, e, t, e, i, n)
  44537. },
  44538. _lerp: function(e, t, i, n, r) {
  44539. for (var o = 1 - n, a = 0; a !== r; ++a) {
  44540. var s = t + a;
  44541. e[s] = e[s] * o + e[i + a] * n
  44542. }
  44543. }
  44544. },
  44545. Ci.BooleanKeyframeTrack = function(e, t, i) {
  44546. Ci.KeyframeTrack.call(this, e, t, i)
  44547. }
  44548. ,
  44549. Ci.BooleanKeyframeTrack.prototype = Object.assign(Object.create(Ci.KeyframeTrack.prototype), {
  44550. constructor: Ci.BooleanKeyframeTrack,
  44551. ValueTypeName: "bool",
  44552. ValueBufferType: Array,
  44553. DefaultInterpolation: Ci.IntepolateDiscrete,
  44554. InterpolantFactoryMethodLinear: void 0,
  44555. InterpolantFactoryMethodSmooth: void 0
  44556. }),
  44557. Ci.NumberKeyframeTrack = function(e, t, i, n) {
  44558. Ci.KeyframeTrack.call(this, e, t, i, n)
  44559. }
  44560. ,
  44561. Ci.NumberKeyframeTrack.prototype = Object.assign(Object.create(Ci.KeyframeTrack.prototype), {
  44562. constructor: Ci.NumberKeyframeTrack,
  44563. ValueTypeName: "number"
  44564. }),
  44565. Ci.QuaternionKeyframeTrack = function(e, t, i, n) {
  44566. Ci.KeyframeTrack.call(this, e, t, i, n)
  44567. }
  44568. ,
  44569. Ci.QuaternionKeyframeTrack.prototype = Object.assign(Object.create(Ci.KeyframeTrack.prototype), {
  44570. constructor: Ci.QuaternionKeyframeTrack,
  44571. ValueTypeName: "quaternion",
  44572. DefaultInterpolation: Ci.InterpolateLinear,
  44573. InterpolantFactoryMethodLinear: function(e) {
  44574. return new Ci.QuaternionLinearInterpolant(this.times,this.values,this.getValueSize(),e)
  44575. },
  44576. InterpolantFactoryMethodSmooth: void 0
  44577. }),
  44578. Ci.StringKeyframeTrack = function(e, t, i, n) {
  44579. Ci.KeyframeTrack.call(this, e, t, i, n)
  44580. }
  44581. ,
  44582. Ci.StringKeyframeTrack.prototype = Object.assign(Object.create(Ci.KeyframeTrack.prototype), {
  44583. constructor: Ci.StringKeyframeTrack,
  44584. ValueTypeName: "string",
  44585. ValueBufferType: Array,
  44586. DefaultInterpolation: Ci.IntepolateDiscrete,
  44587. InterpolantFactoryMethodLinear: void 0,
  44588. InterpolantFactoryMethodSmooth: void 0
  44589. }),
  44590. Ci.VectorKeyframeTrack = function(e, t, i, n) {
  44591. Ci.KeyframeTrack.call(this, e, t, i, n)
  44592. }
  44593. ,
  44594. Ci.VectorKeyframeTrack.prototype = Object.assign(Object.create(Ci.KeyframeTrack.prototype), {
  44595. constructor: Ci.VectorKeyframeTrack,
  44596. ValueTypeName: "vector"
  44597. }),
  44598. Ci.Audio = function(e) {
  44599. Ci.Object3D.call(this),
  44600. this.type = "Audio",
  44601. this.context = e.context,
  44602. this.source = this.context.createBufferSource(),
  44603. this.source.onended = this.onEnded.bind(this),
  44604. this.gain = this.context.createGain(),
  44605. this.gain.connect(e.getInput()),
  44606. this.autoplay = !1,
  44607. this.startTime = 0,
  44608. this.playbackRate = 1,
  44609. this.isPlaying = !1,
  44610. this.hasPlaybackControl = !0,
  44611. this.sourceType = "empty",
  44612. this.filter = null
  44613. }
  44614. ,
  44615. Ci.Audio.prototype = Object.create(Ci.Object3D.prototype),
  44616. Ci.Audio.prototype.constructor = Ci.Audio,
  44617. Ci.Audio.prototype.getOutput = function() {
  44618. return this.gain
  44619. }
  44620. ,
  44621. Ci.Audio.prototype.load = function(e) {
  44622. var t = new Ci.AudioBuffer(this.context);
  44623. return t.load(e),
  44624. this.setBuffer(t),
  44625. this
  44626. }
  44627. ,
  44628. Ci.Audio.prototype.setNodeSource = function(e) {
  44629. return this.hasPlaybackControl = !1,
  44630. this.sourceType = "audioNode",
  44631. this.source = e,
  44632. this.connect(),
  44633. this
  44634. }
  44635. ,
  44636. Ci.Audio.prototype.setBuffer = function(e) {
  44637. var t = this;
  44638. return e.onReady(function(e) {
  44639. t.source.buffer = e,
  44640. t.sourceType = "buffer",
  44641. t.autoplay && t.play()
  44642. }),
  44643. this
  44644. }
  44645. ,
  44646. Ci.Audio.prototype.play = function() {
  44647. if (!0 !== this.isPlaying)
  44648. if (!1 !== this.hasPlaybackControl) {
  44649. var e = this.context.createBufferSource();
  44650. e.buffer = this.source.buffer,
  44651. e.loop = this.source.loop,
  44652. e.onended = this.source.onended,
  44653. e.start(0, this.startTime),
  44654. e.playbackRate.value = this.playbackRate,
  44655. this.isPlaying = !0,
  44656. this.source = e,
  44657. this.connect()
  44658. } else
  44659. console.warn("THREE.Audio: this Audio has no playback control.");
  44660. else
  44661. console.warn("THREE.Audio: Audio is already playing.")
  44662. }
  44663. ,
  44664. Ci.Audio.prototype.pause = function() {
  44665. return !1 === this.hasPlaybackControl ? void console.warn("THREE.Audio: this Audio has no playback control.") : (this.source.stop(),
  44666. void (this.startTime = this.context.currentTime))
  44667. }
  44668. ,
  44669. Ci.Audio.prototype.stop = function() {
  44670. return !1 === this.hasPlaybackControl ? void console.warn("THREE.Audio: this Audio has no playback control.") : (this.source.stop(),
  44671. void (this.startTime = 0))
  44672. }
  44673. ,
  44674. Ci.Audio.prototype.connect = function() {
  44675. null !== this.filter ? (this.source.connect(this.filter),
  44676. this.filter.connect(this.getOutput())) : this.source.connect(this.getOutput())
  44677. }
  44678. ,
  44679. Ci.Audio.prototype.disconnect = function() {
  44680. null !== this.filter ? (this.source.disconnect(this.filter),
  44681. this.filter.disconnect(this.getOutput())) : this.source.disconnect(this.getOutput())
  44682. }
  44683. ,
  44684. Ci.Audio.prototype.getFilter = function() {
  44685. return this.filter
  44686. }
  44687. ,
  44688. Ci.Audio.prototype.setFilter = function(e) {
  44689. void 0 === e && (e = null),
  44690. !0 === this.isPlaying ? (this.disconnect(),
  44691. this.filter = e,
  44692. this.connect()) : this.filter = e
  44693. }
  44694. ,
  44695. Ci.Audio.prototype.setPlaybackRate = function(e) {
  44696. return !1 === this.hasPlaybackControl ? void console.warn("THREE.Audio: this Audio has no playback control.") : (this.playbackRate = e,
  44697. void (!0 === this.isPlaying && (this.source.playbackRate.value = this.playbackRate)))
  44698. }
  44699. ,
  44700. Ci.Audio.prototype.getPlaybackRate = function() {
  44701. return this.playbackRate
  44702. }
  44703. ,
  44704. Ci.Audio.prototype.onEnded = function() {
  44705. this.isPlaying = !1
  44706. }
  44707. ,
  44708. Ci.Audio.prototype.setLoop = function(e) {
  44709. return !1 === this.hasPlaybackControl ? void console.warn("THREE.Audio: this Audio has no playback control.") : void (this.source.loop = e)
  44710. }
  44711. ,
  44712. Ci.Audio.prototype.getLoop = function() {
  44713. return !1 === this.hasPlaybackControl ? (console.warn("THREE.Audio: this Audio has no playback control."),
  44714. !1) : this.source.loop
  44715. }
  44716. ,
  44717. Ci.Audio.prototype.setVolume = function(e) {
  44718. this.gain.gain.value = e
  44719. }
  44720. ,
  44721. Ci.Audio.prototype.getVolume = function() {
  44722. return this.gain.gain.value
  44723. }
  44724. ,
  44725. Ci.AudioAnalyser = function(e, t) {
  44726. this.analyser = e.context.createAnalyser(),
  44727. this.analyser.fftSize = void 0 !== t ? t : 2048,
  44728. this.data = new Uint8Array(this.analyser.frequencyBinCount),
  44729. e.getOutput().connect(this.analyser)
  44730. }
  44731. ,
  44732. Ci.AudioAnalyser.prototype = {
  44733. constructor: Ci.AudioAnalyser,
  44734. getData: function() {
  44735. return this.analyser.getByteFrequencyData(this.data),
  44736. this.data
  44737. }
  44738. },
  44739. Ci.AudioBuffer = function(e) {
  44740. this.context = e,
  44741. this.ready = !1,
  44742. this.readyCallbacks = []
  44743. }
  44744. ,
  44745. Ci.AudioBuffer.prototype.load = function(e) {
  44746. var i = this
  44747. , t = new XMLHttpRequest;
  44748. return t.open("GET", e, !0),
  44749. t.responseType = "arraybuffer",
  44750. t.onload = function(e) {
  44751. i.context.decodeAudioData(this.response, function(e) {
  44752. i.buffer = e,
  44753. i.ready = !0;
  44754. for (var t = 0; t < i.readyCallbacks.length; t++)
  44755. i.readyCallbacks[t](i.buffer);
  44756. i.readyCallbacks = []
  44757. })
  44758. }
  44759. ,
  44760. t.send(),
  44761. this
  44762. }
  44763. ,
  44764. Ci.AudioBuffer.prototype.onReady = function(e) {
  44765. this.ready ? e(this.buffer) : this.readyCallbacks.push(e)
  44766. }
  44767. ,
  44768. Ci.PositionalAudio = function(e) {
  44769. Ci.Audio.call(this, e),
  44770. this.panner = this.context.createPanner(),
  44771. this.panner.connect(this.gain)
  44772. }
  44773. ,
  44774. Ci.PositionalAudio.prototype = Object.create(Ci.Audio.prototype),
  44775. Ci.PositionalAudio.prototype.constructor = Ci.PositionalAudio,
  44776. Ci.PositionalAudio.prototype.getOutput = function() {
  44777. return this.panner
  44778. }
  44779. ,
  44780. Ci.PositionalAudio.prototype.setRefDistance = function(e) {
  44781. this.panner.refDistance = e
  44782. }
  44783. ,
  44784. Ci.PositionalAudio.prototype.getRefDistance = function() {
  44785. return this.panner.refDistance
  44786. }
  44787. ,
  44788. Ci.PositionalAudio.prototype.setRolloffFactor = function(e) {
  44789. this.panner.rolloffFactor = e
  44790. }
  44791. ,
  44792. Ci.PositionalAudio.prototype.getRolloffFactor = function() {
  44793. return this.panner.rolloffFactor
  44794. }
  44795. ,
  44796. Ci.PositionalAudio.prototype.setDistanceModel = function(e) {
  44797. this.panner.distanceModel = e
  44798. }
  44799. ,
  44800. Ci.PositionalAudio.prototype.getDistanceModel = function() {
  44801. return this.panner.distanceModel
  44802. }
  44803. ,
  44804. Ci.PositionalAudio.prototype.setMaxDistance = function(e) {
  44805. this.panner.maxDistance = e
  44806. }
  44807. ,
  44808. Ci.PositionalAudio.prototype.getMaxDistance = function() {
  44809. return this.panner.maxDistance
  44810. }
  44811. ,
  44812. Ci.PositionalAudio.prototype.updateMatrixWorld = (it = new Ci.Vector3,
  44813. function(e) {
  44814. Ci.Object3D.prototype.updateMatrixWorld.call(this, e),
  44815. it.setFromMatrixPosition(this.matrixWorld),
  44816. this.panner.setPosition(it.x, it.y, it.z)
  44817. }
  44818. ),
  44819. Ci.AudioListener = function() {
  44820. Ci.Object3D.call(this),
  44821. this.type = "AudioListener",
  44822. this.context = new (window.AudioContext || window.webkitAudioContext),
  44823. this.gain = this.context.createGain(),
  44824. this.gain.connect(this.context.destination),
  44825. this.filter = null
  44826. }
  44827. ,
  44828. Ci.AudioListener.prototype = Object.create(Ci.Object3D.prototype),
  44829. Ci.AudioListener.prototype.constructor = Ci.AudioListener,
  44830. Ci.AudioListener.prototype.getInput = function() {
  44831. return this.gain
  44832. }
  44833. ,
  44834. Ci.AudioListener.prototype.removeFilter = function() {
  44835. null !== this.filter && (this.gain.disconnect(this.filter),
  44836. this.filter.disconnect(this.context.destination),
  44837. this.gain.connect(this.context.destination),
  44838. this.filter = null)
  44839. }
  44840. ,
  44841. Ci.AudioListener.prototype.setFilter = function(e) {
  44842. null !== this.filter ? (this.gain.disconnect(this.filter),
  44843. this.filter.disconnect(this.context.destination)) : this.gain.disconnect(this.context.destination),
  44844. this.filter = e,
  44845. this.gain.connect(this.filter),
  44846. this.filter.connect(this.context.destination)
  44847. }
  44848. ,
  44849. Ci.AudioListener.prototype.getFilter = function() {
  44850. return this.filter
  44851. }
  44852. ,
  44853. Ci.AudioListener.prototype.setMasterVolume = function(e) {
  44854. this.gain.gain.value = e
  44855. }
  44856. ,
  44857. Ci.AudioListener.prototype.getMasterVolume = function() {
  44858. return this.gain.gain.value
  44859. }
  44860. ,
  44861. Ci.AudioListener.prototype.updateMatrixWorld = (Je = new Ci.Vector3,
  44862. $e = new Ci.Quaternion,
  44863. et = new Ci.Vector3,
  44864. tt = new Ci.Vector3,
  44865. function(e) {
  44866. Ci.Object3D.prototype.updateMatrixWorld.call(this, e);
  44867. var t = this.context.listener
  44868. , i = this.up;
  44869. this.matrixWorld.decompose(Je, $e, et),
  44870. tt.set(0, 0, -1).applyQuaternion($e),
  44871. t.setPosition(Je.x, Je.y, Je.z),
  44872. t.setOrientation(tt.x, tt.y, tt.z, i.x, i.y, i.z)
  44873. }
  44874. ),
  44875. Ci.Camera = function() {
  44876. Ci.Object3D.call(this),
  44877. this.type = "Camera",
  44878. this.matrixWorldInverse = new Ci.Matrix4,
  44879. this.projectionMatrix = new Ci.Matrix4
  44880. }
  44881. ,
  44882. Ci.Camera.prototype = Object.create(Ci.Object3D.prototype),
  44883. Ci.Camera.prototype.constructor = Ci.Camera,
  44884. Ci.Camera.prototype.getWorldDirection = (Qe = new Ci.Quaternion,
  44885. function(e) {
  44886. var t = e || new Ci.Vector3;
  44887. return this.getWorldQuaternion(Qe),
  44888. t.set(0, 0, -1).applyQuaternion(Qe)
  44889. }
  44890. ),
  44891. Ci.Camera.prototype.lookAt = (Ke = new Ci.Matrix4,
  44892. function(e) {
  44893. Ke.lookAt(this.position, e, this.up),
  44894. this.quaternion.setFromRotationMatrix(Ke)
  44895. }
  44896. ),
  44897. Ci.Camera.prototype.clone = function() {
  44898. return (new this.constructor).copy(this)
  44899. }
  44900. ,
  44901. Ci.Camera.prototype.copy = function(e) {
  44902. return Ci.Object3D.prototype.copy.call(this, e),
  44903. this.matrixWorldInverse.copy(e.matrixWorldInverse),
  44904. this.projectionMatrix.copy(e.projectionMatrix),
  44905. this
  44906. }
  44907. ,
  44908. Ci.CubeCamera = function(e, t, i) {
  44909. Ci.Object3D.call(this),
  44910. this.type = "CubeCamera";
  44911. var r = new Ci.PerspectiveCamera(90,1,e,t);
  44912. r.up.set(0, -1, 0),
  44913. r.lookAt(new Ci.Vector3(1,0,0)),
  44914. this.add(r);
  44915. var o = new Ci.PerspectiveCamera(90,1,e,t);
  44916. o.up.set(0, -1, 0),
  44917. o.lookAt(new Ci.Vector3(-1,0,0)),
  44918. this.add(o);
  44919. var a = new Ci.PerspectiveCamera(90,1,e,t);
  44920. a.up.set(0, 0, 1),
  44921. a.lookAt(new Ci.Vector3(0,1,0)),
  44922. this.add(a);
  44923. var s = new Ci.PerspectiveCamera(90,1,e,t);
  44924. s.up.set(0, 0, -1),
  44925. s.lookAt(new Ci.Vector3(0,-1,0)),
  44926. this.add(s);
  44927. var l = new Ci.PerspectiveCamera(90,1,e,t);
  44928. l.up.set(0, -1, 0),
  44929. l.lookAt(new Ci.Vector3(0,0,1)),
  44930. this.add(l);
  44931. var c = new Ci.PerspectiveCamera(90,1,e,t);
  44932. c.up.set(0, -1, 0),
  44933. c.lookAt(new Ci.Vector3(0,0,-1)),
  44934. this.add(c);
  44935. var n = {
  44936. format: Ci.RGBFormat,
  44937. magFilter: Ci.LinearFilter,
  44938. minFilter: Ci.LinearFilter
  44939. };
  44940. this.renderTarget = new Ci.WebGLRenderTargetCube(i,i,n),
  44941. this.updateCubeMap = function(e, t) {
  44942. null === this.parent && this.updateMatrixWorld();
  44943. var i = this.renderTarget
  44944. , n = i.texture.generateMipmaps;
  44945. i.texture.generateMipmaps = !1,
  44946. i.activeCubeFace = 0,
  44947. e.render(t, r, i),
  44948. i.activeCubeFace = 1,
  44949. e.render(t, o, i),
  44950. i.activeCubeFace = 2,
  44951. e.render(t, a, i),
  44952. i.activeCubeFace = 3,
  44953. e.render(t, s, i),
  44954. i.activeCubeFace = 4,
  44955. e.render(t, l, i),
  44956. i.texture.generateMipmaps = n,
  44957. i.activeCubeFace = 5,
  44958. e.render(t, c, i),
  44959. e.setRenderTarget(null)
  44960. }
  44961. }
  44962. ,
  44963. Ci.CubeCamera.prototype = Object.create(Ci.Object3D.prototype),
  44964. Ci.CubeCamera.prototype.constructor = Ci.CubeCamera,
  44965. Ci.OrthographicCamera = function(e, t, i, n, r, o) {
  44966. Ci.Camera.call(this),
  44967. this.type = "OrthographicCamera",
  44968. this.zoom = 1,
  44969. this.left = e,
  44970. this.right = t,
  44971. this.top = i,
  44972. this.bottom = n,
  44973. this.near = void 0 !== r ? r : .1,
  44974. this.far = void 0 !== o ? o : 2e3,
  44975. this.updateProjectionMatrix()
  44976. }
  44977. ,
  44978. Ci.OrthographicCamera.prototype = Object.create(Ci.Camera.prototype),
  44979. Ci.OrthographicCamera.prototype.constructor = Ci.OrthographicCamera,
  44980. Ci.OrthographicCamera.prototype.updateProjectionMatrix = function() {
  44981. var e = (this.right - this.left) / (2 * this.zoom)
  44982. , t = (this.top - this.bottom) / (2 * this.zoom)
  44983. , i = (this.right + this.left) / 2
  44984. , n = (this.top + this.bottom) / 2;
  44985. this.projectionMatrix.makeOrthographic(i - e, i + e, n + t, n - t, this.near, this.far)
  44986. }
  44987. ,
  44988. Ci.OrthographicCamera.prototype.copy = function(e) {
  44989. return Ci.Camera.prototype.copy.call(this, e),
  44990. this.left = e.left,
  44991. this.right = e.right,
  44992. this.top = e.top,
  44993. this.bottom = e.bottom,
  44994. this.near = e.near,
  44995. this.far = e.far,
  44996. this.zoom = e.zoom,
  44997. this
  44998. }
  44999. ,
  45000. Ci.OrthographicCamera.prototype.toJSON = function(e) {
  45001. var t = Ci.Object3D.prototype.toJSON.call(this, e);
  45002. return t.object.zoom = this.zoom,
  45003. t.object.left = this.left,
  45004. t.object.right = this.right,
  45005. t.object.top = this.top,
  45006. t.object.bottom = this.bottom,
  45007. t.object.near = this.near,
  45008. t.object.far = this.far,
  45009. t
  45010. }
  45011. ,
  45012. Ci.PerspectiveCamera = function(e, t, i, n) {
  45013. Ci.Camera.call(this),
  45014. this.type = "PerspectiveCamera",
  45015. this.focalLength = 10,
  45016. this.zoom = 1,
  45017. this.fov = void 0 !== e ? e : 50,
  45018. this.aspect = void 0 !== t ? t : 1,
  45019. this.near = void 0 !== i ? i : .1,
  45020. this.far = void 0 !== n ? n : 2e3,
  45021. this.updateProjectionMatrix()
  45022. }
  45023. ,
  45024. Ci.PerspectiveCamera.prototype = Object.create(Ci.Camera.prototype),
  45025. Ci.PerspectiveCamera.prototype.constructor = Ci.PerspectiveCamera,
  45026. Ci.PerspectiveCamera.prototype.setLens = function(e, t) {
  45027. void 0 === t && (t = 24),
  45028. this.fov = 2 * Ci.Math.radToDeg(Math.atan(t / (2 * e))),
  45029. this.updateProjectionMatrix()
  45030. }
  45031. ,
  45032. Ci.PerspectiveCamera.prototype.setViewOffset = function(e, t, i, n, r, o) {
  45033. this.fullWidth = e,
  45034. this.fullHeight = t,
  45035. this.x = i,
  45036. this.y = n,
  45037. this.width = r,
  45038. this.height = o,
  45039. this.updateProjectionMatrix()
  45040. }
  45041. ,
  45042. Ci.PerspectiveCamera.prototype.updateProjectionMatrix = function() {
  45043. var e = Ci.Math.radToDeg(2 * Math.atan(Math.tan(.5 * Ci.Math.degToRad(this.fov)) / this.zoom));
  45044. if (this.fullWidth) {
  45045. var t = this.fullWidth / this.fullHeight
  45046. , i = Math.tan(Ci.Math.degToRad(.5 * e)) * this.near
  45047. , n = -i
  45048. , r = t * n
  45049. , o = t * i
  45050. , a = Math.abs(o - r)
  45051. , s = Math.abs(i - n);
  45052. 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)
  45053. } else
  45054. this.projectionMatrix.makePerspective(e, this.aspect, this.near, this.far)
  45055. }
  45056. ,
  45057. Ci.PerspectiveCamera.prototype.copy = function(e) {
  45058. return Ci.Camera.prototype.copy.call(this, e),
  45059. this.focalLength = e.focalLength,
  45060. this.zoom = e.zoom,
  45061. this.fov = e.fov,
  45062. this.aspect = e.aspect,
  45063. this.near = e.near,
  45064. this.far = e.far,
  45065. this
  45066. }
  45067. ,
  45068. Ci.PerspectiveCamera.prototype.toJSON = function(e) {
  45069. var t = Ci.Object3D.prototype.toJSON.call(this, e);
  45070. return t.object.focalLength = this.focalLength,
  45071. t.object.zoom = this.zoom,
  45072. t.object.fov = this.fov,
  45073. t.object.aspect = this.aspect,
  45074. t.object.near = this.near,
  45075. t.object.far = this.far,
  45076. t
  45077. }
  45078. ,
  45079. Ci.StereoCamera = function() {
  45080. this.type = "StereoCamera",
  45081. this.aspect = 1,
  45082. this.cameraL = new Ci.PerspectiveCamera,
  45083. this.cameraL.layers.enable(1),
  45084. this.cameraL.matrixAutoUpdate = !1,
  45085. this.cameraR = new Ci.PerspectiveCamera,
  45086. this.cameraR.layers.enable(2),
  45087. this.cameraR.matrixAutoUpdate = !1
  45088. }
  45089. ,
  45090. Ci.StereoCamera.prototype = {
  45091. constructor: Ci.StereoCamera,
  45092. update: (Xe = new Ci.Matrix4,
  45093. Ze = new Ci.Matrix4,
  45094. function(e) {
  45095. if (Ge !== e.focalLength || We !== e.fov || je !== e.aspect * this.aspect || Ye !== e.near || qe !== e.far) {
  45096. Ge = e.focalLength,
  45097. We = e.fov,
  45098. je = e.aspect * this.aspect,
  45099. Ye = e.near,
  45100. qe = e.far;
  45101. var t, i, n = e.projectionMatrix.clone(), r = .032 * Ye / Ge, o = Ye * Math.tan(Ci.Math.degToRad(.5 * We));
  45102. Ze.elements[12] = -.032,
  45103. Xe.elements[12] = .032,
  45104. t = -o * je + r,
  45105. i = o * je + r,
  45106. n.elements[0] = 2 * Ye / (i - t),
  45107. n.elements[8] = (i + t) / (i - t),
  45108. this.cameraL.projectionMatrix.copy(n),
  45109. t = -o * je - r,
  45110. i = o * je - r,
  45111. n.elements[0] = 2 * Ye / (i - t),
  45112. n.elements[8] = (i + t) / (i - t),
  45113. this.cameraR.projectionMatrix.copy(n)
  45114. }
  45115. this.cameraL.matrixWorld.copy(e.matrixWorld).multiply(Ze),
  45116. this.cameraR.matrixWorld.copy(e.matrixWorld).multiply(Xe)
  45117. }
  45118. )
  45119. },
  45120. Ci.Light = function(e, t) {
  45121. Ci.Object3D.call(this),
  45122. this.type = "Light",
  45123. this.color = new Ci.Color(e),
  45124. this.intensity = void 0 !== t ? t : 1,
  45125. this.receiveShadow = void 0
  45126. }
  45127. ,
  45128. Ci.Light.prototype = Object.create(Ci.Object3D.prototype),
  45129. Ci.Light.prototype.constructor = Ci.Light,
  45130. Ci.Light.prototype.copy = function(e) {
  45131. return Ci.Object3D.prototype.copy.call(this, e),
  45132. this.color.copy(e.color),
  45133. this.intensity = e.intensity,
  45134. this
  45135. }
  45136. ,
  45137. Ci.Light.prototype.toJSON = function(e) {
  45138. var t = Ci.Object3D.prototype.toJSON.call(this, e);
  45139. return t.object.color = this.color.getHex(),
  45140. t.object.intensity = this.intensity,
  45141. void 0 !== this.groundColor && (t.object.groundColor = this.groundColor.getHex()),
  45142. void 0 !== this.distance && (t.object.distance = this.distance),
  45143. void 0 !== this.angle && (t.object.angle = this.angle),
  45144. void 0 !== this.decay && (t.object.decay = this.decay),
  45145. void 0 !== this.penumbra && (t.object.penumbra = this.penumbra),
  45146. t
  45147. }
  45148. ,
  45149. Ci.LightShadow = function(e) {
  45150. this.camera = e,
  45151. this.bias = 0,
  45152. this.radius = 1,
  45153. this.mapSize = new Ci.Vector2(512,512),
  45154. this.map = null,
  45155. this.matrix = new Ci.Matrix4
  45156. }
  45157. ,
  45158. Ci.LightShadow.prototype = {
  45159. constructor: Ci.LightShadow,
  45160. copy: function(e) {
  45161. return this.camera = e.camera.clone(),
  45162. this.bias = e.bias,
  45163. this.radius = e.radius,
  45164. this.mapSize.copy(e.mapSize),
  45165. this
  45166. },
  45167. clone: function() {
  45168. return (new this.constructor).copy(this)
  45169. }
  45170. },
  45171. Ci.AmbientLight = function(e, t) {
  45172. Ci.Light.call(this, e, t),
  45173. this.type = "AmbientLight",
  45174. this.castShadow = void 0
  45175. }
  45176. ,
  45177. Ci.AmbientLight.prototype = Object.create(Ci.Light.prototype),
  45178. Ci.AmbientLight.prototype.constructor = Ci.AmbientLight,
  45179. Ci.DirectionalLight = function(e, t) {
  45180. Ci.Light.call(this, e, t),
  45181. this.type = "DirectionalLight",
  45182. this.position.set(0, 1, 0),
  45183. this.updateMatrix(),
  45184. this.target = new Ci.Object3D,
  45185. this.shadow = new Ci.LightShadow(new Ci.OrthographicCamera(-5,5,5,-5,.5,500))
  45186. }
  45187. ,
  45188. Ci.DirectionalLight.prototype = Object.create(Ci.Light.prototype),
  45189. Ci.DirectionalLight.prototype.constructor = Ci.DirectionalLight,
  45190. Ci.DirectionalLight.prototype.copy = function(e) {
  45191. return Ci.Light.prototype.copy.call(this, e),
  45192. this.target = e.target.clone(),
  45193. this.shadow = e.shadow.clone(),
  45194. this
  45195. }
  45196. ,
  45197. Ci.HemisphereLight = function(e, t, i) {
  45198. Ci.Light.call(this, e, i),
  45199. this.type = "HemisphereLight",
  45200. this.castShadow = void 0,
  45201. this.position.set(0, 1, 0),
  45202. this.updateMatrix(),
  45203. this.groundColor = new Ci.Color(t)
  45204. }
  45205. ,
  45206. Ci.HemisphereLight.prototype = Object.create(Ci.Light.prototype),
  45207. Ci.HemisphereLight.prototype.constructor = Ci.HemisphereLight,
  45208. Ci.HemisphereLight.prototype.copy = function(e) {
  45209. return Ci.Light.prototype.copy.call(this, e),
  45210. this.groundColor.copy(e.groundColor),
  45211. this
  45212. }
  45213. ,
  45214. Ci.PointLight = function(e, t, i, n) {
  45215. Ci.Light.call(this, e, t),
  45216. this.type = "PointLight",
  45217. this.distance = void 0 !== i ? i : 0,
  45218. this.decay = void 0 !== n ? n : 1,
  45219. this.shadow = new Ci.LightShadow(new Ci.PerspectiveCamera(90,1,.5,500))
  45220. }
  45221. ,
  45222. Ci.PointLight.prototype = Object.create(Ci.Light.prototype),
  45223. Ci.PointLight.prototype.constructor = Ci.PointLight,
  45224. Object.defineProperty(Ci.PointLight.prototype, "power", {
  45225. get: function() {
  45226. return 4 * this.intensity * Math.PI
  45227. },
  45228. set: function(e) {
  45229. this.intensity = e / (4 * Math.PI)
  45230. }
  45231. }),
  45232. Ci.PointLight.prototype.copy = function(e) {
  45233. return Ci.Light.prototype.copy.call(this, e),
  45234. this.distance = e.distance,
  45235. this.decay = e.decay,
  45236. this.shadow = e.shadow.clone(),
  45237. this
  45238. }
  45239. ,
  45240. Ci.SpotLight = function(e, t, i, n, r, o) {
  45241. Ci.Light.call(this, e, t),
  45242. this.type = "SpotLight",
  45243. this.position.set(0, 1, 0),
  45244. this.updateMatrix(),
  45245. this.target = new Ci.Object3D,
  45246. this.distance = void 0 !== i ? i : 0,
  45247. this.angle = void 0 !== n ? n : Math.PI / 3,
  45248. this.penumbra = void 0 !== r ? r : 0,
  45249. this.decay = void 0 !== o ? o : 1,
  45250. this.shadow = new Ci.LightShadow(new Ci.PerspectiveCamera(50,1,.5,500))
  45251. }
  45252. ,
  45253. Ci.SpotLight.prototype = Object.create(Ci.Light.prototype),
  45254. Ci.SpotLight.prototype.constructor = Ci.SpotLight,
  45255. Object.defineProperty(Ci.SpotLight.prototype, "power", {
  45256. get: function() {
  45257. return this.intensity * Math.PI
  45258. },
  45259. set: function(e) {
  45260. this.intensity = e / Math.PI
  45261. }
  45262. }),
  45263. Ci.SpotLight.prototype.copy = function(e) {
  45264. return Ci.Light.prototype.copy.call(this, e),
  45265. this.distance = e.distance,
  45266. this.angle = e.angle,
  45267. this.penumbra = e.penumbra,
  45268. this.decay = e.decay,
  45269. this.target = e.target.clone(),
  45270. this.shadow = e.shadow.clone(),
  45271. this
  45272. }
  45273. ,
  45274. Ci.Cache = {
  45275. enabled: !1,
  45276. files: {},
  45277. add: function(e, t) {
  45278. !1 !== this.enabled && (this.files[e] = t)
  45279. },
  45280. get: function(e) {
  45281. if (!1 !== this.enabled)
  45282. return this.files[e]
  45283. },
  45284. remove: function(e) {
  45285. delete this.files[e]
  45286. },
  45287. clear: function() {
  45288. this.files = {}
  45289. }
  45290. },
  45291. Ci.Loader = function() {
  45292. this.onLoadStart = function() {}
  45293. ,
  45294. this.onLoadProgress = function() {}
  45295. ,
  45296. this.onLoadComplete = function() {}
  45297. }
  45298. ,
  45299. Ci.Loader.prototype = {
  45300. constructor: Ci.Loader,
  45301. crossOrigin: void 0,
  45302. extractUrlBase: function(e) {
  45303. var t = e.split("/");
  45304. return 1 === t.length ? "./" : (t.pop(),
  45305. t.join("/") + "/")
  45306. },
  45307. initMaterials: function(e, t, i) {
  45308. for (var n = [], r = 0; r < e.length; ++r)
  45309. n[r] = this.createMaterial(e[r], t, i);
  45310. return n
  45311. },
  45312. createMaterial: function(e, c, h) {
  45313. function t(e, t, i, n, r) {
  45314. var o, a = c + e, s = Ci.Loader.Handlers.get(a);
  45315. o = null !== s ? s.load(a) : (He.setCrossOrigin(h),
  45316. He.load(a)),
  45317. void 0 !== t && (o.repeat.fromArray(t),
  45318. 1 !== t[0] && (o.wrapS = Ci.RepeatWrapping),
  45319. 1 !== t[1] && (o.wrapT = Ci.RepeatWrapping)),
  45320. void 0 !== i && o.offset.fromArray(i),
  45321. void 0 !== n && ("repeat" === n[0] && (o.wrapS = Ci.RepeatWrapping),
  45322. "mirror" === n[0] && (o.wrapS = Ci.MirroredRepeatWrapping),
  45323. "repeat" === n[1] && (o.wrapT = Ci.RepeatWrapping),
  45324. "mirror" === n[1] && (o.wrapT = Ci.MirroredRepeatWrapping)),
  45325. void 0 !== r && (o.anisotropy = r);
  45326. var l = Ci.Math.generateUUID();
  45327. return u[l] = o,
  45328. l
  45329. }
  45330. void 0 === Ue && (Ue = new Ci.Color),
  45331. void 0 === He && (He = new Ci.TextureLoader),
  45332. void 0 === ze && (ze = new Ci.MaterialLoader);
  45333. var u = {}
  45334. , i = {
  45335. uuid: Ci.Math.generateUUID(),
  45336. type: "MeshLambertMaterial"
  45337. };
  45338. for (var n in e) {
  45339. var r = e[n];
  45340. switch (n) {
  45341. case "DbgColor":
  45342. case "DbgIndex":
  45343. case "opticalDensity":
  45344. case "illumination":
  45345. break;
  45346. case "DbgName":
  45347. i.name = r;
  45348. break;
  45349. case "blending":
  45350. i.blending = Ci[r];
  45351. break;
  45352. case "colorAmbient":
  45353. case "mapAmbient":
  45354. console.warn("THREE.Loader.createMaterial:", n, "is no longer supported.");
  45355. break;
  45356. case "colorDiffuse":
  45357. i.color = Ue.fromArray(r).getHex();
  45358. break;
  45359. case "colorSpecular":
  45360. i.specular = Ue.fromArray(r).getHex();
  45361. break;
  45362. case "colorEmissive":
  45363. i.emissive = Ue.fromArray(r).getHex();
  45364. break;
  45365. case "specularCoef":
  45366. i.shininess = r;
  45367. break;
  45368. case "shading":
  45369. "basic" === r.toLowerCase() && (i.type = "MeshBasicMaterial"),
  45370. "phong" === r.toLowerCase() && (i.type = "MeshPhongMaterial");
  45371. break;
  45372. case "mapDiffuse":
  45373. i.map = t(r, e.mapDiffuseRepeat, e.mapDiffuseOffset, e.mapDiffuseWrap, e.mapDiffuseAnisotropy);
  45374. break;
  45375. case "mapDiffuseRepeat":
  45376. case "mapDiffuseOffset":
  45377. case "mapDiffuseWrap":
  45378. case "mapDiffuseAnisotropy":
  45379. break;
  45380. case "mapLight":
  45381. i.lightMap = t(r, e.mapLightRepeat, e.mapLightOffset, e.mapLightWrap, e.mapLightAnisotropy);
  45382. break;
  45383. case "mapLightRepeat":
  45384. case "mapLightOffset":
  45385. case "mapLightWrap":
  45386. case "mapLightAnisotropy":
  45387. break;
  45388. case "mapAO":
  45389. i.aoMap = t(r, e.mapAORepeat, e.mapAOOffset, e.mapAOWrap, e.mapAOAnisotropy);
  45390. break;
  45391. case "mapAORepeat":
  45392. case "mapAOOffset":
  45393. case "mapAOWrap":
  45394. case "mapAOAnisotropy":
  45395. break;
  45396. case "mapBump":
  45397. i.bumpMap = t(r, e.mapBumpRepeat, e.mapBumpOffset, e.mapBumpWrap, e.mapBumpAnisotropy);
  45398. break;
  45399. case "mapBumpScale":
  45400. i.bumpScale = r;
  45401. break;
  45402. case "mapBumpRepeat":
  45403. case "mapBumpOffset":
  45404. case "mapBumpWrap":
  45405. case "mapBumpAnisotropy":
  45406. break;
  45407. case "mapNormal":
  45408. i.normalMap = t(r, e.mapNormalRepeat, e.mapNormalOffset, e.mapNormalWrap, e.mapNormalAnisotropy);
  45409. break;
  45410. case "mapNormalFactor":
  45411. i.normalScale = [r, r];
  45412. break;
  45413. case "mapNormalRepeat":
  45414. case "mapNormalOffset":
  45415. case "mapNormalWrap":
  45416. case "mapNormalAnisotropy":
  45417. break;
  45418. case "mapSpecular":
  45419. i.specularMap = t(r, e.mapSpecularRepeat, e.mapSpecularOffset, e.mapSpecularWrap, e.mapSpecularAnisotropy);
  45420. break;
  45421. case "mapSpecularRepeat":
  45422. case "mapSpecularOffset":
  45423. case "mapSpecularWrap":
  45424. case "mapSpecularAnisotropy":
  45425. break;
  45426. case "mapAlpha":
  45427. i.alphaMap = t(r, e.mapAlphaRepeat, e.mapAlphaOffset, e.mapAlphaWrap, e.mapAlphaAnisotropy);
  45428. break;
  45429. case "mapAlphaRepeat":
  45430. case "mapAlphaOffset":
  45431. case "mapAlphaWrap":
  45432. case "mapAlphaAnisotropy":
  45433. break;
  45434. case "flipSided":
  45435. i.side = Ci.BackSide;
  45436. break;
  45437. case "doubleSided":
  45438. i.side = Ci.DoubleSide;
  45439. break;
  45440. case "transparency":
  45441. console.warn("THREE.Loader.createMaterial: transparency has been renamed to opacity"),
  45442. i.opacity = r;
  45443. break;
  45444. case "depthTest":
  45445. case "depthWrite":
  45446. case "colorWrite":
  45447. case "opacity":
  45448. case "reflectivity":
  45449. case "transparent":
  45450. case "visible":
  45451. case "wireframe":
  45452. i[n] = r;
  45453. break;
  45454. case "vertexColors":
  45455. !0 === r && (i.vertexColors = Ci.VertexColors),
  45456. "face" === r && (i.vertexColors = Ci.FaceColors);
  45457. break;
  45458. default:
  45459. console.error("THREE.Loader.createMaterial: Unsupported", n, r)
  45460. }
  45461. }
  45462. return "MeshBasicMaterial" === i.type && delete i.emissive,
  45463. "MeshPhongMaterial" !== i.type && delete i.specular,
  45464. i.opacity < 1 && (i.transparent = !0),
  45465. ze.setTextures(u),
  45466. ze.parse(i)
  45467. }
  45468. },
  45469. Ci.Loader.Handlers = {
  45470. handlers: [],
  45471. add: function(e, t) {
  45472. this.handlers.push(e, t)
  45473. },
  45474. get: function(e) {
  45475. for (var t = this.handlers, i = 0, n = t.length; i < n; i += 2) {
  45476. var r = t[i]
  45477. , o = t[i + 1];
  45478. if (r.test(e))
  45479. return o
  45480. }
  45481. return null
  45482. }
  45483. },
  45484. Ci.XHRLoader = function(e) {
  45485. this.manager = void 0 !== e ? e : Ci.DefaultLoadingManager
  45486. }
  45487. ,
  45488. Ci.XHRLoader.prototype = {
  45489. constructor: Ci.XHRLoader,
  45490. load: function(i, n, t, r) {
  45491. void 0 !== this.path && (i = this.path + i);
  45492. var o = this
  45493. , e = Ci.Cache.get(i);
  45494. if (void 0 !== e)
  45495. return n && setTimeout(function() {
  45496. n(e)
  45497. }, 0),
  45498. e;
  45499. var a = new XMLHttpRequest;
  45500. return a.overrideMimeType("text/plain"),
  45501. a.open("GET", i, !0),
  45502. a.addEventListener("load", function(e) {
  45503. var t = e.target.response;
  45504. Ci.Cache.add(i, t),
  45505. 200 === this.status ? (n && n(t),
  45506. o.manager.itemEnd(i)) : 0 === this.status ? (console.warn("THREE.XHRLoader: HTTP Status 0 received."),
  45507. n && n(t),
  45508. o.manager.itemEnd(i)) : (r && r(e),
  45509. o.manager.itemError(i))
  45510. }, !1),
  45511. void 0 !== t && a.addEventListener("progress", function(e) {
  45512. t(e)
  45513. }, !1),
  45514. a.addEventListener("error", function(e) {
  45515. r && r(e),
  45516. o.manager.itemError(i)
  45517. }, !1),
  45518. void 0 !== this.responseType && (a.responseType = this.responseType),
  45519. void 0 !== this.withCredentials && (a.withCredentials = this.withCredentials),
  45520. a.send(null),
  45521. o.manager.itemStart(i),
  45522. a
  45523. },
  45524. setPath: function(e) {
  45525. this.path = e
  45526. },
  45527. setResponseType: function(e) {
  45528. this.responseType = e
  45529. },
  45530. setWithCredentials: function(e) {
  45531. this.withCredentials = e
  45532. }
  45533. },
  45534. Ci.FontLoader = function(e) {
  45535. this.manager = void 0 !== e ? e : Ci.DefaultLoadingManager
  45536. }
  45537. ,
  45538. Ci.FontLoader.prototype = {
  45539. constructor: Ci.FontLoader,
  45540. load: function(e, t, i, n) {
  45541. new Ci.XHRLoader(this.manager).load(e, function(e) {
  45542. t(new Ci.Font(JSON.parse(e.substring(65, e.length - 2))))
  45543. }, i, n)
  45544. }
  45545. },
  45546. Ci.ImageLoader = function(e) {
  45547. this.manager = void 0 !== e ? e : Ci.DefaultLoadingManager
  45548. }
  45549. ,
  45550. Ci.ImageLoader.prototype = {
  45551. constructor: Ci.ImageLoader,
  45552. load: function(t, i, n, r) {
  45553. void 0 !== this.path && (t = this.path + t);
  45554. var o = this
  45555. , e = Ci.Cache.get(t);
  45556. if (void 0 !== e)
  45557. return o.manager.itemStart(t),
  45558. i ? setTimeout(function() {
  45559. i(e),
  45560. o.manager.itemEnd(t)
  45561. }, 0) : o.manager.itemEnd(t),
  45562. e;
  45563. var a = document.createElement("img");
  45564. return a.addEventListener("load", function(e) {
  45565. Ci.Cache.add(t, this),
  45566. i && i(this),
  45567. o.manager.itemEnd(t)
  45568. }, !1),
  45569. void 0 !== n && a.addEventListener("progress", function(e) {
  45570. n(e)
  45571. }, !1),
  45572. a.addEventListener("error", function(e) {
  45573. r && r(e),
  45574. o.manager.itemError(t)
  45575. }, !1),
  45576. void 0 !== this.crossOrigin && (a.crossOrigin = this.crossOrigin),
  45577. o.manager.itemStart(t),
  45578. a.src = t,
  45579. a
  45580. },
  45581. setCrossOrigin: function(e) {
  45582. this.crossOrigin = e
  45583. },
  45584. setPath: function(e) {
  45585. this.path = e
  45586. }
  45587. },
  45588. Ci.JSONLoader = function(e) {
  45589. "boolean" == typeof e && (console.warn("THREE.JSONLoader: showStatus parameter has been removed from constructor."),
  45590. e = void 0),
  45591. this.manager = void 0 !== e ? e : Ci.DefaultLoadingManager,
  45592. this.withCredentials = !1
  45593. }
  45594. ,
  45595. Ci.JSONLoader.prototype = {
  45596. constructor: Ci.JSONLoader,
  45597. get statusDomElement() {
  45598. return void 0 === this._statusDomElement && (this._statusDomElement = document.createElement("div")),
  45599. console.warn("THREE.JSONLoader: .statusDomElement has been removed."),
  45600. this._statusDomElement
  45601. },
  45602. load: function(o, a, e, t) {
  45603. var s = this
  45604. , l = this.texturePath && "string" == typeof this.texturePath ? this.texturePath : Ci.Loader.prototype.extractUrlBase(o)
  45605. , i = new Ci.XHRLoader(this.manager);
  45606. i.setWithCredentials(this.withCredentials),
  45607. i.load(o, function(e) {
  45608. var t = JSON.parse(e)
  45609. , i = t.metadata;
  45610. if (void 0 !== i) {
  45611. var n = i.type;
  45612. if (void 0 !== n) {
  45613. if ("object" === n.toLowerCase())
  45614. return void console.error("THREE.JSONLoader: " + o + " should be loaded with THREE.ObjectLoader instead.");
  45615. if ("scene" === n.toLowerCase())
  45616. return void console.error("THREE.JSONLoader: " + o + " should be loaded with THREE.SceneLoader instead.")
  45617. }
  45618. }
  45619. var r = s.parse(t, l);
  45620. a(r.geometry, r.materials)
  45621. }, e, t)
  45622. },
  45623. setTexturePath: function(e) {
  45624. this.texturePath = e
  45625. },
  45626. parse: function(D, e) {
  45627. var N = new Ci.Geometry
  45628. , t = void 0 !== D.scale ? 1 / D.scale : 1;
  45629. if (function(e) {
  45630. function t(e, t) {
  45631. return e & 1 << t
  45632. }
  45633. 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;
  45634. if (void 0 !== D.uvs) {
  45635. for (i = 0; i < D.uvs.length; i++)
  45636. D.uvs[i].length && L++;
  45637. for (i = 0; i < L; i++)
  45638. N.faceVertexUvs[i] = []
  45639. }
  45640. for (o = 0,
  45641. a = R.length; o < a; )
  45642. (A = new Ci.Vector3).x = R[o++] * e,
  45643. A.y = R[o++] * e,
  45644. A.z = R[o++] * e,
  45645. N.vertices.push(A);
  45646. for (o = 0,
  45647. a = M.length; o < a; )
  45648. if (d = t(u = M[o++], 0),
  45649. p = t(u, 1),
  45650. f = t(u, 3),
  45651. g = t(u, 4),
  45652. m = t(u, 5),
  45653. v = t(u, 6),
  45654. y = t(u, 7),
  45655. d) {
  45656. if ((I = new Ci.Face3).a = M[o],
  45657. I.b = M[o + 1],
  45658. I.c = M[o + 3],
  45659. (E = new Ci.Face3).a = M[o + 1],
  45660. E.b = M[o + 2],
  45661. E.c = M[o + 3],
  45662. o += 4,
  45663. p && (h = M[o++],
  45664. I.materialIndex = h,
  45665. E.materialIndex = h),
  45666. r = N.faces.length,
  45667. f)
  45668. for (i = 0; i < L; i++)
  45669. for (w = D.uvs[i],
  45670. N.faceVertexUvs[i][r] = [],
  45671. N.faceVertexUvs[i][r + 1] = [],
  45672. n = 0; n < 4; n++)
  45673. x = w[2 * (c = M[o++])],
  45674. S = w[2 * c + 1],
  45675. T = new Ci.Vector2(x,S),
  45676. 2 !== n && N.faceVertexUvs[i][r].push(T),
  45677. 0 !== n && N.faceVertexUvs[i][r + 1].push(T);
  45678. if (g && (l = 3 * M[o++],
  45679. I.normal.set(P[l++], P[l++], P[l]),
  45680. E.normal.copy(I.normal)),
  45681. m)
  45682. for (i = 0; i < 4; i++)
  45683. l = 3 * M[o++],
  45684. b = new Ci.Vector3(P[l++],P[l++],P[l]),
  45685. 2 !== i && I.vertexNormals.push(b),
  45686. 0 !== i && E.vertexNormals.push(b);
  45687. if (v && (_ = O[s = M[o++]],
  45688. I.color.setHex(_),
  45689. E.color.setHex(_)),
  45690. y)
  45691. for (i = 0; i < 4; i++)
  45692. _ = O[s = M[o++]],
  45693. 2 !== i && I.vertexColors.push(new Ci.Color(_)),
  45694. 0 !== i && E.vertexColors.push(new Ci.Color(_));
  45695. N.faces.push(I),
  45696. N.faces.push(E)
  45697. } else {
  45698. if ((C = new Ci.Face3).a = M[o++],
  45699. C.b = M[o++],
  45700. C.c = M[o++],
  45701. p && (h = M[o++],
  45702. C.materialIndex = h),
  45703. r = N.faces.length,
  45704. f)
  45705. for (i = 0; i < L; i++)
  45706. for (w = D.uvs[i],
  45707. N.faceVertexUvs[i][r] = [],
  45708. n = 0; n < 3; n++)
  45709. x = w[2 * (c = M[o++])],
  45710. S = w[2 * c + 1],
  45711. T = new Ci.Vector2(x,S),
  45712. N.faceVertexUvs[i][r].push(T);
  45713. if (g && (l = 3 * M[o++],
  45714. C.normal.set(P[l++], P[l++], P[l])),
  45715. m)
  45716. for (i = 0; i < 3; i++)
  45717. l = 3 * M[o++],
  45718. b = new Ci.Vector3(P[l++],P[l++],P[l]),
  45719. C.vertexNormals.push(b);
  45720. if (v && (s = M[o++],
  45721. C.color.setHex(O[s])),
  45722. y)
  45723. for (i = 0; i < 3; i++)
  45724. s = M[o++],
  45725. C.vertexColors.push(new Ci.Color(O[s]));
  45726. N.faces.push(C)
  45727. }
  45728. }(t),
  45729. function() {
  45730. var e = void 0 !== D.influencesPerVertex ? D.influencesPerVertex : 2;
  45731. if (D.skinWeights)
  45732. for (var t = 0, i = D.skinWeights.length; t < i; t += e) {
  45733. var n = D.skinWeights[t]
  45734. , r = 1 < e ? D.skinWeights[t + 1] : 0
  45735. , o = 2 < e ? D.skinWeights[t + 2] : 0
  45736. , a = 3 < e ? D.skinWeights[t + 3] : 0;
  45737. N.skinWeights.push(new Ci.Vector4(n,r,o,a))
  45738. }
  45739. if (D.skinIndices)
  45740. for (t = 0,
  45741. i = D.skinIndices.length; t < i; t += e) {
  45742. var s = D.skinIndices[t]
  45743. , l = 1 < e ? D.skinIndices[t + 1] : 0
  45744. , c = 2 < e ? D.skinIndices[t + 2] : 0
  45745. , h = 3 < e ? D.skinIndices[t + 3] : 0;
  45746. N.skinIndices.push(new Ci.Vector4(s,l,c,h))
  45747. }
  45748. N.bones = D.bones,
  45749. 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.")
  45750. }(),
  45751. function(e) {
  45752. if (void 0 !== D.morphTargets)
  45753. for (var t = 0, i = D.morphTargets.length; t < i; t++) {
  45754. N.morphTargets[t] = {},
  45755. N.morphTargets[t].name = D.morphTargets[t].name,
  45756. N.morphTargets[t].vertices = [];
  45757. for (var n = N.morphTargets[t].vertices, r = D.morphTargets[t].vertices, o = 0, a = r.length; o < a; o += 3) {
  45758. var s = new Ci.Vector3;
  45759. s.x = r[o] * e,
  45760. s.y = r[o + 1] * e,
  45761. s.z = r[o + 2] * e,
  45762. n.push(s)
  45763. }
  45764. }
  45765. if (void 0 !== D.morphColors && 0 < D.morphColors.length) {
  45766. console.warn('THREE.JSONLoader: "morphColors" no longer supported. Using them as face colors.');
  45767. var l = N.faces
  45768. , c = D.morphColors[0].colors;
  45769. for (t = 0,
  45770. i = l.length; t < i; t++)
  45771. l[t].color.fromArray(c, 3 * t)
  45772. }
  45773. }(t),
  45774. function() {
  45775. var e = []
  45776. , t = [];
  45777. void 0 !== D.animation && t.push(D.animation),
  45778. void 0 !== D.animations && (D.animations.length ? t = t.concat(D.animations) : t.push(D.animations));
  45779. for (var i = 0; i < t.length; i++) {
  45780. var n = Ci.AnimationClip.parseAnimation(t[i], N.bones);
  45781. n && e.push(n)
  45782. }
  45783. if (N.morphTargets) {
  45784. var r = Ci.AnimationClip.CreateClipsFromMorphTargetSequences(N.morphTargets, 10);
  45785. e = e.concat(r)
  45786. }
  45787. 0 < e.length && (N.animations = e)
  45788. }(),
  45789. N.computeFaceNormals(),
  45790. N.computeBoundingSphere(),
  45791. void 0 === D.materials || 0 === D.materials.length)
  45792. return {
  45793. geometry: N
  45794. };
  45795. var i = Ci.Loader.prototype.initMaterials(D.materials, e, this.crossOrigin);
  45796. return {
  45797. geometry: N,
  45798. materials: i
  45799. }
  45800. }
  45801. },
  45802. Ci.LoadingManager = function(e, t, i) {
  45803. var n = this
  45804. , r = !1
  45805. , o = 0
  45806. , a = 0;
  45807. this.onStart = void 0,
  45808. this.onLoad = e,
  45809. this.onProgress = t,
  45810. this.onError = i,
  45811. this.itemStart = function(e) {
  45812. a++,
  45813. !1 === r && void 0 !== n.onStart && n.onStart(e, o, a),
  45814. r = !0
  45815. }
  45816. ,
  45817. this.itemEnd = function(e) {
  45818. o++,
  45819. void 0 !== n.onProgress && n.onProgress(e, o, a),
  45820. o === a && (r = !1,
  45821. void 0 !== n.onLoad && n.onLoad())
  45822. }
  45823. ,
  45824. this.itemError = function(e) {
  45825. void 0 !== n.onError && n.onError(e)
  45826. }
  45827. }
  45828. ,
  45829. Ci.DefaultLoadingManager = new Ci.LoadingManager,
  45830. Ci.BufferGeometryLoader = function(e) {
  45831. this.manager = void 0 !== e ? e : Ci.DefaultLoadingManager
  45832. }
  45833. ,
  45834. Ci.BufferGeometryLoader.prototype = {
  45835. constructor: Ci.BufferGeometryLoader,
  45836. load: function(e, t, i, n) {
  45837. var r = this;
  45838. new Ci.XHRLoader(r.manager).load(e, function(e) {
  45839. t(r.parse(JSON.parse(e)))
  45840. }, i, n)
  45841. },
  45842. parse: function(e) {
  45843. var t = new Ci.BufferGeometry
  45844. , i = e.data.index
  45845. , n = {
  45846. Int8Array: Int8Array,
  45847. Uint8Array: Uint8Array,
  45848. Uint8ClampedArray: Uint8ClampedArray,
  45849. Int16Array: Int16Array,
  45850. Uint16Array: Uint16Array,
  45851. Int32Array: Int32Array,
  45852. Uint32Array: Uint32Array,
  45853. Float32Array: Float32Array,
  45854. Float64Array: Float64Array
  45855. };
  45856. if (void 0 !== i) {
  45857. var r = new n[i.type](i.array);
  45858. t.setIndex(new Ci.BufferAttribute(r,1))
  45859. }
  45860. var o = e.data.attributes;
  45861. for (var a in o) {
  45862. var s = o[a];
  45863. r = new n[s.type](s.array);
  45864. t.addAttribute(a, new Ci.BufferAttribute(r,s.itemSize))
  45865. }
  45866. var l = e.data.groups || e.data.drawcalls || e.data.offsets;
  45867. if (void 0 !== l)
  45868. for (var c = 0, h = l.length; c !== h; ++c) {
  45869. var u = l[c];
  45870. t.addGroup(u.start, u.count, u.materialIndex)
  45871. }
  45872. var d = e.data.boundingSphere;
  45873. if (void 0 !== d) {
  45874. var p = new Ci.Vector3;
  45875. void 0 !== d.center && p.fromArray(d.center),
  45876. t.boundingSphere = new Ci.Sphere(p,d.radius)
  45877. }
  45878. return t
  45879. }
  45880. },
  45881. Ci.MaterialLoader = function(e) {
  45882. this.manager = void 0 !== e ? e : Ci.DefaultLoadingManager,
  45883. this.textures = {}
  45884. }
  45885. ,
  45886. Ci.MaterialLoader.prototype = {
  45887. constructor: Ci.MaterialLoader,
  45888. load: function(e, t, i, n) {
  45889. var r = this;
  45890. new Ci.XHRLoader(r.manager).load(e, function(e) {
  45891. t(r.parse(JSON.parse(e)))
  45892. }, i, n)
  45893. },
  45894. setTextures: function(e) {
  45895. this.textures = e
  45896. },
  45897. getTexture: function(e) {
  45898. var t = this.textures;
  45899. return void 0 === t[e] && console.warn("THREE.MaterialLoader: Undefined texture", e),
  45900. t[e]
  45901. },
  45902. parse: function(e) {
  45903. var t = new Ci[e.type];
  45904. if (void 0 !== e.uuid && (t.uuid = e.uuid),
  45905. void 0 !== e.name && (t.name = e.name),
  45906. void 0 !== e.color && t.color.setHex(e.color),
  45907. void 0 !== e.roughness && (t.roughness = e.roughness),
  45908. void 0 !== e.metalness && (t.metalness = e.metalness),
  45909. void 0 !== e.emissive && t.emissive.setHex(e.emissive),
  45910. void 0 !== e.specular && t.specular.setHex(e.specular),
  45911. void 0 !== e.shininess && (t.shininess = e.shininess),
  45912. void 0 !== e.uniforms && (t.uniforms = e.uniforms),
  45913. void 0 !== e.vertexShader && (t.vertexShader = e.vertexShader),
  45914. void 0 !== e.fragmentShader && (t.fragmentShader = e.fragmentShader),
  45915. void 0 !== e.vertexColors && (t.vertexColors = e.vertexColors),
  45916. void 0 !== e.shading && (t.shading = e.shading),
  45917. void 0 !== e.blending && (t.blending = e.blending),
  45918. void 0 !== e.side && (t.side = e.side),
  45919. void 0 !== e.opacity && (t.opacity = e.opacity),
  45920. void 0 !== e.transparent && (t.transparent = e.transparent),
  45921. void 0 !== e.alphaTest && (t.alphaTest = e.alphaTest),
  45922. void 0 !== e.depthTest && (t.depthTest = e.depthTest),
  45923. void 0 !== e.depthWrite && (t.depthWrite = e.depthWrite),
  45924. void 0 !== e.colorWrite && (t.colorWrite = e.colorWrite),
  45925. void 0 !== e.wireframe && (t.wireframe = e.wireframe),
  45926. void 0 !== e.wireframeLinewidth && (t.wireframeLinewidth = e.wireframeLinewidth),
  45927. void 0 !== e.size && (t.size = e.size),
  45928. void 0 !== e.sizeAttenuation && (t.sizeAttenuation = e.sizeAttenuation),
  45929. void 0 !== e.map && (t.map = this.getTexture(e.map)),
  45930. void 0 !== e.alphaMap && (t.alphaMap = this.getTexture(e.alphaMap),
  45931. t.transparent = !0),
  45932. void 0 !== e.bumpMap && (t.bumpMap = this.getTexture(e.bumpMap)),
  45933. void 0 !== e.bumpScale && (t.bumpScale = e.bumpScale),
  45934. void 0 !== e.normalMap && (t.normalMap = this.getTexture(e.normalMap)),
  45935. void 0 !== e.normalScale) {
  45936. var i = e.normalScale;
  45937. !1 === Array.isArray(i) && (i = [i, i]),
  45938. t.normalScale = (new Ci.Vector2).fromArray(i)
  45939. }
  45940. if (void 0 !== e.displacementMap && (t.displacementMap = this.getTexture(e.displacementMap)),
  45941. void 0 !== e.displacementScale && (t.displacementScale = e.displacementScale),
  45942. void 0 !== e.displacementBias && (t.displacementBias = e.displacementBias),
  45943. void 0 !== e.roughnessMap && (t.roughnessMap = this.getTexture(e.roughnessMap)),
  45944. void 0 !== e.metalnessMap && (t.metalnessMap = this.getTexture(e.metalnessMap)),
  45945. void 0 !== e.emissiveMap && (t.emissiveMap = this.getTexture(e.emissiveMap)),
  45946. void 0 !== e.emissiveIntensity && (t.emissiveIntensity = e.emissiveIntensity),
  45947. void 0 !== e.specularMap && (t.specularMap = this.getTexture(e.specularMap)),
  45948. void 0 !== e.envMap && (t.envMap = this.getTexture(e.envMap),
  45949. t.combine = Ci.MultiplyOperation),
  45950. e.reflectivity && (t.reflectivity = e.reflectivity),
  45951. void 0 !== e.lightMap && (t.lightMap = this.getTexture(e.lightMap)),
  45952. void 0 !== e.lightMapIntensity && (t.lightMapIntensity = e.lightMapIntensity),
  45953. void 0 !== e.aoMap && (t.aoMap = this.getTexture(e.aoMap)),
  45954. void 0 !== e.aoMapIntensity && (t.aoMapIntensity = e.aoMapIntensity),
  45955. void 0 !== e.materials)
  45956. for (var n = 0, r = e.materials.length; n < r; n++)
  45957. t.materials.push(this.parse(e.materials[n]));
  45958. return t
  45959. }
  45960. },
  45961. Ci.ObjectLoader = function(e) {
  45962. this.manager = void 0 !== e ? e : Ci.DefaultLoadingManager,
  45963. this.texturePath = ""
  45964. }
  45965. ,
  45966. Ci.ObjectLoader.prototype = {
  45967. constructor: Ci.ObjectLoader,
  45968. load: function(e, t, i, n) {
  45969. "" === this.texturePath && (this.texturePath = e.substring(0, e.lastIndexOf("/") + 1));
  45970. var r = this;
  45971. new Ci.XHRLoader(r.manager).load(e, function(e) {
  45972. r.parse(JSON.parse(e), t)
  45973. }, i, n)
  45974. },
  45975. setTexturePath: function(e) {
  45976. this.texturePath = e
  45977. },
  45978. setCrossOrigin: function(e) {
  45979. this.crossOrigin = e
  45980. },
  45981. parse: function(e, t) {
  45982. var i = this.parseGeometries(e.geometries)
  45983. , n = this.parseImages(e.images, function() {
  45984. void 0 !== t && t(a)
  45985. })
  45986. , r = this.parseTextures(e.textures, n)
  45987. , o = this.parseMaterials(e.materials, r)
  45988. , a = this.parseObject(e.object, i, o);
  45989. return e.animations && (a.animations = this.parseAnimations(e.animations)),
  45990. void 0 !== e.images && 0 !== e.images.length || void 0 !== t && t(a),
  45991. a
  45992. },
  45993. parseGeometries: function(e) {
  45994. var t = {};
  45995. if (void 0 !== e)
  45996. for (var i = new Ci.JSONLoader, n = new Ci.BufferGeometryLoader, r = 0, o = e.length; r < o; r++) {
  45997. var a, s = e[r];
  45998. switch (s.type) {
  45999. case "PlaneGeometry":
  46000. case "PlaneBufferGeometry":
  46001. a = new Ci[s.type](s.width,s.height,s.widthSegments,s.heightSegments);
  46002. break;
  46003. case "BoxGeometry":
  46004. case "BoxBufferGeometry":
  46005. case "CubeGeometry":
  46006. a = new Ci[s.type](s.width,s.height,s.depth,s.widthSegments,s.heightSegments,s.depthSegments);
  46007. break;
  46008. case "CircleGeometry":
  46009. case "CircleBufferGeometry":
  46010. a = new Ci[s.type](s.radius,s.segments,s.thetaStart,s.thetaLength);
  46011. break;
  46012. case "CylinderGeometry":
  46013. case "CylinderBufferGeometry":
  46014. a = new Ci[s.type](s.radiusTop,s.radiusBottom,s.height,s.radialSegments,s.heightSegments,s.openEnded,s.thetaStart,s.thetaLength);
  46015. break;
  46016. case "SphereGeometry":
  46017. case "SphereBufferGeometry":
  46018. a = new Ci[s.type](s.radius,s.widthSegments,s.heightSegments,s.phiStart,s.phiLength,s.thetaStart,s.thetaLength);
  46019. break;
  46020. case "DodecahedronGeometry":
  46021. a = new Ci.DodecahedronGeometry(s.radius,s.detail);
  46022. break;
  46023. case "IcosahedronGeometry":
  46024. a = new Ci.IcosahedronGeometry(s.radius,s.detail);
  46025. break;
  46026. case "OctahedronGeometry":
  46027. a = new Ci.OctahedronGeometry(s.radius,s.detail);
  46028. break;
  46029. case "TetrahedronGeometry":
  46030. a = new Ci.TetrahedronGeometry(s.radius,s.detail);
  46031. break;
  46032. case "RingGeometry":
  46033. case "RingBufferGeometry":
  46034. a = new Ci[s.type](s.innerRadius,s.outerRadius,s.thetaSegments,s.phiSegments,s.thetaStart,s.thetaLength);
  46035. break;
  46036. case "TorusGeometry":
  46037. case "TorusBufferGeometry":
  46038. a = new Ci[s.type](s.radius,s.tube,s.radialSegments,s.tubularSegments,s.arc);
  46039. break;
  46040. case "TorusKnotGeometry":
  46041. case "TorusKnotBufferGeometry":
  46042. a = new Ci[s.type](s.radius,s.tube,s.tubularSegments,s.radialSegments,s.p,s.q);
  46043. break;
  46044. case "LatheGeometry":
  46045. a = new Ci.LatheGeometry(s.points,s.segments,s.phiStart,s.phiLength);
  46046. break;
  46047. case "BufferGeometry":
  46048. a = n.parse(s);
  46049. break;
  46050. case "Geometry":
  46051. a = i.parse(s.data, this.texturePath).geometry;
  46052. break;
  46053. default:
  46054. console.warn('THREE.ObjectLoader: Unsupported geometry type "' + s.type + '"');
  46055. continue
  46056. }
  46057. a.uuid = s.uuid,
  46058. void 0 !== s.name && (a.name = s.name),
  46059. t[s.uuid] = a
  46060. }
  46061. return t
  46062. },
  46063. parseMaterials: function(e, t) {
  46064. var i = {};
  46065. if (void 0 !== e) {
  46066. var n = new Ci.MaterialLoader;
  46067. n.setTextures(t);
  46068. for (var r = 0, o = e.length; r < o; r++) {
  46069. var a = n.parse(e[r]);
  46070. i[a.uuid] = a
  46071. }
  46072. }
  46073. return i
  46074. },
  46075. parseAnimations: function(e) {
  46076. for (var t = [], i = 0; i < e.length; i++) {
  46077. var n = Ci.AnimationClip.parse(e[i]);
  46078. t.push(n)
  46079. }
  46080. return t
  46081. },
  46082. parseImages: function(e, t) {
  46083. function i(e) {
  46084. return n.manager.itemStart(e),
  46085. a.load(e, function() {
  46086. n.manager.itemEnd(e)
  46087. })
  46088. }
  46089. var n = this
  46090. , r = {};
  46091. if (void 0 !== e && 0 < e.length) {
  46092. var o = new Ci.LoadingManager(t)
  46093. , a = new Ci.ImageLoader(o);
  46094. a.setCrossOrigin(this.crossOrigin);
  46095. for (var s = 0, l = e.length; s < l; s++) {
  46096. var c = e[s]
  46097. , h = /^(\/\/)|([a-z]+:(\/\/)?)/i.test(c.url) ? c.url : n.texturePath + c.url;
  46098. r[c.uuid] = i(h)
  46099. }
  46100. }
  46101. return r
  46102. },
  46103. parseTextures: function(e, t) {
  46104. function i(e) {
  46105. return "number" == typeof e ? e : (console.warn("THREE.ObjectLoader.parseTexture: Constant should be in numeric form.", e),
  46106. Ci[e])
  46107. }
  46108. var n = {};
  46109. if (void 0 !== e)
  46110. for (var r = 0, o = e.length; r < o; r++) {
  46111. var a = e[r];
  46112. void 0 === a.image && console.warn('THREE.ObjectLoader: No "image" specified for', a.uuid),
  46113. void 0 === t[a.image] && console.warn("THREE.ObjectLoader: Undefined image", a.image);
  46114. var s = new Ci.Texture(t[a.image]);
  46115. s.needsUpdate = !0,
  46116. s.uuid = a.uuid,
  46117. void 0 !== a.name && (s.name = a.name),
  46118. void 0 !== a.mapping && (s.mapping = i(a.mapping)),
  46119. void 0 !== a.offset && (s.offset = new Ci.Vector2(a.offset[0],a.offset[1])),
  46120. void 0 !== a.repeat && (s.repeat = new Ci.Vector2(a.repeat[0],a.repeat[1])),
  46121. void 0 !== a.minFilter && (s.minFilter = i(a.minFilter)),
  46122. void 0 !== a.magFilter && (s.magFilter = i(a.magFilter)),
  46123. void 0 !== a.anisotropy && (s.anisotropy = a.anisotropy),
  46124. Array.isArray(a.wrap) && (s.wrapS = i(a.wrap[0]),
  46125. s.wrapT = i(a.wrap[1])),
  46126. n[a.uuid] = s
  46127. }
  46128. return n
  46129. },
  46130. parseObject: (ke = new Ci.Matrix4,
  46131. function(e, t, i) {
  46132. function n(e) {
  46133. return void 0 === t[e] && console.warn("THREE.ObjectLoader: Undefined geometry", e),
  46134. t[e]
  46135. }
  46136. function r(e) {
  46137. if (void 0 !== e)
  46138. return void 0 === i[e] && console.warn("THREE.ObjectLoader: Undefined material", e),
  46139. i[e]
  46140. }
  46141. var o;
  46142. switch (e.type) {
  46143. case "Scene":
  46144. o = new Ci.Scene;
  46145. break;
  46146. case "PerspectiveCamera":
  46147. o = new Ci.PerspectiveCamera(e.fov,e.aspect,e.near,e.far);
  46148. break;
  46149. case "OrthographicCamera":
  46150. o = new Ci.OrthographicCamera(e.left,e.right,e.top,e.bottom,e.near,e.far);
  46151. break;
  46152. case "AmbientLight":
  46153. o = new Ci.AmbientLight(e.color,e.intensity);
  46154. break;
  46155. case "DirectionalLight":
  46156. o = new Ci.DirectionalLight(e.color,e.intensity);
  46157. break;
  46158. case "PointLight":
  46159. o = new Ci.PointLight(e.color,e.intensity,e.distance,e.decay);
  46160. break;
  46161. case "SpotLight":
  46162. o = new Ci.SpotLight(e.color,e.intensity,e.distance,e.angle,e.penumbra,e.decay);
  46163. break;
  46164. case "HemisphereLight":
  46165. o = new Ci.HemisphereLight(e.color,e.groundColor,e.intensity);
  46166. break;
  46167. case "Mesh":
  46168. var a = n(e.geometry)
  46169. , s = r(e.material);
  46170. o = a.bones && 0 < a.bones.length ? new Ci.SkinnedMesh(a,s) : new Ci.Mesh(a,s);
  46171. break;
  46172. case "LOD":
  46173. o = new Ci.LOD;
  46174. break;
  46175. case "Line":
  46176. o = new Ci.Line(n(e.geometry),r(e.material),e.mode);
  46177. break;
  46178. case "PointCloud":
  46179. case "Points":
  46180. o = new Ci.Points(n(e.geometry),r(e.material));
  46181. break;
  46182. case "Sprite":
  46183. o = new Ci.Sprite(r(e.material));
  46184. break;
  46185. case "Group":
  46186. o = new Ci.Group;
  46187. break;
  46188. default:
  46189. o = new Ci.Object3D
  46190. }
  46191. if (o.uuid = e.uuid,
  46192. void 0 !== e.name && (o.name = e.name),
  46193. void 0 !== e.matrix ? (ke.fromArray(e.matrix),
  46194. ke.decompose(o.position, o.quaternion, o.scale)) : (void 0 !== e.position && o.position.fromArray(e.position),
  46195. void 0 !== e.rotation && o.rotation.fromArray(e.rotation),
  46196. void 0 !== e.scale && o.scale.fromArray(e.scale)),
  46197. void 0 !== e.castShadow && (o.castShadow = e.castShadow),
  46198. void 0 !== e.receiveShadow && (o.receiveShadow = e.receiveShadow),
  46199. void 0 !== e.visible && (o.visible = e.visible),
  46200. void 0 !== e.userData && (o.userData = e.userData),
  46201. void 0 !== e.children)
  46202. for (var l in e.children)
  46203. o.add(this.parseObject(e.children[l], t, i));
  46204. if ("LOD" === e.type)
  46205. for (var c = e.levels, h = 0; h < c.length; h++) {
  46206. var u = c[h];
  46207. void 0 !== (l = o.getObjectByProperty("uuid", u.object)) && o.addLevel(l, u.distance)
  46208. }
  46209. return o
  46210. }
  46211. )
  46212. },
  46213. Ci.TextureLoader = function(e) {
  46214. this.manager = void 0 !== e ? e : Ci.DefaultLoadingManager
  46215. }
  46216. ,
  46217. Ci.TextureLoader.prototype = {
  46218. constructor: Ci.TextureLoader,
  46219. load: function(e, t, i, n) {
  46220. var r = new Ci.Texture
  46221. , o = new Ci.ImageLoader(this.manager);
  46222. return o.setCrossOrigin(this.crossOrigin),
  46223. o.setPath(this.path),
  46224. o.load(e, function(e) {
  46225. r.image = e,
  46226. r.needsUpdate = !0,
  46227. void 0 !== t && t(r)
  46228. }, i, n),
  46229. r
  46230. },
  46231. setCrossOrigin: function(e) {
  46232. this.crossOrigin = e
  46233. },
  46234. setPath: function(e) {
  46235. this.path = e
  46236. }
  46237. },
  46238. Ci.CubeTextureLoader = function(e) {
  46239. this.manager = void 0 !== e ? e : Ci.DefaultLoadingManager
  46240. }
  46241. ,
  46242. Ci.CubeTextureLoader.prototype = {
  46243. constructor: Ci.CubeTextureLoader,
  46244. load: function(e, i, t, n) {
  46245. function r(t) {
  46246. a.load(e[t], function(e) {
  46247. o.images[t] = e,
  46248. 6 === ++s && (o.needsUpdate = !0,
  46249. i && i(o))
  46250. }, void 0, n)
  46251. }
  46252. var o = new Ci.CubeTexture
  46253. , a = new Ci.ImageLoader(this.manager);
  46254. a.setCrossOrigin(this.crossOrigin),
  46255. a.setPath(this.path);
  46256. for (var s = 0, l = 0; l < e.length; ++l)
  46257. r(l);
  46258. return o
  46259. },
  46260. setCrossOrigin: function(e) {
  46261. this.crossOrigin = e
  46262. },
  46263. setPath: function(e) {
  46264. this.path = e
  46265. }
  46266. },
  46267. Ci.DataTextureLoader = Ci.BinaryTextureLoader = function(e) {
  46268. this.manager = void 0 !== e ? e : Ci.DefaultLoadingManager,
  46269. this._parser = null
  46270. }
  46271. ,
  46272. Ci.BinaryTextureLoader.prototype = {
  46273. constructor: Ci.BinaryTextureLoader,
  46274. load: function(e, i, t, n) {
  46275. var r = this
  46276. , o = new Ci.DataTexture
  46277. , a = new Ci.XHRLoader(this.manager);
  46278. return a.setResponseType("arraybuffer"),
  46279. a.load(e, function(e) {
  46280. var t = r._parser(e);
  46281. t && (void 0 !== t.image ? o.image = t.image : void 0 !== t.data && (o.image.width = t.width,
  46282. o.image.height = t.height,
  46283. o.image.data = t.data),
  46284. o.wrapS = void 0 !== t.wrapS ? t.wrapS : Ci.ClampToEdgeWrapping,
  46285. o.wrapT = void 0 !== t.wrapT ? t.wrapT : Ci.ClampToEdgeWrapping,
  46286. o.magFilter = void 0 !== t.magFilter ? t.magFilter : Ci.LinearFilter,
  46287. o.minFilter = void 0 !== t.minFilter ? t.minFilter : Ci.LinearMipMapLinearFilter,
  46288. o.anisotropy = void 0 !== t.anisotropy ? t.anisotropy : 1,
  46289. void 0 !== t.format && (o.format = t.format),
  46290. void 0 !== t.type && (o.type = t.type),
  46291. void 0 !== t.mipmaps && (o.mipmaps = t.mipmaps),
  46292. 1 === t.mipmapCount && (o.minFilter = Ci.LinearFilter),
  46293. o.needsUpdate = !0,
  46294. i && i(o, t))
  46295. }, t, n),
  46296. o
  46297. }
  46298. },
  46299. Ci.CompressedTextureLoader = function(e) {
  46300. this.manager = void 0 !== e ? e : Ci.DefaultLoadingManager,
  46301. this._parser = null
  46302. }
  46303. ,
  46304. Ci.CompressedTextureLoader.prototype = {
  46305. constructor: Ci.CompressedTextureLoader,
  46306. load: function(e, o, t, n) {
  46307. function i(i) {
  46308. r.load(e[i], function(e) {
  46309. var t = a._parser(e, !0);
  46310. s[i] = {
  46311. width: t.width,
  46312. height: t.height,
  46313. format: t.format,
  46314. mipmaps: t.mipmaps
  46315. },
  46316. 6 === (c += 1) && (1 === t.mipmapCount && (l.minFilter = Ci.LinearFilter),
  46317. l.format = t.format,
  46318. l.needsUpdate = !0,
  46319. o && o(l))
  46320. }, t, n)
  46321. }
  46322. var a = this
  46323. , s = []
  46324. , l = new Ci.CompressedTexture;
  46325. l.image = s;
  46326. var r = new Ci.XHRLoader(this.manager);
  46327. if (r.setPath(this.path),
  46328. r.setResponseType("arraybuffer"),
  46329. Array.isArray(e))
  46330. for (var c = 0, h = 0, u = e.length; h < u; ++h)
  46331. i(h);
  46332. else
  46333. r.load(e, function(e) {
  46334. var t = a._parser(e, !0);
  46335. if (t.isCubemap)
  46336. for (var i = t.mipmaps.length / t.mipmapCount, n = 0; n < i; n++) {
  46337. s[n] = {
  46338. mipmaps: []
  46339. };
  46340. for (var r = 0; r < t.mipmapCount; r++)
  46341. s[n].mipmaps.push(t.mipmaps[n * t.mipmapCount + r]),
  46342. s[n].format = t.format,
  46343. s[n].width = t.width,
  46344. s[n].height = t.height
  46345. }
  46346. else
  46347. l.image.width = t.width,
  46348. l.image.height = t.height,
  46349. l.mipmaps = t.mipmaps;
  46350. 1 === t.mipmapCount && (l.minFilter = Ci.LinearFilter),
  46351. l.format = t.format,
  46352. l.needsUpdate = !0,
  46353. o && o(l)
  46354. }, t, n);
  46355. return l
  46356. },
  46357. setPath: function(e) {
  46358. this.path = e
  46359. }
  46360. },
  46361. Ci.Material = function() {
  46362. Object.defineProperty(this, "id", {
  46363. value: Ci.MaterialIdCount++
  46364. }),
  46365. this.uuid = Ci.Math.generateUUID(),
  46366. this.name = "",
  46367. this.type = "Material",
  46368. this.side = Ci.FrontSide,
  46369. this.opacity = 1,
  46370. this.transparent = !1,
  46371. this.blending = Ci.NormalBlending,
  46372. this.blendSrc = Ci.SrcAlphaFactor,
  46373. this.blendDst = Ci.OneMinusSrcAlphaFactor,
  46374. this.blendEquation = Ci.AddEquation,
  46375. this.blendSrcAlpha = null,
  46376. this.blendDstAlpha = null,
  46377. this.blendEquationAlpha = null,
  46378. this.depthFunc = Ci.LessEqualDepth,
  46379. this.depthTest = !0,
  46380. this.depthWrite = !0,
  46381. this.colorWrite = !0,
  46382. this.precision = null,
  46383. this.polygonOffset = !1,
  46384. this.polygonOffsetFactor = 0,
  46385. this.polygonOffsetUnits = 0,
  46386. this.alphaTest = 0,
  46387. this.premultipliedAlpha = !1,
  46388. this.overdraw = 0,
  46389. this.visible = !0,
  46390. this._needsUpdate = !0
  46391. }
  46392. ,
  46393. Ci.Material.prototype = {
  46394. constructor: Ci.Material,
  46395. get needsUpdate() {
  46396. return this._needsUpdate
  46397. },
  46398. set needsUpdate(e) {
  46399. !0 === e && this.update(),
  46400. this._needsUpdate = e
  46401. },
  46402. setValues: function(e) {
  46403. if (void 0 !== e)
  46404. for (var t in e) {
  46405. var i = e[t];
  46406. if (void 0 !== i) {
  46407. var n = this[t];
  46408. 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.")
  46409. } else
  46410. console.warn("THREE.Material: '" + t + "' parameter is undefined.")
  46411. }
  46412. },
  46413. toJSON: function(e) {
  46414. function t(e) {
  46415. var t = [];
  46416. for (var i in e) {
  46417. var n = e[i];
  46418. delete n.metadata,
  46419. t.push(n)
  46420. }
  46421. return t
  46422. }
  46423. var i = void 0 === e;
  46424. i && (e = {
  46425. textures: {},
  46426. images: {}
  46427. });
  46428. var n = {
  46429. metadata: {
  46430. version: 4.4,
  46431. type: "Material",
  46432. generator: "Material.toJSON"
  46433. }
  46434. };
  46435. if (n.uuid = this.uuid,
  46436. n.type = this.type,
  46437. "" !== this.name && (n.name = this.name),
  46438. this.color instanceof Ci.Color && (n.color = this.color.getHex()),
  46439. .5 !== this.roughness && (n.roughness = this.roughness),
  46440. .5 !== this.metalness && (n.metalness = this.metalness),
  46441. this.emissive instanceof Ci.Color && (n.emissive = this.emissive.getHex()),
  46442. this.specular instanceof Ci.Color && (n.specular = this.specular.getHex()),
  46443. void 0 !== this.shininess && (n.shininess = this.shininess),
  46444. this.map instanceof Ci.Texture && (n.map = this.map.toJSON(e).uuid),
  46445. this.alphaMap instanceof Ci.Texture && (n.alphaMap = this.alphaMap.toJSON(e).uuid),
  46446. this.lightMap instanceof Ci.Texture && (n.lightMap = this.lightMap.toJSON(e).uuid),
  46447. this.bumpMap instanceof Ci.Texture && (n.bumpMap = this.bumpMap.toJSON(e).uuid,
  46448. n.bumpScale = this.bumpScale),
  46449. this.normalMap instanceof Ci.Texture && (n.normalMap = this.normalMap.toJSON(e).uuid,
  46450. n.normalScale = this.normalScale.toArray()),
  46451. this.displacementMap instanceof Ci.Texture && (n.displacementMap = this.displacementMap.toJSON(e).uuid,
  46452. n.displacementScale = this.displacementScale,
  46453. n.displacementBias = this.displacementBias),
  46454. this.roughnessMap instanceof Ci.Texture && (n.roughnessMap = this.roughnessMap.toJSON(e).uuid),
  46455. this.metalnessMap instanceof Ci.Texture && (n.metalnessMap = this.metalnessMap.toJSON(e).uuid),
  46456. this.emissiveMap instanceof Ci.Texture && (n.emissiveMap = this.emissiveMap.toJSON(e).uuid),
  46457. this.specularMap instanceof Ci.Texture && (n.specularMap = this.specularMap.toJSON(e).uuid),
  46458. this.envMap instanceof Ci.Texture && (n.envMap = this.envMap.toJSON(e).uuid,
  46459. n.reflectivity = this.reflectivity),
  46460. void 0 !== this.size && (n.size = this.size),
  46461. void 0 !== this.sizeAttenuation && (n.sizeAttenuation = this.sizeAttenuation),
  46462. void 0 !== this.vertexColors && this.vertexColors !== Ci.NoColors && (n.vertexColors = this.vertexColors),
  46463. void 0 !== this.shading && this.shading !== Ci.SmoothShading && (n.shading = this.shading),
  46464. void 0 !== this.blending && this.blending !== Ci.NormalBlending && (n.blending = this.blending),
  46465. void 0 !== this.side && this.side !== Ci.FrontSide && (n.side = this.side),
  46466. this.opacity < 1 && (n.opacity = this.opacity),
  46467. !0 === this.transparent && (n.transparent = this.transparent),
  46468. 0 < this.alphaTest && (n.alphaTest = this.alphaTest),
  46469. !0 === this.premultipliedAlpha && (n.premultipliedAlpha = this.premultipliedAlpha),
  46470. !0 === this.wireframe && (n.wireframe = this.wireframe),
  46471. 1 < this.wireframeLinewidth && (n.wireframeLinewidth = this.wireframeLinewidth),
  46472. i) {
  46473. var r = t(e.textures)
  46474. , o = t(e.images);
  46475. 0 < r.length && (n.textures = r),
  46476. 0 < o.length && (n.images = o)
  46477. }
  46478. return n
  46479. },
  46480. clone: function() {
  46481. return (new this.constructor).copy(this)
  46482. },
  46483. copy: function(e) {
  46484. return this.name = e.name,
  46485. this.side = e.side,
  46486. this.opacity = e.opacity,
  46487. this.transparent = e.transparent,
  46488. this.blending = e.blending,
  46489. this.blendSrc = e.blendSrc,
  46490. this.blendDst = e.blendDst,
  46491. this.blendEquation = e.blendEquation,
  46492. this.blendSrcAlpha = e.blendSrcAlpha,
  46493. this.blendDstAlpha = e.blendDstAlpha,
  46494. this.blendEquationAlpha = e.blendEquationAlpha,
  46495. this.depthFunc = e.depthFunc,
  46496. this.depthTest = e.depthTest,
  46497. this.depthWrite = e.depthWrite,
  46498. this.colorWrite = e.colorWrite,
  46499. this.precision = e.precision,
  46500. this.polygonOffset = e.polygonOffset,
  46501. this.polygonOffsetFactor = e.polygonOffsetFactor,
  46502. this.polygonOffsetUnits = e.polygonOffsetUnits,
  46503. this.alphaTest = e.alphaTest,
  46504. this.premultipliedAlpha = e.premultipliedAlpha,
  46505. this.overdraw = e.overdraw,
  46506. this.visible = e.visible,
  46507. this
  46508. },
  46509. update: function() {
  46510. this.dispatchEvent({
  46511. type: "update"
  46512. })
  46513. },
  46514. dispose: function() {
  46515. this.dispatchEvent({
  46516. type: "dispose"
  46517. })
  46518. }
  46519. },
  46520. Ci.EventDispatcher.prototype.apply(Ci.Material.prototype),
  46521. Ci.MaterialIdCount = 0,
  46522. Ci.LineBasicMaterial = function(e) {
  46523. Ci.Material.call(this),
  46524. this.type = "LineBasicMaterial",
  46525. this.color = new Ci.Color(16777215),
  46526. this.linewidth = 1,
  46527. this.linecap = "round",
  46528. this.linejoin = "round",
  46529. this.blending = Ci.NormalBlending,
  46530. this.vertexColors = Ci.NoColors,
  46531. this.fog = !0,
  46532. this.setValues(e)
  46533. }
  46534. ,
  46535. Ci.LineBasicMaterial.prototype = Object.create(Ci.Material.prototype),
  46536. Ci.LineBasicMaterial.prototype.constructor = Ci.LineBasicMaterial,
  46537. Ci.LineBasicMaterial.prototype.copy = function(e) {
  46538. return Ci.Material.prototype.copy.call(this, e),
  46539. this.color.copy(e.color),
  46540. this.linewidth = e.linewidth,
  46541. this.linecap = e.linecap,
  46542. this.linejoin = e.linejoin,
  46543. this.vertexColors = e.vertexColors,
  46544. this.fog = e.fog,
  46545. this
  46546. }
  46547. ,
  46548. Ci.LineDashedMaterial = function(e) {
  46549. Ci.Material.call(this),
  46550. this.type = "LineDashedMaterial",
  46551. this.color = new Ci.Color(16777215),
  46552. this.linewidth = 1,
  46553. this.scale = 1,
  46554. this.dashSize = 3,
  46555. this.gapSize = 1,
  46556. this.blending = Ci.NormalBlending,
  46557. this.vertexColors = Ci.NoColors,
  46558. this.fog = !0,
  46559. this.setValues(e)
  46560. }
  46561. ,
  46562. Ci.LineDashedMaterial.prototype = Object.create(Ci.Material.prototype),
  46563. Ci.LineDashedMaterial.prototype.constructor = Ci.LineDashedMaterial,
  46564. Ci.LineDashedMaterial.prototype.copy = function(e) {
  46565. return Ci.Material.prototype.copy.call(this, e),
  46566. this.color.copy(e.color),
  46567. this.linewidth = e.linewidth,
  46568. this.scale = e.scale,
  46569. this.dashSize = e.dashSize,
  46570. this.gapSize = e.gapSize,
  46571. this.vertexColors = e.vertexColors,
  46572. this.fog = e.fog,
  46573. this
  46574. }
  46575. ,
  46576. Ci.MeshBasicMaterial = function(e) {
  46577. Ci.Material.call(this),
  46578. this.type = "MeshBasicMaterial",
  46579. this.color = new Ci.Color(16777215),
  46580. this.map = null,
  46581. this.aoMap = null,
  46582. this.aoMapIntensity = 1,
  46583. this.specularMap = null,
  46584. this.alphaMap = null,
  46585. this.envMap = null,
  46586. this.combine = Ci.MultiplyOperation,
  46587. this.reflectivity = 1,
  46588. this.refractionRatio = .98,
  46589. this.fog = !0,
  46590. this.shading = Ci.SmoothShading,
  46591. this.blending = Ci.NormalBlending,
  46592. this.wireframe = !1,
  46593. this.wireframeLinewidth = 1,
  46594. this.wireframeLinecap = "round",
  46595. this.wireframeLinejoin = "round",
  46596. this.vertexColors = Ci.NoColors,
  46597. this.skinning = !1,
  46598. this.morphTargets = !1,
  46599. this.setValues(e)
  46600. }
  46601. ,
  46602. Ci.MeshBasicMaterial.prototype = Object.create(Ci.Material.prototype),
  46603. Ci.MeshBasicMaterial.prototype.constructor = Ci.MeshBasicMaterial,
  46604. Ci.MeshBasicMaterial.prototype.copy = function(e) {
  46605. return Ci.Material.prototype.copy.call(this, e),
  46606. this.color.copy(e.color),
  46607. this.map = e.map,
  46608. this.aoMap = e.aoMap,
  46609. this.aoMapIntensity = e.aoMapIntensity,
  46610. this.specularMap = e.specularMap,
  46611. this.alphaMap = e.alphaMap,
  46612. this.envMap = e.envMap,
  46613. this.combine = e.combine,
  46614. this.reflectivity = e.reflectivity,
  46615. this.refractionRatio = e.refractionRatio,
  46616. this.fog = e.fog,
  46617. this.shading = e.shading,
  46618. this.wireframe = e.wireframe,
  46619. this.wireframeLinewidth = e.wireframeLinewidth,
  46620. this.wireframeLinecap = e.wireframeLinecap,
  46621. this.wireframeLinejoin = e.wireframeLinejoin,
  46622. this.vertexColors = e.vertexColors,
  46623. this.skinning = e.skinning,
  46624. this.morphTargets = e.morphTargets,
  46625. this
  46626. }
  46627. ,
  46628. Ci.MeshLambertMaterial = function(e) {
  46629. Ci.Material.call(this),
  46630. this.type = "MeshLambertMaterial",
  46631. this.color = new Ci.Color(16777215),
  46632. this.map = null,
  46633. this.lightMap = null,
  46634. this.lightMapIntensity = 1,
  46635. this.aoMap = null,
  46636. this.aoMapIntensity = 1,
  46637. this.emissive = new Ci.Color(0),
  46638. this.emissiveIntensity = 1,
  46639. this.emissiveMap = null,
  46640. this.specularMap = null,
  46641. this.alphaMap = null,
  46642. this.envMap = null,
  46643. this.combine = Ci.MultiplyOperation,
  46644. this.reflectivity = 1,
  46645. this.refractionRatio = .98,
  46646. this.fog = !0,
  46647. this.blending = Ci.NormalBlending,
  46648. this.wireframe = !1,
  46649. this.wireframeLinewidth = 1,
  46650. this.wireframeLinecap = "round",
  46651. this.wireframeLinejoin = "round",
  46652. this.vertexColors = Ci.NoColors,
  46653. this.skinning = !1,
  46654. this.morphTargets = !1,
  46655. this.morphNormals = !1,
  46656. this.setValues(e)
  46657. }
  46658. ,
  46659. Ci.MeshLambertMaterial.prototype = Object.create(Ci.Material.prototype),
  46660. Ci.MeshLambertMaterial.prototype.constructor = Ci.MeshLambertMaterial,
  46661. Ci.MeshLambertMaterial.prototype.copy = function(e) {
  46662. return Ci.Material.prototype.copy.call(this, e),
  46663. this.color.copy(e.color),
  46664. this.map = e.map,
  46665. this.lightMap = e.lightMap,
  46666. this.lightMapIntensity = e.lightMapIntensity,
  46667. this.aoMap = e.aoMap,
  46668. this.aoMapIntensity = e.aoMapIntensity,
  46669. this.emissive.copy(e.emissive),
  46670. this.emissiveMap = e.emissiveMap,
  46671. this.emissiveIntensity = e.emissiveIntensity,
  46672. this.specularMap = e.specularMap,
  46673. this.alphaMap = e.alphaMap,
  46674. this.envMap = e.envMap,
  46675. this.combine = e.combine,
  46676. this.reflectivity = e.reflectivity,
  46677. this.refractionRatio = e.refractionRatio,
  46678. this.fog = e.fog,
  46679. this.wireframe = e.wireframe,
  46680. this.wireframeLinewidth = e.wireframeLinewidth,
  46681. this.wireframeLinecap = e.wireframeLinecap,
  46682. this.wireframeLinejoin = e.wireframeLinejoin,
  46683. this.vertexColors = e.vertexColors,
  46684. this.skinning = e.skinning,
  46685. this.morphTargets = e.morphTargets,
  46686. this.morphNormals = e.morphNormals,
  46687. this
  46688. }
  46689. ,
  46690. Ci.MeshPhongMaterial = function(e) {
  46691. Ci.Material.call(this),
  46692. this.type = "MeshPhongMaterial",
  46693. this.color = new Ci.Color(16777215),
  46694. this.specular = new Ci.Color(1118481),
  46695. this.shininess = 30,
  46696. this.map = null,
  46697. this.lightMap = null,
  46698. this.lightMapIntensity = 1,
  46699. this.aoMap = null,
  46700. this.aoMapIntensity = 1,
  46701. this.emissive = new Ci.Color(0),
  46702. this.emissiveIntensity = 1,
  46703. this.emissiveMap = null,
  46704. this.bumpMap = null,
  46705. this.bumpScale = 1,
  46706. this.normalMap = null,
  46707. this.normalScale = new Ci.Vector2(1,1),
  46708. this.displacementMap = null,
  46709. this.displacementScale = 1,
  46710. this.displacementBias = 0,
  46711. this.specularMap = null,
  46712. this.alphaMap = null,
  46713. this.envMap = null,
  46714. this.combine = Ci.MultiplyOperation,
  46715. this.reflectivity = 1,
  46716. this.refractionRatio = .98,
  46717. this.fog = !0,
  46718. this.shading = Ci.SmoothShading,
  46719. this.blending = Ci.NormalBlending,
  46720. this.wireframe = !1,
  46721. this.wireframeLinewidth = 1,
  46722. this.wireframeLinecap = "round",
  46723. this.wireframeLinejoin = "round",
  46724. this.vertexColors = Ci.NoColors,
  46725. this.skinning = !1,
  46726. this.morphTargets = !1,
  46727. this.morphNormals = !1,
  46728. this.setValues(e)
  46729. }
  46730. ,
  46731. Ci.MeshPhongMaterial.prototype = Object.create(Ci.Material.prototype),
  46732. Ci.MeshPhongMaterial.prototype.constructor = Ci.MeshPhongMaterial,
  46733. Ci.MeshPhongMaterial.prototype.copy = function(e) {
  46734. return Ci.Material.prototype.copy.call(this, e),
  46735. this.color.copy(e.color),
  46736. this.specular.copy(e.specular),
  46737. this.shininess = e.shininess,
  46738. this.map = e.map,
  46739. this.lightMap = e.lightMap,
  46740. this.lightMapIntensity = e.lightMapIntensity,
  46741. this.aoMap = e.aoMap,
  46742. this.aoMapIntensity = e.aoMapIntensity,
  46743. this.emissive.copy(e.emissive),
  46744. this.emissiveMap = e.emissiveMap,
  46745. this.emissiveIntensity = e.emissiveIntensity,
  46746. this.bumpMap = e.bumpMap,
  46747. this.bumpScale = e.bumpScale,
  46748. this.normalMap = e.normalMap,
  46749. this.normalScale.copy(e.normalScale),
  46750. this.displacementMap = e.displacementMap,
  46751. this.displacementScale = e.displacementScale,
  46752. this.displacementBias = e.displacementBias,
  46753. this.specularMap = e.specularMap,
  46754. this.alphaMap = e.alphaMap,
  46755. this.envMap = e.envMap,
  46756. this.combine = e.combine,
  46757. this.reflectivity = e.reflectivity,
  46758. this.refractionRatio = e.refractionRatio,
  46759. this.fog = e.fog,
  46760. this.shading = e.shading,
  46761. this.wireframe = e.wireframe,
  46762. this.wireframeLinewidth = e.wireframeLinewidth,
  46763. this.wireframeLinecap = e.wireframeLinecap,
  46764. this.wireframeLinejoin = e.wireframeLinejoin,
  46765. this.vertexColors = e.vertexColors,
  46766. this.skinning = e.skinning,
  46767. this.morphTargets = e.morphTargets,
  46768. this.morphNormals = e.morphNormals,
  46769. this
  46770. }
  46771. ,
  46772. Ci.MeshStandardMaterial = function(e) {
  46773. Ci.Material.call(this),
  46774. this.type = "MeshStandardMaterial",
  46775. this.color = new Ci.Color(16777215),
  46776. this.roughness = .5,
  46777. this.metalness = .5,
  46778. this.map = null,
  46779. this.lightMap = null,
  46780. this.lightMapIntensity = 1,
  46781. this.aoMap = null,
  46782. this.aoMapIntensity = 1,
  46783. this.emissive = new Ci.Color(0),
  46784. this.emissiveIntensity = 1,
  46785. this.emissiveMap = null,
  46786. this.bumpMap = null,
  46787. this.bumpScale = 1,
  46788. this.normalMap = null,
  46789. this.normalScale = new Ci.Vector2(1,1),
  46790. this.displacementMap = null,
  46791. this.displacementScale = 1,
  46792. this.displacementBias = 0,
  46793. this.roughnessMap = null,
  46794. this.metalnessMap = null,
  46795. this.alphaMap = null,
  46796. this.envMap = null,
  46797. this.envMapIntensity = 1,
  46798. this.refractionRatio = .98,
  46799. this.fog = !0,
  46800. this.shading = Ci.SmoothShading,
  46801. this.blending = Ci.NormalBlending,
  46802. this.wireframe = !1,
  46803. this.wireframeLinewidth = 1,
  46804. this.wireframeLinecap = "round",
  46805. this.wireframeLinejoin = "round",
  46806. this.vertexColors = Ci.NoColors,
  46807. this.skinning = !1,
  46808. this.morphTargets = !1,
  46809. this.morphNormals = !1,
  46810. this.setValues(e)
  46811. }
  46812. ,
  46813. Ci.MeshStandardMaterial.prototype = Object.create(Ci.Material.prototype),
  46814. Ci.MeshStandardMaterial.prototype.constructor = Ci.MeshStandardMaterial,
  46815. Ci.MeshStandardMaterial.prototype.copy = function(e) {
  46816. return Ci.Material.prototype.copy.call(this, e),
  46817. this.color.copy(e.color),
  46818. this.roughness = e.roughness,
  46819. this.metalness = e.metalness,
  46820. this.map = e.map,
  46821. this.lightMap = e.lightMap,
  46822. this.lightMapIntensity = e.lightMapIntensity,
  46823. this.aoMap = e.aoMap,
  46824. this.aoMapIntensity = e.aoMapIntensity,
  46825. this.emissive.copy(e.emissive),
  46826. this.emissiveMap = e.emissiveMap,
  46827. this.emissiveIntensity = e.emissiveIntensity,
  46828. this.bumpMap = e.bumpMap,
  46829. this.bumpScale = e.bumpScale,
  46830. this.normalMap = e.normalMap,
  46831. this.normalScale.copy(e.normalScale),
  46832. this.displacementMap = e.displacementMap,
  46833. this.displacementScale = e.displacementScale,
  46834. this.displacementBias = e.displacementBias,
  46835. this.roughnessMap = e.roughnessMap,
  46836. this.metalnessMap = e.metalnessMap,
  46837. this.alphaMap = e.alphaMap,
  46838. this.envMap = e.envMap,
  46839. this.envMapIntensity = e.envMapIntensity,
  46840. this.refractionRatio = e.refractionRatio,
  46841. this.fog = e.fog,
  46842. this.shading = e.shading,
  46843. this.wireframe = e.wireframe,
  46844. this.wireframeLinewidth = e.wireframeLinewidth,
  46845. this.wireframeLinecap = e.wireframeLinecap,
  46846. this.wireframeLinejoin = e.wireframeLinejoin,
  46847. this.vertexColors = e.vertexColors,
  46848. this.skinning = e.skinning,
  46849. this.morphTargets = e.morphTargets,
  46850. this.morphNormals = e.morphNormals,
  46851. this
  46852. }
  46853. ,
  46854. Ci.MeshDepthMaterial = function(e) {
  46855. Ci.Material.call(this),
  46856. this.type = "MeshDepthMaterial",
  46857. this.morphTargets = !1,
  46858. this.wireframe = !1,
  46859. this.wireframeLinewidth = 1,
  46860. this.setValues(e)
  46861. }
  46862. ,
  46863. Ci.MeshDepthMaterial.prototype = Object.create(Ci.Material.prototype),
  46864. Ci.MeshDepthMaterial.prototype.constructor = Ci.MeshDepthMaterial,
  46865. Ci.MeshDepthMaterial.prototype.copy = function(e) {
  46866. return Ci.Material.prototype.copy.call(this, e),
  46867. this.wireframe = e.wireframe,
  46868. this.wireframeLinewidth = e.wireframeLinewidth,
  46869. this
  46870. }
  46871. ,
  46872. Ci.MeshNormalMaterial = function(e) {
  46873. Ci.Material.call(this, e),
  46874. this.type = "MeshNormalMaterial",
  46875. this.wireframe = !1,
  46876. this.wireframeLinewidth = 1,
  46877. this.morphTargets = !1,
  46878. this.setValues(e)
  46879. }
  46880. ,
  46881. Ci.MeshNormalMaterial.prototype = Object.create(Ci.Material.prototype),
  46882. Ci.MeshNormalMaterial.prototype.constructor = Ci.MeshNormalMaterial,
  46883. Ci.MeshNormalMaterial.prototype.copy = function(e) {
  46884. return Ci.Material.prototype.copy.call(this, e),
  46885. this.wireframe = e.wireframe,
  46886. this.wireframeLinewidth = e.wireframeLinewidth,
  46887. this
  46888. }
  46889. ,
  46890. Ci.MultiMaterial = function(e) {
  46891. this.uuid = Ci.Math.generateUUID(),
  46892. this.type = "MultiMaterial",
  46893. this.materials = e instanceof Array ? e : [],
  46894. this.visible = !0
  46895. }
  46896. ,
  46897. Ci.MultiMaterial.prototype = {
  46898. constructor: Ci.MultiMaterial,
  46899. toJSON: function(e) {
  46900. for (var t = {
  46901. metadata: {
  46902. version: 4.2,
  46903. type: "material",
  46904. generator: "MaterialExporter"
  46905. },
  46906. uuid: this.uuid,
  46907. type: this.type,
  46908. materials: []
  46909. }, i = this.materials, n = 0, r = i.length; n < r; n++) {
  46910. var o = i[n].toJSON(e);
  46911. delete o.metadata,
  46912. t.materials.push(o)
  46913. }
  46914. return t.visible = this.visible,
  46915. t
  46916. },
  46917. clone: function() {
  46918. for (var e = new this.constructor, t = 0; t < this.materials.length; t++)
  46919. e.materials.push(this.materials[t].clone());
  46920. return e.visible = this.visible,
  46921. e
  46922. }
  46923. },
  46924. Ci.PointsMaterial = function(e) {
  46925. Ci.Material.call(this),
  46926. this.type = "PointsMaterial",
  46927. this.color = new Ci.Color(16777215),
  46928. this.map = null,
  46929. this.size = 1,
  46930. this.sizeAttenuation = !0,
  46931. this.blending = Ci.NormalBlending,
  46932. this.vertexColors = Ci.NoColors,
  46933. this.fog = !0,
  46934. this.setValues(e)
  46935. }
  46936. ,
  46937. Ci.PointsMaterial.prototype = Object.create(Ci.Material.prototype),
  46938. Ci.PointsMaterial.prototype.constructor = Ci.PointsMaterial,
  46939. Ci.PointsMaterial.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.size = e.size,
  46944. this.sizeAttenuation = e.sizeAttenuation,
  46945. this.vertexColors = e.vertexColors,
  46946. this.fog = e.fog,
  46947. this
  46948. }
  46949. ,
  46950. Ci.ShaderMaterial = function(e) {
  46951. Ci.Material.call(this),
  46952. this.type = "ShaderMaterial",
  46953. this.defines = {},
  46954. this.uniforms = {},
  46955. this.vertexShader = "void main() {\n\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}",
  46956. this.fragmentShader = "void main() {\n\tgl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );\n}",
  46957. this.shading = Ci.SmoothShading,
  46958. this.linewidth = 1,
  46959. this.wireframe = !1,
  46960. this.wireframeLinewidth = 1,
  46961. this.fog = !1,
  46962. this.lights = !1,
  46963. this.vertexColors = Ci.NoColors,
  46964. this.skinning = !1,
  46965. this.morphTargets = !1,
  46966. this.morphNormals = !1,
  46967. this.extensions = {
  46968. derivatives: !1,
  46969. fragDepth: !1,
  46970. drawBuffers: !1,
  46971. shaderTextureLOD: !1
  46972. },
  46973. this.defaultAttributeValues = {
  46974. color: [1, 1, 1],
  46975. uv: [0, 0],
  46976. uv2: [0, 0]
  46977. },
  46978. (this.index0AttributeName = void 0) !== e && (void 0 !== e.attributes && console.error("THREE.ShaderMaterial: attributes should now be defined in THREE.BufferGeometry instead."),
  46979. this.setValues(e))
  46980. }
  46981. ,
  46982. Ci.ShaderMaterial.prototype = Object.create(Ci.Material.prototype),
  46983. Ci.ShaderMaterial.prototype.constructor = Ci.ShaderMaterial,
  46984. Ci.ShaderMaterial.prototype.copy = function(e) {
  46985. return Ci.Material.prototype.copy.call(this, e),
  46986. this.fragmentShader = e.fragmentShader,
  46987. this.vertexShader = e.vertexShader,
  46988. this.uniforms = Ci.UniformsUtils.clone(e.uniforms),
  46989. this.defines = e.defines,
  46990. this.shading = e.shading,
  46991. this.wireframe = e.wireframe,
  46992. this.wireframeLinewidth = e.wireframeLinewidth,
  46993. this.fog = e.fog,
  46994. this.lights = e.lights,
  46995. this.vertexColors = e.vertexColors,
  46996. this.skinning = e.skinning,
  46997. this.morphTargets = e.morphTargets,
  46998. this.morphNormals = e.morphNormals,
  46999. this.extensions = e.extensions,
  47000. this
  47001. }
  47002. ,
  47003. Ci.ShaderMaterial.prototype.toJSON = function(e) {
  47004. var t = Ci.Material.prototype.toJSON.call(this, e);
  47005. return t.uniforms = this.uniforms,
  47006. t.vertexShader = this.vertexShader,
  47007. t.fragmentShader = this.fragmentShader,
  47008. t
  47009. }
  47010. ,
  47011. Ci.RawShaderMaterial = function(e) {
  47012. Ci.ShaderMaterial.call(this, e),
  47013. this.type = "RawShaderMaterial"
  47014. }
  47015. ,
  47016. Ci.RawShaderMaterial.prototype = Object.create(Ci.ShaderMaterial.prototype),
  47017. Ci.RawShaderMaterial.prototype.constructor = Ci.RawShaderMaterial,
  47018. Ci.SpriteMaterial = function(e) {
  47019. Ci.Material.call(this),
  47020. this.type = "SpriteMaterial",
  47021. this.color = new Ci.Color(16777215),
  47022. this.map = null,
  47023. this.rotation = 0,
  47024. this.fog = !1,
  47025. this.setValues(e)
  47026. }
  47027. ,
  47028. Ci.SpriteMaterial.prototype = Object.create(Ci.Material.prototype),
  47029. Ci.SpriteMaterial.prototype.constructor = Ci.SpriteMaterial,
  47030. Ci.SpriteMaterial.prototype.copy = function(e) {
  47031. return Ci.Material.prototype.copy.call(this, e),
  47032. this.color.copy(e.color),
  47033. this.map = e.map,
  47034. this.rotation = e.rotation,
  47035. this.fog = e.fog,
  47036. this
  47037. }
  47038. ,
  47039. Ci.Texture = function(e, t, i, n, r, o, a, s, l) {
  47040. Object.defineProperty(this, "id", {
  47041. value: Ci.TextureIdCount++
  47042. }),
  47043. this.uuid = Ci.Math.generateUUID(),
  47044. this.name = "",
  47045. this.sourceFile = "",
  47046. this.image = void 0 !== e ? e : Ci.Texture.DEFAULT_IMAGE,
  47047. this.mipmaps = [],
  47048. this.mapping = void 0 !== t ? t : Ci.Texture.DEFAULT_MAPPING,
  47049. this.wrapS = void 0 !== i ? i : Ci.ClampToEdgeWrapping,
  47050. this.wrapT = void 0 !== n ? n : Ci.ClampToEdgeWrapping,
  47051. this.magFilter = void 0 !== r ? r : Ci.LinearFilter,
  47052. this.minFilter = void 0 !== o ? o : Ci.LinearMipMapLinearFilter,
  47053. this.anisotropy = void 0 !== l ? l : 1,
  47054. this.format = void 0 !== a ? a : Ci.RGBAFormat,
  47055. this.type = void 0 !== s ? s : Ci.UnsignedByteType,
  47056. this.offset = new Ci.Vector2(0,0),
  47057. this.repeat = new Ci.Vector2(1,1),
  47058. this.generateMipmaps = !0,
  47059. this.premultiplyAlpha = !1,
  47060. this.flipY = !0,
  47061. this.unpackAlignment = 4,
  47062. this.encoding = Ci.LinearEncoding,
  47063. this.version = 0,
  47064. this.onUpdate = null
  47065. }
  47066. ,
  47067. Ci.Texture.DEFAULT_IMAGE = void 0,
  47068. Ci.Texture.DEFAULT_MAPPING = Ci.UVMapping,
  47069. Ci.Texture.prototype = {
  47070. constructor: Ci.Texture,
  47071. set needsUpdate(e) {
  47072. !0 === e && this.version++
  47073. },
  47074. clone: function() {
  47075. return (new this.constructor).copy(this)
  47076. },
  47077. copy: function(e) {
  47078. return this.image = e.image,
  47079. this.mipmaps = e.mipmaps.slice(0),
  47080. this.mapping = e.mapping,
  47081. this.wrapS = e.wrapS,
  47082. this.wrapT = e.wrapT,
  47083. this.magFilter = e.magFilter,
  47084. this.minFilter = e.minFilter,
  47085. this.anisotropy = e.anisotropy,
  47086. this.format = e.format,
  47087. this.type = e.type,
  47088. this.offset.copy(e.offset),
  47089. this.repeat.copy(e.repeat),
  47090. this.generateMipmaps = e.generateMipmaps,
  47091. this.premultiplyAlpha = e.premultiplyAlpha,
  47092. this.flipY = e.flipY,
  47093. this.unpackAlignment = e.unpackAlignment,
  47094. this.encoding = e.encoding,
  47095. this
  47096. },
  47097. toJSON: function(e) {
  47098. if (void 0 !== e.textures[this.uuid])
  47099. return e.textures[this.uuid];
  47100. var t, i, n = {
  47101. metadata: {
  47102. version: 4.4,
  47103. type: "Texture",
  47104. generator: "Texture.toJSON"
  47105. },
  47106. uuid: this.uuid,
  47107. name: this.name,
  47108. mapping: this.mapping,
  47109. repeat: [this.repeat.x, this.repeat.y],
  47110. offset: [this.offset.x, this.offset.y],
  47111. wrap: [this.wrapS, this.wrapT],
  47112. minFilter: this.minFilter,
  47113. magFilter: this.magFilter,
  47114. anisotropy: this.anisotropy
  47115. };
  47116. if (void 0 !== this.image) {
  47117. var r = this.image;
  47118. void 0 === r.uuid && (r.uuid = Ci.Math.generateUUID()),
  47119. void 0 === e.images[r.uuid] && (e.images[r.uuid] = {
  47120. uuid: r.uuid,
  47121. url: (t = r,
  47122. void 0 !== t.toDataURL ? i = t : ((i = document.createElement("canvas")).width = t.width,
  47123. i.height = t.height,
  47124. i.getContext("2d").drawImage(t, 0, 0, t.width, t.height)),
  47125. 2048 < i.width || 2048 < i.height ? i.toDataURL("image/jpeg", .6) : i.toDataURL("image/png"))
  47126. }),
  47127. n.image = r.uuid
  47128. }
  47129. return e.textures[this.uuid] = n
  47130. },
  47131. dispose: function() {
  47132. this.dispatchEvent({
  47133. type: "dispose"
  47134. })
  47135. },
  47136. transformUv: function(e) {
  47137. if (this.mapping === Ci.UVMapping) {
  47138. if (e.multiply(this.repeat),
  47139. e.add(this.offset),
  47140. e.x < 0 || 1 < e.x)
  47141. switch (this.wrapS) {
  47142. case Ci.RepeatWrapping:
  47143. e.x = e.x - Math.floor(e.x);
  47144. break;
  47145. case Ci.ClampToEdgeWrapping:
  47146. e.x = e.x < 0 ? 0 : 1;
  47147. break;
  47148. case Ci.MirroredRepeatWrapping:
  47149. 1 === Math.abs(Math.floor(e.x) % 2) ? e.x = Math.ceil(e.x) - e.x : e.x = e.x - Math.floor(e.x)
  47150. }
  47151. if (e.y < 0 || 1 < e.y)
  47152. switch (this.wrapT) {
  47153. case Ci.RepeatWrapping:
  47154. e.y = e.y - Math.floor(e.y);
  47155. break;
  47156. case Ci.ClampToEdgeWrapping:
  47157. e.y = e.y < 0 ? 0 : 1;
  47158. break;
  47159. case Ci.MirroredRepeatWrapping:
  47160. 1 === Math.abs(Math.floor(e.y) % 2) ? e.y = Math.ceil(e.y) - e.y : e.y = e.y - Math.floor(e.y)
  47161. }
  47162. this.flipY && (e.y = 1 - e.y)
  47163. }
  47164. }
  47165. },
  47166. Ci.EventDispatcher.prototype.apply(Ci.Texture.prototype),
  47167. Ci.TextureIdCount = 0,
  47168. Ci.CanvasTexture = function(e, t, i, n, r, o, a, s, l) {
  47169. Ci.Texture.call(this, e, t, i, n, r, o, a, s, l),
  47170. this.needsUpdate = !0
  47171. }
  47172. ,
  47173. Ci.CanvasTexture.prototype = Object.create(Ci.Texture.prototype),
  47174. Ci.CanvasTexture.prototype.constructor = Ci.CanvasTexture,
  47175. Ci.CubeTexture = function(e, t, i, n, r, o, a, s, l) {
  47176. e = void 0 !== e ? e : [],
  47177. t = void 0 !== t ? t : Ci.CubeReflectionMapping,
  47178. Ci.Texture.call(this, e, t, i, n, r, o, a, s, l),
  47179. this.flipY = !1
  47180. }
  47181. ,
  47182. Ci.CubeTexture.prototype = Object.create(Ci.Texture.prototype),
  47183. Ci.CubeTexture.prototype.constructor = Ci.CubeTexture,
  47184. Object.defineProperty(Ci.CubeTexture.prototype, "images", {
  47185. get: function() {
  47186. return this.image
  47187. },
  47188. set: function(e) {
  47189. this.image = e
  47190. }
  47191. }),
  47192. Ci.CompressedTexture = function(e, t, i, n, r, o, a, s, l, c, h) {
  47193. Ci.Texture.call(this, null, o, a, s, l, c, n, r, h),
  47194. this.image = {
  47195. width: t,
  47196. height: i
  47197. },
  47198. this.mipmaps = e,
  47199. this.flipY = !1,
  47200. this.generateMipmaps = !1
  47201. }
  47202. ,
  47203. Ci.CompressedTexture.prototype = Object.create(Ci.Texture.prototype),
  47204. Ci.CompressedTexture.prototype.constructor = Ci.CompressedTexture,
  47205. Ci.DataTexture = function(e, t, i, n, r, o, a, s, l, c, h) {
  47206. Ci.Texture.call(this, null, o, a, s, l, c, n, r, h),
  47207. this.image = {
  47208. data: e,
  47209. width: t,
  47210. height: i
  47211. },
  47212. this.magFilter = void 0 !== l ? l : Ci.NearestFilter,
  47213. this.minFilter = void 0 !== c ? c : Ci.NearestFilter,
  47214. this.flipY = !1,
  47215. this.generateMipmaps = !1
  47216. }
  47217. ,
  47218. Ci.DataTexture.prototype = Object.create(Ci.Texture.prototype),
  47219. Ci.DataTexture.prototype.constructor = Ci.DataTexture,
  47220. Ci.VideoTexture = function(t, e, i, n, r, o, a, s, l) {
  47221. Ci.Texture.call(this, t, e, i, n, r, o, a, s, l),
  47222. this.generateMipmaps = !1;
  47223. var c = this;
  47224. !function e() {
  47225. requestAnimationFrame(e),
  47226. !t.paused && t.readyState === t.HAVE_ENOUGH_DATA && (c.needsUpdate = !0)
  47227. }()
  47228. }
  47229. ,
  47230. Ci.VideoTexture.prototype = Object.create(Ci.Texture.prototype),
  47231. Ci.VideoTexture.prototype.constructor = Ci.VideoTexture,
  47232. Ci.Group = function() {
  47233. Ci.Object3D.call(this),
  47234. this.type = "Group"
  47235. }
  47236. ,
  47237. Ci.Group.prototype = Object.create(Ci.Object3D.prototype),
  47238. Ci.Group.prototype.constructor = Ci.Group,
  47239. Ci.Points = function(e, t) {
  47240. Ci.Object3D.call(this),
  47241. this.type = "Points",
  47242. this.geometry = void 0 !== e ? e : new Ci.Geometry,
  47243. this.material = void 0 !== t ? t : new Ci.PointsMaterial({
  47244. color: 16777215 * Math.random()
  47245. })
  47246. }
  47247. ,
  47248. Ci.Points.prototype = Object.create(Ci.Object3D.prototype),
  47249. Ci.Points.prototype.constructor = Ci.Points,
  47250. Ci.Points.prototype.raycast = (Wt = new Ci.Matrix4,
  47251. jt = new Ci.Ray,
  47252. Yt = new Ci.Sphere,
  47253. function(o, a) {
  47254. function e(e, t) {
  47255. var i = jt.distanceSqToPoint(e);
  47256. if (i < c) {
  47257. var n = jt.closestPointToPoint(e);
  47258. n.applyMatrix4(l);
  47259. var r = o.ray.origin.distanceTo(n);
  47260. if (r < o.near || r > o.far)
  47261. return;
  47262. a.push({
  47263. distance: r,
  47264. distanceToRay: Math.sqrt(i),
  47265. point: n.clone(),
  47266. index: t,
  47267. face: null,
  47268. object: s
  47269. })
  47270. }
  47271. }
  47272. var s = this
  47273. , t = this.geometry
  47274. , l = this.matrixWorld
  47275. , i = o.params.Points.threshold;
  47276. if (null === t.boundingSphere && t.computeBoundingSphere(),
  47277. Yt.copy(t.boundingSphere),
  47278. Yt.applyMatrix4(l),
  47279. !1 !== o.ray.intersectsSphere(Yt)) {
  47280. Wt.getInverse(l),
  47281. jt.copy(o.ray).applyMatrix4(Wt);
  47282. var n = i / ((this.scale.x + this.scale.y + this.scale.z) / 3)
  47283. , c = n * n
  47284. , r = new Ci.Vector3;
  47285. if (t instanceof Ci.BufferGeometry) {
  47286. var h = t.index
  47287. , u = t.attributes.position.array;
  47288. if (null !== h)
  47289. for (var d = h.array, p = 0, f = d.length; p < f; p++) {
  47290. var g = d[p];
  47291. r.fromArray(u, 3 * g),
  47292. e(r, g)
  47293. }
  47294. else {
  47295. p = 0;
  47296. for (var m = u.length / 3; p < m; p++)
  47297. r.fromArray(u, 3 * p),
  47298. e(r, p)
  47299. }
  47300. } else {
  47301. var v = t.vertices;
  47302. for (p = 0,
  47303. m = v.length; p < m; p++)
  47304. e(v[p], p)
  47305. }
  47306. }
  47307. }
  47308. ),
  47309. Ci.Points.prototype.clone = function() {
  47310. return new this.constructor(this.geometry,this.material).copy(this)
  47311. }
  47312. ,
  47313. Ci.Line = function(e, t, i) {
  47314. return 1 === i ? (console.warn("THREE.Line: parameter THREE.LinePieces no longer supported. Created THREE.LineSegments instead."),
  47315. new Ci.LineSegments(e,t)) : (Ci.Object3D.call(this),
  47316. this.type = "Line",
  47317. this.geometry = void 0 !== e ? e : new Ci.Geometry,
  47318. void (this.material = void 0 !== t ? t : new Ci.LineBasicMaterial({
  47319. color: 16777215 * Math.random()
  47320. })))
  47321. }
  47322. ,
  47323. Ci.Line.prototype = Object.create(Ci.Object3D.prototype),
  47324. Ci.Line.prototype.constructor = Ci.Line,
  47325. Ci.Line.prototype.raycast = (Ht = new Ci.Matrix4,
  47326. zt = new Ci.Ray,
  47327. Gt = new Ci.Sphere,
  47328. function(e, t) {
  47329. var i = e.linePrecision
  47330. , n = i * i
  47331. , r = this.geometry
  47332. , o = this.matrixWorld;
  47333. if (null === r.boundingSphere && r.computeBoundingSphere(),
  47334. Gt.copy(r.boundingSphere),
  47335. Gt.applyMatrix4(o),
  47336. !1 !== e.ray.intersectsSphere(Gt)) {
  47337. Ht.getInverse(o),
  47338. zt.copy(e.ray).applyMatrix4(Ht);
  47339. var a = new Ci.Vector3
  47340. , s = new Ci.Vector3
  47341. , l = new Ci.Vector3
  47342. , c = new Ci.Vector3
  47343. , h = this instanceof Ci.LineSegments ? 2 : 1;
  47344. if (r instanceof Ci.BufferGeometry) {
  47345. var u = r.index
  47346. , d = r.attributes.position.array;
  47347. if (null !== u)
  47348. for (var p = u.array, f = 0, g = p.length - 1; f < g; f += h) {
  47349. var m = p[f]
  47350. , v = p[f + 1];
  47351. a.fromArray(d, 3 * m),
  47352. s.fromArray(d, 3 * v),
  47353. n < zt.distanceSqToSegment(a, s, c, l) || (c.applyMatrix4(this.matrixWorld),
  47354. (C = e.ray.origin.distanceTo(c)) < e.near || C > e.far || t.push({
  47355. distance: C,
  47356. point: l.clone().applyMatrix4(this.matrixWorld),
  47357. index: f,
  47358. face: null,
  47359. faceIndex: null,
  47360. object: this
  47361. }))
  47362. }
  47363. else
  47364. for (f = 0,
  47365. g = d.length / 3 - 1; f < g; f += h)
  47366. a.fromArray(d, 3 * f),
  47367. s.fromArray(d, 3 * f + 3),
  47368. n < zt.distanceSqToSegment(a, s, c, l) || (c.applyMatrix4(this.matrixWorld),
  47369. (C = e.ray.origin.distanceTo(c)) < e.near || C > e.far || t.push({
  47370. distance: C,
  47371. point: l.clone().applyMatrix4(this.matrixWorld),
  47372. index: f,
  47373. face: null,
  47374. faceIndex: null,
  47375. object: this
  47376. }))
  47377. } else if (r instanceof Ci.Geometry) {
  47378. var y = r.vertices
  47379. , A = y.length;
  47380. for (f = 0; f < A - 1; f += h) {
  47381. var C;
  47382. n < zt.distanceSqToSegment(y[f], y[f + 1], c, l) || (c.applyMatrix4(this.matrixWorld),
  47383. (C = e.ray.origin.distanceTo(c)) < e.near || C > e.far || t.push({
  47384. distance: C,
  47385. point: l.clone().applyMatrix4(this.matrixWorld),
  47386. index: f,
  47387. face: null,
  47388. faceIndex: null,
  47389. object: this
  47390. }))
  47391. }
  47392. }
  47393. }
  47394. }
  47395. ),
  47396. Ci.Line.prototype.clone = function() {
  47397. return new this.constructor(this.geometry,this.material).copy(this)
  47398. }
  47399. ,
  47400. Ci.LineStrip = 0,
  47401. Ci.LinePieces = 1,
  47402. Ci.LineSegments = function(e, t) {
  47403. Ci.Line.call(this, e, t),
  47404. this.type = "LineSegments"
  47405. }
  47406. ,
  47407. Ci.LineSegments.prototype = Object.create(Ci.Line.prototype),
  47408. Ci.LineSegments.prototype.constructor = Ci.LineSegments,
  47409. Ci.Mesh = function(e, t) {
  47410. Ci.Object3D.call(this),
  47411. this.type = "Mesh",
  47412. this.geometry = void 0 !== e ? e : new Ci.Geometry,
  47413. this.material = void 0 !== t ? t : new Ci.MeshBasicMaterial({
  47414. color: 16777215 * Math.random()
  47415. }),
  47416. this.drawMode = Ci.TrianglesDrawMode,
  47417. this.updateMorphTargets()
  47418. }
  47419. ,
  47420. Ci.Mesh.prototype = Object.create(Ci.Object3D.prototype),
  47421. Ci.Mesh.prototype.constructor = Ci.Mesh,
  47422. Ci.Mesh.prototype.setDrawMode = function(e) {
  47423. this.drawMode = e
  47424. }
  47425. ,
  47426. Ci.Mesh.prototype.updateMorphTargets = function() {
  47427. if (void 0 !== this.geometry.morphTargets && 0 < this.geometry.morphTargets.length) {
  47428. this.morphTargetBase = -1,
  47429. this.morphTargetInfluences = [],
  47430. this.morphTargetDictionary = {};
  47431. for (var e = 0, t = this.geometry.morphTargets.length; e < t; e++)
  47432. this.morphTargetInfluences.push(0),
  47433. this.morphTargetDictionary[this.geometry.morphTargets[e].name] = e
  47434. }
  47435. }
  47436. ,
  47437. Ci.Mesh.prototype.getMorphTargetIndexByName = function(e) {
  47438. return void 0 !== this.morphTargetDictionary[e] ? this.morphTargetDictionary[e] : (console.warn("THREE.Mesh.getMorphTargetIndexByName: morph target " + e + " does not exist. Returning 0."),
  47439. 0)
  47440. }
  47441. ,
  47442. Ci.Mesh.prototype.raycast = (Tt = new Ci.Matrix4,
  47443. xt = new Ci.Ray,
  47444. St = new Ci.Sphere,
  47445. Mt = new Ci.Vector3,
  47446. Rt = new Ci.Vector3,
  47447. Pt = new Ci.Vector3,
  47448. Ot = new Ci.Vector3,
  47449. Lt = new Ci.Vector3,
  47450. Dt = new Ci.Vector3,
  47451. Nt = new Ci.Vector2,
  47452. Ft = new Ci.Vector2,
  47453. Bt = new Ci.Vector2,
  47454. Vt = new Ci.Vector3,
  47455. kt = new Ci.Vector3,
  47456. Ut = new Ci.Vector3,
  47457. function(e, t) {
  47458. var i, n, r = this.geometry, o = this.material, a = this.matrixWorld;
  47459. if (void 0 !== o && (null === r.boundingSphere && r.computeBoundingSphere(),
  47460. St.copy(r.boundingSphere),
  47461. St.applyMatrix4(a),
  47462. !1 !== e.ray.intersectsSphere(St) && (Tt.getInverse(a),
  47463. xt.copy(e.ray).applyMatrix4(Tt),
  47464. null === r.boundingBox || !1 !== xt.intersectsBox(r.boundingBox))))
  47465. if (r instanceof Ci.BufferGeometry) {
  47466. var s, l, c, h = r.index, u = r.attributes, d = u.position.array;
  47467. if (void 0 !== u.uv && (i = u.uv.array),
  47468. null !== h)
  47469. for (var p = h.array, f = 0, g = p.length; f < g; f += 3)
  47470. s = p[f],
  47471. l = p[f + 1],
  47472. c = p[f + 2],
  47473. (n = Ti(this, e, xt, d, i, s, l, c)) && (n.faceIndex = Math.floor(f / 3),
  47474. t.push(n));
  47475. else
  47476. for (f = 0,
  47477. g = d.length; f < g; f += 9)
  47478. (n = Ti(this, e, xt, d, i, s = f / 3, l = s + 1, c = s + 2)) && (n.index = s,
  47479. t.push(n))
  47480. } else if (r instanceof Ci.Geometry) {
  47481. var m, v, y, A = o instanceof Ci.MultiMaterial, C = 1 == A ? o.materials : null, I = r.vertices, E = r.faces, _ = r.faceVertexUvs[0];
  47482. 0 < _.length && (i = _);
  47483. for (var b = 0, w = E.length; b < w; b++) {
  47484. var T = E[b]
  47485. , x = 1 == A ? C[T.materialIndex] : o;
  47486. if (void 0 !== x) {
  47487. if (m = I[T.a],
  47488. v = I[T.b],
  47489. y = I[T.c],
  47490. !0 === x.morphTargets) {
  47491. var S = r.morphTargets
  47492. , M = this.morphTargetInfluences;
  47493. Mt.set(0, 0, 0),
  47494. Rt.set(0, 0, 0),
  47495. Pt.set(0, 0, 0);
  47496. for (var R = 0, P = S.length; R < P; R++) {
  47497. var O = M[R];
  47498. if (0 !== O) {
  47499. var L = S[R].vertices;
  47500. Mt.addScaledVector(Ot.subVectors(L[T.a], m), O),
  47501. Rt.addScaledVector(Lt.subVectors(L[T.b], v), O),
  47502. Pt.addScaledVector(Dt.subVectors(L[T.c], y), O)
  47503. }
  47504. }
  47505. Mt.add(m),
  47506. Rt.add(v),
  47507. Pt.add(y),
  47508. m = Mt,
  47509. v = Rt,
  47510. y = Pt
  47511. }
  47512. if (n = wi(this, e, xt, m, v, y, kt)) {
  47513. if (i) {
  47514. var D = i[b];
  47515. Nt.copy(D[0]),
  47516. Ft.copy(D[1]),
  47517. Bt.copy(D[2]),
  47518. n.uv = bi(kt, m, v, y, Nt, Ft, Bt)
  47519. }
  47520. n.face = T,
  47521. n.faceIndex = b,
  47522. t.push(n)
  47523. }
  47524. }
  47525. }
  47526. }
  47527. }
  47528. ),
  47529. Ci.Mesh.prototype.clone = function() {
  47530. return new this.constructor(this.geometry,this.material).copy(this)
  47531. }
  47532. ,
  47533. Ci.Bone = function(e) {
  47534. Ci.Object3D.call(this),
  47535. this.type = "Bone",
  47536. this.skin = e
  47537. }
  47538. ,
  47539. Ci.Bone.prototype = Object.create(Ci.Object3D.prototype),
  47540. Ci.Bone.prototype.constructor = Ci.Bone,
  47541. Ci.Bone.prototype.copy = function(e) {
  47542. return Ci.Object3D.prototype.copy.call(this, e),
  47543. this.skin = e.skin,
  47544. this
  47545. }
  47546. ,
  47547. Ci.Skeleton = function(e, t, i) {
  47548. if (this.useVertexTexture = void 0 === i || i,
  47549. this.identityMatrix = new Ci.Matrix4,
  47550. e = e || [],
  47551. this.bones = e.slice(0),
  47552. this.useVertexTexture) {
  47553. var n = Math.sqrt(4 * this.bones.length);
  47554. n = Ci.Math.nextPowerOfTwo(Math.ceil(n)),
  47555. n = Math.max(n, 4),
  47556. this.boneTextureWidth = n,
  47557. this.boneTextureHeight = n,
  47558. this.boneMatrices = new Float32Array(this.boneTextureWidth * this.boneTextureHeight * 4),
  47559. this.boneTexture = new Ci.DataTexture(this.boneMatrices,this.boneTextureWidth,this.boneTextureHeight,Ci.RGBAFormat,Ci.FloatType)
  47560. } else
  47561. this.boneMatrices = new Float32Array(16 * this.bones.length);
  47562. if (void 0 === t)
  47563. this.calculateInverses();
  47564. else if (this.bones.length === t.length)
  47565. this.boneInverses = t.slice(0);
  47566. else {
  47567. console.warn("THREE.Skeleton bonInverses is the wrong length."),
  47568. this.boneInverses = [];
  47569. for (var r = 0, o = this.bones.length; r < o; r++)
  47570. this.boneInverses.push(new Ci.Matrix4)
  47571. }
  47572. }
  47573. ,
  47574. Ci.Skeleton.prototype.calculateInverses = function() {
  47575. this.boneInverses = [];
  47576. for (var e = 0, t = this.bones.length; e < t; e++) {
  47577. var i = new Ci.Matrix4;
  47578. this.bones[e] && i.getInverse(this.bones[e].matrixWorld),
  47579. this.boneInverses.push(i)
  47580. }
  47581. }
  47582. ,
  47583. Ci.Skeleton.prototype.pose = function() {
  47584. for (var e, t = 0, i = this.bones.length; t < i; t++)
  47585. (e = this.bones[t]) && e.matrixWorld.getInverse(this.boneInverses[t]);
  47586. for (t = 0,
  47587. i = this.bones.length; t < i; t++)
  47588. (e = this.bones[t]) && (e.parent ? (e.matrix.getInverse(e.parent.matrixWorld),
  47589. e.matrix.multiply(e.matrixWorld)) : e.matrix.copy(e.matrixWorld),
  47590. e.matrix.decompose(e.position, e.quaternion, e.scale))
  47591. }
  47592. ,
  47593. Ci.Skeleton.prototype.update = (wt = new Ci.Matrix4,
  47594. function() {
  47595. for (var e = 0, t = this.bones.length; e < t; e++) {
  47596. var i = this.bones[e] ? this.bones[e].matrixWorld : this.identityMatrix;
  47597. wt.multiplyMatrices(i, this.boneInverses[e]),
  47598. wt.flattenToArrayOffset(this.boneMatrices, 16 * e)
  47599. }
  47600. this.useVertexTexture && (this.boneTexture.needsUpdate = !0)
  47601. }
  47602. ),
  47603. Ci.Skeleton.prototype.clone = function() {
  47604. return new Ci.Skeleton(this.bones,this.boneInverses,this.useVertexTexture)
  47605. }
  47606. ,
  47607. Ci.SkinnedMesh = function(e, t, i) {
  47608. Ci.Mesh.call(this, e, t),
  47609. this.type = "SkinnedMesh",
  47610. this.bindMode = "attached",
  47611. this.bindMatrix = new Ci.Matrix4,
  47612. this.bindMatrixInverse = new Ci.Matrix4;
  47613. var n = [];
  47614. if (this.geometry && void 0 !== this.geometry.bones) {
  47615. for (var r, o, a = 0, s = this.geometry.bones.length; a < s; ++a)
  47616. o = this.geometry.bones[a],
  47617. r = new Ci.Bone(this),
  47618. n.push(r),
  47619. r.name = o.name,
  47620. r.position.fromArray(o.pos),
  47621. r.quaternion.fromArray(o.rotq),
  47622. void 0 !== o.scl && r.scale.fromArray(o.scl);
  47623. for (a = 0,
  47624. s = this.geometry.bones.length; a < s; ++a)
  47625. -1 !== (o = this.geometry.bones[a]).parent && null !== o.parent ? n[o.parent].add(n[a]) : this.add(n[a])
  47626. }
  47627. this.normalizeSkinWeights(),
  47628. this.updateMatrixWorld(!0),
  47629. this.bind(new Ci.Skeleton(n,void 0,i), this.matrixWorld)
  47630. }
  47631. ,
  47632. Ci.SkinnedMesh.prototype = Object.create(Ci.Mesh.prototype),
  47633. Ci.SkinnedMesh.prototype.constructor = Ci.SkinnedMesh,
  47634. Ci.SkinnedMesh.prototype.bind = function(e, t) {
  47635. this.skeleton = e,
  47636. void 0 === t && (this.updateMatrixWorld(!0),
  47637. this.skeleton.calculateInverses(),
  47638. t = this.matrixWorld),
  47639. this.bindMatrix.copy(t),
  47640. this.bindMatrixInverse.getInverse(t)
  47641. }
  47642. ,
  47643. Ci.SkinnedMesh.prototype.pose = function() {
  47644. this.skeleton.pose()
  47645. }
  47646. ,
  47647. Ci.SkinnedMesh.prototype.normalizeSkinWeights = function() {
  47648. if (this.geometry instanceof Ci.Geometry)
  47649. for (var e = 0; e < this.geometry.skinWeights.length; e++) {
  47650. var t = this.geometry.skinWeights[e];
  47651. (r = 1 / t.lengthManhattan()) !== 1 / 0 ? t.multiplyScalar(r) : t.set(1, 0, 0, 0)
  47652. }
  47653. else if (this.geometry instanceof Ci.BufferGeometry) {
  47654. var i = new Ci.Vector4
  47655. , n = this.geometry.attributes.skinWeight;
  47656. for (e = 0; e < n.count; e++) {
  47657. var r;
  47658. i.x = n.getX(e),
  47659. i.y = n.getY(e),
  47660. i.z = n.getZ(e),
  47661. i.w = n.getW(e),
  47662. (r = 1 / i.lengthManhattan()) !== 1 / 0 ? i.multiplyScalar(r) : i.set(1, 0, 0, 0),
  47663. n.setXYZW(e, i.x, i.y, i.z, i.w)
  47664. }
  47665. }
  47666. }
  47667. ,
  47668. Ci.SkinnedMesh.prototype.updateMatrixWorld = function(e) {
  47669. Ci.Mesh.prototype.updateMatrixWorld.call(this, !0),
  47670. "attached" === this.bindMode ? this.bindMatrixInverse.getInverse(this.matrixWorld) : "detached" === this.bindMode ? this.bindMatrixInverse.getInverse(this.bindMatrix) : console.warn("THREE.SkinnedMesh unrecognized bindMode: " + this.bindMode)
  47671. }
  47672. ,
  47673. Ci.SkinnedMesh.prototype.clone = function() {
  47674. return new this.constructor(this.geometry,this.material,this.useVertexTexture).copy(this)
  47675. }
  47676. ,
  47677. Ci.LOD = function() {
  47678. Ci.Object3D.call(this),
  47679. this.type = "LOD",
  47680. Object.defineProperties(this, {
  47681. levels: {
  47682. enumerable: !0,
  47683. value: []
  47684. },
  47685. objects: {
  47686. get: function() {
  47687. return console.warn("THREE.LOD: .objects has been renamed to .levels."),
  47688. this.levels
  47689. }
  47690. }
  47691. })
  47692. }
  47693. ,
  47694. Ci.LOD.prototype = Object.create(Ci.Object3D.prototype),
  47695. Ci.LOD.prototype.constructor = Ci.LOD,
  47696. Ci.LOD.prototype.addLevel = function(e, t) {
  47697. void 0 === t && (t = 0),
  47698. t = Math.abs(t);
  47699. for (var i = this.levels, n = 0; n < i.length && !(t < i[n].distance); n++)
  47700. ;
  47701. i.splice(n, 0, {
  47702. distance: t,
  47703. object: e
  47704. }),
  47705. this.add(e)
  47706. }
  47707. ,
  47708. Ci.LOD.prototype.getObjectForDistance = function(e) {
  47709. for (var t = this.levels, i = 1, n = t.length; i < n && !(e < t[i].distance); i++)
  47710. ;
  47711. return t[i - 1].object
  47712. }
  47713. ,
  47714. Ci.LOD.prototype.raycast = (bt = new Ci.Vector3,
  47715. function(e, t) {
  47716. bt.setFromMatrixPosition(this.matrixWorld);
  47717. var i = e.ray.origin.distanceTo(bt);
  47718. this.getObjectForDistance(i).raycast(e, t)
  47719. }
  47720. ),
  47721. Ci.LOD.prototype.update = (Et = new Ci.Vector3,
  47722. _t = new Ci.Vector3,
  47723. function(e) {
  47724. var t = this.levels;
  47725. if (1 < t.length) {
  47726. Et.setFromMatrixPosition(e.matrixWorld),
  47727. _t.setFromMatrixPosition(this.matrixWorld);
  47728. var i = Et.distanceTo(_t);
  47729. t[0].object.visible = !0;
  47730. for (var n = 1, r = t.length; n < r && i >= t[n].distance; n++)
  47731. t[n - 1].object.visible = !1,
  47732. t[n].object.visible = !0;
  47733. for (; n < r; n++)
  47734. t[n].object.visible = !1
  47735. }
  47736. }
  47737. ),
  47738. Ci.LOD.prototype.copy = function(e) {
  47739. Ci.Object3D.prototype.copy.call(this, e, !1);
  47740. for (var t = e.levels, i = 0, n = t.length; i < n; i++) {
  47741. var r = t[i];
  47742. this.addLevel(r.object.clone(), r.distance)
  47743. }
  47744. return this
  47745. }
  47746. ,
  47747. Ci.LOD.prototype.toJSON = function(e) {
  47748. var t = Ci.Object3D.prototype.toJSON.call(this, e);
  47749. t.object.levels = [];
  47750. for (var i = this.levels, n = 0, r = i.length; n < r; n++) {
  47751. var o = i[n];
  47752. t.object.levels.push({
  47753. object: o.object.uuid,
  47754. distance: o.distance
  47755. })
  47756. }
  47757. return t
  47758. }
  47759. ,
  47760. Ci.Sprite = (yt = new Uint16Array([0, 1, 2, 0, 2, 3]),
  47761. At = new Float32Array([-.5, -.5, 0, .5, -.5, 0, .5, .5, 0, -.5, .5, 0]),
  47762. Ct = new Float32Array([0, 0, 1, 0, 1, 1, 0, 1]),
  47763. (It = new Ci.BufferGeometry).setIndex(new Ci.BufferAttribute(yt,1)),
  47764. It.addAttribute("position", new Ci.BufferAttribute(At,3)),
  47765. It.addAttribute("uv", new Ci.BufferAttribute(Ct,2)),
  47766. function(e) {
  47767. Ci.Object3D.call(this),
  47768. this.type = "Sprite",
  47769. this.geometry = It,
  47770. this.material = void 0 !== e ? e : new Ci.SpriteMaterial
  47771. }
  47772. ),
  47773. Ci.Sprite.prototype = Object.create(Ci.Object3D.prototype),
  47774. Ci.Sprite.prototype.constructor = Ci.Sprite,
  47775. Ci.Sprite.prototype.raycast = (vt = new Ci.Vector3,
  47776. function(e, t) {
  47777. vt.setFromMatrixPosition(this.matrixWorld);
  47778. var i = e.ray.distanceSqToPoint(vt);
  47779. this.scale.x * this.scale.y < i || t.push({
  47780. distance: Math.sqrt(i),
  47781. point: this.position,
  47782. face: null,
  47783. object: this
  47784. })
  47785. }
  47786. ),
  47787. Ci.Sprite.prototype.clone = function() {
  47788. return new this.constructor(this.material).copy(this)
  47789. }
  47790. ,
  47791. Ci.Particle = Ci.Sprite,
  47792. Ci.LensFlare = function(e, t, i, n, r) {
  47793. Ci.Object3D.call(this),
  47794. this.lensFlares = [],
  47795. this.positionScreen = new Ci.Vector3,
  47796. (this.customUpdateCallback = void 0) !== e && this.add(e, t, i, n, r)
  47797. }
  47798. ,
  47799. Ci.LensFlare.prototype = Object.create(Ci.Object3D.prototype),
  47800. Ci.LensFlare.prototype.constructor = Ci.LensFlare,
  47801. Ci.LensFlare.prototype.add = function(e, t, i, n, r, o) {
  47802. void 0 === t && (t = -1),
  47803. void 0 === i && (i = 0),
  47804. void 0 === o && (o = 1),
  47805. void 0 === r && (r = new Ci.Color(16777215)),
  47806. void 0 === n && (n = Ci.NormalBlending),
  47807. i = Math.min(i, Math.max(0, i)),
  47808. this.lensFlares.push({
  47809. texture: e,
  47810. size: t,
  47811. distance: i,
  47812. x: 0,
  47813. y: 0,
  47814. z: 0,
  47815. scale: 1,
  47816. rotation: 0,
  47817. opacity: o,
  47818. color: r,
  47819. blending: n
  47820. })
  47821. }
  47822. ,
  47823. Ci.LensFlare.prototype.updateLensFlares = function() {
  47824. var e, t, i = this.lensFlares.length, n = 2 * -this.positionScreen.x, r = 2 * -this.positionScreen.y;
  47825. for (e = 0; e < i; e++)
  47826. (t = this.lensFlares[e]).x = this.positionScreen.x + n * t.distance,
  47827. t.y = this.positionScreen.y + r * t.distance,
  47828. t.wantedRotation = t.x * Math.PI * .25,
  47829. t.rotation += .25 * (t.wantedRotation - t.rotation)
  47830. }
  47831. ,
  47832. Ci.LensFlare.prototype.copy = function(e) {
  47833. Ci.Object3D.prototype.copy.call(this, e),
  47834. this.positionScreen.copy(e.positionScreen),
  47835. this.customUpdateCallback = e.customUpdateCallback;
  47836. for (var t = 0, i = e.lensFlares.length; t < i; t++)
  47837. this.lensFlares.push(e.lensFlares[t]);
  47838. return this
  47839. }
  47840. ,
  47841. Ci.Scene = function() {
  47842. Ci.Object3D.call(this),
  47843. this.type = "Scene",
  47844. this.fog = null,
  47845. this.overrideMaterial = null,
  47846. this.autoUpdate = !0
  47847. }
  47848. ,
  47849. Ci.Scene.prototype = Object.create(Ci.Object3D.prototype),
  47850. Ci.Scene.prototype.constructor = Ci.Scene,
  47851. Ci.Scene.prototype.copy = function(e, t) {
  47852. return Ci.Object3D.prototype.copy.call(this, e, t),
  47853. null !== e.fog && (this.fog = e.fog.clone()),
  47854. null !== e.overrideMaterial && (this.overrideMaterial = e.overrideMaterial.clone()),
  47855. this.autoUpdate = e.autoUpdate,
  47856. this.matrixAutoUpdate = e.matrixAutoUpdate,
  47857. this
  47858. }
  47859. ,
  47860. Ci.Fog = function(e, t, i) {
  47861. this.name = "",
  47862. this.color = new Ci.Color(e),
  47863. this.near = void 0 !== t ? t : 1,
  47864. this.far = void 0 !== i ? i : 1e3
  47865. }
  47866. ,
  47867. Ci.Fog.prototype.clone = function() {
  47868. return new Ci.Fog(this.color.getHex(),this.near,this.far)
  47869. }
  47870. ,
  47871. Ci.FogExp2 = function(e, t) {
  47872. this.name = "",
  47873. this.color = new Ci.Color(e),
  47874. this.density = void 0 !== t ? t : 25e-5
  47875. }
  47876. ,
  47877. Ci.FogExp2.prototype.clone = function() {
  47878. return new Ci.FogExp2(this.color.getHex(),this.density)
  47879. }
  47880. ,
  47881. Ci.ShaderChunk = {},
  47882. Ci.ShaderChunk.alphamap_fragment = "#ifdef USE_ALPHAMAP\n\tdiffuseColor.a *= texture2D( alphaMap, vUv ).g;\n#endif\n",
  47883. Ci.ShaderChunk.alphamap_pars_fragment = "#ifdef USE_ALPHAMAP\n\tuniform sampler2D alphaMap;\n#endif\n",
  47884. Ci.ShaderChunk.alphatest_fragment = "#ifdef ALPHATEST\n\tif ( diffuseColor.a < ALPHATEST ) discard;\n#endif\n",
  47885. 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",
  47886. Ci.ShaderChunk.aomap_pars_fragment = "#ifdef USE_AOMAP\n\tuniform sampler2D aoMap;\n\tuniform float aoMapIntensity;\n#endif",
  47887. Ci.ShaderChunk.begin_vertex = "\nvec3 transformed = vec3( position );\n",
  47888. Ci.ShaderChunk.beginnormal_vertex = "\nvec3 objectNormal = vec3( normal );\n",
  47889. 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",
  47890. 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",
  47891. Ci.ShaderChunk.color_fragment = "#ifdef USE_COLOR\n\tdiffuseColor.rgb *= vColor;\n#endif",
  47892. Ci.ShaderChunk.color_pars_fragment = "#ifdef USE_COLOR\n\tvarying vec3 vColor;\n#endif\n",
  47893. Ci.ShaderChunk.color_pars_vertex = "#ifdef USE_COLOR\n\tvarying vec3 vColor;\n#endif",
  47894. Ci.ShaderChunk.color_vertex = "#ifdef USE_COLOR\n\tvColor.xyz = color.xyz;\n#endif",
  47895. 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",
  47896. 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",
  47897. Ci.ShaderChunk.defaultnormal_vertex = "#ifdef FLIP_SIDED\n\tobjectNormal = -objectNormal;\n#endif\nvec3 transformedNormal = normalMatrix * objectNormal;\n",
  47898. Ci.ShaderChunk.displacementmap_vertex = "#ifdef USE_DISPLACEMENTMAP\n\ttransformed += normal * ( texture2D( displacementMap, uv ).x * displacementScale + displacementBias );\n#endif\n",
  47899. Ci.ShaderChunk.displacementmap_pars_vertex = "#ifdef USE_DISPLACEMENTMAP\n\tuniform sampler2D displacementMap;\n\tuniform float displacementScale;\n\tuniform float displacementBias;\n#endif\n",
  47900. 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",
  47901. Ci.ShaderChunk.emissivemap_pars_fragment = "#ifdef USE_EMISSIVEMAP\n\tuniform sampler2D emissiveMap;\n#endif\n",
  47902. 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",
  47903. Ci.ShaderChunk.encodings_fragment = " gl_FragColor = linearToOutputTexel( gl_FragColor );\n",
  47904. 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",
  47905. 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",
  47906. 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",
  47907. 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",
  47908. 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",
  47909. 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",
  47910. Ci.ShaderChunk.lightmap_fragment = "#ifdef USE_LIGHTMAP\n\treflectedLight.indirectDiffuse += PI * texture2D( lightMap, vUv2 ).xyz * lightMapIntensity;\n#endif\n",
  47911. Ci.ShaderChunk.lightmap_pars_fragment = "#ifdef USE_LIGHTMAP\n\tuniform sampler2D lightMap;\n\tuniform float lightMapIntensity;\n#endif",
  47912. 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",
  47913. 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",
  47914. Ci.ShaderChunk.lights_phong_fragment = "BlinnPhongMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularColor = specular;\nmaterial.specularShininess = shininess;\nmaterial.specularStrength = specularStrength;\n",
  47915. 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",
  47916. Ci.ShaderChunk.lights_phong_pars_vertex = "#ifdef USE_ENVMAP\n\tvarying vec3 vWorldPosition;\n#endif\n",
  47917. Ci.ShaderChunk.lights_phong_vertex = "#ifdef USE_ENVMAP\n\tvWorldPosition = worldPosition.xyz;\n#endif\n",
  47918. 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",
  47919. 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",
  47920. 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",
  47921. Ci.ShaderChunk.logdepthbuf_fragment = "#if defined(USE_LOGDEPTHBUF) && defined(USE_LOGDEPTHBUF_EXT)\n\tgl_FragDepthEXT = log2(vFragDepth) * logDepthBufFC * 0.5;\n#endif",
  47922. 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",
  47923. 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",
  47924. 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",
  47925. Ci.ShaderChunk.map_fragment = "#ifdef USE_MAP\n\tvec4 texelColor = texture2D( map, vUv );\n\ttexelColor = mapTexelToLinear( texelColor );\n\tdiffuseColor *= texelColor;\n#endif\n",
  47926. Ci.ShaderChunk.map_pars_fragment = "#ifdef USE_MAP\n\tuniform sampler2D map;\n#endif\n",
  47927. 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",
  47928. Ci.ShaderChunk.map_particle_pars_fragment = "#ifdef USE_MAP\n\tuniform vec4 offsetRepeat;\n\tuniform sampler2D map;\n#endif\n",
  47929. Ci.ShaderChunk.metalnessmap_fragment = "float metalnessFactor = metalness;\n#ifdef USE_METALNESSMAP\n\tvec4 texelMetalness = texture2D( metalnessMap, vUv );\n\tmetalnessFactor *= texelMetalness.r;\n#endif\n",
  47930. Ci.ShaderChunk.metalnessmap_pars_fragment = "#ifdef USE_METALNESSMAP\n\tuniform sampler2D metalnessMap;\n#endif",
  47931. 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",
  47932. 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",
  47933. 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",
  47934. 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",
  47935. 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",
  47936. Ci.ShaderChunk.premultiplied_alpha_fragment = "#ifdef PREMULTIPLIED_ALPHA\n\tgl_FragColor.rgb *= gl_FragColor.a;\n#endif\n",
  47937. 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",
  47938. Ci.ShaderChunk.roughnessmap_fragment = "float roughnessFactor = roughness;\n#ifdef USE_ROUGHNESSMAP\n\tvec4 texelRoughness = texture2D( roughnessMap, vUv );\n\troughnessFactor *= texelRoughness.r;\n#endif\n",
  47939. Ci.ShaderChunk.roughnessmap_pars_fragment = "#ifdef USE_ROUGHNESSMAP\n\tuniform sampler2D roughnessMap;\n#endif",
  47940. 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",
  47941. 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",
  47942. 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",
  47943. 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",
  47944. 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",
  47945. 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",
  47946. 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",
  47947. 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",
  47948. 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",
  47949. Ci.ShaderChunk.specularmap_pars_fragment = "#ifdef USE_SPECULARMAP\n\tuniform sampler2D specularMap;\n#endif",
  47950. Ci.ShaderChunk.tonemapping_fragment = "#if defined( TONE_MAPPING )\n gl_FragColor.rgb = toneMapping( gl_FragColor.rgb );\n#endif\n",
  47951. 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",
  47952. Ci.ShaderChunk.uv2_pars_fragment = "#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tvarying vec2 vUv2;\n#endif",
  47953. Ci.ShaderChunk.uv2_pars_vertex = "#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tattribute vec2 uv2;\n\tvarying vec2 vUv2;\n#endif",
  47954. Ci.ShaderChunk.uv2_vertex = "#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tvUv2 = uv2;\n#endif",
  47955. 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",
  47956. 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",
  47957. 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",
  47958. 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",
  47959. Ci.UniformsUtils = {
  47960. merge: function(e) {
  47961. for (var t = {}, i = 0; i < e.length; i++) {
  47962. var n = this.clone(e[i]);
  47963. for (var r in n)
  47964. t[r] = n[r]
  47965. }
  47966. return t
  47967. },
  47968. clone: function(e) {
  47969. var t = {};
  47970. for (var i in e)
  47971. for (var n in t[i] = {},
  47972. e[i]) {
  47973. var r = e[i][n];
  47974. 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
  47975. }
  47976. return t
  47977. }
  47978. },
  47979. Ci.UniformsLib = {
  47980. common: {
  47981. diffuse: {
  47982. type: "c",
  47983. value: new Ci.Color(15658734)
  47984. },
  47985. opacity: {
  47986. type: "f",
  47987. value: 1
  47988. },
  47989. map: {
  47990. type: "t",
  47991. value: null
  47992. },
  47993. offsetRepeat: {
  47994. type: "v4",
  47995. value: new Ci.Vector4(0,0,1,1)
  47996. },
  47997. specularMap: {
  47998. type: "t",
  47999. value: null
  48000. },
  48001. alphaMap: {
  48002. type: "t",
  48003. value: null
  48004. },
  48005. envMap: {
  48006. type: "t",
  48007. value: null
  48008. },
  48009. flipEnvMap: {
  48010. type: "f",
  48011. value: -1
  48012. },
  48013. reflectivity: {
  48014. type: "f",
  48015. value: 1
  48016. },
  48017. refractionRatio: {
  48018. type: "f",
  48019. value: .98
  48020. }
  48021. },
  48022. aomap: {
  48023. aoMap: {
  48024. type: "t",
  48025. value: null
  48026. },
  48027. aoMapIntensity: {
  48028. type: "f",
  48029. value: 1
  48030. }
  48031. },
  48032. lightmap: {
  48033. lightMap: {
  48034. type: "t",
  48035. value: null
  48036. },
  48037. lightMapIntensity: {
  48038. type: "f",
  48039. value: 1
  48040. }
  48041. },
  48042. emissivemap: {
  48043. emissiveMap: {
  48044. type: "t",
  48045. value: null
  48046. }
  48047. },
  48048. bumpmap: {
  48049. bumpMap: {
  48050. type: "t",
  48051. value: null
  48052. },
  48053. bumpScale: {
  48054. type: "f",
  48055. value: 1
  48056. }
  48057. },
  48058. normalmap: {
  48059. normalMap: {
  48060. type: "t",
  48061. value: null
  48062. },
  48063. normalScale: {
  48064. type: "v2",
  48065. value: new Ci.Vector2(1,1)
  48066. }
  48067. },
  48068. displacementmap: {
  48069. displacementMap: {
  48070. type: "t",
  48071. value: null
  48072. },
  48073. displacementScale: {
  48074. type: "f",
  48075. value: 1
  48076. },
  48077. displacementBias: {
  48078. type: "f",
  48079. value: 0
  48080. }
  48081. },
  48082. roughnessmap: {
  48083. roughnessMap: {
  48084. type: "t",
  48085. value: null
  48086. }
  48087. },
  48088. metalnessmap: {
  48089. metalnessMap: {
  48090. type: "t",
  48091. value: null
  48092. }
  48093. },
  48094. fog: {
  48095. fogDensity: {
  48096. type: "f",
  48097. value: 25e-5
  48098. },
  48099. fogNear: {
  48100. type: "f",
  48101. value: 1
  48102. },
  48103. fogFar: {
  48104. type: "f",
  48105. value: 2e3
  48106. },
  48107. fogColor: {
  48108. type: "c",
  48109. value: new Ci.Color(16777215)
  48110. }
  48111. },
  48112. lights: {
  48113. ambientLightColor: {
  48114. type: "fv",
  48115. value: []
  48116. },
  48117. directionalLights: {
  48118. type: "sa",
  48119. value: [],
  48120. properties: {
  48121. direction: {
  48122. type: "v3"
  48123. },
  48124. color: {
  48125. type: "c"
  48126. },
  48127. shadow: {
  48128. type: "i"
  48129. },
  48130. shadowBias: {
  48131. type: "f"
  48132. },
  48133. shadowRadius: {
  48134. type: "f"
  48135. },
  48136. shadowMapSize: {
  48137. type: "v2"
  48138. }
  48139. }
  48140. },
  48141. directionalShadowMap: {
  48142. type: "tv",
  48143. value: []
  48144. },
  48145. directionalShadowMatrix: {
  48146. type: "m4v",
  48147. value: []
  48148. },
  48149. spotLights: {
  48150. type: "sa",
  48151. value: [],
  48152. properties: {
  48153. color: {
  48154. type: "c"
  48155. },
  48156. position: {
  48157. type: "v3"
  48158. },
  48159. direction: {
  48160. type: "v3"
  48161. },
  48162. distance: {
  48163. type: "f"
  48164. },
  48165. coneCos: {
  48166. type: "f"
  48167. },
  48168. penumbraCos: {
  48169. type: "f"
  48170. },
  48171. decay: {
  48172. type: "f"
  48173. },
  48174. shadow: {
  48175. type: "i"
  48176. },
  48177. shadowBias: {
  48178. type: "f"
  48179. },
  48180. shadowRadius: {
  48181. type: "f"
  48182. },
  48183. shadowMapSize: {
  48184. type: "v2"
  48185. }
  48186. }
  48187. },
  48188. spotShadowMap: {
  48189. type: "tv",
  48190. value: []
  48191. },
  48192. spotShadowMatrix: {
  48193. type: "m4v",
  48194. value: []
  48195. },
  48196. pointLights: {
  48197. type: "sa",
  48198. value: [],
  48199. properties: {
  48200. color: {
  48201. type: "c"
  48202. },
  48203. position: {
  48204. type: "v3"
  48205. },
  48206. decay: {
  48207. type: "f"
  48208. },
  48209. distance: {
  48210. type: "f"
  48211. },
  48212. shadow: {
  48213. type: "i"
  48214. },
  48215. shadowBias: {
  48216. type: "f"
  48217. },
  48218. shadowRadius: {
  48219. type: "f"
  48220. },
  48221. shadowMapSize: {
  48222. type: "v2"
  48223. }
  48224. }
  48225. },
  48226. pointShadowMap: {
  48227. type: "tv",
  48228. value: []
  48229. },
  48230. pointShadowMatrix: {
  48231. type: "m4v",
  48232. value: []
  48233. },
  48234. hemisphereLights: {
  48235. type: "sa",
  48236. value: [],
  48237. properties: {
  48238. direction: {
  48239. type: "v3"
  48240. },
  48241. skyColor: {
  48242. type: "c"
  48243. },
  48244. groundColor: {
  48245. type: "c"
  48246. }
  48247. }
  48248. }
  48249. },
  48250. points: {
  48251. diffuse: {
  48252. type: "c",
  48253. value: new Ci.Color(15658734)
  48254. },
  48255. opacity: {
  48256. type: "f",
  48257. value: 1
  48258. },
  48259. size: {
  48260. type: "f",
  48261. value: 1
  48262. },
  48263. scale: {
  48264. type: "f",
  48265. value: 1
  48266. },
  48267. map: {
  48268. type: "t",
  48269. value: null
  48270. },
  48271. offsetRepeat: {
  48272. type: "v4",
  48273. value: new Ci.Vector4(0,0,1,1)
  48274. }
  48275. }
  48276. },
  48277. 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",
  48278. 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",
  48279. 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",
  48280. 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",
  48281. 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",
  48282. 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",
  48283. 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",
  48284. 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",
  48285. 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",
  48286. 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",
  48287. 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",
  48288. 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",
  48289. 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",
  48290. 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",
  48291. 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",
  48292. 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",
  48293. 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",
  48294. 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",
  48295. 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",
  48296. 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",
  48297. 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",
  48298. 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",
  48299. 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",
  48300. 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",
  48301. Ci.ShaderLib = {
  48302. basic: {
  48303. uniforms: Ci.UniformsUtils.merge([Ci.UniformsLib.common, Ci.UniformsLib.aomap, Ci.UniformsLib.fog]),
  48304. vertexShader: Ci.ShaderChunk.meshbasic_vert,
  48305. fragmentShader: Ci.ShaderChunk.meshbasic_frag
  48306. },
  48307. lambert: {
  48308. uniforms: Ci.UniformsUtils.merge([Ci.UniformsLib.common, Ci.UniformsLib.aomap, Ci.UniformsLib.lightmap, Ci.UniformsLib.emissivemap, Ci.UniformsLib.fog, Ci.UniformsLib.lights, {
  48309. emissive: {
  48310. type: "c",
  48311. value: new Ci.Color(0)
  48312. }
  48313. }]),
  48314. vertexShader: Ci.ShaderChunk.meshlambert_vert,
  48315. fragmentShader: Ci.ShaderChunk.meshlambert_frag
  48316. },
  48317. phong: {
  48318. 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, {
  48319. emissive: {
  48320. type: "c",
  48321. value: new Ci.Color(0)
  48322. },
  48323. specular: {
  48324. type: "c",
  48325. value: new Ci.Color(1118481)
  48326. },
  48327. shininess: {
  48328. type: "f",
  48329. value: 30
  48330. }
  48331. }]),
  48332. vertexShader: Ci.ShaderChunk.meshphong_vert,
  48333. fragmentShader: Ci.ShaderChunk.meshphong_frag
  48334. },
  48335. standard: {
  48336. 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, {
  48337. emissive: {
  48338. type: "c",
  48339. value: new Ci.Color(0)
  48340. },
  48341. roughness: {
  48342. type: "f",
  48343. value: .5
  48344. },
  48345. metalness: {
  48346. type: "f",
  48347. value: 0
  48348. },
  48349. envMapIntensity: {
  48350. type: "f",
  48351. value: 1
  48352. }
  48353. }]),
  48354. vertexShader: Ci.ShaderChunk.meshstandard_vert,
  48355. fragmentShader: Ci.ShaderChunk.meshstandard_frag
  48356. },
  48357. points: {
  48358. uniforms: Ci.UniformsUtils.merge([Ci.UniformsLib.points, Ci.UniformsLib.fog]),
  48359. vertexShader: Ci.ShaderChunk.points_vert,
  48360. fragmentShader: Ci.ShaderChunk.points_frag
  48361. },
  48362. dashed: {
  48363. uniforms: Ci.UniformsUtils.merge([Ci.UniformsLib.common, Ci.UniformsLib.fog, {
  48364. scale: {
  48365. type: "f",
  48366. value: 1
  48367. },
  48368. dashSize: {
  48369. type: "f",
  48370. value: 1
  48371. },
  48372. totalSize: {
  48373. type: "f",
  48374. value: 2
  48375. }
  48376. }]),
  48377. vertexShader: Ci.ShaderChunk.linedashed_vert,
  48378. fragmentShader: Ci.ShaderChunk.linedashed_frag
  48379. },
  48380. depth: {
  48381. uniforms: {
  48382. mNear: {
  48383. type: "f",
  48384. value: 1
  48385. },
  48386. mFar: {
  48387. type: "f",
  48388. value: 2e3
  48389. },
  48390. opacity: {
  48391. type: "f",
  48392. value: 1
  48393. }
  48394. },
  48395. vertexShader: Ci.ShaderChunk.depth_vert,
  48396. fragmentShader: Ci.ShaderChunk.depth_frag
  48397. },
  48398. normal: {
  48399. uniforms: {
  48400. opacity: {
  48401. type: "f",
  48402. value: 1
  48403. }
  48404. },
  48405. vertexShader: Ci.ShaderChunk.normal_vert,
  48406. fragmentShader: Ci.ShaderChunk.normal_frag
  48407. },
  48408. cube: {
  48409. uniforms: {
  48410. tCube: {
  48411. type: "t",
  48412. value: null
  48413. },
  48414. tFlip: {
  48415. type: "f",
  48416. value: -1
  48417. }
  48418. },
  48419. vertexShader: Ci.ShaderChunk.cube_vert,
  48420. fragmentShader: Ci.ShaderChunk.cube_frag
  48421. },
  48422. equirect: {
  48423. uniforms: {
  48424. tEquirect: {
  48425. type: "t",
  48426. value: null
  48427. },
  48428. tFlip: {
  48429. type: "f",
  48430. value: -1
  48431. }
  48432. },
  48433. vertexShader: Ci.ShaderChunk.equirect_vert,
  48434. fragmentShader: Ci.ShaderChunk.equirect_frag
  48435. },
  48436. depthRGBA: {
  48437. uniforms: {},
  48438. vertexShader: Ci.ShaderChunk.depthRGBA_vert,
  48439. fragmentShader: Ci.ShaderChunk.depthRGBA_frag
  48440. },
  48441. distanceRGBA: {
  48442. uniforms: {
  48443. lightPos: {
  48444. type: "v3",
  48445. value: new Ci.Vector3(0,0,0)
  48446. }
  48447. },
  48448. vertexShader: Ci.ShaderChunk.distanceRGBA_vert,
  48449. fragmentShader: Ci.ShaderChunk.distanceRGBA_frag
  48450. }
  48451. },
  48452. Ci.WebGLRenderer = function(e) {
  48453. function S() {
  48454. return null === Q ? he : 1
  48455. }
  48456. function i(e, t, i, n) {
  48457. !0 === V && (e *= n,
  48458. t *= n,
  48459. i *= n),
  48460. _e.clearColor(e, t, i, n)
  48461. }
  48462. function t() {
  48463. _e.init(),
  48464. _e.scissor(ie.copy(ue).multiplyScalar(he)),
  48465. _e.viewport(re.copy(pe).multiplyScalar(he)),
  48466. i(ae.r, ae.g, ae.b, se)
  48467. }
  48468. function n() {
  48469. te = K = null,
  48470. ee = "",
  48471. $ = -1,
  48472. _e.reset()
  48473. }
  48474. function r(e) {
  48475. e.preventDefault(),
  48476. n(),
  48477. t(),
  48478. be.clear()
  48479. }
  48480. function f(e) {
  48481. var t = e.target;
  48482. t.removeEventListener("dispose", f),
  48483. function(e) {
  48484. var t = be.get(e);
  48485. if (e.image && t.__image__webglTextureCube)
  48486. X.deleteTexture(t.__image__webglTextureCube);
  48487. else {
  48488. if (void 0 === t.__webglInit)
  48489. return;
  48490. X.deleteTexture(t.__webglTexture)
  48491. }
  48492. be.delete(e)
  48493. }(t),
  48494. ye.textures--
  48495. }
  48496. function a(e) {
  48497. var t = e.target;
  48498. t.removeEventListener("dispose", a),
  48499. function(e) {
  48500. var t = be.get(e)
  48501. , i = be.get(e.texture);
  48502. if (e && void 0 !== i.__webglTexture) {
  48503. if (X.deleteTexture(i.__webglTexture),
  48504. e instanceof Ci.WebGLRenderTargetCube)
  48505. for (var n = 0; n < 6; n++)
  48506. X.deleteFramebuffer(t.__webglFramebuffer[n]),
  48507. X.deleteRenderbuffer(t.__webglDepthbuffer[n]);
  48508. else
  48509. X.deleteFramebuffer(t.__webglFramebuffer),
  48510. X.deleteRenderbuffer(t.__webglDepthbuffer);
  48511. be.delete(e.texture),
  48512. be.delete(e)
  48513. }
  48514. }(t),
  48515. ye.textures--
  48516. }
  48517. function v(e) {
  48518. var t = e.target;
  48519. t.removeEventListener("dispose", v),
  48520. function(e) {
  48521. y(e),
  48522. be.delete(e)
  48523. }(t)
  48524. }
  48525. function y(e) {
  48526. var t = be.get(e).program;
  48527. (e.program = void 0) !== t && Te.releaseProgram(t)
  48528. }
  48529. function M(e, t) {
  48530. return Math.abs(t[0]) - Math.abs(e[0])
  48531. }
  48532. function s(e, t) {
  48533. 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
  48534. }
  48535. function l(e, t) {
  48536. 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
  48537. }
  48538. function d(e, t, i, n, r) {
  48539. var o, a;
  48540. a = i.transparent ? (o = G,
  48541. ++W) : (o = H,
  48542. ++z);
  48543. var s = o[a];
  48544. void 0 !== s ? (s.id = e.id,
  48545. s.object = e,
  48546. s.geometry = t,
  48547. s.material = i,
  48548. s.z = me.z,
  48549. s.group = r) : (s = {
  48550. id: e.id,
  48551. object: e,
  48552. geometry: t,
  48553. material: i,
  48554. z: me.z,
  48555. group: r
  48556. },
  48557. o.push(s))
  48558. }
  48559. function c(e, t, i, n) {
  48560. for (var r = 0, o = e.length; r < o; r++) {
  48561. var a = e[r]
  48562. , s = a.object
  48563. , l = a.geometry
  48564. , c = void 0 === n ? a.material : n
  48565. , h = a.group;
  48566. if (s.modelViewMatrix.multiplyMatrices(t.matrixWorldInverse, s.matrixWorld),
  48567. s.normalMatrix.getNormalMatrix(s.modelViewMatrix),
  48568. s instanceof Ci.ImmediateRenderObject) {
  48569. R(c);
  48570. var u = P(t, i, c, s);
  48571. ee = "",
  48572. s.render(function(e) {
  48573. Z.renderBufferImmediate(e, u, c)
  48574. })
  48575. } else
  48576. Z.renderBufferDirect(t, i, l, c, s, h)
  48577. }
  48578. }
  48579. function R(e) {
  48580. (function(e) {
  48581. e.side !== Ci.DoubleSide ? _e.enable(X.CULL_FACE) : _e.disable(X.CULL_FACE),
  48582. _e.setFlipSided(e.side === Ci.BackSide)
  48583. }
  48584. )(e),
  48585. !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),
  48586. _e.setDepthFunc(e.depthFunc),
  48587. _e.setDepthTest(e.depthTest),
  48588. _e.setDepthWrite(e.depthWrite),
  48589. _e.setColorWrite(e.colorWrite),
  48590. _e.setPolygonOffset(e.polygonOffset, e.polygonOffsetFactor, e.polygonOffsetUnits)
  48591. }
  48592. function P(e, t, i, n) {
  48593. oe = 0;
  48594. var r = be.get(i);
  48595. void 0 === r.program && (i.needsUpdate = !0),
  48596. void 0 !== r.lightsHash && r.lightsHash !== ve.hash && (i.needsUpdate = !0),
  48597. i.needsUpdate && (function(e, t, i) {
  48598. var n = be.get(e)
  48599. , r = Te.getParameters(e, ve, t, i)
  48600. , o = Te.getProgramCode(e, r)
  48601. , a = n.program
  48602. , s = !0;
  48603. if (void 0 === a)
  48604. e.addEventListener("dispose", v);
  48605. else if (a.code !== o)
  48606. y(e);
  48607. else {
  48608. if (void 0 !== r.shaderID)
  48609. return;
  48610. s = !1
  48611. }
  48612. if (s) {
  48613. if (r.shaderID) {
  48614. var l = Ci.ShaderLib[r.shaderID];
  48615. n.__webglShader = {
  48616. name: e.type,
  48617. uniforms: Ci.UniformsUtils.clone(l.uniforms),
  48618. vertexShader: l.vertexShader,
  48619. fragmentShader: l.fragmentShader
  48620. }
  48621. } else
  48622. n.__webglShader = {
  48623. name: e.type,
  48624. uniforms: e.uniforms,
  48625. vertexShader: e.vertexShader,
  48626. fragmentShader: e.fragmentShader
  48627. };
  48628. e.__webglShader = n.__webglShader,
  48629. a = Te.acquireProgram(e, r, o),
  48630. n.program = a,
  48631. e.program = a
  48632. }
  48633. var c = a.getAttributes();
  48634. if (e.morphTargets)
  48635. for (var h = e.numSupportedMorphTargets = 0; h < Z.maxMorphTargets; h++)
  48636. 0 <= c["morphTarget" + h] && e.numSupportedMorphTargets++;
  48637. if (e.morphNormals)
  48638. for (h = e.numSupportedMorphNormals = 0; h < Z.maxMorphNormals; h++)
  48639. 0 <= c["morphNormal" + h] && e.numSupportedMorphNormals++;
  48640. n.uniformsList = [];
  48641. var u = n.__webglShader.uniforms
  48642. , d = n.program.getUniforms();
  48643. for (var p in u) {
  48644. var f = d[p];
  48645. f && n.uniformsList.push([n.__webglShader.uniforms[p], f])
  48646. }
  48647. (e instanceof Ci.MeshPhongMaterial || e instanceof Ci.MeshLambertMaterial || e instanceof Ci.MeshStandardMaterial || e.lights) && (n.lightsHash = ve.hash,
  48648. u.ambientLightColor.value = ve.ambient,
  48649. u.directionalLights.value = ve.directional,
  48650. u.spotLights.value = ve.spot,
  48651. u.pointLights.value = ve.point,
  48652. u.hemisphereLights.value = ve.hemi,
  48653. u.directionalShadowMap.value = ve.directionalShadowMap,
  48654. u.directionalShadowMatrix.value = ve.directionalShadowMatrix,
  48655. u.spotShadowMap.value = ve.spotShadowMap,
  48656. u.spotShadowMatrix.value = ve.spotShadowMatrix,
  48657. u.pointShadowMap.value = ve.pointShadowMap,
  48658. u.pointShadowMatrix.value = ve.pointShadowMatrix),
  48659. n.hasDynamicUniforms = !1;
  48660. for (var g = 0, m = n.uniformsList.length; g < m; g++) {
  48661. if (!0 === n.uniformsList[g][0].dynamic) {
  48662. n.hasDynamicUniforms = !0;
  48663. break
  48664. }
  48665. }
  48666. }(i, t, n),
  48667. i.needsUpdate = !1);
  48668. var o = !1
  48669. , a = !1
  48670. , s = !1
  48671. , l = r.program
  48672. , c = l.getUniforms()
  48673. , h = r.__webglShader.uniforms;
  48674. if (l.id !== K && (X.useProgram(l.program),
  48675. K = l.id,
  48676. s = a = o = !0),
  48677. i.id !== $ && ($ = i.id,
  48678. a = !0),
  48679. !o && e === te || (X.uniformMatrix4fv(c.projectionMatrix, !1, e.projectionMatrix.elements),
  48680. Ee.logarithmicDepthBuffer && X.uniform1f(c.logDepthBufFC, 2 / (Math.log(e.far + 1) / Math.LN2)),
  48681. e !== te && (te = e,
  48682. s = a = !0),
  48683. (i instanceof Ci.ShaderMaterial || i instanceof Ci.MeshPhongMaterial || i instanceof Ci.MeshStandardMaterial || i.envMap) && void 0 !== c.cameraPosition && (me.setFromMatrixPosition(e.matrixWorld),
  48684. X.uniform3f(c.cameraPosition, me.x, me.y, me.z)),
  48685. (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),
  48686. void 0 !== c.toneMappingExposure && X.uniform1f(c.toneMappingExposure, Z.toneMappingExposure),
  48687. void 0 !== c.toneMappingWhitePoint && X.uniform1f(c.toneMappingWhitePoint, Z.toneMappingWhitePoint)),
  48688. i.skinning)
  48689. if (n.bindMatrix && void 0 !== c.bindMatrix && X.uniformMatrix4fv(c.bindMatrix, !1, n.bindMatrix.elements),
  48690. n.bindMatrixInverse && void 0 !== c.bindMatrixInverse && X.uniformMatrix4fv(c.bindMatrixInverse, !1, n.bindMatrixInverse.elements),
  48691. Ee.floatVertexTextures && n.skeleton && n.skeleton.useVertexTexture) {
  48692. if (void 0 !== c.boneTexture) {
  48693. var u = A();
  48694. X.uniform1i(c.boneTexture, u),
  48695. Z.setTexture(n.skeleton.boneTexture, u)
  48696. }
  48697. void 0 !== c.boneTextureWidth && X.uniform1i(c.boneTextureWidth, n.skeleton.boneTextureWidth),
  48698. void 0 !== c.boneTextureHeight && X.uniform1i(c.boneTextureHeight, n.skeleton.boneTextureHeight)
  48699. } else
  48700. n.skeleton && n.skeleton.boneMatrices && void 0 !== c.boneGlobalMatrices && X.uniformMatrix4fv(c.boneGlobalMatrices, !1, n.skeleton.boneMatrices);
  48701. return a && ((i instanceof Ci.MeshPhongMaterial || i instanceof Ci.MeshLambertMaterial || i instanceof Ci.MeshStandardMaterial || i.lights) && function(e, t) {
  48702. e.ambientLightColor.needsUpdate = t,
  48703. e.directionalLights.needsUpdate = t,
  48704. e.pointLights.needsUpdate = t,
  48705. e.spotLights.needsUpdate = t,
  48706. e.hemisphereLights.needsUpdate = t
  48707. }(h, s),
  48708. t && i.fog && function(e, t) {
  48709. e.fogColor.value = t.color,
  48710. t instanceof Ci.Fog ? (e.fogNear.value = t.near,
  48711. e.fogFar.value = t.far) : t instanceof Ci.FogExp2 && (e.fogDensity.value = t.density)
  48712. }(h, t),
  48713. (i instanceof Ci.MeshBasicMaterial || i instanceof Ci.MeshLambertMaterial || i instanceof Ci.MeshPhongMaterial || i instanceof Ci.MeshStandardMaterial) && function(e, t) {
  48714. var i;
  48715. if (e.opacity.value = t.opacity,
  48716. e.diffuse.value = t.color,
  48717. t.emissive && e.emissive.value.copy(t.emissive).multiplyScalar(t.emissiveIntensity),
  48718. e.map.value = t.map,
  48719. e.specularMap.value = t.specularMap,
  48720. e.alphaMap.value = t.alphaMap,
  48721. t.aoMap && (e.aoMap.value = t.aoMap,
  48722. e.aoMapIntensity.value = t.aoMapIntensity),
  48723. 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),
  48724. void 0 !== i) {
  48725. i instanceof Ci.WebGLRenderTarget && (i = i.texture);
  48726. var n = i.offset
  48727. , r = i.repeat;
  48728. e.offsetRepeat.value.set(n.x, n.y, r.x, r.y)
  48729. }
  48730. e.envMap.value = t.envMap,
  48731. e.flipEnvMap.value = t.envMap instanceof Ci.WebGLRenderTargetCube ? 1 : -1,
  48732. e.reflectivity.value = t.reflectivity,
  48733. e.refractionRatio.value = t.refractionRatio
  48734. }(h, i),
  48735. i instanceof Ci.LineBasicMaterial ? p(h, i) : i instanceof Ci.LineDashedMaterial ? (p(h, i),
  48736. function(e, t) {
  48737. e.dashSize.value = t.dashSize,
  48738. e.totalSize.value = t.dashSize + t.gapSize,
  48739. e.scale.value = t.scale
  48740. }(h, i)) : i instanceof Ci.PointsMaterial ? function(e, t) {
  48741. if (e.diffuse.value = t.color,
  48742. e.opacity.value = t.opacity,
  48743. e.size.value = t.size * he,
  48744. e.scale.value = O.clientHeight / 2,
  48745. e.map.value = t.map,
  48746. null !== t.map) {
  48747. var i = t.map.offset
  48748. , n = t.map.repeat;
  48749. e.offsetRepeat.value.set(i.x, i.y, n.x, n.y)
  48750. }
  48751. }(h, i) : i instanceof Ci.MeshLambertMaterial ? function(e, t) {
  48752. t.lightMap && (e.lightMap.value = t.lightMap,
  48753. e.lightMapIntensity.value = t.lightMapIntensity),
  48754. t.emissiveMap && (e.emissiveMap.value = t.emissiveMap)
  48755. }(h, i) : i instanceof Ci.MeshPhongMaterial ? function(e, t) {
  48756. e.specular.value = t.specular,
  48757. e.shininess.value = Math.max(t.shininess, 1e-4),
  48758. t.lightMap && (e.lightMap.value = t.lightMap,
  48759. e.lightMapIntensity.value = t.lightMapIntensity),
  48760. t.emissiveMap && (e.emissiveMap.value = t.emissiveMap),
  48761. t.bumpMap && (e.bumpMap.value = t.bumpMap,
  48762. e.bumpScale.value = t.bumpScale),
  48763. t.normalMap && (e.normalMap.value = t.normalMap,
  48764. e.normalScale.value.copy(t.normalScale)),
  48765. t.displacementMap && (e.displacementMap.value = t.displacementMap,
  48766. e.displacementScale.value = t.displacementScale,
  48767. e.displacementBias.value = t.displacementBias)
  48768. }(h, i) : i instanceof Ci.MeshStandardMaterial ? function(e, t) {
  48769. e.roughness.value = t.roughness,
  48770. e.metalness.value = t.metalness,
  48771. t.roughnessMap && (e.roughnessMap.value = t.roughnessMap),
  48772. t.metalnessMap && (e.metalnessMap.value = t.metalnessMap),
  48773. t.lightMap && (e.lightMap.value = t.lightMap,
  48774. e.lightMapIntensity.value = t.lightMapIntensity),
  48775. t.emissiveMap && (e.emissiveMap.value = t.emissiveMap),
  48776. t.bumpMap && (e.bumpMap.value = t.bumpMap,
  48777. e.bumpScale.value = t.bumpScale),
  48778. t.normalMap && (e.normalMap.value = t.normalMap,
  48779. e.normalScale.value.copy(t.normalScale)),
  48780. t.displacementMap && (e.displacementMap.value = t.displacementMap,
  48781. e.displacementScale.value = t.displacementScale,
  48782. e.displacementBias.value = t.displacementBias),
  48783. t.envMap && (e.envMapIntensity.value = t.envMapIntensity)
  48784. }(h, i) : i instanceof Ci.MeshDepthMaterial ? (h.mNear.value = e.near,
  48785. h.mFar.value = e.far,
  48786. h.opacity.value = i.opacity) : i instanceof Ci.MeshNormalMaterial && (h.opacity.value = i.opacity),
  48787. g(r.uniformsList)),
  48788. function(e, t) {
  48789. X.uniformMatrix4fv(e.modelViewMatrix, !1, t.modelViewMatrix.elements),
  48790. e.normalMatrix && X.uniformMatrix3fv(e.normalMatrix, !1, t.normalMatrix.elements)
  48791. }(c, n),
  48792. void 0 !== c.modelMatrix && X.uniformMatrix4fv(c.modelMatrix, !1, n.matrixWorld.elements),
  48793. !0 === r.hasDynamicUniforms && function(e, t, i) {
  48794. for (var n = [], r = 0, o = e.length; r < o; r++) {
  48795. var a = e[r][0]
  48796. , s = a.onUpdateCallback;
  48797. void 0 !== s && (s.bind(a)(t, i),
  48798. n.push(e[r]))
  48799. }
  48800. g(n)
  48801. }(r.uniformsList, n, e),
  48802. l
  48803. }
  48804. function p(e, t) {
  48805. e.diffuse.value = t.color,
  48806. e.opacity.value = t.opacity
  48807. }
  48808. function A() {
  48809. var e = oe;
  48810. return e >= Ee.maxTextures && console.warn("WebGLRenderer: trying to use " + e + " texture units while this GPU supports only " + Ee.maxTextures),
  48811. oe += 1,
  48812. e
  48813. }
  48814. function C(e, t, i, n) {
  48815. var r, o;
  48816. if ("1i" === t)
  48817. X.uniform1i(i, n);
  48818. else if ("1f" === t)
  48819. X.uniform1f(i, n);
  48820. else if ("2f" === t)
  48821. X.uniform2f(i, n[0], n[1]);
  48822. else if ("3f" === t)
  48823. X.uniform3f(i, n[0], n[1], n[2]);
  48824. else if ("4f" === t)
  48825. X.uniform4f(i, n[0], n[1], n[2], n[3]);
  48826. else if ("1iv" === t)
  48827. X.uniform1iv(i, n);
  48828. else if ("3iv" === t)
  48829. X.uniform3iv(i, n);
  48830. else if ("1fv" === t)
  48831. X.uniform1fv(i, n);
  48832. else if ("2fv" === t)
  48833. X.uniform2fv(i, n);
  48834. else if ("3fv" === t)
  48835. X.uniform3fv(i, n);
  48836. else if ("4fv" === t)
  48837. X.uniform4fv(i, n);
  48838. else if ("Matrix2fv" === t)
  48839. X.uniformMatrix2fv(i, !1, n);
  48840. else if ("Matrix3fv" === t)
  48841. X.uniformMatrix3fv(i, !1, n);
  48842. else if ("Matrix4fv" === t)
  48843. X.uniformMatrix4fv(i, !1, n);
  48844. else if ("i" === t)
  48845. X.uniform1i(i, n);
  48846. else if ("f" === t)
  48847. X.uniform1f(i, n);
  48848. else if ("v2" === t)
  48849. X.uniform2f(i, n.x, n.y);
  48850. else if ("v3" === t)
  48851. X.uniform3f(i, n.x, n.y, n.z);
  48852. else if ("v4" === t)
  48853. X.uniform4f(i, n.x, n.y, n.z, n.w);
  48854. else if ("c" === t)
  48855. X.uniform3f(i, n.r, n.g, n.b);
  48856. else if ("s" === t) {
  48857. var a = e.properties;
  48858. for (var s in a) {
  48859. var l = a[s]
  48860. , c = i[s]
  48861. , h = n[s];
  48862. C(l, l.type, c, h)
  48863. }
  48864. } else if ("sa" === t) {
  48865. a = e.properties;
  48866. for (var u = 0, d = n.length; u < d; u++)
  48867. for (var s in a) {
  48868. l = a[s],
  48869. c = i[u][s],
  48870. h = n[u][s];
  48871. C(l, l.type, c, h)
  48872. }
  48873. } else if ("iv1" === t)
  48874. X.uniform1iv(i, n);
  48875. else if ("iv" === t)
  48876. X.uniform3iv(i, n);
  48877. else if ("fv1" === t)
  48878. X.uniform1fv(i, n);
  48879. else if ("fv" === t)
  48880. X.uniform3fv(i, n);
  48881. else if ("v2v" === t) {
  48882. void 0 === e._array && (e._array = new Float32Array(2 * n.length));
  48883. u = 0;
  48884. for (var p = 0, f = n.length; u < f; u++,
  48885. p += 2)
  48886. e._array[p + 0] = n[u].x,
  48887. e._array[p + 1] = n[u].y;
  48888. X.uniform2fv(i, e._array)
  48889. } else if ("v3v" === t) {
  48890. void 0 === e._array && (e._array = new Float32Array(3 * n.length));
  48891. u = 0;
  48892. var g = 0;
  48893. for (f = n.length; u < f; u++,
  48894. g += 3)
  48895. e._array[g + 0] = n[u].x,
  48896. e._array[g + 1] = n[u].y,
  48897. e._array[g + 2] = n[u].z;
  48898. X.uniform3fv(i, e._array)
  48899. } else if ("v4v" === t) {
  48900. void 0 === e._array && (e._array = new Float32Array(4 * n.length));
  48901. u = 0;
  48902. var m = 0;
  48903. for (f = n.length; u < f; u++,
  48904. m += 4)
  48905. e._array[m + 0] = n[u].x,
  48906. e._array[m + 1] = n[u].y,
  48907. e._array[m + 2] = n[u].z,
  48908. e._array[m + 3] = n[u].w;
  48909. X.uniform4fv(i, e._array)
  48910. } else if ("m2" === t)
  48911. X.uniformMatrix2fv(i, !1, n.elements);
  48912. else if ("m3" === t)
  48913. X.uniformMatrix3fv(i, !1, n.elements);
  48914. else if ("m3v" === t) {
  48915. void 0 === e._array && (e._array = new Float32Array(9 * n.length));
  48916. for (u = 0,
  48917. f = n.length; u < f; u++)
  48918. n[u].flattenToArrayOffset(e._array, 9 * u);
  48919. X.uniformMatrix3fv(i, !1, e._array)
  48920. } else if ("m4" === t)
  48921. X.uniformMatrix4fv(i, !1, n.elements);
  48922. else if ("m4v" === t) {
  48923. void 0 === e._array && (e._array = new Float32Array(16 * n.length));
  48924. for (u = 0,
  48925. f = n.length; u < f; u++)
  48926. n[u].flattenToArrayOffset(e._array, 16 * u);
  48927. X.uniformMatrix4fv(i, !1, e._array)
  48928. } else if ("t" === t) {
  48929. if (r = n,
  48930. o = A(),
  48931. X.uniform1i(i, o),
  48932. !r)
  48933. return;
  48934. 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)
  48935. } else if ("tv" === t) {
  48936. void 0 === e._array && (e._array = []);
  48937. for (u = 0,
  48938. f = e.value.length; u < f; u++)
  48939. e._array[u] = A();
  48940. X.uniform1iv(i, e._array);
  48941. for (u = 0,
  48942. f = e.value.length; u < f; u++)
  48943. r = e.value[u],
  48944. o = e._array[u],
  48945. 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))
  48946. } else
  48947. console.warn("THREE.WebGLRenderer: Unknown uniform type: " + t)
  48948. }
  48949. function g(e) {
  48950. for (var t = 0, i = e.length; t < i; t++) {
  48951. var n = e[t][0];
  48952. if (!1 !== n.needsUpdate)
  48953. C(n, n.type, e[t][1], n.value)
  48954. }
  48955. }
  48956. function m(e, t, i) {
  48957. var n;
  48958. if (i ? (X.texParameteri(e, X.TEXTURE_WRAP_S, x(t.wrapS)),
  48959. X.texParameteri(e, X.TEXTURE_WRAP_T, x(t.wrapT)),
  48960. X.texParameteri(e, X.TEXTURE_MAG_FILTER, x(t.magFilter)),
  48961. X.texParameteri(e, X.TEXTURE_MIN_FILTER, x(t.minFilter))) : (X.texParameteri(e, X.TEXTURE_WRAP_S, X.CLAMP_TO_EDGE),
  48962. X.texParameteri(e, X.TEXTURE_WRAP_T, X.CLAMP_TO_EDGE),
  48963. 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),
  48964. X.texParameteri(e, X.TEXTURE_MAG_FILTER, T(t.magFilter)),
  48965. X.texParameteri(e, X.TEXTURE_MIN_FILTER, T(t.minFilter)),
  48966. 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)),
  48967. n = Ie.get("EXT_texture_filter_anisotropic")) {
  48968. if (t.type === Ci.FloatType && null === Ie.get("OES_texture_float_linear"))
  48969. return;
  48970. if (t.type === Ci.HalfFloatType && null === Ie.get("OES_texture_half_float_linear"))
  48971. return;
  48972. (1 < t.anisotropy || be.get(t).__currentAnisotropy) && (X.texParameterf(e, n.TEXTURE_MAX_ANISOTROPY_EXT, Math.min(t.anisotropy, Z.getMaxAnisotropy())),
  48973. be.get(t).__currentAnisotropy = t.anisotropy)
  48974. }
  48975. }
  48976. function o(e, t, i) {
  48977. void 0 === e.__webglInit && (e.__webglInit = !0,
  48978. t.addEventListener("dispose", f),
  48979. e.__webglTexture = X.createTexture(),
  48980. ye.textures++),
  48981. _e.activeTexture(X.TEXTURE0 + i),
  48982. _e.bindTexture(X.TEXTURE_2D, e.__webglTexture),
  48983. X.pixelStorei(X.UNPACK_FLIP_Y_WEBGL, t.flipY),
  48984. X.pixelStorei(X.UNPACK_PREMULTIPLY_ALPHA_WEBGL, t.premultiplyAlpha),
  48985. X.pixelStorei(X.UNPACK_ALIGNMENT, t.unpackAlignment);
  48986. var n = I(t.image, Ee.maxTextureSize);
  48987. !function(e) {
  48988. return e.wrapS !== Ci.ClampToEdgeWrapping || e.wrapT !== Ci.ClampToEdgeWrapping || e.minFilter !== Ci.NearestFilter && e.minFilter !== Ci.LinearFilter
  48989. }(t) || !1 !== E(n) || (n = function(e) {
  48990. if (e instanceof HTMLImageElement || e instanceof HTMLCanvasElement) {
  48991. var t = document.createElement("canvas");
  48992. return t.width = Ci.Math.nearestPowerOfTwo(e.width),
  48993. t.height = Ci.Math.nearestPowerOfTwo(e.height),
  48994. t.getContext("2d").drawImage(e, 0, 0, t.width, t.height),
  48995. console.warn("THREE.WebGLRenderer: image is not power of two (" + e.width + "x" + e.height + "). Resized to " + t.width + "x" + t.height, e),
  48996. t
  48997. }
  48998. return e
  48999. }(n));
  49000. var r = E(n)
  49001. , o = x(t.format)
  49002. , a = x(t.type);
  49003. m(X.TEXTURE_2D, t, r);
  49004. var s, l = t.mipmaps;
  49005. if (t instanceof Ci.DataTexture)
  49006. if (0 < l.length && r) {
  49007. for (var c = 0, h = l.length; c < h; c++)
  49008. s = l[c],
  49009. _e.texImage2D(X.TEXTURE_2D, c, o, s.width, s.height, 0, o, a, s.data);
  49010. t.generateMipmaps = !1
  49011. } else
  49012. _e.texImage2D(X.TEXTURE_2D, 0, o, n.width, n.height, 0, o, a, n.data);
  49013. else if (t instanceof Ci.CompressedTexture)
  49014. for (c = 0,
  49015. h = l.length; c < h; c++)
  49016. s = l[c],
  49017. 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);
  49018. else if (0 < l.length && r) {
  49019. for (c = 0,
  49020. h = l.length; c < h; c++)
  49021. s = l[c],
  49022. _e.texImage2D(X.TEXTURE_2D, c, o, o, a, s);
  49023. t.generateMipmaps = !1
  49024. } else
  49025. _e.texImage2D(X.TEXTURE_2D, 0, o, o, a, n);
  49026. t.generateMipmaps && r && X.generateMipmap(X.TEXTURE_2D),
  49027. e.__version = t.version,
  49028. t.onUpdate && t.onUpdate(t)
  49029. }
  49030. function I(e, t) {
  49031. if (e.width > t || e.height > t) {
  49032. var i = t / Math.max(e.width, e.height)
  49033. , n = document.createElement("canvas");
  49034. return n.width = Math.floor(e.width * i),
  49035. n.height = Math.floor(e.height * i),
  49036. n.getContext("2d").drawImage(e, 0, 0, e.width, e.height, 0, 0, n.width, n.height),
  49037. console.warn("THREE.WebGLRenderer: image is too big (" + e.width + "x" + e.height + "). Resized to " + n.width + "x" + n.height, e),
  49038. n
  49039. }
  49040. return e
  49041. }
  49042. function E(e) {
  49043. return Ci.Math.isPowerOfTwo(e.width) && Ci.Math.isPowerOfTwo(e.height)
  49044. }
  49045. function _(e, t) {
  49046. var i = be.get(e);
  49047. if (6 === e.image.length)
  49048. if (0 < e.version && i.__version !== e.version) {
  49049. i.__image__webglTextureCube || (e.addEventListener("dispose", f),
  49050. i.__image__webglTextureCube = X.createTexture(),
  49051. ye.textures++),
  49052. _e.activeTexture(X.TEXTURE0 + t),
  49053. _e.bindTexture(X.TEXTURE_CUBE_MAP, i.__image__webglTextureCube),
  49054. X.pixelStorei(X.UNPACK_FLIP_Y_WEBGL, e.flipY);
  49055. for (var n = e instanceof Ci.CompressedTexture, r = e.image[0]instanceof Ci.DataTexture, o = [], a = 0; a < 6; a++)
  49056. !Z.autoScaleCubemaps || n || r ? o[a] = r ? e.image[a].image : e.image[a] : o[a] = I(e.image[a], Ee.maxCubemapSize);
  49057. var s = E(o[0])
  49058. , l = x(e.format)
  49059. , c = x(e.type);
  49060. m(X.TEXTURE_CUBE_MAP, e, s);
  49061. for (a = 0; a < 6; a++)
  49062. if (n)
  49063. for (var h, u = o[a].mipmaps, d = 0, p = u.length; d < p; d++)
  49064. h = u[d],
  49065. 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);
  49066. else
  49067. 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]);
  49068. e.generateMipmaps && s && X.generateMipmap(X.TEXTURE_CUBE_MAP),
  49069. i.__version = e.version,
  49070. e.onUpdate && e.onUpdate(e)
  49071. } else
  49072. _e.activeTexture(X.TEXTURE0 + t),
  49073. _e.bindTexture(X.TEXTURE_CUBE_MAP, i.__image__webglTextureCube)
  49074. }
  49075. function b(e, t) {
  49076. _e.activeTexture(X.TEXTURE0 + t),
  49077. _e.bindTexture(X.TEXTURE_CUBE_MAP, be.get(e).__webglTexture)
  49078. }
  49079. function h(e, t, i, n) {
  49080. var r = x(t.texture.format)
  49081. , o = x(t.texture.type);
  49082. _e.texImage2D(n, 0, r, t.width, t.height, 0, r, o, null),
  49083. X.bindFramebuffer(X.FRAMEBUFFER, e),
  49084. X.framebufferTexture2D(X.FRAMEBUFFER, i, n, be.get(t.texture).__webglTexture, 0),
  49085. X.bindFramebuffer(X.FRAMEBUFFER, null)
  49086. }
  49087. function u(e, t) {
  49088. X.bindRenderbuffer(X.RENDERBUFFER, e),
  49089. t.depthBuffer && !t.stencilBuffer ? (X.renderbufferStorage(X.RENDERBUFFER, X.DEPTH_COMPONENT16, t.width, t.height),
  49090. 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),
  49091. X.framebufferRenderbuffer(X.FRAMEBUFFER, X.DEPTH_STENCIL_ATTACHMENT, X.RENDERBUFFER, e)) : X.renderbufferStorage(X.RENDERBUFFER, X.RGBA4, t.width, t.height),
  49092. X.bindRenderbuffer(X.RENDERBUFFER, null)
  49093. }
  49094. function w(e) {
  49095. var t = be.get(e)
  49096. , i = be.get(e.texture);
  49097. e.addEventListener("dispose", a),
  49098. i.__webglTexture = X.createTexture(),
  49099. ye.textures++;
  49100. var n = e instanceof Ci.WebGLRenderTargetCube
  49101. , r = Ci.Math.isPowerOfTwo(e.width) && Ci.Math.isPowerOfTwo(e.height);
  49102. if (n) {
  49103. t.__webglFramebuffer = [];
  49104. for (var o = 0; o < 6; o++)
  49105. t.__webglFramebuffer[o] = X.createFramebuffer()
  49106. } else
  49107. t.__webglFramebuffer = X.createFramebuffer();
  49108. if (n) {
  49109. _e.bindTexture(X.TEXTURE_CUBE_MAP, i.__webglTexture),
  49110. m(X.TEXTURE_CUBE_MAP, e.texture, r);
  49111. for (o = 0; o < 6; o++)
  49112. h(t.__webglFramebuffer[o], e, X.COLOR_ATTACHMENT0, X.TEXTURE_CUBE_MAP_POSITIVE_X + o);
  49113. e.texture.generateMipmaps && r && X.generateMipmap(X.TEXTURE_CUBE_MAP),
  49114. _e.bindTexture(X.TEXTURE_CUBE_MAP, null)
  49115. } else
  49116. _e.bindTexture(X.TEXTURE_2D, i.__webglTexture),
  49117. m(X.TEXTURE_2D, e.texture, r),
  49118. h(t.__webglFramebuffer, e, X.COLOR_ATTACHMENT0, X.TEXTURE_2D),
  49119. e.texture.generateMipmaps && r && X.generateMipmap(X.TEXTURE_2D),
  49120. _e.bindTexture(X.TEXTURE_2D, null);
  49121. e.depthBuffer && function(e) {
  49122. var t = be.get(e);
  49123. if (e instanceof Ci.WebGLRenderTargetCube) {
  49124. t.__webglDepthbuffer = [];
  49125. for (var i = 0; i < 6; i++)
  49126. X.bindFramebuffer(X.FRAMEBUFFER, t.__webglFramebuffer[i]),
  49127. t.__webglDepthbuffer[i] = X.createRenderbuffer(),
  49128. u(t.__webglDepthbuffer[i], e)
  49129. } else
  49130. X.bindFramebuffer(X.FRAMEBUFFER, t.__webglFramebuffer),
  49131. t.__webglDepthbuffer = X.createRenderbuffer(),
  49132. u(t.__webglDepthbuffer, e);
  49133. X.bindFramebuffer(X.FRAMEBUFFER, null)
  49134. }(e)
  49135. }
  49136. function T(e) {
  49137. return e === Ci.NearestFilter || e === Ci.NearestMipMapNearestFilter || e === Ci.NearestMipMapLinearFilter ? X.NEAREST : X.LINEAR
  49138. }
  49139. function x(e) {
  49140. var t;
  49141. if (e === Ci.RepeatWrapping)
  49142. return X.REPEAT;
  49143. if (e === Ci.ClampToEdgeWrapping)
  49144. return X.CLAMP_TO_EDGE;
  49145. if (e === Ci.MirroredRepeatWrapping)
  49146. return X.MIRRORED_REPEAT;
  49147. if (e === Ci.NearestFilter)
  49148. return X.NEAREST;
  49149. if (e === Ci.NearestMipMapNearestFilter)
  49150. return X.NEAREST_MIPMAP_NEAREST;
  49151. if (e === Ci.NearestMipMapLinearFilter)
  49152. return X.NEAREST_MIPMAP_LINEAR;
  49153. if (e === Ci.LinearFilter)
  49154. return X.LINEAR;
  49155. if (e === Ci.LinearMipMapNearestFilter)
  49156. return X.LINEAR_MIPMAP_NEAREST;
  49157. if (e === Ci.LinearMipMapLinearFilter)
  49158. return X.LINEAR_MIPMAP_LINEAR;
  49159. if (e === Ci.UnsignedByteType)
  49160. return X.UNSIGNED_BYTE;
  49161. if (e === Ci.UnsignedShort4444Type)
  49162. return X.UNSIGNED_SHORT_4_4_4_4;
  49163. if (e === Ci.UnsignedShort5551Type)
  49164. return X.UNSIGNED_SHORT_5_5_5_1;
  49165. if (e === Ci.UnsignedShort565Type)
  49166. return X.UNSIGNED_SHORT_5_6_5;
  49167. if (e === Ci.ByteType)
  49168. return X.BYTE;
  49169. if (e === Ci.ShortType)
  49170. return X.SHORT;
  49171. if (e === Ci.UnsignedShortType)
  49172. return X.UNSIGNED_SHORT;
  49173. if (e === Ci.IntType)
  49174. return X.INT;
  49175. if (e === Ci.UnsignedIntType)
  49176. return X.UNSIGNED_INT;
  49177. if (e === Ci.FloatType)
  49178. return X.FLOAT;
  49179. if (null !== (t = Ie.get("OES_texture_half_float")) && e === Ci.HalfFloatType)
  49180. return t.HALF_FLOAT_OES;
  49181. if (e === Ci.AlphaFormat)
  49182. return X.ALPHA;
  49183. if (e === Ci.RGBFormat)
  49184. return X.RGB;
  49185. if (e === Ci.RGBAFormat)
  49186. return X.RGBA;
  49187. if (e === Ci.LuminanceFormat)
  49188. return X.LUMINANCE;
  49189. if (e === Ci.LuminanceAlphaFormat)
  49190. return X.LUMINANCE_ALPHA;
  49191. if (e === Ci.AddEquation)
  49192. return X.FUNC_ADD;
  49193. if (e === Ci.SubtractEquation)
  49194. return X.FUNC_SUBTRACT;
  49195. if (e === Ci.ReverseSubtractEquation)
  49196. return X.FUNC_REVERSE_SUBTRACT;
  49197. if (e === Ci.ZeroFactor)
  49198. return X.ZERO;
  49199. if (e === Ci.OneFactor)
  49200. return X.ONE;
  49201. if (e === Ci.SrcColorFactor)
  49202. return X.SRC_COLOR;
  49203. if (e === Ci.OneMinusSrcColorFactor)
  49204. return X.ONE_MINUS_SRC_COLOR;
  49205. if (e === Ci.SrcAlphaFactor)
  49206. return X.SRC_ALPHA;
  49207. if (e === Ci.OneMinusSrcAlphaFactor)
  49208. return X.ONE_MINUS_SRC_ALPHA;
  49209. if (e === Ci.DstAlphaFactor)
  49210. return X.DST_ALPHA;
  49211. if (e === Ci.OneMinusDstAlphaFactor)
  49212. return X.ONE_MINUS_DST_ALPHA;
  49213. if (e === Ci.DstColorFactor)
  49214. return X.DST_COLOR;
  49215. if (e === Ci.OneMinusDstColorFactor)
  49216. return X.ONE_MINUS_DST_COLOR;
  49217. if (e === Ci.SrcAlphaSaturateFactor)
  49218. return X.SRC_ALPHA_SATURATE;
  49219. if (null !== (t = Ie.get("WEBGL_compressed_texture_s3tc"))) {
  49220. if (e === Ci.RGB_S3TC_DXT1_Format)
  49221. return t.COMPRESSED_RGB_S3TC_DXT1_EXT;
  49222. if (e === Ci.RGBA_S3TC_DXT1_Format)
  49223. return t.COMPRESSED_RGBA_S3TC_DXT1_EXT;
  49224. if (e === Ci.RGBA_S3TC_DXT3_Format)
  49225. return t.COMPRESSED_RGBA_S3TC_DXT3_EXT;
  49226. if (e === Ci.RGBA_S3TC_DXT5_Format)
  49227. return t.COMPRESSED_RGBA_S3TC_DXT5_EXT
  49228. }
  49229. if (null !== (t = Ie.get("WEBGL_compressed_texture_pvrtc"))) {
  49230. if (e === Ci.RGB_PVRTC_4BPPV1_Format)
  49231. return t.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;
  49232. if (e === Ci.RGB_PVRTC_2BPPV1_Format)
  49233. return t.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;
  49234. if (e === Ci.RGBA_PVRTC_4BPPV1_Format)
  49235. return t.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;
  49236. if (e === Ci.RGBA_PVRTC_2BPPV1_Format)
  49237. return t.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG
  49238. }
  49239. if (null !== (t = Ie.get("WEBGL_compressed_texture_etc1")) && e === Ci.RGB_ETC1_Format)
  49240. return t.COMPRESSED_RGB_ETC1_WEBGL;
  49241. if (null !== (t = Ie.get("EXT_blend_minmax"))) {
  49242. if (e === Ci.MinEquation)
  49243. return t.MIN_EXT;
  49244. if (e === Ci.MaxEquation)
  49245. return t.MAX_EXT
  49246. }
  49247. return 0
  49248. }
  49249. console.log("THREE.WebGLRenderer", Ci.REVISION);
  49250. var O = void 0 !== (e = e || {}).canvas ? e.canvas : document.createElement("canvas")
  49251. , L = void 0 !== e.context ? e.context : null
  49252. , D = void 0 !== e.alpha && e.alpha
  49253. , N = void 0 === e.depth || e.depth
  49254. , F = void 0 === e.stencil || e.stencil
  49255. , B = void 0 !== e.antialias && e.antialias
  49256. , V = void 0 === e.premultipliedAlpha || e.premultipliedAlpha
  49257. , k = void 0 !== e.preserveDrawingBuffer && e.preserveDrawingBuffer
  49258. , U = []
  49259. , H = []
  49260. , z = -1
  49261. , G = []
  49262. , W = -1
  49263. , j = new Float32Array(8)
  49264. , Y = []
  49265. , q = [];
  49266. this.domElement = O,
  49267. this.context = null,
  49268. this.autoClear = !0,
  49269. this.autoClearColor = !0,
  49270. this.autoClearDepth = !0,
  49271. this.autoClearStencil = !0,
  49272. this.sortObjects = !0,
  49273. this.gammaFactor = 2,
  49274. this.gammaInput = !1,
  49275. this.gammaOutput = !1,
  49276. this.physicallyCorrectLights = !1,
  49277. this.toneMapping = Ci.LinearToneMapping,
  49278. this.toneMappingExposure = 1,
  49279. this.toneMappingWhitePoint = 1,
  49280. this.maxMorphTargets = 8,
  49281. this.maxMorphNormals = 4,
  49282. this.autoScaleCubemaps = !0;
  49283. 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 = {
  49284. hash: "",
  49285. ambient: [0, 0, 0],
  49286. directional: [],
  49287. directionalShadowMap: [],
  49288. directionalShadowMatrix: [],
  49289. spot: [],
  49290. spotShadowMap: [],
  49291. spotShadowMatrix: [],
  49292. point: [],
  49293. pointShadowMap: [],
  49294. pointShadowMatrix: [],
  49295. hemi: [],
  49296. shadows: [],
  49297. shadowsPointLight: 0
  49298. }, ye = {
  49299. geometries: 0,
  49300. textures: 0
  49301. }, Ae = {
  49302. calls: 0,
  49303. vertices: 0,
  49304. faces: 0,
  49305. points: 0
  49306. };
  49307. this.info = {
  49308. render: Ae,
  49309. memory: ye,
  49310. programs: null
  49311. };
  49312. try {
  49313. var Ce = {
  49314. alpha: D,
  49315. depth: N,
  49316. stencil: F,
  49317. antialias: B,
  49318. premultipliedAlpha: V,
  49319. preserveDrawingBuffer: k
  49320. };
  49321. if (null === (X = L || O.getContext("webgl", Ce) || O.getContext("experimental-webgl", Ce)))
  49322. throw null !== O.getContext("webgl") ? "Error creating WebGL context with your selected attributes." : "Error creating WebGL context.";
  49323. void 0 === X.getShaderPrecisionFormat && (X.getShaderPrecisionFormat = function() {
  49324. return {
  49325. rangeMin: 1,
  49326. rangeMax: 1,
  49327. precision: 1
  49328. }
  49329. }
  49330. ),
  49331. O.addEventListener("webglcontextlost", r, !1)
  49332. } catch (e) {
  49333. console.error("THREE.WebGLRenderer: " + e)
  49334. }
  49335. var Ie = new Ci.WebGLExtensions(X);
  49336. Ie.get("OES_texture_float"),
  49337. Ie.get("OES_texture_float_linear"),
  49338. Ie.get("OES_texture_half_float"),
  49339. Ie.get("OES_texture_half_float_linear"),
  49340. Ie.get("OES_standard_derivatives"),
  49341. Ie.get("ANGLE_instanced_arrays"),
  49342. Ie.get("OES_element_index_uint") && (Ci.BufferGeometry.MaxIndex = 4294967296);
  49343. var Ee = new Ci.WebGLCapabilities(X,Ie,e)
  49344. , _e = new Ci.WebGLState(X,Ie,x)
  49345. , be = new Ci.WebGLProperties
  49346. , we = new Ci.WebGLObjects(X,be,this.info)
  49347. , Te = new Ci.WebGLPrograms(this,Ee)
  49348. , xe = new Ci.WebGLLights;
  49349. this.info.programs = Te.programs;
  49350. var Se = new Ci.WebGLBufferRenderer(X,Ie,Ae)
  49351. , Me = new Ci.WebGLIndexedBufferRenderer(X,Ie,Ae);
  49352. t(),
  49353. this.context = X,
  49354. this.capabilities = Ee,
  49355. this.extensions = Ie,
  49356. this.properties = be,
  49357. this.state = _e;
  49358. var Re = new Ci.WebGLShadowMap(this,ve,we);
  49359. this.shadowMap = Re;
  49360. var Pe, Oe = new Ci.SpritePlugin(this,Y), Le = new Ci.LensFlarePlugin(this,q);
  49361. this.getContext = function() {
  49362. return X
  49363. }
  49364. ,
  49365. this.getContextAttributes = function() {
  49366. return X.getContextAttributes()
  49367. }
  49368. ,
  49369. this.forceContextLoss = function() {
  49370. Ie.get("WEBGL_lose_context").loseContext()
  49371. }
  49372. ,
  49373. this.getMaxAnisotropy = function() {
  49374. if (void 0 !== Pe)
  49375. return Pe;
  49376. var e = Ie.get("EXT_texture_filter_anisotropic");
  49377. return Pe = null !== e ? X.getParameter(e.MAX_TEXTURE_MAX_ANISOTROPY_EXT) : 0
  49378. }
  49379. ,
  49380. this.getPrecision = function() {
  49381. return Ee.precision
  49382. }
  49383. ,
  49384. this.getPixelRatio = function() {
  49385. return he
  49386. }
  49387. ,
  49388. this.setPixelRatio = function(e) {
  49389. void 0 !== e && (he = e,
  49390. this.setSize(pe.z, pe.w, !1))
  49391. }
  49392. ,
  49393. this.getSize = function() {
  49394. return {
  49395. width: le,
  49396. height: ce
  49397. }
  49398. }
  49399. ,
  49400. this.setSize = function(e, t, i, n) {
  49401. null != n && (he = n),
  49402. le = e,
  49403. ce = t,
  49404. O.width = e * he,
  49405. O.height = t * he,
  49406. !1 !== i && (O.style.width = e + "px",
  49407. O.style.height = t + "px"),
  49408. this.setViewport(0, 0, e, t)
  49409. }
  49410. ,
  49411. this.setViewport = function(e, t, i, n) {
  49412. _e.viewport(pe.set(e, t, i, n))
  49413. }
  49414. ,
  49415. this.setScissor = function(e, t, i, n) {
  49416. _e.scissor(ue.set(e, t, i, n))
  49417. }
  49418. ,
  49419. this.setScissorTest = function(e) {
  49420. _e.setScissorTest(de = e)
  49421. }
  49422. ,
  49423. this.getClearColor = function() {
  49424. return ae
  49425. }
  49426. ,
  49427. this.setClearColor = function(e, t) {
  49428. ae.set(e),
  49429. se = void 0 !== t ? t : 1,
  49430. i(ae.r, ae.g, ae.b, se)
  49431. }
  49432. ,
  49433. this.getClearAlpha = function() {
  49434. return se
  49435. }
  49436. ,
  49437. this.setClearAlpha = function(e) {
  49438. se = e,
  49439. i(ae.r, ae.g, ae.b, se)
  49440. }
  49441. ,
  49442. this.clear = function(e, t, i) {
  49443. var n = 0;
  49444. void 0 !== e && !e || (n |= X.COLOR_BUFFER_BIT),
  49445. void 0 !== t && !t || (n |= X.DEPTH_BUFFER_BIT),
  49446. void 0 !== i && !i || (n |= X.STENCIL_BUFFER_BIT),
  49447. X.clear(n)
  49448. }
  49449. ,
  49450. this.clearColor = function() {
  49451. this.clear(!0, !1, !1)
  49452. }
  49453. ,
  49454. this.clearDepth = function() {
  49455. this.clear(!1, !0, !1)
  49456. }
  49457. ,
  49458. this.clearStencil = function() {
  49459. this.clear(!1, !1, !0)
  49460. }
  49461. ,
  49462. this.clearTarget = function(e, t, i, n) {
  49463. this.setRenderTarget(e),
  49464. this.clear(t, i, n)
  49465. }
  49466. ,
  49467. this.resetGLState = n,
  49468. this.dispose = function() {
  49469. O.removeEventListener("webglcontextlost", r, !1)
  49470. }
  49471. ,
  49472. this.renderBufferImmediate = function(e, t, i) {
  49473. _e.initAttributes();
  49474. var n = be.get(e);
  49475. e.hasPositions && !n.position && (n.position = X.createBuffer()),
  49476. e.hasNormals && !n.normal && (n.normal = X.createBuffer()),
  49477. e.hasUvs && !n.uv && (n.uv = X.createBuffer()),
  49478. e.hasColors && !n.color && (n.color = X.createBuffer());
  49479. var r = t.getAttributes();
  49480. if (e.hasPositions && (X.bindBuffer(X.ARRAY_BUFFER, n.position),
  49481. X.bufferData(X.ARRAY_BUFFER, e.positionArray, X.DYNAMIC_DRAW),
  49482. _e.enableAttribute(r.position),
  49483. X.vertexAttribPointer(r.position, 3, X.FLOAT, !1, 0, 0)),
  49484. e.hasNormals) {
  49485. if (X.bindBuffer(X.ARRAY_BUFFER, n.normal),
  49486. "MeshPhongMaterial" !== i.type && "MeshStandardMaterial" !== i.type && i.shading === Ci.FlatShading)
  49487. for (var o = 0, a = 3 * e.count; o < a; o += 9) {
  49488. var s = e.normalArray
  49489. , l = (s[o + 0] + s[o + 3] + s[o + 6]) / 3
  49490. , c = (s[o + 1] + s[o + 4] + s[o + 7]) / 3
  49491. , h = (s[o + 2] + s[o + 5] + s[o + 8]) / 3;
  49492. s[o + 0] = l,
  49493. s[o + 1] = c,
  49494. s[o + 2] = h,
  49495. s[o + 3] = l,
  49496. s[o + 4] = c,
  49497. s[o + 5] = h,
  49498. s[o + 6] = l,
  49499. s[o + 7] = c,
  49500. s[o + 8] = h
  49501. }
  49502. X.bufferData(X.ARRAY_BUFFER, e.normalArray, X.DYNAMIC_DRAW),
  49503. _e.enableAttribute(r.normal),
  49504. X.vertexAttribPointer(r.normal, 3, X.FLOAT, !1, 0, 0)
  49505. }
  49506. e.hasUvs && i.map && (X.bindBuffer(X.ARRAY_BUFFER, n.uv),
  49507. X.bufferData(X.ARRAY_BUFFER, e.uvArray, X.DYNAMIC_DRAW),
  49508. _e.enableAttribute(r.uv),
  49509. X.vertexAttribPointer(r.uv, 2, X.FLOAT, !1, 0, 0)),
  49510. e.hasColors && i.vertexColors !== Ci.NoColors && (X.bindBuffer(X.ARRAY_BUFFER, n.color),
  49511. X.bufferData(X.ARRAY_BUFFER, e.colorArray, X.DYNAMIC_DRAW),
  49512. _e.enableAttribute(r.color),
  49513. X.vertexAttribPointer(r.color, 3, X.FLOAT, !1, 0, 0)),
  49514. _e.disableUnusedAttributes(),
  49515. X.drawArrays(X.TRIANGLES, 0, e.count),
  49516. e.count = 0
  49517. }
  49518. ,
  49519. this.renderBufferDirect = function(e, t, i, n, r, o) {
  49520. R(n);
  49521. var a = P(e, t, n, r)
  49522. , s = !1
  49523. , l = i.id + "_" + a.id + "_" + n.wireframe;
  49524. l !== ee && (ee = l,
  49525. s = !0);
  49526. var c = r.morphTargetInfluences;
  49527. if (void 0 !== c) {
  49528. for (var h = [], u = 0, d = c.length; u < d; u++) {
  49529. var p = c[u];
  49530. h.push([p, u])
  49531. }
  49532. h.sort(M),
  49533. 8 < h.length && (h.length = 8);
  49534. var f = i.morphAttributes;
  49535. for (u = 0,
  49536. d = h.length; u < d; u++) {
  49537. p = h[u];
  49538. if (j[u] = p[0],
  49539. 0 !== p[0]) {
  49540. var g = p[1];
  49541. !0 === n.morphTargets && f.position && i.addAttribute("morphTarget" + u, f.position[g]),
  49542. !0 === n.morphNormals && f.normal && i.addAttribute("morphNormal" + u, f.normal[g])
  49543. } else
  49544. !0 === n.morphTargets && i.removeAttribute("morphTarget" + u),
  49545. !0 === n.morphNormals && i.removeAttribute("morphNormal" + u)
  49546. }
  49547. var m = a.getUniforms();
  49548. null !== m.morphTargetInfluences && X.uniform1fv(m.morphTargetInfluences, j),
  49549. s = !0
  49550. }
  49551. g = i.index;
  49552. var v, y = i.attributes.position;
  49553. !0 === n.wireframe && (g = we.getWireframeAttribute(i)),
  49554. null !== g ? (v = Me).setIndex(g) : v = Se,
  49555. s && (function(e, t, i, n) {
  49556. var r;
  49557. if (i instanceof Ci.InstancedBufferGeometry && null === (r = Ie.get("ANGLE_instanced_arrays")))
  49558. console.error("THREE.WebGLRenderer.setupVertexAttributes: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");
  49559. else {
  49560. void 0 === n && (n = 0),
  49561. _e.initAttributes();
  49562. var o = i.attributes
  49563. , a = t.getAttributes()
  49564. , s = e.defaultAttributeValues;
  49565. for (var l in a) {
  49566. var c = a[l];
  49567. if (0 <= c) {
  49568. var h = o[l];
  49569. if (void 0 !== h) {
  49570. var u = h.itemSize
  49571. , d = we.getAttributeBuffer(h);
  49572. if (h instanceof Ci.InterleavedBufferAttribute) {
  49573. var p = h.data
  49574. , f = p.stride
  49575. , g = h.offset;
  49576. p instanceof Ci.InstancedInterleavedBuffer ? (_e.enableAttributeAndDivisor(c, p.meshPerAttribute, r),
  49577. void 0 === i.maxInstancedCount && (i.maxInstancedCount = p.meshPerAttribute * p.count)) : _e.enableAttribute(c),
  49578. X.bindBuffer(X.ARRAY_BUFFER, d),
  49579. X.vertexAttribPointer(c, u, X.FLOAT, !1, f * p.array.BYTES_PER_ELEMENT, (n * f + g) * p.array.BYTES_PER_ELEMENT)
  49580. } else
  49581. h instanceof Ci.InstancedBufferAttribute ? (_e.enableAttributeAndDivisor(c, h.meshPerAttribute, r),
  49582. void 0 === i.maxInstancedCount && (i.maxInstancedCount = h.meshPerAttribute * h.count)) : _e.enableAttribute(c),
  49583. X.bindBuffer(X.ARRAY_BUFFER, d),
  49584. X.vertexAttribPointer(c, u, X.FLOAT, !1, 0, n * u * 4)
  49585. } else if (void 0 !== s) {
  49586. var m = s[l];
  49587. if (void 0 !== m)
  49588. switch (m.length) {
  49589. case 2:
  49590. X.vertexAttrib2fv(c, m);
  49591. break;
  49592. case 3:
  49593. X.vertexAttrib3fv(c, m);
  49594. break;
  49595. case 4:
  49596. X.vertexAttrib4fv(c, m);
  49597. break;
  49598. default:
  49599. X.vertexAttrib1fv(c, m)
  49600. }
  49601. }
  49602. }
  49603. }
  49604. _e.disableUnusedAttributes()
  49605. }
  49606. }(n, a, i),
  49607. null !== g && X.bindBuffer(X.ELEMENT_ARRAY_BUFFER, we.getAttributeBuffer(g)));
  49608. var A = 1 / 0;
  49609. null !== g ? A = g.count : void 0 !== y && (A = y.count);
  49610. var C = i.drawRange.start
  49611. , I = i.drawRange.count
  49612. , E = null !== o ? o.start : 0
  49613. , _ = null !== o ? o.count : 1 / 0
  49614. , b = Math.max(0, C, E)
  49615. , w = Math.min(0 + A, C + I, E + _) - 1
  49616. , T = Math.max(0, w - b + 1);
  49617. if (r instanceof Ci.Mesh)
  49618. if (!0 === n.wireframe)
  49619. _e.setLineWidth(n.wireframeLinewidth * S()),
  49620. v.setMode(X.LINES);
  49621. else
  49622. switch (r.drawMode) {
  49623. case Ci.TrianglesDrawMode:
  49624. v.setMode(X.TRIANGLES);
  49625. break;
  49626. case Ci.TriangleStripDrawMode:
  49627. v.setMode(X.TRIANGLE_STRIP);
  49628. break;
  49629. case Ci.TriangleFanDrawMode:
  49630. v.setMode(X.TRIANGLE_FAN)
  49631. }
  49632. else if (r instanceof Ci.Line) {
  49633. var x = n.linewidth;
  49634. void 0 === x && (x = 1),
  49635. _e.setLineWidth(x * S()),
  49636. r instanceof Ci.LineSegments ? v.setMode(X.LINES) : v.setMode(X.LINE_STRIP)
  49637. } else
  49638. r instanceof Ci.Points && v.setMode(X.POINTS);
  49639. i instanceof Ci.InstancedBufferGeometry ? 0 < i.maxInstancedCount && v.renderInstances(i, b, T) : v.render(b, T)
  49640. }
  49641. ,
  49642. this.render = function(e, t, i, n) {
  49643. if (t instanceof Ci.Camera != 0) {
  49644. var r = e.fog;
  49645. if (ee = "",
  49646. $ = -1,
  49647. !(te = null) === e.autoUpdate && e.updateMatrixWorld(),
  49648. null === t.parent && t.updateMatrixWorld(),
  49649. t.matrixWorldInverse.getInverse(t.matrixWorld),
  49650. ge.multiplyMatrices(t.projectionMatrix, t.matrixWorldInverse),
  49651. fe.setFromMatrix(ge),
  49652. U.length = 0,
  49653. W = z = -1,
  49654. Y.length = 0,
  49655. q.length = 0,
  49656. function e(t, i) {
  49657. if (!1 !== t.visible) {
  49658. if (t.layers.test(i.layers))
  49659. if (t instanceof Ci.Light)
  49660. U.push(t);
  49661. else if (t instanceof Ci.Sprite)
  49662. !1 !== t.frustumCulled && !0 !== fe.intersectsObject(t) || Y.push(t);
  49663. else if (t instanceof Ci.LensFlare)
  49664. q.push(t);
  49665. else if (t instanceof Ci.ImmediateRenderObject)
  49666. !0 === Z.sortObjects && (me.setFromMatrixPosition(t.matrixWorld),
  49667. me.applyProjection(ge)),
  49668. d(t, null, t.material, me.z, null);
  49669. else if ((t instanceof Ci.Mesh || t instanceof Ci.Line || t instanceof Ci.Points) && (t instanceof Ci.SkinnedMesh && t.skeleton.update(),
  49670. !1 === t.frustumCulled || !0 === fe.intersectsObject(t))) {
  49671. var n = t.material;
  49672. if (!0 === n.visible) {
  49673. !0 === Z.sortObjects && (me.setFromMatrixPosition(t.matrixWorld),
  49674. me.applyProjection(ge));
  49675. var r = we.update(t);
  49676. if (n instanceof Ci.MultiMaterial)
  49677. for (var o = r.groups, a = n.materials, s = 0, l = o.length; s < l; s++) {
  49678. var c = o[s]
  49679. , h = a[c.materialIndex];
  49680. !0 === h.visible && d(t, r, h, me.z, c)
  49681. }
  49682. else
  49683. d(t, r, n, me.z, null)
  49684. }
  49685. }
  49686. var u = t.children;
  49687. for (s = 0,
  49688. l = u.length; s < l; s++)
  49689. e(u[s], i)
  49690. }
  49691. }(e, t),
  49692. H.length = z + 1,
  49693. G.length = W + 1,
  49694. !0 === Z.sortObjects && (H.sort(s),
  49695. G.sort(l)),
  49696. function(e, t) {
  49697. 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;
  49698. for (i = ve.shadowsPointLight = 0,
  49699. n = e.length; i < n; i++)
  49700. if (o = (r = e[i]).color,
  49701. a = r.intensity,
  49702. s = r.distance,
  49703. r instanceof Ci.AmbientLight)
  49704. l += o.r * a,
  49705. c += o.g * a,
  49706. h += o.b * a;
  49707. else if (r instanceof Ci.DirectionalLight) {
  49708. (v = xe.get(r)).color.copy(r.color).multiplyScalar(r.intensity),
  49709. v.direction.setFromMatrixPosition(r.matrixWorld),
  49710. me.setFromMatrixPosition(r.target.matrixWorld),
  49711. v.direction.sub(me),
  49712. v.direction.transformDirection(u),
  49713. v.shadow = r.castShadow,
  49714. r.castShadow && (v.shadowBias = r.shadow.bias,
  49715. v.shadowRadius = r.shadow.radius,
  49716. v.shadowMapSize = r.shadow.mapSize,
  49717. ve.shadows[m++] = r),
  49718. ve.directionalShadowMap[d] = r.shadow.map,
  49719. ve.directionalShadowMatrix[d] = r.shadow.matrix,
  49720. ve.directional[d++] = v
  49721. } else if (r instanceof Ci.SpotLight) {
  49722. (v = xe.get(r)).position.setFromMatrixPosition(r.matrixWorld),
  49723. v.position.applyMatrix4(u),
  49724. v.color.copy(o).multiplyScalar(a),
  49725. v.distance = s,
  49726. v.direction.setFromMatrixPosition(r.matrixWorld),
  49727. me.setFromMatrixPosition(r.target.matrixWorld),
  49728. v.direction.sub(me),
  49729. v.direction.transformDirection(u),
  49730. v.coneCos = Math.cos(r.angle),
  49731. v.penumbraCos = Math.cos(r.angle * (1 - r.penumbra)),
  49732. v.decay = 0 === r.distance ? 0 : r.decay,
  49733. v.shadow = r.castShadow,
  49734. r.castShadow && (v.shadowBias = r.shadow.bias,
  49735. v.shadowRadius = r.shadow.radius,
  49736. v.shadowMapSize = r.shadow.mapSize,
  49737. ve.shadows[m++] = r),
  49738. ve.spotShadowMap[f] = r.shadow.map,
  49739. ve.spotShadowMatrix[f] = r.shadow.matrix,
  49740. ve.spot[f++] = v
  49741. } else if (r instanceof Ci.PointLight) {
  49742. (v = xe.get(r)).position.setFromMatrixPosition(r.matrixWorld),
  49743. v.position.applyMatrix4(u),
  49744. v.color.copy(r.color).multiplyScalar(r.intensity),
  49745. v.distance = r.distance,
  49746. v.decay = 0 === r.distance ? 0 : r.decay,
  49747. v.shadow = r.castShadow,
  49748. r.castShadow && (v.shadowBias = r.shadow.bias,
  49749. v.shadowRadius = r.shadow.radius,
  49750. v.shadowMapSize = r.shadow.mapSize,
  49751. ve.shadows[m++] = r),
  49752. ve.pointShadowMap[p] = r.shadow.map,
  49753. void 0 === ve.pointShadowMatrix[p] && (ve.pointShadowMatrix[p] = new Ci.Matrix4),
  49754. me.setFromMatrixPosition(r.matrixWorld).negate(),
  49755. ve.pointShadowMatrix[p].identity().setPosition(me),
  49756. ve.point[p++] = v
  49757. } else if (r instanceof Ci.HemisphereLight) {
  49758. var v;
  49759. (v = xe.get(r)).direction.setFromMatrixPosition(r.matrixWorld),
  49760. v.direction.transformDirection(u),
  49761. v.direction.normalize(),
  49762. v.skyColor.copy(r.color).multiplyScalar(a),
  49763. v.groundColor.copy(r.groundColor).multiplyScalar(a),
  49764. ve.hemi[g++] = v
  49765. }
  49766. ve.ambient[0] = l,
  49767. ve.ambient[1] = c,
  49768. ve.ambient[2] = h,
  49769. ve.directional.length = d,
  49770. ve.spot.length = f,
  49771. ve.point.length = p,
  49772. ve.hemi.length = g,
  49773. ve.shadows.length = m,
  49774. ve.hash = d + "," + p + "," + f + "," + g + "," + m
  49775. }(U, t),
  49776. Re.render(e, t),
  49777. Ae.calls = 0,
  49778. Ae.vertices = 0,
  49779. Ae.faces = 0,
  49780. void (Ae.points = 0) === i && (i = null),
  49781. this.setRenderTarget(i),
  49782. (this.autoClear || n) && this.clear(this.autoClearColor, this.autoClearDepth, this.autoClearStencil),
  49783. e.overrideMaterial) {
  49784. var o = e.overrideMaterial;
  49785. c(H, t, r, o),
  49786. c(G, t, r, o)
  49787. } else
  49788. _e.setBlending(Ci.NoBlending),
  49789. c(H, t, r),
  49790. c(G, t, r);
  49791. if (Oe.render(e, t),
  49792. Le.render(e, t, re),
  49793. i) {
  49794. var a = i.texture;
  49795. a.generateMipmaps && E(i) && a.minFilter !== Ci.NearestFilter && a.minFilter !== Ci.LinearFilter && function(e) {
  49796. var t = e instanceof Ci.WebGLRenderTargetCube ? X.TEXTURE_CUBE_MAP : X.TEXTURE_2D
  49797. , i = be.get(e.texture).__webglTexture;
  49798. _e.bindTexture(t, i),
  49799. X.generateMipmap(t),
  49800. _e.bindTexture(t, null)
  49801. }(i)
  49802. }
  49803. _e.setDepthTest(!0),
  49804. _e.setDepthWrite(!0),
  49805. _e.setColorWrite(!0)
  49806. } else
  49807. console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.")
  49808. }
  49809. ,
  49810. this.setFaceCulling = function(e, t) {
  49811. e === Ci.CullFaceNone ? _e.disable(X.CULL_FACE) : (t === Ci.FrontFaceDirectionCW ? X.frontFace(X.CW) : X.frontFace(X.CCW),
  49812. e === Ci.CullFaceBack ? X.cullFace(X.BACK) : e === Ci.CullFaceFront ? X.cullFace(X.FRONT) : X.cullFace(X.FRONT_AND_BACK),
  49813. _e.enable(X.CULL_FACE))
  49814. }
  49815. ,
  49816. this.setTexture = function(e, t) {
  49817. var i = be.get(e);
  49818. if (0 < e.version && i.__version !== e.version) {
  49819. var n = e.image;
  49820. 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)
  49821. }
  49822. _e.activeTexture(X.TEXTURE0 + t),
  49823. _e.bindTexture(X.TEXTURE_2D, i.__webglTexture)
  49824. }
  49825. ,
  49826. this.getCurrentRenderTarget = function() {
  49827. return Q
  49828. }
  49829. ,
  49830. this.setRenderTarget = function(e) {
  49831. (Q = e) && void 0 === be.get(e).__webglFramebuffer && w(e);
  49832. var t, i = e instanceof Ci.WebGLRenderTargetCube;
  49833. if (e) {
  49834. var n = be.get(e);
  49835. t = i ? n.__webglFramebuffer[e.activeCubeFace] : n.__webglFramebuffer,
  49836. ie.copy(e.scissor),
  49837. ne = e.scissorTest,
  49838. re.copy(e.viewport)
  49839. } else
  49840. t = null,
  49841. ie.copy(ue).multiplyScalar(he),
  49842. ne = de,
  49843. re.copy(pe).multiplyScalar(he);
  49844. if (J !== t && (X.bindFramebuffer(X.FRAMEBUFFER, t),
  49845. J = t),
  49846. _e.scissor(ie),
  49847. _e.setScissorTest(ne),
  49848. _e.viewport(re),
  49849. i) {
  49850. var r = be.get(e.texture);
  49851. X.framebufferTexture2D(X.FRAMEBUFFER, X.COLOR_ATTACHMENT0, X.TEXTURE_CUBE_MAP_POSITIVE_X + e.activeCubeFace, r.__webglTexture, e.activeMipMapLevel)
  49852. }
  49853. }
  49854. ,
  49855. this.readRenderTargetPixels = function(e, t, i, n, r, o) {
  49856. if (e instanceof Ci.WebGLRenderTarget != 0) {
  49857. var a = be.get(e).__webglFramebuffer;
  49858. if (a) {
  49859. var s = !1;
  49860. a !== J && (X.bindFramebuffer(X.FRAMEBUFFER, a),
  49861. s = !0);
  49862. try {
  49863. var l = e.texture;
  49864. if (l.format !== Ci.RGBAFormat && x(l.format) !== X.getParameter(X.IMPLEMENTATION_COLOR_READ_FORMAT))
  49865. return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");
  49866. 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")))
  49867. return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");
  49868. 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.")
  49869. } finally {
  49870. s && X.bindFramebuffer(X.FRAMEBUFFER, J)
  49871. }
  49872. }
  49873. } else
  49874. console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.")
  49875. }
  49876. }
  49877. ,
  49878. Ci.WebGLRenderTarget = function(e, t, i) {
  49879. this.uuid = Ci.Math.generateUUID(),
  49880. this.width = e,
  49881. this.height = t,
  49882. this.scissor = new Ci.Vector4(0,0,e,t),
  49883. this.scissorTest = !1,
  49884. this.viewport = new Ci.Vector4(0,0,e,t),
  49885. void 0 === (i = i || {}).minFilter && (i.minFilter = Ci.LinearFilter),
  49886. this.texture = new Ci.Texture(void 0,void 0,i.wrapS,i.wrapT,i.magFilter,i.minFilter,i.format,i.type,i.anisotropy),
  49887. this.depthBuffer = void 0 === i.depthBuffer || i.depthBuffer,
  49888. this.stencilBuffer = void 0 === i.stencilBuffer || i.stencilBuffer
  49889. }
  49890. ,
  49891. Ci.WebGLRenderTarget.prototype = {
  49892. constructor: Ci.WebGLRenderTarget,
  49893. setSize: function(e, t) {
  49894. this.width === e && this.height === t || (this.width = e,
  49895. this.height = t,
  49896. this.dispose()),
  49897. this.viewport.set(0, 0, e, t),
  49898. this.scissor.set(0, 0, e, t)
  49899. },
  49900. clone: function() {
  49901. return (new this.constructor).copy(this)
  49902. },
  49903. copy: function(e) {
  49904. return this.width = e.width,
  49905. this.height = e.height,
  49906. this.viewport.copy(e.viewport),
  49907. this.texture = e.texture.clone(),
  49908. this.depthBuffer = e.depthBuffer,
  49909. this.stencilBuffer = e.stencilBuffer,
  49910. this
  49911. },
  49912. dispose: function() {
  49913. this.dispatchEvent({
  49914. type: "dispose"
  49915. })
  49916. }
  49917. },
  49918. Ci.EventDispatcher.prototype.apply(Ci.WebGLRenderTarget.prototype),
  49919. Ci.WebGLRenderTargetCube = function(e, t, i) {
  49920. Ci.WebGLRenderTarget.call(this, e, t, i),
  49921. this.activeCubeFace = 0,
  49922. this.activeMipMapLevel = 0
  49923. }
  49924. ,
  49925. Ci.WebGLRenderTargetCube.prototype = Object.create(Ci.WebGLRenderTarget.prototype),
  49926. Ci.WebGLRenderTargetCube.prototype.constructor = Ci.WebGLRenderTargetCube,
  49927. Ci.WebGLBufferRenderer = function(r, o, a) {
  49928. var s;
  49929. this.setMode = function(e) {
  49930. s = e
  49931. }
  49932. ,
  49933. this.render = function(e, t) {
  49934. r.drawArrays(s, e, t),
  49935. a.calls++,
  49936. a.vertices += t,
  49937. s === r.TRIANGLES && (a.faces += t / 3)
  49938. }
  49939. ,
  49940. this.renderInstances = function(e) {
  49941. var t = o.get("ANGLE_instanced_arrays");
  49942. if (null !== t) {
  49943. var i = e.attributes.position
  49944. , n = 0;
  49945. n = i instanceof Ci.InterleavedBufferAttribute ? i.data.count : i.count,
  49946. t.drawArraysInstancedANGLE(s, 0, n, e.maxInstancedCount),
  49947. a.calls++,
  49948. a.vertices += n * e.maxInstancedCount,
  49949. s === r.TRIANGLES && (a.faces += e.maxInstancedCount * n / 3)
  49950. } else
  49951. console.error("THREE.WebGLBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.")
  49952. }
  49953. }
  49954. ,
  49955. Ci.WebGLIndexedBufferRenderer = function(r, o, a) {
  49956. var s, l, c;
  49957. this.setMode = function(e) {
  49958. s = e
  49959. }
  49960. ,
  49961. this.setIndex = function(e) {
  49962. c = e.array instanceof Uint32Array && o.get("OES_element_index_uint") ? (l = r.UNSIGNED_INT,
  49963. 4) : (l = r.UNSIGNED_SHORT,
  49964. 2)
  49965. }
  49966. ,
  49967. this.render = function(e, t) {
  49968. r.drawElements(s, t, l, e * c),
  49969. a.calls++,
  49970. a.vertices += t,
  49971. s === r.TRIANGLES && (a.faces += t / 3)
  49972. }
  49973. ,
  49974. this.renderInstances = function(e, t, i) {
  49975. var n = o.get("ANGLE_instanced_arrays");
  49976. 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),
  49977. a.calls++,
  49978. a.vertices += i * e.maxInstancedCount,
  49979. void (s === r.TRIANGLES && (a.faces += e.maxInstancedCount * i / 3)))
  49980. }
  49981. }
  49982. ,
  49983. Ci.WebGLExtensions = function(i) {
  49984. var n = {};
  49985. this.get = function(e) {
  49986. if (void 0 !== n[e])
  49987. return n[e];
  49988. var t;
  49989. switch (e) {
  49990. case "EXT_texture_filter_anisotropic":
  49991. t = i.getExtension("EXT_texture_filter_anisotropic") || i.getExtension("MOZ_EXT_texture_filter_anisotropic") || i.getExtension("WEBKIT_EXT_texture_filter_anisotropic");
  49992. break;
  49993. case "WEBGL_compressed_texture_s3tc":
  49994. t = i.getExtension("WEBGL_compressed_texture_s3tc") || i.getExtension("MOZ_WEBGL_compressed_texture_s3tc") || i.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc");
  49995. break;
  49996. case "WEBGL_compressed_texture_pvrtc":
  49997. t = i.getExtension("WEBGL_compressed_texture_pvrtc") || i.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc");
  49998. break;
  49999. case "WEBGL_compressed_texture_etc1":
  50000. t = i.getExtension("WEBGL_compressed_texture_etc1");
  50001. break;
  50002. default:
  50003. t = i.getExtension(e)
  50004. }
  50005. return null === t && console.warn("THREE.WebGLRenderer: " + e + " extension not supported."),
  50006. n[e] = t
  50007. }
  50008. }
  50009. ,
  50010. Ci.WebGLCapabilities = function(t, e, i) {
  50011. function n(e) {
  50012. if ("highp" === e) {
  50013. if (0 < t.getShaderPrecisionFormat(t.VERTEX_SHADER, t.HIGH_FLOAT).precision && 0 < t.getShaderPrecisionFormat(t.FRAGMENT_SHADER, t.HIGH_FLOAT).precision)
  50014. return "highp";
  50015. e = "mediump"
  50016. }
  50017. 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"
  50018. }
  50019. this.getMaxPrecision = n,
  50020. this.precision = void 0 !== i.precision ? i.precision : "highp",
  50021. this.logarithmicDepthBuffer = void 0 !== i.logarithmicDepthBuffer && i.logarithmicDepthBuffer,
  50022. this.maxTextures = t.getParameter(t.MAX_TEXTURE_IMAGE_UNITS),
  50023. this.maxVertexTextures = t.getParameter(t.MAX_VERTEX_TEXTURE_IMAGE_UNITS),
  50024. this.maxTextureSize = t.getParameter(t.MAX_TEXTURE_SIZE),
  50025. this.maxCubemapSize = t.getParameter(t.MAX_CUBE_MAP_TEXTURE_SIZE),
  50026. this.maxAttributes = t.getParameter(t.MAX_VERTEX_ATTRIBS),
  50027. this.maxVertexUniforms = t.getParameter(t.MAX_VERTEX_UNIFORM_VECTORS),
  50028. this.maxVaryings = t.getParameter(t.MAX_VARYING_VECTORS),
  50029. this.maxFragmentUniforms = t.getParameter(t.MAX_FRAGMENT_UNIFORM_VECTORS),
  50030. this.vertexTextures = 0 < this.maxVertexTextures,
  50031. this.floatFragmentTextures = !!e.get("OES_texture_float"),
  50032. this.floatVertexTextures = this.vertexTextures && this.floatFragmentTextures;
  50033. var r = n(this.precision);
  50034. r !== this.precision && (console.warn("THREE.WebGLRenderer:", this.precision, "not supported, using", r, "instead."),
  50035. this.precision = r),
  50036. this.logarithmicDepthBuffer && (this.logarithmicDepthBuffer = !!e.get("EXT_frag_depth"))
  50037. }
  50038. ,
  50039. Ci.WebGLGeometries = function(i, o, a) {
  50040. function s(e) {
  50041. var t = e.target
  50042. , i = c[t.id];
  50043. null !== i.index && l(i.index),
  50044. function(e) {
  50045. for (var t in e)
  50046. l(e[t])
  50047. }(i.attributes),
  50048. t.removeEventListener("dispose", s),
  50049. delete c[t.id];
  50050. var n = o.get(t);
  50051. n.wireframe && l(n.wireframe),
  50052. o.delete(t);
  50053. var r = o.get(i);
  50054. r.wireframe && l(r.wireframe),
  50055. o.delete(i),
  50056. a.memory.geometries--
  50057. }
  50058. function l(e) {
  50059. var t = function(e) {
  50060. return e instanceof Ci.InterleavedBufferAttribute ? o.get(e.data).__webglBuffer : o.get(e).__webglBuffer
  50061. }(e);
  50062. void 0 !== t && (i.deleteBuffer(t),
  50063. function(e) {
  50064. e instanceof Ci.InterleavedBufferAttribute ? o.delete(e.data) : o.delete(e)
  50065. }(e))
  50066. }
  50067. var c = {};
  50068. this.get = function(e) {
  50069. var t, i = e.geometry;
  50070. return void 0 !== c[i.id] ? c[i.id] : (i.addEventListener("dispose", s),
  50071. i instanceof Ci.BufferGeometry ? t = i : i instanceof Ci.Geometry && (void 0 === i._bufferGeometry && (i._bufferGeometry = (new Ci.BufferGeometry).setFromObject(e)),
  50072. t = i._bufferGeometry),
  50073. c[i.id] = t,
  50074. a.memory.geometries++,
  50075. t)
  50076. }
  50077. }
  50078. ,
  50079. Ci.WebGLLights = function() {
  50080. var i = {};
  50081. this.get = function(e) {
  50082. if (void 0 !== i[e.id])
  50083. return i[e.id];
  50084. var t;
  50085. switch (e.type) {
  50086. case "DirectionalLight":
  50087. t = {
  50088. direction: new Ci.Vector3,
  50089. color: new Ci.Color,
  50090. shadow: !1,
  50091. shadowBias: 0,
  50092. shadowRadius: 1,
  50093. shadowMapSize: new Ci.Vector2
  50094. };
  50095. break;
  50096. case "SpotLight":
  50097. t = {
  50098. position: new Ci.Vector3,
  50099. direction: new Ci.Vector3,
  50100. color: new Ci.Color,
  50101. distance: 0,
  50102. coneCos: 0,
  50103. penumbraCos: 0,
  50104. decay: 0,
  50105. shadow: !1,
  50106. shadowBias: 0,
  50107. shadowRadius: 1,
  50108. shadowMapSize: new Ci.Vector2
  50109. };
  50110. break;
  50111. case "PointLight":
  50112. t = {
  50113. position: new Ci.Vector3,
  50114. color: new Ci.Color,
  50115. distance: 0,
  50116. decay: 0,
  50117. shadow: !1,
  50118. shadowBias: 0,
  50119. shadowRadius: 1,
  50120. shadowMapSize: new Ci.Vector2
  50121. };
  50122. break;
  50123. case "HemisphereLight":
  50124. t = {
  50125. direction: new Ci.Vector3,
  50126. skyColor: new Ci.Color,
  50127. groundColor: new Ci.Color
  50128. }
  50129. }
  50130. return i[e.id] = t
  50131. }
  50132. }
  50133. ,
  50134. Ci.WebGLObjects = function(g, m, e) {
  50135. function v(e, t) {
  50136. var i = e instanceof Ci.InterleavedBufferAttribute ? e.data : e
  50137. , n = m.get(i);
  50138. void 0 === n.__webglBuffer ? function(e, t, i) {
  50139. e.__webglBuffer = g.createBuffer(),
  50140. g.bindBuffer(i, e.__webglBuffer);
  50141. var n = t.dynamic ? g.DYNAMIC_DRAW : g.STATIC_DRAW;
  50142. g.bufferData(i, t.array, n),
  50143. e.version = t.version
  50144. }(n, i, t) : n.version !== i.version && function(e, t, i) {
  50145. g.bindBuffer(i, e.__webglBuffer),
  50146. !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)),
  50147. t.updateRange.count = 0),
  50148. e.version = t.version
  50149. }(n, i, t)
  50150. }
  50151. function y(e, t, i) {
  50152. if (i < t) {
  50153. var n = t;
  50154. t = i,
  50155. i = n
  50156. }
  50157. var r = e[t];
  50158. return void 0 === r ? (e[t] = [i],
  50159. !0) : -1 === r.indexOf(i) && (r.push(i),
  50160. !0)
  50161. }
  50162. var c = new Ci.WebGLGeometries(g,m,e);
  50163. this.getAttributeBuffer = function(e) {
  50164. return e instanceof Ci.InterleavedBufferAttribute ? m.get(e.data).__webglBuffer : m.get(e).__webglBuffer
  50165. }
  50166. ,
  50167. this.getWireframeAttribute = function(e) {
  50168. var t = m.get(e);
  50169. if (void 0 !== t.wireframe)
  50170. return t.wireframe;
  50171. var i, n = [], r = e.index, o = e.attributes, a = o.position;
  50172. if (null !== r)
  50173. for (var s = {}, l = 0, c = (i = r.array).length; l < c; l += 3) {
  50174. var h = i[l + 0]
  50175. , u = i[l + 1]
  50176. , d = i[l + 2];
  50177. y(s, h, u) && n.push(h, u),
  50178. y(s, u, d) && n.push(u, d),
  50179. y(s, d, h) && n.push(d, h)
  50180. }
  50181. else
  50182. for (l = 0,
  50183. c = (i = o.position.array).length / 3 - 1; l < c; l += 3) {
  50184. h = l + 0,
  50185. u = l + 1,
  50186. d = l + 2;
  50187. n.push(h, u, u, d, d, h)
  50188. }
  50189. var p = 65535 < a.count ? Uint32Array : Uint16Array
  50190. , f = new Ci.BufferAttribute(new p(n),1);
  50191. return v(f, g.ELEMENT_ARRAY_BUFFER),
  50192. t.wireframe = f
  50193. }
  50194. ,
  50195. this.update = function(e) {
  50196. var t = c.get(e);
  50197. e.geometry instanceof Ci.Geometry && t.updateFromObject(e);
  50198. var i = t.index
  50199. , n = t.attributes;
  50200. for (var r in null !== i && v(i, g.ELEMENT_ARRAY_BUFFER),
  50201. n)
  50202. v(n[r], g.ARRAY_BUFFER);
  50203. var o = t.morphAttributes;
  50204. for (var r in o)
  50205. for (var a = o[r], s = 0, l = a.length; s < l; s++)
  50206. v(a[s], g.ARRAY_BUFFER);
  50207. return t
  50208. }
  50209. }
  50210. ,
  50211. Ci.WebGLProgram = (Qt = 0,
  50212. Jt = /^([\w\d_]+)\.([\w\d_]+)$/,
  50213. $t = /^([\w\d_]+)\[(\d+)\]\.([\w\d_]+)$/,
  50214. ei = /^([\w\d_]+)\[0\]$/,
  50215. function(e, t, i, n) {
  50216. var r = e.context
  50217. , o = i.extensions
  50218. , a = i.defines
  50219. , s = i.__webglShader.vertexShader
  50220. , l = i.__webglShader.fragmentShader
  50221. , c = "SHADOWMAP_TYPE_BASIC";
  50222. n.shadowMapType === Ci.PCFShadowMap ? c = "SHADOWMAP_TYPE_PCF" : n.shadowMapType === Ci.PCFSoftShadowMap && (c = "SHADOWMAP_TYPE_PCF_SOFT");
  50223. var h = "ENVMAP_TYPE_CUBE"
  50224. , u = "ENVMAP_MODE_REFLECTION"
  50225. , d = "ENVMAP_BLENDING_MULTIPLY";
  50226. if (n.envMap) {
  50227. switch (i.envMap.mapping) {
  50228. case Ci.CubeReflectionMapping:
  50229. case Ci.CubeRefractionMapping:
  50230. h = "ENVMAP_TYPE_CUBE";
  50231. break;
  50232. case Ci.CubeUVReflectionMapping:
  50233. case Ci.CubeUVRefractionMapping:
  50234. h = "ENVMAP_TYPE_CUBE_UV";
  50235. break;
  50236. case Ci.EquirectangularReflectionMapping:
  50237. case Ci.EquirectangularRefractionMapping:
  50238. h = "ENVMAP_TYPE_EQUIREC";
  50239. break;
  50240. case Ci.SphericalReflectionMapping:
  50241. h = "ENVMAP_TYPE_SPHERE"
  50242. }
  50243. switch (i.envMap.mapping) {
  50244. case Ci.CubeRefractionMapping:
  50245. case Ci.EquirectangularRefractionMapping:
  50246. u = "ENVMAP_MODE_REFRACTION"
  50247. }
  50248. switch (i.combine) {
  50249. case Ci.MultiplyOperation:
  50250. d = "ENVMAP_BLENDING_MULTIPLY";
  50251. break;
  50252. case Ci.MixOperation:
  50253. d = "ENVMAP_BLENDING_MIX";
  50254. break;
  50255. case Ci.AddOperation:
  50256. d = "ENVMAP_BLENDING_ADD"
  50257. }
  50258. }
  50259. var p, f, g = 0 < e.gammaFactor ? e.gammaFactor : 1, m = function(e, t, i) {
  50260. 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")
  50261. }(o, n, e.extensions), v = function(e) {
  50262. var t = [];
  50263. for (var i in e) {
  50264. var n = e[i];
  50265. !1 !== n && t.push("#define " + i + " " + n)
  50266. }
  50267. return t.join("\n")
  50268. }(a), y = r.createProgram();
  50269. 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"),
  50270. [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) {
  50271. var i;
  50272. switch (t) {
  50273. case Ci.LinearToneMapping:
  50274. i = "Linear";
  50275. break;
  50276. case Ci.ReinhardToneMapping:
  50277. i = "Reinhard";
  50278. break;
  50279. case Ci.Uncharted2ToneMapping:
  50280. i = "Uncharted2";
  50281. break;
  50282. case Ci.CineonToneMapping:
  50283. i = "OptimizedCineon";
  50284. break;
  50285. default:
  50286. throw new Error("unsupported toneMapping: " + t)
  50287. }
  50288. return "vec3 " + e + "( vec3 color ) { return " + i + "ToneMapping( color ); }"
  50289. }("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) {
  50290. var i = Mi(t);
  50291. return "vec4 " + e + "( vec4 value ) { return LinearTo" + i[0] + i[1] + "; }"
  50292. }("linearToOutputTexel", n.outputEncoding) : "", "\n"].filter(Pi).join("\n")),
  50293. s = Oi(s = Li(s), n),
  50294. l = Oi(l = Li(l), n),
  50295. i instanceof Ci.ShaderMaterial == 0 && (s = Di(s),
  50296. l = Di(l));
  50297. var A = p + s
  50298. , C = f + l
  50299. , I = Ci.WebGLShader(r, r.VERTEX_SHADER, A)
  50300. , E = Ci.WebGLShader(r, r.FRAGMENT_SHADER, C);
  50301. r.attachShader(y, I),
  50302. r.attachShader(y, E),
  50303. void 0 !== i.index0AttributeName ? r.bindAttribLocation(y, 0, i.index0AttributeName) : !0 === n.morphTargets && r.bindAttribLocation(y, 0, "position"),
  50304. r.linkProgram(y);
  50305. var _, b, w = r.getProgramInfoLog(y), T = r.getShaderInfoLog(I), x = r.getShaderInfoLog(E), S = !0, M = !0;
  50306. return !1 === r.getProgramParameter(y, r.LINK_STATUS) ? (S = !1,
  50307. 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),
  50308. M && (this.diagnostics = {
  50309. runnable: S,
  50310. material: i,
  50311. programLog: w,
  50312. vertexShader: {
  50313. log: T,
  50314. prefix: p
  50315. },
  50316. fragmentShader: {
  50317. log: x,
  50318. prefix: f
  50319. }
  50320. }),
  50321. r.deleteShader(I),
  50322. r.deleteShader(E),
  50323. this.getUniforms = function() {
  50324. return void 0 === _ && (_ = function(e, t) {
  50325. for (var i = {}, n = e.getProgramParameter(t, e.ACTIVE_UNIFORMS), r = 0; r < n; r++) {
  50326. var o = e.getActiveUniform(t, r).name
  50327. , a = e.getUniformLocation(t, o)
  50328. , s = Jt.exec(o);
  50329. if (s) {
  50330. var l = s[1]
  50331. , c = s[2]
  50332. , h = i[l];
  50333. (h = h || (i[l] = {}))[c] = a
  50334. } else if (s = $t.exec(o)) {
  50335. var u = s[1]
  50336. , d = s[2]
  50337. , p = s[3]
  50338. , f = i[u]
  50339. , g = (f = f || (i[u] = []))[d];
  50340. (g = g || (f[d] = {}))[p] = a
  50341. } else
  50342. (s = ei.exec(o)) ? i[u = s[1]] = a : i[o] = a
  50343. }
  50344. return i
  50345. }(r, y)),
  50346. _
  50347. }
  50348. ,
  50349. this.getAttributes = function() {
  50350. return void 0 === b && (b = function(e, t) {
  50351. for (var i = {}, n = e.getProgramParameter(t, e.ACTIVE_ATTRIBUTES), r = 0; r < n; r++) {
  50352. var o = e.getActiveAttrib(t, r).name;
  50353. i[o] = e.getAttribLocation(t, o)
  50354. }
  50355. return i
  50356. }(r, y)),
  50357. b
  50358. }
  50359. ,
  50360. this.destroy = function() {
  50361. r.deleteProgram(y),
  50362. this.program = void 0
  50363. }
  50364. ,
  50365. Object.defineProperties(this, {
  50366. uniforms: {
  50367. get: function() {
  50368. return console.warn("THREE.WebGLProgram: .uniforms is now .getUniforms()."),
  50369. this.getUniforms()
  50370. }
  50371. },
  50372. attributes: {
  50373. get: function() {
  50374. return console.warn("THREE.WebGLProgram: .attributes is now .getAttributes()."),
  50375. this.getAttributes()
  50376. }
  50377. }
  50378. }),
  50379. this.id = Qt++,
  50380. this.code = t,
  50381. this.usedTimes = 1,
  50382. this.program = y,
  50383. this.vertexShader = I,
  50384. this.fragmentShader = E,
  50385. this
  50386. }
  50387. ),
  50388. Ci.WebGLPrograms = function(s, l) {
  50389. function c(e, t) {
  50390. var i;
  50391. return e ? e instanceof Ci.Texture ? i = e.encoding : e instanceof Ci.WebGLRenderTarget && (i = e.texture.encoding) : i = Ci.LinearEncoding,
  50392. i === Ci.LinearEncoding && t && (i = Ci.GammaEncoding),
  50393. i
  50394. }
  50395. var h = []
  50396. , u = {
  50397. MeshDepthMaterial: "depth",
  50398. MeshNormalMaterial: "normal",
  50399. MeshBasicMaterial: "basic",
  50400. MeshLambertMaterial: "lambert",
  50401. MeshPhongMaterial: "phong",
  50402. MeshStandardMaterial: "standard",
  50403. LineBasicMaterial: "basic",
  50404. LineDashedMaterial: "dashed",
  50405. PointsMaterial: "points"
  50406. }
  50407. , 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"];
  50408. this.getParameters = function(e, t, i, n) {
  50409. var r = u[e.type]
  50410. , o = function(e) {
  50411. if (l.floatVertexTextures && e && e.skeleton && e.skeleton.useVertexTexture)
  50412. return 1024;
  50413. var t = l.maxVertexUniforms
  50414. , i = Math.floor((t - 20) / 4);
  50415. 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)")),
  50416. i
  50417. }(n)
  50418. , a = s.getPrecision();
  50419. return null === e.precision || (a = l.getMaxPrecision(e.precision)) !== e.precision && console.warn("THREE.WebGLProgram.getParameters:", e.precision, "not supported, using", a, "instead."),
  50420. {
  50421. shaderID: r,
  50422. precision: a,
  50423. supportsVertexTextures: l.vertexTextures,
  50424. outputEncoding: c(s.getCurrentRenderTarget(), s.gammaOutput),
  50425. map: !!e.map,
  50426. mapEncoding: c(e.map, s.gammaInput),
  50427. envMap: !!e.envMap,
  50428. envMapMode: e.envMap && e.envMap.mapping,
  50429. envMapEncoding: c(e.envMap, s.gammaInput),
  50430. envMapCubeUV: !!e.envMap && (e.envMap.mapping === Ci.CubeUVReflectionMapping || e.envMap.mapping === Ci.CubeUVRefractionMapping),
  50431. lightMap: !!e.lightMap,
  50432. aoMap: !!e.aoMap,
  50433. emissiveMap: !!e.emissiveMap,
  50434. emissiveMapEncoding: c(e.emissiveMap, s.gammaInput),
  50435. bumpMap: !!e.bumpMap,
  50436. normalMap: !!e.normalMap,
  50437. displacementMap: !!e.displacementMap,
  50438. roughnessMap: !!e.roughnessMap,
  50439. metalnessMap: !!e.metalnessMap,
  50440. specularMap: !!e.specularMap,
  50441. alphaMap: !!e.alphaMap,
  50442. combine: e.combine,
  50443. vertexColors: e.vertexColors,
  50444. fog: i,
  50445. useFog: e.fog,
  50446. fogExp: i instanceof Ci.FogExp2,
  50447. flatShading: e.shading === Ci.FlatShading,
  50448. sizeAttenuation: e.sizeAttenuation,
  50449. logarithmicDepthBuffer: l.logarithmicDepthBuffer,
  50450. skinning: e.skinning,
  50451. maxBones: o,
  50452. useVertexTexture: l.floatVertexTextures && n && n.skeleton && n.skeleton.useVertexTexture,
  50453. morphTargets: e.morphTargets,
  50454. morphNormals: e.morphNormals,
  50455. maxMorphTargets: s.maxMorphTargets,
  50456. maxMorphNormals: s.maxMorphNormals,
  50457. numDirLights: t.directional.length,
  50458. numPointLights: t.point.length,
  50459. numSpotLights: t.spot.length,
  50460. numHemiLights: t.hemi.length,
  50461. pointLightShadows: t.shadowsPointLight,
  50462. shadowMapEnabled: s.shadowMap.enabled && n.receiveShadow && 0 < t.shadows.length,
  50463. shadowMapType: s.shadowMap.type,
  50464. toneMapping: s.toneMapping,
  50465. physicallyCorrectLights: s.physicallyCorrectLights,
  50466. premultipliedAlpha: e.premultipliedAlpha,
  50467. alphaTest: e.alphaTest,
  50468. doubleSided: e.side === Ci.DoubleSide,
  50469. flipSided: e.side === Ci.BackSide
  50470. }
  50471. }
  50472. ,
  50473. this.getProgramCode = function(e, t) {
  50474. var i = [];
  50475. if (t.shaderID ? i.push(t.shaderID) : (i.push(e.fragmentShader),
  50476. i.push(e.vertexShader)),
  50477. void 0 !== e.defines)
  50478. for (var n in e.defines)
  50479. i.push(n),
  50480. i.push(e.defines[n]);
  50481. for (var r = 0; r < a.length; r++) {
  50482. var o = a[r];
  50483. i.push(o),
  50484. i.push(t[o])
  50485. }
  50486. return i.join()
  50487. }
  50488. ,
  50489. this.acquireProgram = function(e, t, i) {
  50490. for (var n, r = 0, o = h.length; r < o; r++) {
  50491. var a = h[r];
  50492. if (a.code === i) {
  50493. ++(n = a).usedTimes;
  50494. break
  50495. }
  50496. }
  50497. return void 0 === n && (n = new Ci.WebGLProgram(s,i,e,t),
  50498. h.push(n)),
  50499. n
  50500. }
  50501. ,
  50502. this.releaseProgram = function(e) {
  50503. if (0 == --e.usedTimes) {
  50504. var t = h.indexOf(e);
  50505. h[t] = h[h.length - 1],
  50506. h.pop(),
  50507. e.destroy()
  50508. }
  50509. }
  50510. ,
  50511. this.programs = h
  50512. }
  50513. ,
  50514. Ci.WebGLProperties = function() {
  50515. var n = {};
  50516. this.get = function(e) {
  50517. var t = e.uuid
  50518. , i = n[t];
  50519. return void 0 === i && (i = {},
  50520. n[t] = i),
  50521. i
  50522. }
  50523. ,
  50524. this.delete = function(e) {
  50525. delete n[e.uuid]
  50526. }
  50527. ,
  50528. this.clear = function() {
  50529. n = {}
  50530. }
  50531. }
  50532. ,
  50533. Ci.WebGLShader = function(e, t, i) {
  50534. var n = e.createShader(t);
  50535. return e.shaderSource(n, i),
  50536. e.compileShader(n),
  50537. !1 === e.getShaderParameter(n, e.COMPILE_STATUS) && console.error("THREE.WebGLShader: Shader couldn't compile."),
  50538. "" !== e.getShaderInfoLog(n) && console.warn("THREE.WebGLShader: gl.getShaderInfoLog()", t === e.VERTEX_SHADER ? "vertex" : "fragment", e.getShaderInfoLog(n), function(e) {
  50539. for (var t = e.split("\n"), i = 0; i < t.length; i++)
  50540. t[i] = i + 1 + ": " + t[i];
  50541. return t.join("\n")
  50542. }(i)),
  50543. n
  50544. }
  50545. ,
  50546. Ci.WebGLShadowMap = function(P, O, L) {
  50547. function D(e, t, i, n) {
  50548. var r = e.geometry
  50549. , o = null
  50550. , a = p
  50551. , s = e.customDepthMaterial;
  50552. if (i && (a = f,
  50553. s = e.customDistanceMaterial),
  50554. s)
  50555. o = s;
  50556. else {
  50557. var l = void 0 !== r.morphTargets && 0 < r.morphTargets.length && t.morphTargets
  50558. , c = e instanceof Ci.SkinnedMesh && t.skinning
  50559. , h = 0;
  50560. l && (h |= u),
  50561. c && (h |= d),
  50562. o = a[h]
  50563. }
  50564. return o.visible = t.visible,
  50565. o.wireframe = t.wireframe,
  50566. o.wireframeLinewidth = t.wireframeLinewidth,
  50567. i && void 0 !== o.uniforms.lightPos && o.uniforms.lightPos.value.copy(n),
  50568. o
  50569. }
  50570. function N(e, t, i) {
  50571. if (!1 !== e.visible) {
  50572. 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)))
  50573. !0 === e.material.visible && (e.modelViewMatrix.multiplyMatrices(i.matrixWorldInverse, e.matrixWorld),
  50574. G.push(e));
  50575. for (var n = e.children, r = 0, o = n.length; r < o; r++)
  50576. N(n[r], t, i)
  50577. }
  50578. }
  50579. 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) {
  50580. var a = 0 != (o & u)
  50581. , s = 0 != (o & d)
  50582. , l = new Ci.ShaderMaterial({
  50583. uniforms: i,
  50584. vertexShader: t.vertexShader,
  50585. fragmentShader: t.fragmentShader,
  50586. morphTargets: a,
  50587. skinning: s
  50588. });
  50589. p[o] = l;
  50590. var c = new Ci.ShaderMaterial({
  50591. defines: {
  50592. USE_SHADOWMAP: ""
  50593. },
  50594. uniforms: r,
  50595. vertexShader: n.vertexShader,
  50596. fragmentShader: n.fragmentShader,
  50597. morphTargets: a,
  50598. skinning: s
  50599. });
  50600. f[o] = c
  50601. }
  50602. var q = this;
  50603. this.enabled = !1,
  50604. this.autoUpdate = !0,
  50605. this.needsUpdate = !1,
  50606. this.type = Ci.PCFShadowMap,
  50607. this.cullFace = Ci.CullFaceFront,
  50608. this.render = function(e, t) {
  50609. var i, n, r = O.shadows;
  50610. if (0 !== r.length && !1 !== q.enabled && (!1 !== q.autoUpdate || !1 !== q.needsUpdate)) {
  50611. B.clearColor(1, 1, 1, 1),
  50612. B.disable(F.BLEND),
  50613. B.enable(F.CULL_FACE),
  50614. F.frontFace(F.CCW),
  50615. F.cullFace(q.cullFace === Ci.CullFaceFront ? F.FRONT : F.BACK),
  50616. B.setDepthTest(!0),
  50617. B.setScissorTest(!1);
  50618. for (var o = 0, a = r.length; o < a; o++) {
  50619. var s = r[o]
  50620. , l = s.shadow
  50621. , c = l.camera;
  50622. if (U.copy(l.mapSize),
  50623. s instanceof Ci.PointLight) {
  50624. i = 6,
  50625. n = !0;
  50626. var h = U.x
  50627. , u = U.y;
  50628. Y[0].set(2 * h, u, h, u),
  50629. Y[1].set(0, u, h, u),
  50630. Y[2].set(3 * h, u, h, u),
  50631. Y[3].set(h, u, h, u),
  50632. Y[4].set(3 * h, 0, h, u),
  50633. Y[5].set(h, 0, h, u),
  50634. U.x *= 4,
  50635. U.y *= 2
  50636. } else
  50637. n = !(i = 1);
  50638. if (null === l.map) {
  50639. var d = {
  50640. minFilter: Ci.NearestFilter,
  50641. magFilter: Ci.NearestFilter,
  50642. format: Ci.RGBAFormat
  50643. };
  50644. l.map = new Ci.WebGLRenderTarget(U.x,U.y,d),
  50645. s instanceof Ci.SpotLight && (c.aspect = U.x / U.y),
  50646. c.updateProjectionMatrix()
  50647. }
  50648. var p = l.map
  50649. , f = l.matrix;
  50650. z.setFromMatrixPosition(s.matrixWorld),
  50651. c.position.copy(z),
  50652. P.setRenderTarget(p),
  50653. P.clear();
  50654. for (var g = 0; g < i; g++) {
  50655. if (n) {
  50656. H.copy(c.position),
  50657. H.add(W[g]),
  50658. c.up.copy(j[g]),
  50659. c.lookAt(H);
  50660. var m = Y[g];
  50661. B.viewport(m)
  50662. } else
  50663. H.setFromMatrixPosition(s.target.matrixWorld),
  50664. c.lookAt(H);
  50665. c.updateMatrixWorld(),
  50666. c.matrixWorldInverse.getInverse(c.matrixWorld),
  50667. f.set(.5, 0, 0, .5, 0, .5, 0, .5, 0, 0, .5, .5, 0, 0, 0, 1),
  50668. f.multiply(c.projectionMatrix),
  50669. f.multiply(c.matrixWorldInverse),
  50670. k.multiplyMatrices(c.projectionMatrix, c.matrixWorldInverse),
  50671. V.setFromMatrix(k),
  50672. G.length = 0,
  50673. N(e, t, c);
  50674. for (var v = 0, y = G.length; v < y; v++) {
  50675. var A = G[v]
  50676. , C = L.update(A)
  50677. , I = A.material;
  50678. if (I instanceof Ci.MultiMaterial)
  50679. for (var E = C.groups, _ = I.materials, b = 0, w = E.length; b < w; b++) {
  50680. var T = E[b]
  50681. , x = _[T.materialIndex];
  50682. if (!0 === x.visible) {
  50683. var S = D(A, x, n, z);
  50684. P.renderBufferDirect(c, null, C, S, A, T)
  50685. }
  50686. }
  50687. else {
  50688. S = D(A, I, n, z);
  50689. P.renderBufferDirect(c, null, C, S, A, null)
  50690. }
  50691. }
  50692. }
  50693. }
  50694. var M = P.getClearColor()
  50695. , R = P.getClearAlpha();
  50696. P.setClearColor(M, R),
  50697. B.enable(F.BLEND),
  50698. q.cullFace === Ci.CullFaceFront && F.cullFace(F.BACK),
  50699. q.needsUpdate = !1
  50700. }
  50701. }
  50702. }
  50703. ,
  50704. Ci.WebGLState = function(l, i, c) {
  50705. var n = this
  50706. , r = new Ci.Vector4
  50707. , o = new Uint8Array(16)
  50708. , a = new Uint8Array(16)
  50709. , s = new Uint8Array(16)
  50710. , t = {}
  50711. , h = null
  50712. , u = null
  50713. , d = null
  50714. , p = null
  50715. , f = null
  50716. , g = null
  50717. , m = null
  50718. , v = null
  50719. , y = !1
  50720. , A = null
  50721. , C = null
  50722. , I = null
  50723. , E = null
  50724. , _ = null
  50725. , b = null
  50726. , w = null
  50727. , T = null
  50728. , x = null
  50729. , S = null
  50730. , M = null
  50731. , R = null
  50732. , P = null
  50733. , O = null
  50734. , L = null
  50735. , D = l.getParameter(l.MAX_TEXTURE_IMAGE_UNITS)
  50736. , N = void 0
  50737. , F = {}
  50738. , B = new Ci.Vector4
  50739. , V = null
  50740. , k = null
  50741. , U = new Ci.Vector4
  50742. , H = new Ci.Vector4
  50743. , z = l.createTexture();
  50744. l.bindTexture(l.TEXTURE_2D, z),
  50745. l.texParameteri(l.TEXTURE_2D, l.TEXTURE_MIN_FILTER, l.LINEAR),
  50746. l.texImage2D(l.TEXTURE_2D, 0, l.RGB, 1, 1, 0, l.RGB, l.UNSIGNED_BYTE, new Uint8Array(3)),
  50747. this.init = function() {
  50748. this.clearColor(0, 0, 0, 1),
  50749. this.clearDepth(1),
  50750. this.clearStencil(0),
  50751. this.enable(l.DEPTH_TEST),
  50752. l.depthFunc(l.LEQUAL),
  50753. l.frontFace(l.CCW),
  50754. l.cullFace(l.BACK),
  50755. this.enable(l.CULL_FACE),
  50756. this.enable(l.BLEND),
  50757. l.blendEquation(l.FUNC_ADD),
  50758. l.blendFunc(l.SRC_ALPHA, l.ONE_MINUS_SRC_ALPHA)
  50759. }
  50760. ,
  50761. this.initAttributes = function() {
  50762. for (var e = 0, t = o.length; e < t; e++)
  50763. o[e] = 0
  50764. }
  50765. ,
  50766. this.enableAttribute = function(e) {
  50767. o[e] = 1,
  50768. 0 === a[e] && (l.enableVertexAttribArray(e),
  50769. a[e] = 1),
  50770. 0 !== s[e] && (i.get("ANGLE_instanced_arrays").vertexAttribDivisorANGLE(e, 0),
  50771. s[e] = 0)
  50772. }
  50773. ,
  50774. this.enableAttributeAndDivisor = function(e, t, i) {
  50775. o[e] = 1,
  50776. 0 === a[e] && (l.enableVertexAttribArray(e),
  50777. a[e] = 1),
  50778. s[e] !== t && (i.vertexAttribDivisorANGLE(e, t),
  50779. s[e] = t)
  50780. }
  50781. ,
  50782. this.disableUnusedAttributes = function() {
  50783. for (var e = 0, t = a.length; e < t; e++)
  50784. a[e] !== o[e] && (l.disableVertexAttribArray(e),
  50785. a[e] = 0)
  50786. }
  50787. ,
  50788. this.enable = function(e) {
  50789. !0 !== t[e] && (l.enable(e),
  50790. t[e] = !0)
  50791. }
  50792. ,
  50793. this.disable = function(e) {
  50794. !1 !== t[e] && (l.disable(e),
  50795. t[e] = !1)
  50796. }
  50797. ,
  50798. this.getCompressedTextureFormats = function() {
  50799. if (null === h && (h = [],
  50800. i.get("WEBGL_compressed_texture_pvrtc") || i.get("WEBGL_compressed_texture_s3tc") || i.get("WEBGL_compressed_texture_etc1")))
  50801. for (var e = l.getParameter(l.COMPRESSED_TEXTURE_FORMATS), t = 0; t < e.length; t++)
  50802. h.push(e[t]);
  50803. return h
  50804. }
  50805. ,
  50806. this.setBlending = function(e, t, i, n, r, o, a, s) {
  50807. e === Ci.NoBlending ? this.disable(l.BLEND) : this.enable(l.BLEND),
  50808. e === u && s === y || (e === Ci.AdditiveBlending ? s ? (l.blendEquationSeparate(l.FUNC_ADD, l.FUNC_ADD),
  50809. l.blendFuncSeparate(l.ONE, l.ONE, l.ONE, l.ONE)) : (l.blendEquation(l.FUNC_ADD),
  50810. l.blendFunc(l.SRC_ALPHA, l.ONE)) : e === Ci.SubtractiveBlending ? s ? (l.blendEquationSeparate(l.FUNC_ADD, l.FUNC_ADD),
  50811. l.blendFuncSeparate(l.ZERO, l.ZERO, l.ONE_MINUS_SRC_COLOR, l.ONE_MINUS_SRC_ALPHA)) : (l.blendEquation(l.FUNC_ADD),
  50812. l.blendFunc(l.ZERO, l.ONE_MINUS_SRC_COLOR)) : e === Ci.MultiplyBlending ? s ? (l.blendEquationSeparate(l.FUNC_ADD, l.FUNC_ADD),
  50813. l.blendFuncSeparate(l.ZERO, l.ZERO, l.SRC_COLOR, l.SRC_ALPHA)) : (l.blendEquation(l.FUNC_ADD),
  50814. l.blendFunc(l.ZERO, l.SRC_COLOR)) : s ? (l.blendEquationSeparate(l.FUNC_ADD, l.FUNC_ADD),
  50815. l.blendFuncSeparate(l.ONE, l.ONE_MINUS_SRC_ALPHA, l.ONE, l.ONE_MINUS_SRC_ALPHA)) : (l.blendEquationSeparate(l.FUNC_ADD, l.FUNC_ADD),
  50816. l.blendFuncSeparate(l.SRC_ALPHA, l.ONE_MINUS_SRC_ALPHA, l.ONE, l.ONE_MINUS_SRC_ALPHA)),
  50817. u = e,
  50818. y = s),
  50819. e === Ci.CustomBlending ? (r = r || t,
  50820. o = o || i,
  50821. a = a || n,
  50822. t === d && r === g || (l.blendEquationSeparate(c(t), c(r)),
  50823. d = t,
  50824. g = r),
  50825. i === p && n === f && o === m && a === v || (l.blendFuncSeparate(c(i), c(n), c(o), c(a)),
  50826. p = i,
  50827. f = n,
  50828. m = o,
  50829. v = a)) : v = m = g = f = p = d = null
  50830. }
  50831. ,
  50832. this.setDepthFunc = function(e) {
  50833. if (A !== e) {
  50834. if (e)
  50835. switch (e) {
  50836. case Ci.NeverDepth:
  50837. l.depthFunc(l.NEVER);
  50838. break;
  50839. case Ci.AlwaysDepth:
  50840. l.depthFunc(l.ALWAYS);
  50841. break;
  50842. case Ci.LessDepth:
  50843. l.depthFunc(l.LESS);
  50844. break;
  50845. case Ci.LessEqualDepth:
  50846. l.depthFunc(l.LEQUAL);
  50847. break;
  50848. case Ci.EqualDepth:
  50849. l.depthFunc(l.EQUAL);
  50850. break;
  50851. case Ci.GreaterEqualDepth:
  50852. l.depthFunc(l.GEQUAL);
  50853. break;
  50854. case Ci.GreaterDepth:
  50855. l.depthFunc(l.GREATER);
  50856. break;
  50857. case Ci.NotEqualDepth:
  50858. l.depthFunc(l.NOTEQUAL);
  50859. break;
  50860. default:
  50861. l.depthFunc(l.LEQUAL)
  50862. }
  50863. else
  50864. l.depthFunc(l.LEQUAL);
  50865. A = e
  50866. }
  50867. }
  50868. ,
  50869. this.setDepthTest = function(e) {
  50870. e ? this.enable(l.DEPTH_TEST) : this.disable(l.DEPTH_TEST)
  50871. }
  50872. ,
  50873. this.setDepthWrite = function(e) {
  50874. C !== e && (l.depthMask(e),
  50875. C = e)
  50876. }
  50877. ,
  50878. this.setColorWrite = function(e) {
  50879. I !== e && (l.colorMask(e, e, e, e),
  50880. I = e)
  50881. }
  50882. ,
  50883. this.setStencilFunc = function(e, t, i) {
  50884. _ === e && b === t && w === i || (l.stencilFunc(e, t, i),
  50885. _ = e,
  50886. b = t,
  50887. w = i)
  50888. }
  50889. ,
  50890. this.setStencilOp = function(e, t, i) {
  50891. T === e && x === t && S === i || (l.stencilOp(e, t, i),
  50892. T = e,
  50893. x = t,
  50894. S = i)
  50895. }
  50896. ,
  50897. this.setStencilTest = function(e) {
  50898. e ? this.enable(l.STENCIL_TEST) : this.disable(l.STENCIL_TEST)
  50899. }
  50900. ,
  50901. this.setStencilWrite = function(e) {
  50902. E !== e && (l.stencilMask(e),
  50903. E = e)
  50904. }
  50905. ,
  50906. this.setFlipSided = function(e) {
  50907. M !== e && (e ? l.frontFace(l.CW) : l.frontFace(l.CCW),
  50908. M = e)
  50909. }
  50910. ,
  50911. this.setLineWidth = function(e) {
  50912. e !== R && (l.lineWidth(e),
  50913. R = e)
  50914. }
  50915. ,
  50916. this.setPolygonOffset = function(e, t, i) {
  50917. e ? this.enable(l.POLYGON_OFFSET_FILL) : this.disable(l.POLYGON_OFFSET_FILL),
  50918. !e || P === t && O === i || (l.polygonOffset(t, i),
  50919. P = t,
  50920. O = i)
  50921. }
  50922. ,
  50923. this.getScissorTest = function() {
  50924. return L
  50925. }
  50926. ,
  50927. this.setScissorTest = function(e) {
  50928. (L = e) ? this.enable(l.SCISSOR_TEST) : this.disable(l.SCISSOR_TEST)
  50929. }
  50930. ,
  50931. this.activeTexture = function(e) {
  50932. void 0 === e && (e = l.TEXTURE0 + D - 1),
  50933. N !== e && (l.activeTexture(e),
  50934. N = e)
  50935. }
  50936. ,
  50937. this.bindTexture = function(e, t) {
  50938. void 0 === N && n.activeTexture();
  50939. var i = F[N];
  50940. void 0 === i && (i = {
  50941. type: void 0,
  50942. texture: void 0
  50943. },
  50944. F[N] = i),
  50945. i.type === e && i.texture === t || (l.bindTexture(e, t || z),
  50946. i.type = e,
  50947. i.texture = t)
  50948. }
  50949. ,
  50950. this.compressedTexImage2D = function() {
  50951. try {
  50952. l.compressedTexImage2D.apply(l, arguments)
  50953. } catch (e) {
  50954. console.error(e)
  50955. }
  50956. }
  50957. ,
  50958. this.texImage2D = function() {
  50959. try {
  50960. l.texImage2D.apply(l, arguments)
  50961. } catch (e) {
  50962. console.error(e)
  50963. }
  50964. }
  50965. ,
  50966. this.clearColor = function(e, t, i, n) {
  50967. r.set(e, t, i, n),
  50968. !1 === B.equals(r) && (l.clearColor(e, t, i, n),
  50969. B.copy(r))
  50970. }
  50971. ,
  50972. this.clearDepth = function(e) {
  50973. V !== e && (l.clearDepth(e),
  50974. V = e)
  50975. }
  50976. ,
  50977. this.clearStencil = function(e) {
  50978. k !== e && (l.clearStencil(e),
  50979. k = e)
  50980. }
  50981. ,
  50982. this.scissor = function(e) {
  50983. !1 === U.equals(e) && (l.scissor(e.x, e.y, e.z, e.w),
  50984. U.copy(e))
  50985. }
  50986. ,
  50987. this.viewport = function(e) {
  50988. !1 === H.equals(e) && (l.viewport(e.x, e.y, e.z, e.w),
  50989. H.copy(e))
  50990. }
  50991. ,
  50992. this.reset = function() {
  50993. for (var e = 0; e < a.length; e++)
  50994. 1 === a[e] && (l.disableVertexAttribArray(e),
  50995. a[e] = 0);
  50996. t = {},
  50997. N = void 0,
  50998. F = {},
  50999. M = E = C = I = u = h = null
  51000. }
  51001. }
  51002. ,
  51003. Ci.LensFlarePlugin = function(v, y) {
  51004. function A() {
  51005. 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]);
  51006. C = S.createBuffer(),
  51007. I = S.createBuffer(),
  51008. S.bindBuffer(S.ARRAY_BUFFER, C),
  51009. S.bufferData(S.ARRAY_BUFFER, t, S.STATIC_DRAW),
  51010. S.bindBuffer(S.ELEMENT_ARRAY_BUFFER, I),
  51011. S.bufferData(S.ELEMENT_ARRAY_BUFFER, i, S.STATIC_DRAW),
  51012. T = S.createTexture(),
  51013. x = S.createTexture(),
  51014. M.bindTexture(S.TEXTURE_2D, T),
  51015. S.texImage2D(S.TEXTURE_2D, 0, S.RGB, 16, 16, 0, S.RGB, S.UNSIGNED_BYTE, null),
  51016. S.texParameteri(S.TEXTURE_2D, S.TEXTURE_WRAP_S, S.CLAMP_TO_EDGE),
  51017. S.texParameteri(S.TEXTURE_2D, S.TEXTURE_WRAP_T, S.CLAMP_TO_EDGE),
  51018. S.texParameteri(S.TEXTURE_2D, S.TEXTURE_MAG_FILTER, S.NEAREST),
  51019. S.texParameteri(S.TEXTURE_2D, S.TEXTURE_MIN_FILTER, S.NEAREST),
  51020. M.bindTexture(S.TEXTURE_2D, x),
  51021. S.texImage2D(S.TEXTURE_2D, 0, S.RGBA, 16, 16, 0, S.RGBA, S.UNSIGNED_BYTE, null),
  51022. S.texParameteri(S.TEXTURE_2D, S.TEXTURE_WRAP_S, S.CLAMP_TO_EDGE),
  51023. S.texParameteri(S.TEXTURE_2D, S.TEXTURE_WRAP_T, S.CLAMP_TO_EDGE),
  51024. S.texParameteri(S.TEXTURE_2D, S.TEXTURE_MAG_FILTER, S.NEAREST),
  51025. S.texParameteri(S.TEXTURE_2D, S.TEXTURE_MIN_FILTER, S.NEAREST),
  51026. e = (w = 0 < S.getParameter(S.MAX_VERTEX_TEXTURE_IMAGE_UNITS)) ? {
  51027. 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"),
  51028. 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")
  51029. } : {
  51030. 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"),
  51031. 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")
  51032. },
  51033. E = function(e) {
  51034. var t = S.createProgram()
  51035. , i = S.createShader(S.FRAGMENT_SHADER)
  51036. , n = S.createShader(S.VERTEX_SHADER)
  51037. , r = "precision " + v.getPrecision() + " float;\n";
  51038. return S.shaderSource(i, r + e.fragmentShader),
  51039. S.shaderSource(n, r + e.vertexShader),
  51040. S.compileShader(i),
  51041. S.compileShader(n),
  51042. S.attachShader(t, i),
  51043. S.attachShader(t, n),
  51044. S.linkProgram(t),
  51045. t
  51046. }(e),
  51047. _ = {
  51048. vertex: S.getAttribLocation(E, "position"),
  51049. uv: S.getAttribLocation(E, "uv")
  51050. },
  51051. b = {
  51052. renderType: S.getUniformLocation(E, "renderType"),
  51053. map: S.getUniformLocation(E, "map"),
  51054. occlusionMap: S.getUniformLocation(E, "occlusionMap"),
  51055. opacity: S.getUniformLocation(E, "opacity"),
  51056. color: S.getUniformLocation(E, "color"),
  51057. scale: S.getUniformLocation(E, "scale"),
  51058. rotation: S.getUniformLocation(E, "rotation"),
  51059. screenPosition: S.getUniformLocation(E, "screenPosition")
  51060. }
  51061. }
  51062. var C, I, E, _, b, w, T, x, S = v.context, M = v.state;
  51063. this.render = function(e, t, i) {
  51064. if (0 !== y.length) {
  51065. var n = new Ci.Vector3
  51066. , r = i.w / i.z
  51067. , o = .5 * i.z
  51068. , a = .5 * i.w
  51069. , s = 16 / i.w
  51070. , l = new Ci.Vector2(s * r,s)
  51071. , c = new Ci.Vector3(1,1,0)
  51072. , h = new Ci.Vector2(1,1);
  51073. void 0 === E && A(),
  51074. S.useProgram(E),
  51075. M.initAttributes(),
  51076. M.enableAttribute(_.vertex),
  51077. M.enableAttribute(_.uv),
  51078. M.disableUnusedAttributes(),
  51079. S.uniform1i(b.occlusionMap, 0),
  51080. S.uniform1i(b.map, 1),
  51081. S.bindBuffer(S.ARRAY_BUFFER, C),
  51082. S.vertexAttribPointer(_.vertex, 2, S.FLOAT, !1, 16, 0),
  51083. S.vertexAttribPointer(_.uv, 2, S.FLOAT, !1, 16, 8),
  51084. S.bindBuffer(S.ELEMENT_ARRAY_BUFFER, I),
  51085. M.disable(S.CULL_FACE),
  51086. M.setDepthWrite(!1);
  51087. for (var u = 0, d = y.length; u < d; u++) {
  51088. s = 16 / i.w,
  51089. l.set(s * r, s);
  51090. var p = y[u];
  51091. if (n.set(p.matrixWorld.elements[12], p.matrixWorld.elements[13], p.matrixWorld.elements[14]),
  51092. n.applyMatrix4(t.matrixWorldInverse),
  51093. n.applyProjection(t.projectionMatrix),
  51094. c.copy(n),
  51095. h.x = c.x * o + o,
  51096. h.y = c.y * a + a,
  51097. w || 0 < h.x && h.x < i.z && 0 < h.y && h.y < i.w) {
  51098. M.activeTexture(S.TEXTURE0),
  51099. M.bindTexture(S.TEXTURE_2D, null),
  51100. M.activeTexture(S.TEXTURE1),
  51101. M.bindTexture(S.TEXTURE_2D, T),
  51102. S.copyTexImage2D(S.TEXTURE_2D, 0, S.RGB, i.x + h.x - 8, i.y + h.y - 8, 16, 16, 0),
  51103. S.uniform1i(b.renderType, 0),
  51104. S.uniform2f(b.scale, l.x, l.y),
  51105. S.uniform3f(b.screenPosition, c.x, c.y, c.z),
  51106. M.disable(S.BLEND),
  51107. M.enable(S.DEPTH_TEST),
  51108. S.drawElements(S.TRIANGLES, 6, S.UNSIGNED_SHORT, 0),
  51109. M.activeTexture(S.TEXTURE0),
  51110. M.bindTexture(S.TEXTURE_2D, x),
  51111. S.copyTexImage2D(S.TEXTURE_2D, 0, S.RGBA, i.x + h.x - 8, i.y + h.y - 8, 16, 16, 0),
  51112. S.uniform1i(b.renderType, 1),
  51113. M.disable(S.DEPTH_TEST),
  51114. M.activeTexture(S.TEXTURE1),
  51115. M.bindTexture(S.TEXTURE_2D, T),
  51116. S.drawElements(S.TRIANGLES, 6, S.UNSIGNED_SHORT, 0),
  51117. p.positionScreen.copy(c),
  51118. p.customUpdateCallback ? p.customUpdateCallback(p) : p.updateLensFlares(),
  51119. S.uniform1i(b.renderType, 2),
  51120. M.enable(S.BLEND);
  51121. for (var f = 0, g = p.lensFlares.length; f < g; f++) {
  51122. var m = p.lensFlares[f];
  51123. .001 < m.opacity && .001 < m.scale && (c.x = m.x,
  51124. c.y = m.y,
  51125. c.z = m.z,
  51126. s = m.size * m.scale / i.w,
  51127. l.x = s * r,
  51128. l.y = s,
  51129. S.uniform3f(b.screenPosition, c.x, c.y, c.z),
  51130. S.uniform2f(b.scale, l.x, l.y),
  51131. S.uniform1f(b.rotation, m.rotation),
  51132. S.uniform1f(b.opacity, m.opacity),
  51133. S.uniform3f(b.color, m.color.r, m.color.g, m.color.b),
  51134. M.setBlending(m.blending, m.blendEquation, m.blendSrc, m.blendDst),
  51135. v.setTexture(m.texture, 1),
  51136. S.drawElements(S.TRIANGLES, 6, S.UNSIGNED_SHORT, 0))
  51137. }
  51138. }
  51139. }
  51140. M.enable(S.CULL_FACE),
  51141. M.enable(S.DEPTH_TEST),
  51142. M.setDepthWrite(!0),
  51143. v.resetGLState()
  51144. }
  51145. }
  51146. }
  51147. ,
  51148. Ci.SpritePlugin = function(u, d) {
  51149. function p() {
  51150. var e = new Float32Array([-.5, -.5, 0, 0, .5, -.5, 1, 0, .5, .5, 1, 1, -.5, .5, 0, 1])
  51151. , t = new Uint16Array([0, 1, 2, 0, 2, 3]);
  51152. g = I.createBuffer(),
  51153. m = I.createBuffer(),
  51154. I.bindBuffer(I.ARRAY_BUFFER, g),
  51155. I.bufferData(I.ARRAY_BUFFER, e, I.STATIC_DRAW),
  51156. I.bindBuffer(I.ELEMENT_ARRAY_BUFFER, m),
  51157. I.bufferData(I.ELEMENT_ARRAY_BUFFER, t, I.STATIC_DRAW),
  51158. v = function() {
  51159. var e = I.createProgram()
  51160. , t = I.createShader(I.VERTEX_SHADER)
  51161. , i = I.createShader(I.FRAGMENT_SHADER);
  51162. 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")),
  51163. 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")),
  51164. I.compileShader(t),
  51165. I.compileShader(i),
  51166. I.attachShader(e, t),
  51167. I.attachShader(e, i),
  51168. I.linkProgram(e),
  51169. e
  51170. }(),
  51171. y = {
  51172. position: I.getAttribLocation(v, "position"),
  51173. uv: I.getAttribLocation(v, "uv")
  51174. },
  51175. A = {
  51176. uvOffset: I.getUniformLocation(v, "uvOffset"),
  51177. uvScale: I.getUniformLocation(v, "uvScale"),
  51178. rotation: I.getUniformLocation(v, "rotation"),
  51179. scale: I.getUniformLocation(v, "scale"),
  51180. color: I.getUniformLocation(v, "color"),
  51181. map: I.getUniformLocation(v, "map"),
  51182. opacity: I.getUniformLocation(v, "opacity"),
  51183. modelViewMatrix: I.getUniformLocation(v, "modelViewMatrix"),
  51184. projectionMatrix: I.getUniformLocation(v, "projectionMatrix"),
  51185. fogType: I.getUniformLocation(v, "fogType"),
  51186. fogDensity: I.getUniformLocation(v, "fogDensity"),
  51187. fogNear: I.getUniformLocation(v, "fogNear"),
  51188. fogFar: I.getUniformLocation(v, "fogFar"),
  51189. fogColor: I.getUniformLocation(v, "fogColor"),
  51190. alphaTest: I.getUniformLocation(v, "alphaTest")
  51191. };
  51192. var i = document.createElement("canvas");
  51193. i.width = 8,
  51194. i.height = 8;
  51195. var n = i.getContext("2d");
  51196. n.fillStyle = "white",
  51197. n.fillRect(0, 0, 8, 8),
  51198. (C = new Ci.Texture(i)).needsUpdate = !0
  51199. }
  51200. function f(e, t) {
  51201. return e.renderOrder !== t.renderOrder ? e.renderOrder - t.renderOrder : e.z !== t.z ? t.z - e.z : t.id - e.id
  51202. }
  51203. var g, m, v, y, A, C, I = u.context, E = u.state, _ = new Ci.Vector3, b = new Ci.Quaternion, w = new Ci.Vector3;
  51204. this.render = function(e, t) {
  51205. if (0 !== d.length) {
  51206. void 0 === v && p(),
  51207. I.useProgram(v),
  51208. E.initAttributes(),
  51209. E.enableAttribute(y.position),
  51210. E.enableAttribute(y.uv),
  51211. E.disableUnusedAttributes(),
  51212. E.disable(I.CULL_FACE),
  51213. E.enable(I.BLEND),
  51214. I.bindBuffer(I.ARRAY_BUFFER, g),
  51215. I.vertexAttribPointer(y.position, 2, I.FLOAT, !1, 16, 0),
  51216. I.vertexAttribPointer(y.uv, 2, I.FLOAT, !1, 16, 8),
  51217. I.bindBuffer(I.ELEMENT_ARRAY_BUFFER, m),
  51218. I.uniformMatrix4fv(A.projectionMatrix, !1, t.projectionMatrix.elements),
  51219. E.activeTexture(I.TEXTURE0),
  51220. I.uniform1i(A.map, 0);
  51221. var i = 0
  51222. , n = 0
  51223. , r = e.fog;
  51224. r ? (I.uniform3f(A.fogColor, r.color.r, r.color.g, r.color.b),
  51225. r instanceof Ci.Fog ? (I.uniform1f(A.fogNear, r.near),
  51226. I.uniform1f(A.fogFar, r.far),
  51227. I.uniform1i(A.fogType, 1),
  51228. n = i = 1) : r instanceof Ci.FogExp2 && (I.uniform1f(A.fogDensity, r.density),
  51229. I.uniform1i(A.fogType, 2),
  51230. n = i = 2)) : (I.uniform1i(A.fogType, 0),
  51231. n = i = 0);
  51232. for (var o = 0, a = d.length; o < a; o++) {
  51233. (l = d[o]).modelViewMatrix.multiplyMatrices(t.matrixWorldInverse, l.matrixWorld),
  51234. l.z = -l.modelViewMatrix.elements[14]
  51235. }
  51236. d.sort(f);
  51237. var s = [];
  51238. for (o = 0,
  51239. a = d.length; o < a; o++) {
  51240. var l, c = (l = d[o]).material;
  51241. I.uniform1f(A.alphaTest, c.alphaTest),
  51242. I.uniformMatrix4fv(A.modelViewMatrix, !1, l.modelViewMatrix.elements),
  51243. l.matrixWorld.decompose(_, b, w),
  51244. s[0] = w.x,
  51245. s[1] = w.y;
  51246. var h = 0;
  51247. e.fog && c.fog && (h = n),
  51248. i !== h && (I.uniform1i(A.fogType, h),
  51249. i = h),
  51250. null !== c.map ? (I.uniform2f(A.uvOffset, c.map.offset.x, c.map.offset.y),
  51251. I.uniform2f(A.uvScale, c.map.repeat.x, c.map.repeat.y)) : (I.uniform2f(A.uvOffset, 0, 0),
  51252. I.uniform2f(A.uvScale, 1, 1)),
  51253. I.uniform1f(A.opacity, c.opacity),
  51254. I.uniform3f(A.color, c.color.r, c.color.g, c.color.b),
  51255. I.uniform1f(A.rotation, c.rotation),
  51256. I.uniform2fv(A.scale, s),
  51257. E.setBlending(c.blending, c.blendEquation, c.blendSrc, c.blendDst),
  51258. E.setDepthTest(c.depthTest),
  51259. E.setDepthWrite(c.depthWrite),
  51260. c.map && c.map.image && c.map.image.width ? u.setTexture(c.map, 0) : u.setTexture(C, 0),
  51261. I.drawElements(I.TRIANGLES, 6, I.UNSIGNED_SHORT, 0)
  51262. }
  51263. E.enable(I.CULL_FACE),
  51264. u.resetGLState()
  51265. }
  51266. }
  51267. }
  51268. ,
  51269. Object.defineProperties(Ci.Box2.prototype, {
  51270. empty: {
  51271. value: function() {
  51272. return console.warn("THREE.Box2: .empty() has been renamed to .isEmpty()."),
  51273. this.isEmpty()
  51274. }
  51275. },
  51276. isIntersectionBox: {
  51277. value: function(e) {
  51278. return console.warn("THREE.Box2: .isIntersectionBox() has been renamed to .intersectsBox()."),
  51279. this.intersectsBox(e)
  51280. }
  51281. }
  51282. }),
  51283. Object.defineProperties(Ci.Box3.prototype, {
  51284. empty: {
  51285. value: function() {
  51286. return console.warn("THREE.Box3: .empty() has been renamed to .isEmpty()."),
  51287. this.isEmpty()
  51288. }
  51289. },
  51290. isIntersectionBox: {
  51291. value: function(e) {
  51292. return console.warn("THREE.Box3: .isIntersectionBox() has been renamed to .intersectsBox()."),
  51293. this.intersectsBox(e)
  51294. }
  51295. },
  51296. isIntersectionSphere: {
  51297. value: function(e) {
  51298. return console.warn("THREE.Box3: .isIntersectionSphere() has been renamed to .intersectsSphere()."),
  51299. this.intersectsSphere(e)
  51300. }
  51301. }
  51302. }),
  51303. Object.defineProperties(Ci.Matrix3.prototype, {
  51304. multiplyVector3: {
  51305. value: function(e) {
  51306. return console.warn("THREE.Matrix3: .multiplyVector3() has been removed. Use vector.applyMatrix3( matrix ) instead."),
  51307. e.applyMatrix3(this)
  51308. }
  51309. },
  51310. multiplyVector3Array: {
  51311. value: function(e) {
  51312. return console.warn("THREE.Matrix3: .multiplyVector3Array() has been renamed. Use matrix.applyToVector3Array( array ) instead."),
  51313. this.applyToVector3Array(e)
  51314. }
  51315. }
  51316. }),
  51317. Object.defineProperties(Ci.Matrix4.prototype, {
  51318. extractPosition: {
  51319. value: function(e) {
  51320. return console.warn("THREE.Matrix4: .extractPosition() has been renamed to .copyPosition()."),
  51321. this.copyPosition(e)
  51322. }
  51323. },
  51324. setRotationFromQuaternion: {
  51325. value: function(e) {
  51326. return console.warn("THREE.Matrix4: .setRotationFromQuaternion() has been renamed to .makeRotationFromQuaternion()."),
  51327. this.makeRotationFromQuaternion(e)
  51328. }
  51329. },
  51330. multiplyVector3: {
  51331. value: function(e) {
  51332. return console.warn("THREE.Matrix4: .multiplyVector3() has been removed. Use vector.applyMatrix4( matrix ) or vector.applyProjection( matrix ) instead."),
  51333. e.applyProjection(this)
  51334. }
  51335. },
  51336. multiplyVector4: {
  51337. value: function(e) {
  51338. return console.warn("THREE.Matrix4: .multiplyVector4() has been removed. Use vector.applyMatrix4( matrix ) instead."),
  51339. e.applyMatrix4(this)
  51340. }
  51341. },
  51342. multiplyVector3Array: {
  51343. value: function(e) {
  51344. return console.warn("THREE.Matrix4: .multiplyVector3Array() has been renamed. Use matrix.applyToVector3Array( array ) instead."),
  51345. this.applyToVector3Array(e)
  51346. }
  51347. },
  51348. rotateAxis: {
  51349. value: function(e) {
  51350. console.warn("THREE.Matrix4: .rotateAxis() has been removed. Use Vector3.transformDirection( matrix ) instead."),
  51351. e.transformDirection(this)
  51352. }
  51353. },
  51354. crossVector: {
  51355. value: function(e) {
  51356. return console.warn("THREE.Matrix4: .crossVector() has been removed. Use vector.applyMatrix4( matrix ) instead."),
  51357. e.applyMatrix4(this)
  51358. }
  51359. },
  51360. translate: {
  51361. value: function(e) {
  51362. console.error("THREE.Matrix4: .translate() has been removed.")
  51363. }
  51364. },
  51365. rotateX: {
  51366. value: function(e) {
  51367. console.error("THREE.Matrix4: .rotateX() has been removed.")
  51368. }
  51369. },
  51370. rotateY: {
  51371. value: function(e) {
  51372. console.error("THREE.Matrix4: .rotateY() has been removed.")
  51373. }
  51374. },
  51375. rotateZ: {
  51376. value: function(e) {
  51377. console.error("THREE.Matrix4: .rotateZ() has been removed.")
  51378. }
  51379. },
  51380. rotateByAxis: {
  51381. value: function(e, t) {
  51382. console.error("THREE.Matrix4: .rotateByAxis() has been removed.")
  51383. }
  51384. }
  51385. }),
  51386. Object.defineProperties(Ci.Plane.prototype, {
  51387. isIntersectionLine: {
  51388. value: function(e) {
  51389. return console.warn("THREE.Plane: .isIntersectionLine() has been renamed to .intersectsLine()."),
  51390. this.intersectsLine(e)
  51391. }
  51392. }
  51393. }),
  51394. Object.defineProperties(Ci.Quaternion.prototype, {
  51395. multiplyVector3: {
  51396. value: function(e) {
  51397. return console.warn("THREE.Quaternion: .multiplyVector3() has been removed. Use is now vector.applyQuaternion( quaternion ) instead."),
  51398. e.applyQuaternion(this)
  51399. }
  51400. }
  51401. }),
  51402. Object.defineProperties(Ci.Ray.prototype, {
  51403. isIntersectionBox: {
  51404. value: function(e) {
  51405. return console.warn("THREE.Ray: .isIntersectionBox() has been renamed to .intersectsBox()."),
  51406. this.intersectsBox(e)
  51407. }
  51408. },
  51409. isIntersectionPlane: {
  51410. value: function(e) {
  51411. return console.warn("THREE.Ray: .isIntersectionPlane() has been renamed to .intersectsPlane()."),
  51412. this.intersectsPlane(e)
  51413. }
  51414. },
  51415. isIntersectionSphere: {
  51416. value: function(e) {
  51417. return console.warn("THREE.Ray: .isIntersectionSphere() has been renamed to .intersectsSphere()."),
  51418. this.intersectsSphere(e)
  51419. }
  51420. }
  51421. }),
  51422. Object.defineProperties(Ci.Vector3.prototype, {
  51423. setEulerFromRotationMatrix: {
  51424. value: function() {
  51425. console.error("THREE.Vector3: .setEulerFromRotationMatrix() has been removed. Use Euler.setFromRotationMatrix() instead.")
  51426. }
  51427. },
  51428. setEulerFromQuaternion: {
  51429. value: function() {
  51430. console.error("THREE.Vector3: .setEulerFromQuaternion() has been removed. Use Euler.setFromQuaternion() instead.")
  51431. }
  51432. },
  51433. getPositionFromMatrix: {
  51434. value: function(e) {
  51435. return console.warn("THREE.Vector3: .getPositionFromMatrix() has been renamed to .setFromMatrixPosition()."),
  51436. this.setFromMatrixPosition(e)
  51437. }
  51438. },
  51439. getScaleFromMatrix: {
  51440. value: function(e) {
  51441. return console.warn("THREE.Vector3: .getScaleFromMatrix() has been renamed to .setFromMatrixScale()."),
  51442. this.setFromMatrixScale(e)
  51443. }
  51444. },
  51445. getColumnFromMatrix: {
  51446. value: function(e, t) {
  51447. return console.warn("THREE.Vector3: .getColumnFromMatrix() has been renamed to .setFromMatrixColumn()."),
  51448. this.setFromMatrixColumn(e, t)
  51449. }
  51450. }
  51451. }),
  51452. Ci.Face4 = function(e, t, i, n, r, o, a) {
  51453. return console.warn("THREE.Face4 has been removed. A THREE.Face3 will be created instead."),
  51454. new Ci.Face3(e,t,i,r,o,a)
  51455. }
  51456. ,
  51457. Ci.Vertex = function(e, t, i) {
  51458. return console.warn("THREE.Vertex has been removed. Use THREE.Vector3 instead."),
  51459. new Ci.Vector3(e,t,i)
  51460. }
  51461. ,
  51462. Object.defineProperties(Ci.Object3D.prototype, {
  51463. eulerOrder: {
  51464. get: function() {
  51465. return console.warn("THREE.Object3D: .eulerOrder is now .rotation.order."),
  51466. this.rotation.order
  51467. },
  51468. set: function(e) {
  51469. console.warn("THREE.Object3D: .eulerOrder is now .rotation.order."),
  51470. this.rotation.order = e
  51471. }
  51472. },
  51473. getChildByName: {
  51474. value: function(e) {
  51475. return console.warn("THREE.Object3D: .getChildByName() has been renamed to .getObjectByName()."),
  51476. this.getObjectByName(e)
  51477. }
  51478. },
  51479. renderDepth: {
  51480. set: function(e) {
  51481. console.warn("THREE.Object3D: .renderDepth has been removed. Use .renderOrder, instead.")
  51482. }
  51483. },
  51484. translate: {
  51485. value: function(e, t) {
  51486. return console.warn("THREE.Object3D: .translate() has been removed. Use .translateOnAxis( axis, distance ) instead."),
  51487. this.translateOnAxis(t, e)
  51488. }
  51489. },
  51490. useQuaternion: {
  51491. get: function() {
  51492. console.warn("THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.")
  51493. },
  51494. set: function(e) {
  51495. console.warn("THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.")
  51496. }
  51497. }
  51498. }),
  51499. Object.defineProperties(Ci, {
  51500. PointCloud: {
  51501. value: function(e, t) {
  51502. return console.warn("THREE.PointCloud has been renamed to THREE.Points."),
  51503. new Ci.Points(e,t)
  51504. }
  51505. },
  51506. ParticleSystem: {
  51507. value: function(e, t) {
  51508. return console.warn("THREE.ParticleSystem has been renamed to THREE.Points."),
  51509. new Ci.Points(e,t)
  51510. }
  51511. }
  51512. }),
  51513. Object.defineProperties(Ci.Light.prototype, {
  51514. onlyShadow: {
  51515. set: function(e) {
  51516. console.warn("THREE.Light: .onlyShadow has been removed.")
  51517. }
  51518. },
  51519. shadowCameraFov: {
  51520. set: function(e) {
  51521. console.warn("THREE.Light: .shadowCameraFov is now .shadow.camera.fov."),
  51522. this.shadow.camera.fov = e
  51523. }
  51524. },
  51525. shadowCameraLeft: {
  51526. set: function(e) {
  51527. console.warn("THREE.Light: .shadowCameraLeft is now .shadow.camera.left."),
  51528. this.shadow.camera.left = e
  51529. }
  51530. },
  51531. shadowCameraRight: {
  51532. set: function(e) {
  51533. console.warn("THREE.Light: .shadowCameraRight is now .shadow.camera.right."),
  51534. this.shadow.camera.right = e
  51535. }
  51536. },
  51537. shadowCameraTop: {
  51538. set: function(e) {
  51539. console.warn("THREE.Light: .shadowCameraTop is now .shadow.camera.top."),
  51540. this.shadow.camera.top = e
  51541. }
  51542. },
  51543. shadowCameraBottom: {
  51544. set: function(e) {
  51545. console.warn("THREE.Light: .shadowCameraBottom is now .shadow.camera.bottom."),
  51546. this.shadow.camera.bottom = e
  51547. }
  51548. },
  51549. shadowCameraNear: {
  51550. set: function(e) {
  51551. console.warn("THREE.Light: .shadowCameraNear is now .shadow.camera.near."),
  51552. this.shadow.camera.near = e
  51553. }
  51554. },
  51555. shadowCameraFar: {
  51556. set: function(e) {
  51557. console.warn("THREE.Light: .shadowCameraFar is now .shadow.camera.far."),
  51558. this.shadow.camera.far = e
  51559. }
  51560. },
  51561. shadowCameraVisible: {
  51562. set: function(e) {
  51563. console.warn("THREE.Light: .shadowCameraVisible has been removed. Use new THREE.CameraHelper( light.shadow.camera ) instead.")
  51564. }
  51565. },
  51566. shadowBias: {
  51567. set: function(e) {
  51568. console.warn("THREE.Light: .shadowBias is now .shadow.bias."),
  51569. this.shadow.bias = e
  51570. }
  51571. },
  51572. shadowDarkness: {
  51573. set: function(e) {
  51574. console.warn("THREE.Light: .shadowDarkness has been removed.")
  51575. }
  51576. },
  51577. shadowMapWidth: {
  51578. set: function(e) {
  51579. console.warn("THREE.Light: .shadowMapWidth is now .shadow.mapSize.width."),
  51580. this.shadow.mapSize.width = e
  51581. }
  51582. },
  51583. shadowMapHeight: {
  51584. set: function(e) {
  51585. console.warn("THREE.Light: .shadowMapHeight is now .shadow.mapSize.height."),
  51586. this.shadow.mapSize.height = e
  51587. }
  51588. }
  51589. }),
  51590. Object.defineProperties(Ci.BufferAttribute.prototype, {
  51591. length: {
  51592. get: function() {
  51593. return console.warn("THREE.BufferAttribute: .length has been deprecated. Please use .count."),
  51594. this.array.length
  51595. }
  51596. }
  51597. }),
  51598. Object.defineProperties(Ci.BufferGeometry.prototype, {
  51599. drawcalls: {
  51600. get: function() {
  51601. return console.error("THREE.BufferGeometry: .drawcalls has been renamed to .groups."),
  51602. this.groups
  51603. }
  51604. },
  51605. offsets: {
  51606. get: function() {
  51607. return console.warn("THREE.BufferGeometry: .offsets has been renamed to .groups."),
  51608. this.groups
  51609. }
  51610. },
  51611. addIndex: {
  51612. value: function(e) {
  51613. console.warn("THREE.BufferGeometry: .addIndex() has been renamed to .setIndex()."),
  51614. this.setIndex(e)
  51615. }
  51616. },
  51617. addDrawCall: {
  51618. value: function(e, t, i) {
  51619. void 0 !== i && console.warn("THREE.BufferGeometry: .addDrawCall() no longer supports indexOffset."),
  51620. console.warn("THREE.BufferGeometry: .addDrawCall() is now .addGroup()."),
  51621. this.addGroup(e, t)
  51622. }
  51623. },
  51624. clearDrawCalls: {
  51625. value: function() {
  51626. console.warn("THREE.BufferGeometry: .clearDrawCalls() is now .clearGroups()."),
  51627. this.clearGroups()
  51628. }
  51629. },
  51630. computeTangents: {
  51631. value: function() {
  51632. console.warn("THREE.BufferGeometry: .computeTangents() has been removed.")
  51633. }
  51634. },
  51635. computeOffsets: {
  51636. value: function() {
  51637. console.warn("THREE.BufferGeometry: .computeOffsets() has been removed.")
  51638. }
  51639. }
  51640. }),
  51641. Object.defineProperties(Ci.Material.prototype, {
  51642. wrapAround: {
  51643. get: function() {
  51644. console.warn("THREE." + this.type + ": .wrapAround has been removed.")
  51645. },
  51646. set: function(e) {
  51647. console.warn("THREE." + this.type + ": .wrapAround has been removed.")
  51648. }
  51649. },
  51650. wrapRGB: {
  51651. get: function() {
  51652. return console.warn("THREE." + this.type + ": .wrapRGB has been removed."),
  51653. new Ci.Color
  51654. }
  51655. }
  51656. }),
  51657. Object.defineProperties(Ci, {
  51658. PointCloudMaterial: {
  51659. value: function(e) {
  51660. return console.warn("THREE.PointCloudMaterial has been renamed to THREE.PointsMaterial."),
  51661. new Ci.PointsMaterial(e)
  51662. }
  51663. },
  51664. ParticleBasicMaterial: {
  51665. value: function(e) {
  51666. return console.warn("THREE.ParticleBasicMaterial has been renamed to THREE.PointsMaterial."),
  51667. new Ci.PointsMaterial(e)
  51668. }
  51669. },
  51670. ParticleSystemMaterial: {
  51671. value: function(e) {
  51672. return console.warn("THREE.ParticleSystemMaterial has been renamed to THREE.PointsMaterial."),
  51673. new Ci.PointsMaterial(e)
  51674. }
  51675. }
  51676. }),
  51677. Object.defineProperties(Ci.MeshPhongMaterial.prototype, {
  51678. metal: {
  51679. get: function() {
  51680. return console.warn("THREE.MeshPhongMaterial: .metal has been removed. Use THREE.MeshStandardMaterial instead."),
  51681. !1
  51682. },
  51683. set: function(e) {
  51684. console.warn("THREE.MeshPhongMaterial: .metal has been removed. Use THREE.MeshStandardMaterial instead")
  51685. }
  51686. }
  51687. }),
  51688. Object.defineProperties(Ci.ShaderMaterial.prototype, {
  51689. derivatives: {
  51690. get: function() {
  51691. return console.warn("THREE.ShaderMaterial: .derivatives has been moved to .extensions.derivatives."),
  51692. this.extensions.derivatives
  51693. },
  51694. set: function(e) {
  51695. console.warn("THREE. ShaderMaterial: .derivatives has been moved to .extensions.derivatives."),
  51696. this.extensions.derivatives = e
  51697. }
  51698. }
  51699. }),
  51700. Object.defineProperties(Ci.WebGLRenderer.prototype, {
  51701. supportsFloatTextures: {
  51702. value: function() {
  51703. return console.warn("THREE.WebGLRenderer: .supportsFloatTextures() is now .extensions.get( 'OES_texture_float' )."),
  51704. this.extensions.get("OES_texture_float")
  51705. }
  51706. },
  51707. supportsHalfFloatTextures: {
  51708. value: function() {
  51709. return console.warn("THREE.WebGLRenderer: .supportsHalfFloatTextures() is now .extensions.get( 'OES_texture_half_float' )."),
  51710. this.extensions.get("OES_texture_half_float")
  51711. }
  51712. },
  51713. supportsStandardDerivatives: {
  51714. value: function() {
  51715. return console.warn("THREE.WebGLRenderer: .supportsStandardDerivatives() is now .extensions.get( 'OES_standard_derivatives' )."),
  51716. this.extensions.get("OES_standard_derivatives")
  51717. }
  51718. },
  51719. supportsCompressedTextureS3TC: {
  51720. value: function() {
  51721. return console.warn("THREE.WebGLRenderer: .supportsCompressedTextureS3TC() is now .extensions.get( 'WEBGL_compressed_texture_s3tc' )."),
  51722. this.extensions.get("WEBGL_compressed_texture_s3tc")
  51723. }
  51724. },
  51725. supportsCompressedTexturePVRTC: {
  51726. value: function() {
  51727. return console.warn("THREE.WebGLRenderer: .supportsCompressedTexturePVRTC() is now .extensions.get( 'WEBGL_compressed_texture_pvrtc' )."),
  51728. this.extensions.get("WEBGL_compressed_texture_pvrtc")
  51729. }
  51730. },
  51731. supportsBlendMinMax: {
  51732. value: function() {
  51733. return console.warn("THREE.WebGLRenderer: .supportsBlendMinMax() is now .extensions.get( 'EXT_blend_minmax' )."),
  51734. this.extensions.get("EXT_blend_minmax")
  51735. }
  51736. },
  51737. supportsVertexTextures: {
  51738. value: function() {
  51739. return this.capabilities.vertexTextures
  51740. }
  51741. },
  51742. supportsInstancedArrays: {
  51743. value: function() {
  51744. return console.warn("THREE.WebGLRenderer: .supportsInstancedArrays() is now .extensions.get( 'ANGLE_instanced_arrays' )."),
  51745. this.extensions.get("ANGLE_instanced_arrays")
  51746. }
  51747. },
  51748. enableScissorTest: {
  51749. value: function(e) {
  51750. console.warn("THREE.WebGLRenderer: .enableScissorTest() is now .setScissorTest()."),
  51751. this.setScissorTest(e)
  51752. }
  51753. },
  51754. initMaterial: {
  51755. value: function() {
  51756. console.warn("THREE.WebGLRenderer: .initMaterial() has been removed.")
  51757. }
  51758. },
  51759. addPrePlugin: {
  51760. value: function() {
  51761. console.warn("THREE.WebGLRenderer: .addPrePlugin() has been removed.")
  51762. }
  51763. },
  51764. addPostPlugin: {
  51765. value: function() {
  51766. console.warn("THREE.WebGLRenderer: .addPostPlugin() has been removed.")
  51767. }
  51768. },
  51769. updateShadowMap: {
  51770. value: function() {
  51771. console.warn("THREE.WebGLRenderer: .updateShadowMap() has been removed.")
  51772. }
  51773. },
  51774. shadowMapEnabled: {
  51775. get: function() {
  51776. return this.shadowMap.enabled
  51777. },
  51778. set: function(e) {
  51779. console.warn("THREE.WebGLRenderer: .shadowMapEnabled is now .shadowMap.enabled."),
  51780. this.shadowMap.enabled = e
  51781. }
  51782. },
  51783. shadowMapType: {
  51784. get: function() {
  51785. return this.shadowMap.type
  51786. },
  51787. set: function(e) {
  51788. console.warn("THREE.WebGLRenderer: .shadowMapType is now .shadowMap.type."),
  51789. this.shadowMap.type = e
  51790. }
  51791. },
  51792. shadowMapCullFace: {
  51793. get: function() {
  51794. return this.shadowMap.cullFace
  51795. },
  51796. set: function(e) {
  51797. console.warn("THREE.WebGLRenderer: .shadowMapCullFace is now .shadowMap.cullFace."),
  51798. this.shadowMap.cullFace = e
  51799. }
  51800. }
  51801. }),
  51802. Object.defineProperties(Ci.WebGLRenderTarget.prototype, {
  51803. wrapS: {
  51804. get: function() {
  51805. return console.warn("THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS."),
  51806. this.texture.wrapS
  51807. },
  51808. set: function(e) {
  51809. console.warn("THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS."),
  51810. this.texture.wrapS = e
  51811. }
  51812. },
  51813. wrapT: {
  51814. get: function() {
  51815. return console.warn("THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT."),
  51816. this.texture.wrapT
  51817. },
  51818. set: function(e) {
  51819. console.warn("THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT."),
  51820. this.texture.wrapT = e
  51821. }
  51822. },
  51823. magFilter: {
  51824. get: function() {
  51825. return console.warn("THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter."),
  51826. this.texture.magFilter
  51827. },
  51828. set: function(e) {
  51829. console.warn("THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter."),
  51830. this.texture.magFilter = e
  51831. }
  51832. },
  51833. minFilter: {
  51834. get: function() {
  51835. return console.warn("THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter."),
  51836. this.texture.minFilter
  51837. },
  51838. set: function(e) {
  51839. console.warn("THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter."),
  51840. this.texture.minFilter = e
  51841. }
  51842. },
  51843. anisotropy: {
  51844. get: function() {
  51845. return console.warn("THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy."),
  51846. this.texture.anisotropy
  51847. },
  51848. set: function(e) {
  51849. console.warn("THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy."),
  51850. this.texture.anisotropy = e
  51851. }
  51852. },
  51853. offset: {
  51854. get: function() {
  51855. return console.warn("THREE.WebGLRenderTarget: .offset is now .texture.offset."),
  51856. this.texture.offset
  51857. },
  51858. set: function(e) {
  51859. console.warn("THREE.WebGLRenderTarget: .offset is now .texture.offset."),
  51860. this.texture.offset = e
  51861. }
  51862. },
  51863. repeat: {
  51864. get: function() {
  51865. return console.warn("THREE.WebGLRenderTarget: .repeat is now .texture.repeat."),
  51866. this.texture.repeat
  51867. },
  51868. set: function(e) {
  51869. console.warn("THREE.WebGLRenderTarget: .repeat is now .texture.repeat."),
  51870. this.texture.repeat = e
  51871. }
  51872. },
  51873. format: {
  51874. get: function() {
  51875. return console.warn("THREE.WebGLRenderTarget: .format is now .texture.format."),
  51876. this.texture.format
  51877. },
  51878. set: function(e) {
  51879. console.warn("THREE.WebGLRenderTarget: .format is now .texture.format."),
  51880. this.texture.format = e
  51881. }
  51882. },
  51883. type: {
  51884. get: function() {
  51885. return console.warn("THREE.WebGLRenderTarget: .type is now .texture.type."),
  51886. this.texture.type
  51887. },
  51888. set: function(e) {
  51889. console.warn("THREE.WebGLRenderTarget: .type is now .texture.type."),
  51890. this.texture.type = e
  51891. }
  51892. },
  51893. generateMipmaps: {
  51894. get: function() {
  51895. return console.warn("THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps."),
  51896. this.texture.generateMipmaps
  51897. },
  51898. set: function(e) {
  51899. console.warn("THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps."),
  51900. this.texture.generateMipmaps = e
  51901. }
  51902. }
  51903. }),
  51904. Ci.GeometryUtils = {
  51905. merge: function(e, t, i) {
  51906. var n;
  51907. console.warn("THREE.GeometryUtils: .merge() has been moved to Geometry. Use geometry.merge( geometry2, matrix, materialIndexOffset ) instead."),
  51908. t instanceof Ci.Mesh && (t.matrixAutoUpdate && t.updateMatrix(),
  51909. n = t.matrix,
  51910. t = t.geometry),
  51911. e.merge(t, n, i)
  51912. },
  51913. center: function(e) {
  51914. return console.warn("THREE.GeometryUtils: .center() has been moved to Geometry. Use geometry.center() instead."),
  51915. e.center()
  51916. }
  51917. },
  51918. Ci.ImageUtils = {
  51919. crossOrigin: void 0,
  51920. loadTexture: function(e, t, i, n) {
  51921. console.warn("THREE.ImageUtils.loadTexture has been deprecated. Use THREE.TextureLoader() instead.");
  51922. var r = new Ci.TextureLoader;
  51923. r.setCrossOrigin(this.crossOrigin);
  51924. var o = r.load(e, i, void 0, n);
  51925. return t && (o.mapping = t),
  51926. o
  51927. },
  51928. loadTextureCube: function(e, t, i, n) {
  51929. console.warn("THREE.ImageUtils.loadTextureCube has been deprecated. Use THREE.CubeTextureLoader() instead.");
  51930. var r = new Ci.CubeTextureLoader;
  51931. r.setCrossOrigin(this.crossOrigin);
  51932. var o = r.load(e, i, void 0, n);
  51933. return t && (o.mapping = t),
  51934. o
  51935. },
  51936. loadCompressedTexture: function() {
  51937. console.error("THREE.ImageUtils.loadCompressedTexture has been removed. Use THREE.DDSLoader instead.")
  51938. },
  51939. loadCompressedTextureCube: function() {
  51940. console.error("THREE.ImageUtils.loadCompressedTextureCube has been removed. Use THREE.DDSLoader instead.")
  51941. }
  51942. },
  51943. Ci.Projector = function() {
  51944. console.error("THREE.Projector has been moved to /examples/js/renderers/Projector.js."),
  51945. this.projectVector = function(e, t) {
  51946. console.warn("THREE.Projector: .projectVector() is now vector.project()."),
  51947. e.project(t)
  51948. }
  51949. ,
  51950. this.unprojectVector = function(e, t) {
  51951. console.warn("THREE.Projector: .unprojectVector() is now vector.unproject()."),
  51952. e.unproject(t)
  51953. }
  51954. ,
  51955. this.pickingRay = function(e, t) {
  51956. console.error("THREE.Projector: .pickingRay() is now raycaster.setFromCamera().")
  51957. }
  51958. }
  51959. ,
  51960. Ci.CanvasRenderer = function() {
  51961. console.error("THREE.CanvasRenderer has been moved to /examples/js/renderers/CanvasRenderer.js"),
  51962. this.domElement = document.createElement("canvas"),
  51963. this.clear = function() {}
  51964. ,
  51965. this.render = function() {}
  51966. ,
  51967. this.setClearColor = function() {}
  51968. ,
  51969. this.setSize = function() {}
  51970. }
  51971. ,
  51972. Ci.MeshFaceMaterial = Ci.MultiMaterial,
  51973. Ci.CurveUtils = {
  51974. tangentQuadraticBezier: function(e, t, i, n) {
  51975. return 2 * (1 - e) * (i - t) + 2 * e * (n - i)
  51976. },
  51977. tangentCubicBezier: function(e, t, i, n, r) {
  51978. 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
  51979. },
  51980. tangentSpline: function(e, t, i, n, r) {
  51981. return 6 * e * e - 6 * e + (3 * e * e - 4 * e + 1) + (-6 * e * e + 6 * e) + (3 * e * e - 2 * e)
  51982. },
  51983. interpolate: function(e, t, i, n, r) {
  51984. var o = .5 * (i - e)
  51985. , a = .5 * (n - t)
  51986. , s = r * r;
  51987. return (2 * t - 2 * i + o + a) * (r * s) + (-3 * t + 3 * i - 2 * o - a) * s + o * r + t
  51988. }
  51989. },
  51990. Ci.SceneUtils = {
  51991. createMultiMaterialObject: function(e, t) {
  51992. for (var i = new Ci.Group, n = 0, r = t.length; n < r; n++)
  51993. i.add(new Ci.Mesh(e,t[n]));
  51994. return i
  51995. },
  51996. detach: function(e, t, i) {
  51997. e.applyMatrix(t.matrixWorld),
  51998. t.remove(e),
  51999. i.add(e)
  52000. },
  52001. attach: function(e, t, i) {
  52002. var n = new Ci.Matrix4;
  52003. n.getInverse(i.matrixWorld),
  52004. e.applyMatrix(n),
  52005. t.remove(e),
  52006. i.add(e)
  52007. }
  52008. },
  52009. Ci.ShapeUtils = {
  52010. area: function(e) {
  52011. for (var t = e.length, i = 0, n = t - 1, r = 0; r < t; n = r++)
  52012. i += e[n].x * e[r].y - e[r].x * e[n].y;
  52013. return .5 * i
  52014. },
  52015. triangulate: function(e, t) {
  52016. var i = e.length;
  52017. if (i < 3)
  52018. return null;
  52019. var n, r, o, a = [], s = [], l = [];
  52020. if (0 < Ci.ShapeUtils.area(e))
  52021. for (r = 0; r < i; r++)
  52022. s[r] = r;
  52023. else
  52024. for (r = 0; r < i; r++)
  52025. s[r] = i - 1 - r;
  52026. var c = i
  52027. , h = 2 * c;
  52028. for (r = c - 1; 2 < c; ) {
  52029. if (h-- <= 0)
  52030. return console.warn("THREE.ShapeUtils: Unable to triangulate polygon! in triangulate()"),
  52031. t ? l : a;
  52032. if (c <= (n = r) && (n = 0),
  52033. c <= (r = n + 1) && (r = 0),
  52034. c <= (o = r + 1) && (o = 0),
  52035. Si(e, n, r, o, c, s)) {
  52036. var u, d, p, f, g;
  52037. for (u = s[n],
  52038. d = s[r],
  52039. p = s[o],
  52040. a.push([e[u], e[d], e[p]]),
  52041. l.push([s[n], s[r], s[o]]),
  52042. g = (f = r) + 1; g < c; f++,
  52043. g++)
  52044. s[f] = s[g];
  52045. h = 2 * --c
  52046. }
  52047. }
  52048. return t ? l : a
  52049. },
  52050. triangulateShape: function(e, t) {
  52051. function w(e, t, i) {
  52052. 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
  52053. }
  52054. function b(e, t, i, n, r) {
  52055. var o = t.x - e.x
  52056. , a = t.y - e.y
  52057. , s = n.x - i.x
  52058. , l = n.y - i.y
  52059. , c = e.x - i.x
  52060. , h = e.y - i.y
  52061. , u = a * s - o * l
  52062. , d = a * c - o * h;
  52063. if (Math.abs(u) > Number.EPSILON) {
  52064. var p;
  52065. if (0 < u) {
  52066. if (d < 0 || u < d)
  52067. return [];
  52068. if ((p = l * c - s * h) < 0 || u < p)
  52069. return []
  52070. } else {
  52071. if (0 < d || d < u)
  52072. return [];
  52073. if (0 < (p = l * c - s * h) || p < u)
  52074. return []
  52075. }
  52076. if (0 === p)
  52077. return !r || 0 != d && d != u ? [e] : [];
  52078. if (p === u)
  52079. return !r || 0 != d && d != u ? [t] : [];
  52080. if (0 == d)
  52081. return [i];
  52082. if (d == u)
  52083. return [n];
  52084. var f = p / u;
  52085. return [{
  52086. x: e.x + f * o,
  52087. y: e.y + f * a
  52088. }]
  52089. }
  52090. if (0 != d || l * c != s * h)
  52091. return [];
  52092. var g, m, v, y, A, C, I, E, _ = 0 == o && 0 == a, b = 0 == s && 0 == l;
  52093. 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,
  52094. (m = t).x) : (v = (g = t).x,
  52095. (m = e).x),
  52096. i.x < n.x ? (I = (A = i).x,
  52097. (C = n).x) : (I = (A = n).x,
  52098. (C = i).x)) : (y = e.y < t.y ? (v = (g = e).y,
  52099. (m = t).y) : (v = (g = t).y,
  52100. (m = e).y),
  52101. i.y < n.y ? (I = (A = i).y,
  52102. (C = n).y) : (I = (A = n).y,
  52103. (C = i).y)),
  52104. 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])
  52105. }
  52106. function T(e, t, i, n) {
  52107. var r = t.x - e.x
  52108. , o = t.y - e.y
  52109. , a = i.x - e.x
  52110. , s = i.y - e.y
  52111. , l = n.x - e.x
  52112. , c = n.y - e.y
  52113. , h = r * s - o * a
  52114. , u = r * c - o * l;
  52115. if (Math.abs(h) > Number.EPSILON) {
  52116. var d = l * s - c * a;
  52117. return 0 < h ? 0 <= u && 0 <= d : 0 <= u || 0 <= d
  52118. }
  52119. return 0 < u
  52120. }
  52121. for (var i, n, r, o, a, s, l = {}, c = e.concat(), h = 0, u = t.length; h < u; h++)
  52122. Array.prototype.push.apply(c, t[h]);
  52123. for (i = 0,
  52124. n = c.length; i < n; i++)
  52125. void 0 !== l[a = c[i].x + ":" + c[i].y] && console.warn("THREE.Shape: Duplicate point", a),
  52126. l[a] = i;
  52127. var d = function(e, a) {
  52128. function t(e, t) {
  52129. var i = m.length - 1
  52130. , n = e - 1;
  52131. n < 0 && (n = i);
  52132. var r = e + 1;
  52133. i < r && (r = 0);
  52134. var o = T(m[e], m[n], m[r], c[t]);
  52135. if (!o)
  52136. return !1;
  52137. var a = c.length - 1
  52138. , s = t - 1;
  52139. s < 0 && (s = a);
  52140. var l = t + 1;
  52141. return a < l && (l = 0),
  52142. !!(o = T(c[t], c[s], c[l], m[e]))
  52143. }
  52144. function i(e, t) {
  52145. var i, n;
  52146. for (i = 0; i < m.length; i++)
  52147. if (n = i + 1,
  52148. n %= m.length,
  52149. 0 < b(e, t, m[i], m[n], !0).length)
  52150. return !0;
  52151. return !1
  52152. }
  52153. function n(e, t) {
  52154. var i, n, r, o;
  52155. for (i = 0; i < v.length; i++)
  52156. for (n = a[v[i]],
  52157. r = 0; r < n.length; r++)
  52158. if (o = r + 1,
  52159. o %= n.length,
  52160. 0 < b(e, t, n[r], n[o], !0).length)
  52161. return !0;
  52162. return !1
  52163. }
  52164. 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++)
  52165. v.push(A);
  52166. for (var I = 0, E = 2 * v.length; 0 < v.length; ) {
  52167. if (--E < 0) {
  52168. console.log("Infinite Loop! Holes left:" + v.length + ", Probably Hole outside Shape!");
  52169. break
  52170. }
  52171. for (o = I; o < m.length; o++) {
  52172. s = m[o],
  52173. r = -1;
  52174. for (A = 0; A < v.length; A++)
  52175. if (h = v[A],
  52176. void 0 === y[u = s.x + ":" + s.y + ":" + h]) {
  52177. c = a[h];
  52178. for (var _ = 0; _ < c.length; _++)
  52179. if (l = c[_],
  52180. t(o, _) && !i(s, l) && !n(s, l)) {
  52181. r = _,
  52182. v.splice(A, 1),
  52183. d = m.slice(0, o + 1),
  52184. p = m.slice(o),
  52185. f = c.slice(r),
  52186. g = c.slice(0, r + 1),
  52187. m = d.concat(f).concat(g).concat(p),
  52188. I = o;
  52189. break
  52190. }
  52191. if (0 <= r)
  52192. break;
  52193. y[u] = !0
  52194. }
  52195. if (0 <= r)
  52196. break
  52197. }
  52198. }
  52199. return m
  52200. }(e, t)
  52201. , p = Ci.ShapeUtils.triangulate(d, !1);
  52202. for (i = 0,
  52203. n = p.length; i < n; i++)
  52204. for (o = p[i],
  52205. r = 0; r < 3; r++)
  52206. void 0 !== (s = l[a = o[r].x + ":" + o[r].y]) && (o[r] = s);
  52207. return p.concat()
  52208. },
  52209. isClockWise: function(e) {
  52210. return Ci.ShapeUtils.area(e) < 0
  52211. },
  52212. b2: function(e, t, i, n) {
  52213. return function(e, t) {
  52214. var i = 1 - e;
  52215. return i * i * t
  52216. }(e, t) + function(e, t) {
  52217. return 2 * (1 - e) * e * t
  52218. }(e, i) + function(e, t) {
  52219. return e * e * t
  52220. }(e, n)
  52221. },
  52222. b3: function(e, t, i, n, r) {
  52223. return function(e, t) {
  52224. var i = 1 - e;
  52225. return i * i * i * t
  52226. }(e, t) + function(e, t) {
  52227. var i = 1 - e;
  52228. return 3 * i * i * e * t
  52229. }(e, i) + function(e, t) {
  52230. return 3 * (1 - e) * e * e * t
  52231. }(e, n) + function(e, t) {
  52232. return e * e * e * t
  52233. }(e, r)
  52234. }
  52235. },
  52236. Ci.Curve = function() {}
  52237. ,
  52238. Ci.Curve.prototype = {
  52239. constructor: Ci.Curve,
  52240. getPoint: function(e) {
  52241. return console.warn("THREE.Curve: Warning, getPoint() not implemented!"),
  52242. null
  52243. },
  52244. getPointAt: function(e) {
  52245. var t = this.getUtoTmapping(e);
  52246. return this.getPoint(t)
  52247. },
  52248. getPoints: function(e) {
  52249. e = e || 5;
  52250. var t, i = [];
  52251. for (t = 0; t <= e; t++)
  52252. i.push(this.getPoint(t / e));
  52253. return i
  52254. },
  52255. getSpacedPoints: function(e) {
  52256. e = e || 5;
  52257. var t, i = [];
  52258. for (t = 0; t <= e; t++)
  52259. i.push(this.getPointAt(t / e));
  52260. return i
  52261. },
  52262. getLength: function() {
  52263. var e = this.getLengths();
  52264. return e[e.length - 1]
  52265. },
  52266. getLengths: function(e) {
  52267. if (e = e || (this.__arcLengthDivisions ? this.__arcLengthDivisions : 200),
  52268. this.cacheArcLengths && this.cacheArcLengths.length === e + 1 && !this.needsUpdate)
  52269. return this.cacheArcLengths;
  52270. this.needsUpdate = !1;
  52271. var t, i, n = [], r = this.getPoint(0), o = 0;
  52272. for (n.push(0),
  52273. i = 1; i <= e; i++)
  52274. o += (t = this.getPoint(i / e)).distanceTo(r),
  52275. n.push(o),
  52276. r = t;
  52277. return this.cacheArcLengths = n
  52278. },
  52279. updateArcLengths: function() {
  52280. this.needsUpdate = !0,
  52281. this.getLengths()
  52282. },
  52283. getUtoTmapping: function(e, t) {
  52284. var i, n = this.getLengths(), r = 0, o = n.length;
  52285. i = t || e * n[o - 1];
  52286. for (var a, s = 0, l = o - 1; s <= l; )
  52287. if ((a = n[r = Math.floor(s + (l - s) / 2)] - i) < 0)
  52288. s = r + 1;
  52289. else {
  52290. if (!(0 < a)) {
  52291. l = r;
  52292. break
  52293. }
  52294. l = r - 1
  52295. }
  52296. if (n[r = l] === i)
  52297. return r / (o - 1);
  52298. var c = n[r];
  52299. return (r + (i - c) / (n[r + 1] - c)) / (o - 1)
  52300. },
  52301. getTangent: function(e) {
  52302. var t = e - 1e-4
  52303. , i = e + 1e-4;
  52304. t < 0 && (t = 0),
  52305. 1 < i && (i = 1);
  52306. var n = this.getPoint(t);
  52307. return this.getPoint(i).clone().sub(n).normalize()
  52308. },
  52309. getTangentAt: function(e) {
  52310. var t = this.getUtoTmapping(e);
  52311. return this.getTangent(t)
  52312. }
  52313. },
  52314. Ci.Curve.create = function(e, t) {
  52315. return e.prototype = Object.create(Ci.Curve.prototype),
  52316. (e.prototype.constructor = e).prototype.getPoint = t,
  52317. e
  52318. }
  52319. ,
  52320. Ci.CurvePath = function() {
  52321. this.curves = [],
  52322. this.autoClose = !1
  52323. }
  52324. ,
  52325. Ci.CurvePath.prototype = Object.create(Ci.Curve.prototype),
  52326. Ci.CurvePath.prototype.constructor = Ci.CurvePath,
  52327. Ci.CurvePath.prototype.add = function(e) {
  52328. this.curves.push(e)
  52329. }
  52330. ,
  52331. Ci.CurvePath.prototype.closePath = function() {
  52332. var e = this.curves[0].getPoint(0)
  52333. , t = this.curves[this.curves.length - 1].getPoint(1);
  52334. e.equals(t) || this.curves.push(new Ci.LineCurve(t,e))
  52335. }
  52336. ,
  52337. Ci.CurvePath.prototype.getPoint = function(e) {
  52338. for (var t = e * this.getLength(), i = this.getCurveLengths(), n = 0; n < i.length; ) {
  52339. if (i[n] >= t) {
  52340. var r = i[n] - t
  52341. , o = this.curves[n]
  52342. , a = 1 - r / o.getLength();
  52343. return o.getPointAt(a)
  52344. }
  52345. n++
  52346. }
  52347. return null
  52348. }
  52349. ,
  52350. Ci.CurvePath.prototype.getLength = function() {
  52351. var e = this.getCurveLengths();
  52352. return e[e.length - 1]
  52353. }
  52354. ,
  52355. Ci.CurvePath.prototype.getCurveLengths = function() {
  52356. if (this.cacheLengths && this.cacheLengths.length === this.curves.length)
  52357. return this.cacheLengths;
  52358. for (var e = [], t = 0, i = 0, n = this.curves.length; i < n; i++)
  52359. t += this.curves[i].getLength(),
  52360. e.push(t);
  52361. return this.cacheLengths = e
  52362. }
  52363. ,
  52364. Ci.CurvePath.prototype.createPointsGeometry = function(e) {
  52365. var t = this.getPoints(e);
  52366. return this.createGeometry(t)
  52367. }
  52368. ,
  52369. Ci.CurvePath.prototype.createSpacedPointsGeometry = function(e) {
  52370. var t = this.getSpacedPoints(e);
  52371. return this.createGeometry(t)
  52372. }
  52373. ,
  52374. Ci.CurvePath.prototype.createGeometry = function(e) {
  52375. for (var t = new Ci.Geometry, i = 0, n = e.length; i < n; i++) {
  52376. var r = e[i];
  52377. t.vertices.push(new Ci.Vector3(r.x,r.y,r.z || 0))
  52378. }
  52379. return t
  52380. }
  52381. ,
  52382. Ci.Font = function(e) {
  52383. this.data = e
  52384. }
  52385. ,
  52386. Ci.Font.prototype = {
  52387. constructor: Ci.Font,
  52388. generateShapes: function(e, s, b) {
  52389. function l(e, t, i) {
  52390. var n = w.glyphs[e] || w.glyphs["?"];
  52391. if (n) {
  52392. 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;
  52393. if (n.o)
  52394. for (var A = n._cachedOutline || (n._cachedOutline = n.o.split(" ")), C = 0, I = A.length; C < I; ) {
  52395. switch (A[C++]) {
  52396. case "m":
  52397. r = A[C++] * t + i,
  52398. o = A[C++] * t,
  52399. g.moveTo(r, o);
  52400. break;
  52401. case "l":
  52402. r = A[C++] * t + i,
  52403. o = A[C++] * t,
  52404. g.lineTo(r, o);
  52405. break;
  52406. case "q":
  52407. if (a = A[C++] * t + i,
  52408. s = A[C++] * t,
  52409. h = A[C++] * t + i,
  52410. u = A[C++] * t,
  52411. g.quadraticCurveTo(h, u, a, s),
  52412. f = m[m.length - 1]) {
  52413. l = f.x,
  52414. c = f.y;
  52415. for (var E = 1; E <= b; E++) {
  52416. v(_ = E / b, l, h, a),
  52417. v(_, c, u, s)
  52418. }
  52419. }
  52420. break;
  52421. case "b":
  52422. if (a = A[C++] * t + i,
  52423. s = A[C++] * t,
  52424. h = A[C++] * t + i,
  52425. u = A[C++] * t,
  52426. d = A[C++] * t + i,
  52427. p = A[C++] * t,
  52428. g.bezierCurveTo(h, u, d, p, a, s),
  52429. f = m[m.length - 1]) {
  52430. l = f.x,
  52431. c = f.y;
  52432. for (E = 1; E <= b; E++) {
  52433. var _;
  52434. y(_ = E / b, l, h, d, a),
  52435. y(_, c, u, p, s)
  52436. }
  52437. }
  52438. }
  52439. }
  52440. return {
  52441. offset: n.ha * t,
  52442. path: g
  52443. }
  52444. }
  52445. }
  52446. void 0 === s && (s = 100),
  52447. void 0 === b && (b = 4);
  52448. for (var w = this.data, t = function(e) {
  52449. for (var t = String(e).split(""), i = s / w.resolution, n = 0, r = [], o = 0; o < t.length; o++) {
  52450. var a = l(t[o], i, n);
  52451. n += a.offset,
  52452. r.push(a.path)
  52453. }
  52454. return r
  52455. }(e), i = [], n = 0, r = t.length; n < r; n++)
  52456. Array.prototype.push.apply(i, t[n].toShapes());
  52457. return i
  52458. }
  52459. },
  52460. Ci.Path = function(e) {
  52461. Ci.CurvePath.call(this),
  52462. this.actions = [],
  52463. e && this.fromPoints(e)
  52464. }
  52465. ,
  52466. Ci.Path.prototype = Object.create(Ci.CurvePath.prototype),
  52467. Ci.Path.prototype.constructor = Ci.Path,
  52468. Ci.Path.prototype.fromPoints = function(e) {
  52469. this.moveTo(e[0].x, e[0].y);
  52470. for (var t = 1, i = e.length; t < i; t++)
  52471. this.lineTo(e[t].x, e[t].y)
  52472. }
  52473. ,
  52474. Ci.Path.prototype.moveTo = function(e, t) {
  52475. this.actions.push({
  52476. action: "moveTo",
  52477. args: [e, t]
  52478. })
  52479. }
  52480. ,
  52481. Ci.Path.prototype.lineTo = function(e, t) {
  52482. var i = this.actions[this.actions.length - 1].args
  52483. , n = i[i.length - 2]
  52484. , r = i[i.length - 1]
  52485. , o = new Ci.LineCurve(new Ci.Vector2(n,r),new Ci.Vector2(e,t));
  52486. this.curves.push(o),
  52487. this.actions.push({
  52488. action: "lineTo",
  52489. args: [e, t]
  52490. })
  52491. }
  52492. ,
  52493. Ci.Path.prototype.quadraticCurveTo = function(e, t, i, n) {
  52494. var r = this.actions[this.actions.length - 1].args
  52495. , o = r[r.length - 2]
  52496. , a = r[r.length - 1]
  52497. , s = new Ci.QuadraticBezierCurve(new Ci.Vector2(o,a),new Ci.Vector2(e,t),new Ci.Vector2(i,n));
  52498. this.curves.push(s),
  52499. this.actions.push({
  52500. action: "quadraticCurveTo",
  52501. args: [e, t, i, n]
  52502. })
  52503. }
  52504. ,
  52505. Ci.Path.prototype.bezierCurveTo = function(e, t, i, n, r, o) {
  52506. var a = this.actions[this.actions.length - 1].args
  52507. , s = a[a.length - 2]
  52508. , l = a[a.length - 1]
  52509. , c = new Ci.CubicBezierCurve(new Ci.Vector2(s,l),new Ci.Vector2(e,t),new Ci.Vector2(i,n),new Ci.Vector2(r,o));
  52510. this.curves.push(c),
  52511. this.actions.push({
  52512. action: "bezierCurveTo",
  52513. args: [e, t, i, n, r, o]
  52514. })
  52515. }
  52516. ,
  52517. Ci.Path.prototype.splineThru = function(e) {
  52518. var t = Array.prototype.slice.call(arguments)
  52519. , i = this.actions[this.actions.length - 1].args
  52520. , n = i[i.length - 2]
  52521. , r = i[i.length - 1]
  52522. , o = [new Ci.Vector2(n,r)];
  52523. Array.prototype.push.apply(o, e);
  52524. var a = new Ci.SplineCurve(o);
  52525. this.curves.push(a),
  52526. this.actions.push({
  52527. action: "splineThru",
  52528. args: t
  52529. })
  52530. }
  52531. ,
  52532. Ci.Path.prototype.arc = function(e, t, i, n, r, o) {
  52533. var a = this.actions[this.actions.length - 1].args
  52534. , s = a[a.length - 2]
  52535. , l = a[a.length - 1];
  52536. this.absarc(e + s, t + l, i, n, r, o)
  52537. }
  52538. ,
  52539. Ci.Path.prototype.absarc = function(e, t, i, n, r, o) {
  52540. this.absellipse(e, t, i, i, n, r, o)
  52541. }
  52542. ,
  52543. Ci.Path.prototype.ellipse = function(e, t, i, n, r, o, a, s) {
  52544. var l = this.actions[this.actions.length - 1].args
  52545. , c = l[l.length - 2]
  52546. , h = l[l.length - 1];
  52547. this.absellipse(e + c, t + h, i, n, r, o, a, s)
  52548. }
  52549. ,
  52550. Ci.Path.prototype.absellipse = function(e, t, i, n, r, o, a, s) {
  52551. var l = [e, t, i, n, r, o, a, s || 0]
  52552. , c = new Ci.EllipseCurve(e,t,i,n,r,o,a,s);
  52553. this.curves.push(c);
  52554. var h = c.getPoint(1);
  52555. l.push(h.x),
  52556. l.push(h.y),
  52557. this.actions.push({
  52558. action: "ellipse",
  52559. args: l
  52560. })
  52561. }
  52562. ,
  52563. Ci.Path.prototype.getSpacedPoints = function(e) {
  52564. e = e || 40;
  52565. for (var t = [], i = 0; i < e; i++)
  52566. t.push(this.getPoint(i / e));
  52567. return this.autoClose && t.push(t[0]),
  52568. t
  52569. }
  52570. ,
  52571. Ci.Path.prototype.getPoints = function(e) {
  52572. e = e || 12;
  52573. 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++) {
  52574. var v = this.actions[g]
  52575. , y = v.action
  52576. , A = v.args;
  52577. switch (y) {
  52578. case "moveTo":
  52579. case "lineTo":
  52580. f.push(new Ci.Vector2(A[0],A[1]));
  52581. break;
  52582. case "quadraticCurveTo":
  52583. t = A[2],
  52584. i = A[3],
  52585. o = A[0],
  52586. a = A[1],
  52587. l = 0 < f.length ? (s = (c = f[f.length - 1]).x,
  52588. c.y) : (s = (c = this.actions[g - 1].args)[c.length - 2],
  52589. c[c.length - 1]);
  52590. for (var C = 1; C <= e; C++) {
  52591. h = d(O = C / e, s, o, t),
  52592. u = d(O, l, a, i),
  52593. f.push(new Ci.Vector2(h,u))
  52594. }
  52595. break;
  52596. case "bezierCurveTo":
  52597. t = A[4],
  52598. i = A[5],
  52599. o = A[0],
  52600. a = A[1],
  52601. n = A[2],
  52602. r = A[3],
  52603. l = 0 < f.length ? (s = (c = f[f.length - 1]).x,
  52604. c.y) : (s = (c = this.actions[g - 1].args)[c.length - 2],
  52605. c[c.length - 1]);
  52606. for (C = 1; C <= e; C++) {
  52607. h = p(O = C / e, s, o, n, t),
  52608. u = p(O, l, a, r, i),
  52609. f.push(new Ci.Vector2(h,u))
  52610. }
  52611. break;
  52612. case "splineThru":
  52613. c = this.actions[g - 1].args;
  52614. var I = [new Ci.Vector2(c[c.length - 2],c[c.length - 1])]
  52615. , E = e * A[0].length;
  52616. I = I.concat(A[0]);
  52617. var _ = new Ci.SplineCurve(I);
  52618. for (C = 1; C <= E; C++)
  52619. f.push(_.getPointAt(C / E));
  52620. break;
  52621. case "arc":
  52622. var b = A[0]
  52623. , w = A[1]
  52624. , T = A[2]
  52625. , x = A[3]
  52626. , S = A[4]
  52627. , M = !!A[5]
  52628. , R = S - x
  52629. , P = 2 * e;
  52630. for (C = 1; C <= P; C++) {
  52631. var O = C / P;
  52632. M || (O = 1 - O),
  52633. L = x + O * R,
  52634. h = b + T * Math.cos(L),
  52635. u = w + T * Math.sin(L),
  52636. f.push(new Ci.Vector2(h,u))
  52637. }
  52638. break;
  52639. case "ellipse":
  52640. b = A[0],
  52641. w = A[1];
  52642. var L, D, N, F = A[2], B = A[3], V = (x = A[4],
  52643. S = A[5],
  52644. M = !!A[6],
  52645. A[7]);
  52646. R = S - x,
  52647. P = 2 * e;
  52648. 0 !== V && (D = Math.cos(V),
  52649. N = Math.sin(V));
  52650. for (C = 1; C <= P; C++) {
  52651. O = C / P;
  52652. if (M || (O = 1 - O),
  52653. L = x + O * R,
  52654. h = b + F * Math.cos(L),
  52655. u = w + B * Math.sin(L),
  52656. 0 !== V) {
  52657. var k = h;
  52658. h = (k - b) * D - (u - w) * N + b,
  52659. u = (k - b) * N + (u - w) * D + w
  52660. }
  52661. f.push(new Ci.Vector2(h,u))
  52662. }
  52663. }
  52664. }
  52665. var U = f[f.length - 1];
  52666. 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),
  52667. this.autoClose && f.push(f[0]),
  52668. f
  52669. }
  52670. ,
  52671. Ci.Path.prototype.toShapes = function(e, t) {
  52672. function i(e) {
  52673. for (var t = [], i = 0, n = e.length; i < n; i++) {
  52674. var r = e[i]
  52675. , o = new Ci.Shape;
  52676. o.actions = r.actions,
  52677. o.curves = r.curves,
  52678. t.push(o)
  52679. }
  52680. return t
  52681. }
  52682. function n(e, t) {
  52683. for (var i = t.length, n = !1, r = i - 1, o = 0; o < i; r = o++) {
  52684. var a = t[r]
  52685. , s = t[o]
  52686. , l = s.x - a.x
  52687. , c = s.y - a.y;
  52688. if (Math.abs(c) > Number.EPSILON) {
  52689. if (c < 0 && (a = t[o],
  52690. l = -l,
  52691. s = t[r],
  52692. c = -c),
  52693. e.y < a.y || e.y > s.y)
  52694. continue;
  52695. if (e.y === a.y) {
  52696. if (e.x === a.x)
  52697. return !0
  52698. } else {
  52699. var h = c * (e.x - a.x) - l * (e.y - a.y);
  52700. if (0 == h)
  52701. return !0;
  52702. if (h < 0)
  52703. continue;
  52704. n = !n
  52705. }
  52706. } else {
  52707. if (e.y !== a.y)
  52708. continue;
  52709. if (s.x <= e.x && e.x <= a.x || a.x <= e.x && e.x <= s.x)
  52710. return !0
  52711. }
  52712. }
  52713. return n
  52714. }
  52715. var r = Ci.ShapeUtils.isClockWise
  52716. , o = function(e) {
  52717. for (var t = [], i = new Ci.Path, n = 0, r = e.length; n < r; n++) {
  52718. var o = e[n]
  52719. , a = o.args
  52720. , s = o.action;
  52721. "moveTo" === s && 0 !== i.actions.length && (t.push(i),
  52722. i = new Ci.Path),
  52723. i[s].apply(i, a)
  52724. }
  52725. return 0 !== i.actions.length && t.push(i),
  52726. t
  52727. }(this.actions);
  52728. if (0 === o.length)
  52729. return [];
  52730. if (!0 === t)
  52731. return i(o);
  52732. var a, s, l, c = [];
  52733. if (1 === o.length)
  52734. return s = o[0],
  52735. (l = new Ci.Shape).actions = s.actions,
  52736. l.curves = s.curves,
  52737. c.push(l),
  52738. c;
  52739. var h = !r(o[0].getPoints());
  52740. h = e ? !h : h;
  52741. var u, d = [], p = [], f = [], g = 0;
  52742. p[g] = void 0,
  52743. f[g] = [];
  52744. for (var m = 0, v = o.length; m < v; m++)
  52745. a = r(u = (s = o[m]).getPoints()),
  52746. (a = e ? !a : a) ? (!h && p[g] && g++,
  52747. p[g] = {
  52748. s: new Ci.Shape,
  52749. p: u
  52750. },
  52751. p[g].s.actions = s.actions,
  52752. p[g].s.curves = s.curves,
  52753. h && g++,
  52754. f[g] = []) : f[g].push({
  52755. h: s,
  52756. p: u[0]
  52757. });
  52758. if (!p[0])
  52759. return i(o);
  52760. if (1 < p.length) {
  52761. for (var y = !1, A = [], C = 0, I = p.length; C < I; C++)
  52762. d[C] = [];
  52763. for (C = 0,
  52764. I = p.length; C < I; C++)
  52765. for (var E = f[C], _ = 0; _ < E.length; _++) {
  52766. for (var b = E[_], w = !0, T = 0; T < p.length; T++)
  52767. n(b.p, p[T].p) && (C !== T && A.push({
  52768. froms: C,
  52769. tos: T,
  52770. hole: _
  52771. }),
  52772. w ? (w = !1,
  52773. d[T].push(b)) : y = !0);
  52774. w && d[C].push(b)
  52775. }
  52776. 0 < A.length && (y || (f = d))
  52777. }
  52778. m = 0;
  52779. for (var x, S = p.length; m < S; m++) {
  52780. l = p[m].s,
  52781. c.push(l);
  52782. for (var M = 0, R = (x = f[m]).length; M < R; M++)
  52783. l.holes.push(x[M].h)
  52784. }
  52785. return c
  52786. }
  52787. ,
  52788. Ci.Shape = function() {
  52789. Ci.Path.apply(this, arguments),
  52790. this.holes = []
  52791. }
  52792. ,
  52793. Ci.Shape.prototype = Object.create(Ci.Path.prototype),
  52794. Ci.Shape.prototype.constructor = Ci.Shape,
  52795. Ci.Shape.prototype.extrude = function(e) {
  52796. return new Ci.ExtrudeGeometry(this,e)
  52797. }
  52798. ,
  52799. Ci.Shape.prototype.makeGeometry = function(e) {
  52800. return new Ci.ShapeGeometry(this,e)
  52801. }
  52802. ,
  52803. Ci.Shape.prototype.getPointsHoles = function(e) {
  52804. for (var t = [], i = 0, n = this.holes.length; i < n; i++)
  52805. t[i] = this.holes[i].getPoints(e);
  52806. return t
  52807. }
  52808. ,
  52809. Ci.Shape.prototype.extractAllPoints = function(e) {
  52810. return {
  52811. shape: this.getPoints(e),
  52812. holes: this.getPointsHoles(e)
  52813. }
  52814. }
  52815. ,
  52816. Ci.Shape.prototype.extractPoints = function(e) {
  52817. return this.extractAllPoints(e)
  52818. }
  52819. ,
  52820. Ci.LineCurve = function(e, t) {
  52821. this.v1 = e,
  52822. this.v2 = t
  52823. }
  52824. ,
  52825. Ci.LineCurve.prototype = Object.create(Ci.Curve.prototype),
  52826. Ci.LineCurve.prototype.constructor = Ci.LineCurve,
  52827. Ci.LineCurve.prototype.getPoint = function(e) {
  52828. var t = this.v2.clone().sub(this.v1);
  52829. return t.multiplyScalar(e).add(this.v1),
  52830. t
  52831. }
  52832. ,
  52833. Ci.LineCurve.prototype.getPointAt = function(e) {
  52834. return this.getPoint(e)
  52835. }
  52836. ,
  52837. Ci.LineCurve.prototype.getTangent = function(e) {
  52838. return this.v2.clone().sub(this.v1).normalize()
  52839. }
  52840. ,
  52841. Ci.QuadraticBezierCurve = function(e, t, i) {
  52842. this.v0 = e,
  52843. this.v1 = t,
  52844. this.v2 = i
  52845. }
  52846. ,
  52847. Ci.QuadraticBezierCurve.prototype = Object.create(Ci.Curve.prototype),
  52848. Ci.QuadraticBezierCurve.prototype.constructor = Ci.QuadraticBezierCurve,
  52849. Ci.QuadraticBezierCurve.prototype.getPoint = function(e) {
  52850. var t = Ci.ShapeUtils.b2;
  52851. 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))
  52852. }
  52853. ,
  52854. Ci.QuadraticBezierCurve.prototype.getTangent = function(e) {
  52855. var t = Ci.CurveUtils.tangentQuadraticBezier;
  52856. 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()
  52857. }
  52858. ,
  52859. Ci.CubicBezierCurve = function(e, t, i, n) {
  52860. this.v0 = e,
  52861. this.v1 = t,
  52862. this.v2 = i,
  52863. this.v3 = n
  52864. }
  52865. ,
  52866. Ci.CubicBezierCurve.prototype = Object.create(Ci.Curve.prototype),
  52867. Ci.CubicBezierCurve.prototype.constructor = Ci.CubicBezierCurve,
  52868. Ci.CubicBezierCurve.prototype.getPoint = function(e) {
  52869. var t = Ci.ShapeUtils.b3;
  52870. 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))
  52871. }
  52872. ,
  52873. Ci.CubicBezierCurve.prototype.getTangent = function(e) {
  52874. var t = Ci.CurveUtils.tangentCubicBezier;
  52875. 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()
  52876. }
  52877. ,
  52878. Ci.SplineCurve = function(e) {
  52879. this.points = null == e ? [] : e
  52880. }
  52881. ,
  52882. Ci.SplineCurve.prototype = Object.create(Ci.Curve.prototype),
  52883. Ci.SplineCurve.prototype.constructor = Ci.SplineCurve,
  52884. Ci.SplineCurve.prototype.getPoint = function(e) {
  52885. var t = this.points
  52886. , i = (t.length - 1) * e
  52887. , n = Math.floor(i)
  52888. , r = i - n
  52889. , o = t[0 === n ? n : n - 1]
  52890. , a = t[n]
  52891. , s = t[n > t.length - 2 ? t.length - 1 : n + 1]
  52892. , l = t[n > t.length - 3 ? t.length - 1 : n + 2]
  52893. , c = Ci.CurveUtils.interpolate;
  52894. return new Ci.Vector2(c(o.x, a.x, s.x, l.x, r),c(o.y, a.y, s.y, l.y, r))
  52895. }
  52896. ,
  52897. Ci.EllipseCurve = function(e, t, i, n, r, o, a, s) {
  52898. this.aX = e,
  52899. this.aY = t,
  52900. this.xRadius = i,
  52901. this.yRadius = n,
  52902. this.aStartAngle = r,
  52903. this.aEndAngle = o,
  52904. this.aClockwise = a,
  52905. this.aRotation = s || 0
  52906. }
  52907. ,
  52908. Ci.EllipseCurve.prototype = Object.create(Ci.Curve.prototype),
  52909. Ci.EllipseCurve.prototype.constructor = Ci.EllipseCurve,
  52910. Ci.EllipseCurve.prototype.getPoint = function(e) {
  52911. var t, i = this.aEndAngle - this.aStartAngle;
  52912. i < 0 && (i += 2 * Math.PI),
  52913. i > 2 * Math.PI && (i -= 2 * Math.PI),
  52914. t = !0 === this.aClockwise ? this.aEndAngle + (1 - e) * (2 * Math.PI - i) : this.aStartAngle + e * i;
  52915. var n = this.aX + this.xRadius * Math.cos(t)
  52916. , r = this.aY + this.yRadius * Math.sin(t);
  52917. if (0 !== this.aRotation) {
  52918. var o = Math.cos(this.aRotation)
  52919. , a = Math.sin(this.aRotation)
  52920. , s = n
  52921. , l = r;
  52922. n = (s - this.aX) * o - (l - this.aY) * a + this.aX,
  52923. r = (s - this.aX) * a + (l - this.aY) * o + this.aY
  52924. }
  52925. return new Ci.Vector2(n,r)
  52926. }
  52927. ,
  52928. Ci.ArcCurve = function(e, t, i, n, r, o) {
  52929. Ci.EllipseCurve.call(this, e, t, i, i, n, r, o)
  52930. }
  52931. ,
  52932. Ci.ArcCurve.prototype = Object.create(Ci.EllipseCurve.prototype),
  52933. Ci.ArcCurve.prototype.constructor = Ci.ArcCurve,
  52934. Ci.LineCurve3 = Ci.Curve.create(function(e, t) {
  52935. this.v1 = e,
  52936. this.v2 = t
  52937. }, function(e) {
  52938. var t = new Ci.Vector3;
  52939. return t.subVectors(this.v2, this.v1),
  52940. t.multiplyScalar(e),
  52941. t.add(this.v1),
  52942. t
  52943. }),
  52944. Ci.QuadraticBezierCurve3 = Ci.Curve.create(function(e, t, i) {
  52945. this.v0 = e,
  52946. this.v1 = t,
  52947. this.v2 = i
  52948. }, function(e) {
  52949. var t = Ci.ShapeUtils.b2;
  52950. 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))
  52951. }),
  52952. Ci.CubicBezierCurve3 = Ci.Curve.create(function(e, t, i, n) {
  52953. this.v0 = e,
  52954. this.v1 = t,
  52955. this.v2 = i,
  52956. this.v3 = n
  52957. }, function(e) {
  52958. var t = Ci.ShapeUtils.b3;
  52959. 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))
  52960. }),
  52961. Ci.SplineCurve3 = Ci.Curve.create(function(e) {
  52962. console.warn("THREE.SplineCurve3 will be deprecated. Please use THREE.CatmullRomCurve3"),
  52963. this.points = null == e ? [] : e
  52964. }, function(e) {
  52965. var t = this.points
  52966. , i = (t.length - 1) * e
  52967. , n = Math.floor(i)
  52968. , r = i - n
  52969. , o = t[0 == n ? n : n - 1]
  52970. , a = t[n]
  52971. , s = t[n > t.length - 2 ? t.length - 1 : n + 1]
  52972. , l = t[n > t.length - 3 ? t.length - 1 : n + 2]
  52973. , c = Ci.CurveUtils.interpolate;
  52974. 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))
  52975. }),
  52976. Ci.CatmullRomCurve3 = (qt = new Ci.Vector3,
  52977. Xt = new xi,
  52978. Zt = new xi,
  52979. Kt = new xi,
  52980. xi.prototype.init = function(e, t, i, n) {
  52981. this.c0 = e,
  52982. this.c1 = i,
  52983. this.c2 = -3 * e + 3 * t - 2 * i - n,
  52984. this.c3 = 2 * e - 2 * t + i + n
  52985. }
  52986. ,
  52987. xi.prototype.initNonuniformCatmullRom = function(e, t, i, n, r, o, a) {
  52988. var s = (t - e) / r - (i - e) / (r + o) + (i - t) / o
  52989. , l = (i - t) / o - (n - t) / (o + a) + (n - i) / a;
  52990. s *= o,
  52991. l *= o,
  52992. this.init(t, i, s, l)
  52993. }
  52994. ,
  52995. xi.prototype.initCatmullRom = function(e, t, i, n, r) {
  52996. this.init(t, i, r * (i - e), r * (n - t))
  52997. }
  52998. ,
  52999. xi.prototype.calc = function(e) {
  53000. var t = e * e
  53001. , i = t * e;
  53002. return this.c0 + this.c1 * e + this.c2 * t + this.c3 * i
  53003. }
  53004. ,
  53005. Ci.Curve.create(function(e) {
  53006. this.points = e || [],
  53007. this.closed = !1
  53008. }, function(e) {
  53009. var t, i, n, r, o, a, s, l, c = this.points;
  53010. if ((r = c.length) < 2 && console.log("duh, you need at least 2 points"),
  53011. n = (t = (r - (this.closed ? 0 : 1)) * e) - (i = Math.floor(t)),
  53012. this.closed ? i += 0 < i ? 0 : (Math.floor(Math.abs(i) / c.length) + 1) * c.length : 0 === n && i === r - 1 && (i = r - 2,
  53013. n = 1),
  53014. o = this.closed || 0 < i ? c[(i - 1) % r] : (qt.subVectors(c[0], c[1]).add(c[0]),
  53015. qt),
  53016. a = c[i % r],
  53017. s = c[(i + 1) % r],
  53018. l = this.closed || i + 2 < r ? c[(i + 2) % r] : (qt.subVectors(c[r - 1], c[r - 2]).add(c[r - 1]),
  53019. qt),
  53020. void 0 === this.type || "centripetal" === this.type || "chordal" === this.type) {
  53021. var h = "chordal" === this.type ? .5 : .25
  53022. , u = Math.pow(o.distanceToSquared(a), h)
  53023. , d = Math.pow(a.distanceToSquared(s), h)
  53024. , p = Math.pow(s.distanceToSquared(l), h);
  53025. d < 1e-4 && (d = 1),
  53026. u < 1e-4 && (u = d),
  53027. p < 1e-4 && (p = d),
  53028. Xt.initNonuniformCatmullRom(o.x, a.x, s.x, l.x, u, d, p),
  53029. Zt.initNonuniformCatmullRom(o.y, a.y, s.y, l.y, u, d, p),
  53030. Kt.initNonuniformCatmullRom(o.z, a.z, s.z, l.z, u, d, p)
  53031. } else if ("catmullrom" === this.type) {
  53032. var f = void 0 !== this.tension ? this.tension : .5;
  53033. Xt.initCatmullRom(o.x, a.x, s.x, l.x, f),
  53034. Zt.initCatmullRom(o.y, a.y, s.y, l.y, f),
  53035. Kt.initCatmullRom(o.z, a.z, s.z, l.z, f)
  53036. }
  53037. return new Ci.Vector3(Xt.calc(n),Zt.calc(n),Kt.calc(n))
  53038. })),
  53039. Ci.ClosedSplineCurve3 = function(e) {
  53040. console.warn("THREE.ClosedSplineCurve3 has been deprecated. Please use THREE.CatmullRomCurve3."),
  53041. Ci.CatmullRomCurve3.call(this, e),
  53042. this.type = "catmullrom",
  53043. this.closed = !0
  53044. }
  53045. ,
  53046. Ci.ClosedSplineCurve3.prototype = Object.create(Ci.CatmullRomCurve3.prototype),
  53047. Ci.BoxGeometry = function(e, t, i, n, r, o) {
  53048. Ci.Geometry.call(this),
  53049. this.type = "BoxGeometry",
  53050. this.parameters = {
  53051. width: e,
  53052. height: t,
  53053. depth: i,
  53054. widthSegments: n,
  53055. heightSegments: r,
  53056. depthSegments: o
  53057. },
  53058. this.fromBufferGeometry(new Ci.BoxBufferGeometry(e,t,i,n,r,o)),
  53059. this.mergeVertices()
  53060. }
  53061. ,
  53062. Ci.BoxGeometry.prototype = Object.create(Ci.Geometry.prototype),
  53063. Ci.BoxGeometry.prototype.constructor = Ci.BoxGeometry,
  53064. Ci.CubeGeometry = Ci.BoxGeometry,
  53065. Ci.BoxBufferGeometry = function(e, t, i, n, r, o) {
  53066. function a(e, t, i, n, r, o, a, s, l, c, h) {
  53067. 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++)
  53068. for (var E = I * d - f, _ = 0; _ < m; _++) {
  53069. var b = _ * u - p;
  53070. C[e] = b * n,
  53071. C[t] = E * r,
  53072. C[i] = g,
  53073. P[D] = C.x,
  53074. P[D + 1] = C.y,
  53075. P[D + 2] = C.z,
  53076. C[e] = 0,
  53077. C[t] = 0,
  53078. C[i] = 0 < s ? 1 : -1,
  53079. O[D] = C.x,
  53080. O[D + 1] = C.y,
  53081. O[D + 2] = C.z,
  53082. L[N] = _ / l,
  53083. L[N + 1] = 1 - I / c,
  53084. D += 3,
  53085. N += 2,
  53086. y += 1
  53087. }
  53088. for (I = 0; I < c; I++)
  53089. for (_ = 0; _ < l; _++) {
  53090. var w = B + _ + m * I
  53091. , T = B + _ + m * (I + 1)
  53092. , x = B + (_ + 1) + m * (I + 1)
  53093. , S = B + (_ + 1) + m * I;
  53094. R[F] = w,
  53095. R[F + 1] = T,
  53096. R[F + 2] = S,
  53097. R[F + 3] = T,
  53098. R[F + 4] = x,
  53099. R[F + 5] = S,
  53100. F += 6,
  53101. A += 6
  53102. }
  53103. M.addGroup(V, A, h),
  53104. V += A,
  53105. B += y
  53106. }
  53107. Ci.BufferGeometry.call(this),
  53108. this.type = "BoxBufferGeometry",
  53109. this.parameters = {
  53110. width: e,
  53111. height: t,
  53112. depth: i,
  53113. widthSegments: n,
  53114. heightSegments: r,
  53115. depthSegments: o
  53116. };
  53117. var M = this;
  53118. n = Math.floor(n) || 1,
  53119. r = Math.floor(r) || 1,
  53120. o = Math.floor(o) || 1;
  53121. var s, l, c, h, u = (h = 0,
  53122. h += (s = n) * (l = r) * 2,
  53123. h += s * (c = o) * 2,
  53124. 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;
  53125. a("z", "y", "x", -1, -1, i, t, e, o, r, 0),
  53126. a("z", "y", "x", 1, -1, i, t, -e, o, r, 1),
  53127. a("x", "z", "y", 1, 1, e, i, t, n, o, 2),
  53128. a("x", "z", "y", 1, -1, e, i, -t, n, o, 3),
  53129. a("x", "y", "z", 1, -1, e, t, i, n, r, 4),
  53130. a("x", "y", "z", -1, -1, e, t, -i, n, r, 5),
  53131. this.setIndex(new Ci.BufferAttribute(R,1)),
  53132. this.addAttribute("position", new Ci.BufferAttribute(P,3)),
  53133. this.addAttribute("normal", new Ci.BufferAttribute(O,3)),
  53134. this.addAttribute("uv", new Ci.BufferAttribute(L,2))
  53135. }
  53136. ,
  53137. Ci.BoxBufferGeometry.prototype = Object.create(Ci.BufferGeometry.prototype),
  53138. Ci.BoxBufferGeometry.prototype.constructor = Ci.BoxBufferGeometry,
  53139. Ci.CircleGeometry = function(e, t, i, n) {
  53140. Ci.Geometry.call(this),
  53141. this.type = "CircleGeometry",
  53142. this.parameters = {
  53143. radius: e,
  53144. segments: t,
  53145. thetaStart: i,
  53146. thetaLength: n
  53147. },
  53148. this.fromBufferGeometry(new Ci.CircleBufferGeometry(e,t,i,n))
  53149. }
  53150. ,
  53151. Ci.CircleGeometry.prototype = Object.create(Ci.Geometry.prototype),
  53152. Ci.CircleGeometry.prototype.constructor = Ci.CircleGeometry,
  53153. Ci.CircleBufferGeometry = function(e, t, i, n) {
  53154. Ci.BufferGeometry.call(this),
  53155. this.type = "CircleBufferGeometry",
  53156. this.parameters = {
  53157. radius: e,
  53158. segments: t,
  53159. thetaStart: i,
  53160. thetaLength: n
  53161. },
  53162. e = e || 50,
  53163. t = void 0 !== t ? Math.max(3, t) : 8,
  53164. i = void 0 !== i ? i : 0,
  53165. n = void 0 !== n ? n : 2 * Math.PI;
  53166. var r = t + 2
  53167. , o = new Float32Array(3 * r)
  53168. , a = new Float32Array(3 * r)
  53169. , s = new Float32Array(2 * r);
  53170. a[2] = 1,
  53171. s[0] = .5,
  53172. s[1] = .5;
  53173. for (var l = 0, c = 3, h = 2; l <= t; l++,
  53174. c += 3,
  53175. h += 2) {
  53176. var u = i + l / t * n;
  53177. o[c] = e * Math.cos(u),
  53178. o[c + 1] = e * Math.sin(u),
  53179. a[c + 2] = 1,
  53180. s[h] = (o[c] / e + 1) / 2,
  53181. s[h + 1] = (o[c + 1] / e + 1) / 2
  53182. }
  53183. var d = [];
  53184. for (c = 1; c <= t; c++)
  53185. d.push(c, c + 1, 0);
  53186. this.setIndex(new Ci.BufferAttribute(new Uint16Array(d),1)),
  53187. this.addAttribute("position", new Ci.BufferAttribute(o,3)),
  53188. this.addAttribute("normal", new Ci.BufferAttribute(a,3)),
  53189. this.addAttribute("uv", new Ci.BufferAttribute(s,2)),
  53190. this.boundingSphere = new Ci.Sphere(new Ci.Vector3,e)
  53191. }
  53192. ,
  53193. Ci.CircleBufferGeometry.prototype = Object.create(Ci.BufferGeometry.prototype),
  53194. Ci.CircleBufferGeometry.prototype.constructor = Ci.CircleBufferGeometry,
  53195. Ci.CylinderBufferGeometry = function(p, f, g, m, v, e, y, A) {
  53196. function t(e) {
  53197. var t, i, n, r = new Ci.Vector2, o = new Ci.Vector3, a = !0 === e ? p : f, s = !0 === e ? 1 : -1;
  53198. for (i = b,
  53199. t = 1; t <= m; t++)
  53200. I.setXYZ(b, 0, x * s, 0),
  53201. E.setXYZ(b, 0, s, 0),
  53202. !0 === e ? (r.x = t / m,
  53203. r.y = 0) : (r.x = (t - 1) / m,
  53204. r.y = 1),
  53205. _.setXY(b, r.x, r.y),
  53206. b++;
  53207. for (n = b,
  53208. t = 0; t <= m; t++) {
  53209. var l = t / m;
  53210. o.x = a * Math.sin(l * A + y),
  53211. o.y = x * s,
  53212. o.z = a * Math.cos(l * A + y),
  53213. I.setXYZ(b, o.x, o.y, o.z),
  53214. E.setXYZ(b, 0, s, 0),
  53215. _.setXY(b, l, !0 === e ? 1 : 0),
  53216. b++
  53217. }
  53218. for (t = 0; t < m; t++) {
  53219. var c = i + t
  53220. , h = n + t;
  53221. !0 === e ? (C.setX(w, h),
  53222. w++,
  53223. C.setX(w, h + 1)) : (C.setX(w, h + 1),
  53224. w++,
  53225. C.setX(w, h)),
  53226. w++,
  53227. C.setX(w, c),
  53228. w++
  53229. }
  53230. }
  53231. Ci.BufferGeometry.call(this),
  53232. this.type = "CylinderBufferGeometry",
  53233. this.parameters = {
  53234. radiusTop: p,
  53235. radiusBottom: f,
  53236. height: g,
  53237. radialSegments: m,
  53238. heightSegments: v,
  53239. openEnded: e,
  53240. thetaStart: y,
  53241. thetaLength: A
  53242. },
  53243. p = void 0 !== p ? p : 20,
  53244. f = void 0 !== f ? f : 20,
  53245. g = void 0 !== g ? g : 100,
  53246. m = Math.floor(m) || 8,
  53247. v = Math.floor(v) || 1,
  53248. e = void 0 !== e && e,
  53249. y = void 0 !== y ? y : 0,
  53250. A = void 0 !== A ? A : 2 * Math.PI;
  53251. var i, n, r = (n = (m + 1) * (v + 1),
  53252. !1 === e && (n += 2 * (m + 1) + 2 * m),
  53253. n), o = (i = m * v * 2 * 3,
  53254. !1 === e && (i += 2 * m * 3),
  53255. 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;
  53256. (function() {
  53257. var e, t, i = new Ci.Vector3, n = new Ci.Vector3, r = (f - p) / g;
  53258. for (t = 0; t <= v; t++) {
  53259. var o = []
  53260. , a = t / v
  53261. , s = a * (f - p) + p;
  53262. for (e = 0; e <= m; e++) {
  53263. var l = e / m;
  53264. n.x = s * Math.sin(l * A + y),
  53265. n.y = -a * g + x,
  53266. n.z = s * Math.cos(l * A + y),
  53267. I.setXYZ(b, n.x, n.y, n.z),
  53268. i.copy(n),
  53269. (0 === p && 0 === t || 0 === f && t === v) && (i.x = Math.sin(l * A + y),
  53270. i.z = Math.cos(l * A + y)),
  53271. i.setY(Math.sqrt(i.x * i.x + i.z * i.z) * r).normalize(),
  53272. E.setXYZ(b, i.x, i.y, i.z),
  53273. _.setXY(b, l, 1 - a),
  53274. o.push(b),
  53275. b++
  53276. }
  53277. T.push(o)
  53278. }
  53279. for (e = 0; e < m; e++)
  53280. for (t = 0; t < v; t++) {
  53281. var c = T[t][e]
  53282. , h = T[t + 1][e]
  53283. , u = T[t + 1][e + 1]
  53284. , d = T[t][e + 1];
  53285. C.setX(w, c),
  53286. w++,
  53287. C.setX(w, h),
  53288. w++,
  53289. C.setX(w, d),
  53290. w++,
  53291. C.setX(w, h),
  53292. w++,
  53293. C.setX(w, u),
  53294. w++,
  53295. C.setX(w, d),
  53296. w++
  53297. }
  53298. }
  53299. )(),
  53300. !1 === e && (0 < p && t(!0),
  53301. 0 < f && t(!1)),
  53302. this.setIndex(C),
  53303. this.addAttribute("position", I),
  53304. this.addAttribute("normal", E),
  53305. this.addAttribute("uv", _)
  53306. }
  53307. ,
  53308. Ci.CylinderBufferGeometry.prototype = Object.create(Ci.BufferGeometry.prototype),
  53309. Ci.CylinderBufferGeometry.prototype.constructor = Ci.CylinderBufferGeometry,
  53310. Ci.CylinderGeometry = function(e, t, i, n, r, o, a, s) {
  53311. Ci.Geometry.call(this),
  53312. this.type = "CylinderGeometry",
  53313. this.parameters = {
  53314. radiusTop: e,
  53315. radiusBottom: t,
  53316. height: i,
  53317. radialSegments: n,
  53318. heightSegments: r,
  53319. openEnded: o,
  53320. thetaStart: a,
  53321. thetaLength: s
  53322. },
  53323. this.fromBufferGeometry(new Ci.CylinderBufferGeometry(e,t,i,n,r,o,a,s)),
  53324. this.mergeVertices()
  53325. }
  53326. ,
  53327. Ci.CylinderGeometry.prototype = Object.create(Ci.Geometry.prototype),
  53328. Ci.CylinderGeometry.prototype.constructor = Ci.CylinderGeometry,
  53329. Ci.EdgesGeometry = function(e, t) {
  53330. function i(e, t) {
  53331. return e - t
  53332. }
  53333. Ci.BufferGeometry.call(this),
  53334. t = void 0 !== t ? t : 1;
  53335. var n, r = Math.cos(Ci.Math.degToRad(t)), o = [0, 0], a = {}, s = ["a", "b", "c"];
  53336. e instanceof Ci.BufferGeometry ? (n = new Ci.Geometry).fromBufferGeometry(e) : n = e.clone(),
  53337. n.mergeVertices(),
  53338. n.computeFaceNormals();
  53339. for (var l = n.vertices, c = n.faces, h = 0, u = c.length; h < u; h++)
  53340. for (var d = c[h], p = 0; p < 3; p++) {
  53341. o[0] = d[s[p]],
  53342. o[1] = d[s[(p + 1) % 3]],
  53343. o.sort(i),
  53344. void 0 === a[g = o.toString()] ? a[g] = {
  53345. vert1: o[0],
  53346. vert2: o[1],
  53347. face1: h,
  53348. face2: void 0
  53349. } : a[g].face2 = h
  53350. }
  53351. var f = [];
  53352. for (var g in a) {
  53353. var m = a[g];
  53354. if (void 0 === m.face2 || c[m.face1].normal.dot(c[m.face2].normal) <= r) {
  53355. var v = l[m.vert1];
  53356. f.push(v.x),
  53357. f.push(v.y),
  53358. f.push(v.z),
  53359. v = l[m.vert2],
  53360. f.push(v.x),
  53361. f.push(v.y),
  53362. f.push(v.z)
  53363. }
  53364. }
  53365. this.addAttribute("position", new Ci.BufferAttribute(new Float32Array(f),3))
  53366. }
  53367. ,
  53368. Ci.EdgesGeometry.prototype = Object.create(Ci.BufferGeometry.prototype),
  53369. Ci.EdgesGeometry.prototype.constructor = Ci.EdgesGeometry,
  53370. Ci.ExtrudeGeometry = function(e, t) {
  53371. return void 0 === e ? void (e = []) : (Ci.Geometry.call(this),
  53372. this.type = "ExtrudeGeometry",
  53373. e = Array.isArray(e) ? e : [e],
  53374. this.addShapeList(e, t),
  53375. void this.computeFaceNormals())
  53376. }
  53377. ;
  53378. Ci.ExtrudeGeometry.prototype = Object.create(Ci.Geometry.prototype),
  53379. Ci.ExtrudeGeometry.prototype.constructor = Ci.ExtrudeGeometry,
  53380. Ci.ExtrudeGeometry.prototype.addShapeList = function(e, t) {
  53381. for (var i = e.length, n = 0; n < i; n++) {
  53382. var r = e[n];
  53383. this.addShape(r, t)
  53384. }
  53385. }
  53386. ,
  53387. Ci.ExtrudeGeometry.prototype.addShape = function(e, t) {
  53388. function i(e, t, i) {
  53389. return t || console.error("THREE.ExtrudeGeometry: vec does not exist"),
  53390. t.clone().multiplyScalar(i).add(e)
  53391. }
  53392. function n(e, t, i) {
  53393. 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;
  53394. if (Math.abs(u) > Number.EPSILON) {
  53395. var d = Math.sqrt(h)
  53396. , p = Math.sqrt(l * l + c * c)
  53397. , f = t.x - s / d
  53398. , g = t.y + a / d
  53399. , m = ((i.x - c / p - f) * c - (i.y + l / p - g) * l) / (a * c - s * l)
  53400. , v = (n = f + a * m - e.x) * n + (r = g + s * m - e.y) * r;
  53401. if (v <= 2)
  53402. return new Ci.Vector2(n,r);
  53403. o = Math.sqrt(v / 2)
  53404. } else {
  53405. var y = !1;
  53406. a > Number.EPSILON ? l > Number.EPSILON && (y = !0) : a < -Number.EPSILON ? l < -Number.EPSILON && (y = !0) : Math.sign(s) === Math.sign(c) && (y = !0),
  53407. o = y ? (n = -s,
  53408. r = a,
  53409. Math.sqrt(h)) : (n = a,
  53410. r = s,
  53411. Math.sqrt(h / 2))
  53412. }
  53413. return new Ci.Vector2(n / o,r / o)
  53414. }
  53415. function r(e, t) {
  53416. var i, n;
  53417. for (G = e.length; 0 <= --G; ) {
  53418. (n = (i = G) - 1) < 0 && (n = e.length - 1);
  53419. var r = 0
  53420. , o = A + 2 * m;
  53421. for (r = 0; r < o; r++) {
  53422. var a = U * r
  53423. , s = U * (r + 1);
  53424. l(t + i + a, t + n + a, t + n + s, t + i + s, e, r, o, i, n)
  53425. }
  53426. }
  53427. }
  53428. function o(e, t, i) {
  53429. T.vertices.push(new Ci.Vector3(e,t,i))
  53430. }
  53431. function a(e, t, i) {
  53432. e += x,
  53433. t += x,
  53434. i += x,
  53435. T.faces.push(new Ci.Face3(e,t,i,null,null,0));
  53436. var n = E.generateTopUV(T, e, t, i);
  53437. T.faceVertexUvs[0].push(n)
  53438. }
  53439. function l(e, t, i, n) {
  53440. e += x,
  53441. t += x,
  53442. i += x,
  53443. n += x,
  53444. T.faces.push(new Ci.Face3(e,t,n,null,null,1)),
  53445. T.faces.push(new Ci.Face3(t,i,n,null,null,1));
  53446. var r = E.generateSideWallUV(T, e, t, i, n);
  53447. T.faceVertexUvs[0].push([r[0], r[1], r[3]]),
  53448. T.faceVertexUvs[0].push([r[1], r[2], r[3]])
  53449. }
  53450. 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;
  53451. C && (s = C.getSpacedPoints(A),
  53452. v = !(I = !0),
  53453. c = void 0 !== t.frames ? t.frames : new Ci.TubeGeometry.FrenetFrames(C,A,!1),
  53454. h = new Ci.Vector3,
  53455. u = new Ci.Vector3,
  53456. d = new Ci.Vector3),
  53457. v || (g = f = m = 0);
  53458. var _, b, w, T = this, x = this.vertices.length, S = e.extractPoints(y), M = S.shape, R = S.holes, P = !Ci.ShapeUtils.isClockWise(M);
  53459. if (P) {
  53460. for (M = M.reverse(),
  53461. b = 0,
  53462. w = R.length; b < w; b++)
  53463. _ = R[b],
  53464. Ci.ShapeUtils.isClockWise(_) && (R[b] = _.reverse());
  53465. P = !1
  53466. }
  53467. var O = Ci.ShapeUtils.triangulateShape(M, R)
  53468. , L = M;
  53469. for (b = 0,
  53470. w = R.length; b < w; b++)
  53471. _ = R[b],
  53472. M = M.concat(_);
  53473. 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++,
  53474. j++,
  53475. Y++)
  53476. j === W && (j = 0),
  53477. Y === W && (Y = 0),
  53478. z[G] = n(L[G], L[j], L[Y]);
  53479. var q, X, Z = [], K = z.concat();
  53480. for (b = 0,
  53481. w = R.length; b < w; b++) {
  53482. for (_ = R[b],
  53483. q = [],
  53484. G = 0,
  53485. j = (W = _.length) - 1,
  53486. Y = G + 1; G < W; G++,
  53487. j++,
  53488. Y++)
  53489. j === W && (j = 0),
  53490. Y === W && (Y = 0),
  53491. q[G] = n(_[G], _[j], _[Y]);
  53492. Z.push(q),
  53493. K = K.concat(q)
  53494. }
  53495. for (D = 0; D < m; D++) {
  53496. for (B = f * (1 - (F = D / m)),
  53497. N = g * Math.sin(F * Math.PI / 2),
  53498. G = 0,
  53499. W = L.length; G < W; G++)
  53500. o((V = i(L[G], z[G], N)).x, V.y, -B);
  53501. for (b = 0,
  53502. w = R.length; b < w; b++)
  53503. for (_ = R[b],
  53504. q = Z[b],
  53505. G = 0,
  53506. W = _.length; G < W; G++)
  53507. o((V = i(_[G], q[G], N)).x, V.y, -B)
  53508. }
  53509. for (N = g,
  53510. G = 0; G < U; G++)
  53511. V = v ? i(M[G], K[G], N) : M[G],
  53512. I ? (u.copy(c.normals[0]).multiplyScalar(V.x),
  53513. h.copy(c.binormals[0]).multiplyScalar(V.y),
  53514. d.copy(s[0]).add(u).add(h),
  53515. o(d.x, d.y, d.z)) : o(V.x, V.y, 0);
  53516. for (X = 1; X <= A; X++)
  53517. for (G = 0; G < U; G++)
  53518. V = v ? i(M[G], K[G], N) : M[G],
  53519. I ? (u.copy(c.normals[X]).multiplyScalar(V.x),
  53520. h.copy(c.binormals[X]).multiplyScalar(V.y),
  53521. d.copy(s[X]).add(u).add(h),
  53522. o(d.x, d.y, d.z)) : o(V.x, V.y, p / A * X);
  53523. for (D = m - 1; 0 <= D; D--) {
  53524. for (B = f * (1 - (F = D / m)),
  53525. N = g * Math.sin(F * Math.PI / 2),
  53526. G = 0,
  53527. W = L.length; G < W; G++)
  53528. o((V = i(L[G], z[G], N)).x, V.y, p + B);
  53529. for (b = 0,
  53530. w = R.length; b < w; b++)
  53531. for (_ = R[b],
  53532. q = Z[b],
  53533. G = 0,
  53534. W = _.length; G < W; G++)
  53535. V = i(_[G], q[G], N),
  53536. I ? o(V.x, V.y + s[A - 1].y, s[A - 1].x + B) : o(V.x, V.y, p + B)
  53537. }
  53538. (function() {
  53539. if (v) {
  53540. var e = 0
  53541. , t = U * e;
  53542. for (G = 0; G < H; G++)
  53543. a((k = O[G])[2] + t, k[1] + t, k[0] + t);
  53544. for (t = U * (e = A + 2 * m),
  53545. G = 0; G < H; G++)
  53546. a((k = O[G])[0] + t, k[1] + t, k[2] + t)
  53547. } else {
  53548. for (G = 0; G < H; G++)
  53549. a((k = O[G])[2], k[1], k[0]);
  53550. for (G = 0; G < H; G++)
  53551. a((k = O[G])[0] + U * A, k[1] + U * A, k[2] + U * A)
  53552. }
  53553. }
  53554. )(),
  53555. function() {
  53556. var e = 0;
  53557. for (r(L, e),
  53558. e += L.length,
  53559. b = 0,
  53560. w = R.length; b < w; b++)
  53561. r(_ = R[b], e),
  53562. e += _.length
  53563. }()
  53564. }
  53565. ,
  53566. Ci.ExtrudeGeometry.WorldUVGenerator = {
  53567. generateTopUV: function(e, t, i, n) {
  53568. var r = e.vertices
  53569. , o = r[t]
  53570. , a = r[i]
  53571. , s = r[n];
  53572. return [new Ci.Vector2(o.x,o.y), new Ci.Vector2(a.x,a.y), new Ci.Vector2(s.x,s.y)]
  53573. },
  53574. generateSideWallUV: function(e, t, i, n, r) {
  53575. var o = e.vertices
  53576. , a = o[t]
  53577. , s = o[i]
  53578. , l = o[n]
  53579. , c = o[r];
  53580. 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)]
  53581. }
  53582. },
  53583. Ci.ShapeGeometry = function(e, t) {
  53584. Ci.Geometry.call(this),
  53585. !(this.type = "ShapeGeometry") === Array.isArray(e) && (e = [e]),
  53586. this.addShapeList(e, t),
  53587. this.computeFaceNormals()
  53588. }
  53589. ,
  53590. Ci.ShapeGeometry.prototype = Object.create(Ci.Geometry.prototype),
  53591. Ci.ShapeGeometry.prototype.constructor = Ci.ShapeGeometry,
  53592. Ci.ShapeGeometry.prototype.addShapeList = function(e, t) {
  53593. for (var i = 0, n = e.length; i < n; i++)
  53594. this.addShape(e[i], t);
  53595. return this
  53596. }
  53597. ,
  53598. Ci.ShapeGeometry.prototype.addShape = function(e, t) {
  53599. void 0 === t && (t = {});
  53600. 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);
  53601. if (d) {
  53602. for (h = h.reverse(),
  53603. i = 0,
  53604. n = u.length; i < n; i++)
  53605. r = u[i],
  53606. Ci.ShapeUtils.isClockWise(r) && (u[i] = r.reverse());
  53607. d = !1
  53608. }
  53609. var p = Ci.ShapeUtils.triangulateShape(h, u);
  53610. for (i = 0,
  53611. n = u.length; i < n; i++)
  53612. r = u[i],
  53613. h = h.concat(r);
  53614. var f, g, m = h.length, v = p.length;
  53615. for (i = 0; i < m; i++)
  53616. f = h[i],
  53617. this.vertices.push(new Ci.Vector3(f.x,f.y,0));
  53618. for (i = 0; i < v; i++) {
  53619. var y = (g = p[i])[0] + l
  53620. , A = g[1] + l
  53621. , C = g[2] + l;
  53622. this.faces.push(new Ci.Face3(y,A,C,null,null,a)),
  53623. this.faceVertexUvs[0].push(s.generateTopUV(this, y, A, C))
  53624. }
  53625. }
  53626. ,
  53627. Ci.LatheBufferGeometry = function(e, t, i, n) {
  53628. Ci.BufferGeometry.call(this),
  53629. this.type = "LatheBufferGeometry",
  53630. this.parameters = {
  53631. points: e,
  53632. segments: t,
  53633. phiStart: i,
  53634. phiLength: n
  53635. },
  53636. t = Math.floor(t) || 12,
  53637. i = i || 0,
  53638. n = n || 2 * Math.PI,
  53639. n = Ci.Math.clamp(n, 0, 2 * Math.PI);
  53640. 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,
  53641. 1 / t), g = new Ci.Vector3, m = new Ci.Vector2;
  53642. for (o = 0; o <= t; o++) {
  53643. var v = i + o * f * n
  53644. , y = Math.sin(v)
  53645. , A = Math.cos(v);
  53646. for (a = 0; a <= e.length - 1; a++)
  53647. g.x = e[a].x * y,
  53648. g.y = e[a].y,
  53649. g.z = e[a].x * A,
  53650. h.setXYZ(d, g.x, g.y, g.z),
  53651. m.x = o / t,
  53652. m.y = a / (e.length - 1),
  53653. u.setXY(d, m.x, m.y),
  53654. d++
  53655. }
  53656. for (o = 0; o < t; o++)
  53657. for (a = 0; a < e.length - 1; a++) {
  53658. var C = r = a + o * e.length
  53659. , I = r + e.length
  53660. , E = r + e.length + 1
  53661. , _ = r + 1;
  53662. c.setX(p, C),
  53663. p++,
  53664. c.setX(p, I),
  53665. p++,
  53666. c.setX(p, _),
  53667. p++,
  53668. c.setX(p, I),
  53669. p++,
  53670. c.setX(p, E),
  53671. p++,
  53672. c.setX(p, _),
  53673. p++
  53674. }
  53675. if (this.setIndex(c),
  53676. this.addAttribute("position", h),
  53677. this.addAttribute("uv", u),
  53678. this.computeVertexNormals(),
  53679. n === 2 * Math.PI) {
  53680. var b = this.attributes.normal.array
  53681. , w = new Ci.Vector3
  53682. , T = new Ci.Vector3
  53683. , x = new Ci.Vector3;
  53684. for (r = t * e.length * 3,
  53685. a = o = 0; o < e.length; o++,
  53686. a += 3)
  53687. w.x = b[a + 0],
  53688. w.y = b[a + 1],
  53689. w.z = b[a + 2],
  53690. T.x = b[r + a + 0],
  53691. T.y = b[r + a + 1],
  53692. T.z = b[r + a + 2],
  53693. x.addVectors(w, T).normalize(),
  53694. b[a + 0] = b[r + a + 0] = x.x,
  53695. b[a + 1] = b[r + a + 1] = x.y,
  53696. b[a + 2] = b[r + a + 2] = x.z
  53697. }
  53698. }
  53699. ,
  53700. Ci.LatheBufferGeometry.prototype = Object.create(Ci.BufferGeometry.prototype),
  53701. Ci.LatheBufferGeometry.prototype.constructor = Ci.LatheBufferGeometry,
  53702. Ci.LatheGeometry = function(e, t, i, n) {
  53703. Ci.Geometry.call(this),
  53704. this.type = "LatheGeometry",
  53705. this.parameters = {
  53706. points: e,
  53707. segments: t,
  53708. phiStart: i,
  53709. phiLength: n
  53710. },
  53711. this.fromBufferGeometry(new Ci.LatheBufferGeometry(e,t,i,n)),
  53712. this.mergeVertices()
  53713. }
  53714. ,
  53715. Ci.LatheGeometry.prototype = Object.create(Ci.Geometry.prototype),
  53716. Ci.LatheGeometry.prototype.constructor = Ci.LatheGeometry,
  53717. Ci.PlaneGeometry = function(e, t, i, n) {
  53718. Ci.Geometry.call(this),
  53719. this.type = "PlaneGeometry",
  53720. this.parameters = {
  53721. width: e,
  53722. height: t,
  53723. widthSegments: i,
  53724. heightSegments: n
  53725. },
  53726. this.fromBufferGeometry(new Ci.PlaneBufferGeometry(e,t,i,n))
  53727. }
  53728. ,
  53729. Ci.PlaneGeometry.prototype = Object.create(Ci.Geometry.prototype),
  53730. Ci.PlaneGeometry.prototype.constructor = Ci.PlaneGeometry,
  53731. Ci.PlaneBufferGeometry = function(e, t, i, n) {
  53732. Ci.BufferGeometry.call(this),
  53733. this.type = "PlaneBufferGeometry",
  53734. this.parameters = {
  53735. width: e,
  53736. height: t,
  53737. widthSegments: i,
  53738. heightSegments: n
  53739. };
  53740. 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++)
  53741. for (var y = v * u - o, A = 0; A < l; A++) {
  53742. var C = A * h - r;
  53743. d[g] = C,
  53744. d[g + 1] = -y,
  53745. p[g + 2] = 1,
  53746. f[m] = A / a,
  53747. f[m + 1] = 1 - v / s,
  53748. g += 3,
  53749. m += 2
  53750. }
  53751. g = 0;
  53752. var I = new (65535 < d.length / 3 ? Uint32Array : Uint16Array)(a * s * 6);
  53753. for (v = 0; v < s; v++)
  53754. for (A = 0; A < a; A++) {
  53755. var E = A + l * v
  53756. , _ = A + l * (v + 1)
  53757. , b = A + 1 + l * (v + 1)
  53758. , w = A + 1 + l * v;
  53759. I[g] = E,
  53760. I[g + 1] = _,
  53761. I[g + 2] = w,
  53762. I[g + 3] = _,
  53763. I[g + 4] = b,
  53764. I[g + 5] = w,
  53765. g += 6
  53766. }
  53767. this.setIndex(new Ci.BufferAttribute(I,1)),
  53768. this.addAttribute("position", new Ci.BufferAttribute(d,3)),
  53769. this.addAttribute("normal", new Ci.BufferAttribute(p,3)),
  53770. this.addAttribute("uv", new Ci.BufferAttribute(f,2))
  53771. }
  53772. ,
  53773. Ci.PlaneBufferGeometry.prototype = Object.create(Ci.BufferGeometry.prototype),
  53774. Ci.PlaneBufferGeometry.prototype.constructor = Ci.PlaneBufferGeometry,
  53775. Ci.RingBufferGeometry = function(e, t, i, n, r, o) {
  53776. Ci.BufferGeometry.call(this),
  53777. this.type = "RingBufferGeometry",
  53778. this.parameters = {
  53779. innerRadius: e,
  53780. outerRadius: t,
  53781. thetaSegments: i,
  53782. phiSegments: n,
  53783. thetaStart: r,
  53784. thetaLength: o
  53785. },
  53786. e = e || 20,
  53787. t = t || 50,
  53788. r = void 0 !== r ? r : 0,
  53789. o = void 0 !== o ? o : 2 * Math.PI;
  53790. 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;
  53791. for (s = 0; s <= n; s++) {
  53792. for (l = 0; l <= i; l++)
  53793. a = r + l / i * o,
  53794. A.x = v * Math.cos(a),
  53795. A.y = v * Math.sin(a),
  53796. d.setXYZ(g, A.x, A.y, A.z),
  53797. p.setXYZ(g, 0, 0, 1),
  53798. C.x = (A.x / t + 1) / 2,
  53799. C.y = (A.y / t + 1) / 2,
  53800. f.setXY(g, C.x, C.y),
  53801. g++;
  53802. v += y
  53803. }
  53804. for (s = 0; s < n; s++) {
  53805. var I = s * (i + 1);
  53806. for (l = 0; l < i; l++) {
  53807. var E = a = l + I
  53808. , _ = a + i + 1
  53809. , b = a + i + 2
  53810. , w = a + 1;
  53811. u.setX(m, E),
  53812. m++,
  53813. u.setX(m, _),
  53814. m++,
  53815. u.setX(m, b),
  53816. m++,
  53817. u.setX(m, E),
  53818. m++,
  53819. u.setX(m, b),
  53820. m++,
  53821. u.setX(m, w),
  53822. m++
  53823. }
  53824. }
  53825. this.setIndex(u),
  53826. this.addAttribute("position", d),
  53827. this.addAttribute("normal", p),
  53828. this.addAttribute("uv", f)
  53829. }
  53830. ,
  53831. Ci.RingBufferGeometry.prototype = Object.create(Ci.BufferGeometry.prototype),
  53832. Ci.RingBufferGeometry.prototype.constructor = Ci.RingBufferGeometry,
  53833. Ci.RingGeometry = function(e, t, i, n, r, o) {
  53834. Ci.Geometry.call(this),
  53835. this.type = "RingGeometry",
  53836. this.parameters = {
  53837. innerRadius: e,
  53838. outerRadius: t,
  53839. thetaSegments: i,
  53840. phiSegments: n,
  53841. thetaStart: r,
  53842. thetaLength: o
  53843. },
  53844. this.fromBufferGeometry(new Ci.RingBufferGeometry(e,t,i,n,r,o))
  53845. }
  53846. ,
  53847. Ci.RingGeometry.prototype = Object.create(Ci.Geometry.prototype),
  53848. Ci.RingGeometry.prototype.constructor = Ci.RingGeometry,
  53849. Ci.SphereGeometry = function(e, t, i, n, r, o, a) {
  53850. Ci.Geometry.call(this),
  53851. this.type = "SphereGeometry",
  53852. this.parameters = {
  53853. radius: e,
  53854. widthSegments: t,
  53855. heightSegments: i,
  53856. phiStart: n,
  53857. phiLength: r,
  53858. thetaStart: o,
  53859. thetaLength: a
  53860. },
  53861. this.fromBufferGeometry(new Ci.SphereBufferGeometry(e,t,i,n,r,o,a))
  53862. }
  53863. ,
  53864. Ci.SphereGeometry.prototype = Object.create(Ci.Geometry.prototype),
  53865. Ci.SphereGeometry.prototype.constructor = Ci.SphereGeometry,
  53866. Ci.SphereBufferGeometry = function(e, t, i, n, r, o, a) {
  53867. Ci.BufferGeometry.call(this),
  53868. this.type = "SphereBufferGeometry",
  53869. this.parameters = {
  53870. radius: e,
  53871. widthSegments: t,
  53872. heightSegments: i,
  53873. phiStart: n,
  53874. phiLength: r,
  53875. thetaStart: o,
  53876. thetaLength: a
  53877. },
  53878. e = e || 50,
  53879. t = Math.max(3, Math.floor(t) || 8),
  53880. i = Math.max(2, Math.floor(i) || 6),
  53881. n = void 0 !== n ? n : 0,
  53882. r = void 0 !== r ? r : 2 * Math.PI;
  53883. 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++) {
  53884. for (var m = [], v = g / i, y = 0; y <= t; y++) {
  53885. var A = y / t
  53886. , C = -e * Math.cos(n + A * r) * Math.sin(o + v * a)
  53887. , I = e * Math.cos(o + v * a)
  53888. , E = e * Math.sin(n + A * r) * Math.sin(o + v * a);
  53889. f.set(C, I, E).normalize(),
  53890. c.setXYZ(d, C, I, E),
  53891. h.setXYZ(d, f.x, f.y, f.z),
  53892. u.setXY(d, A, 1 - v),
  53893. m.push(d),
  53894. d++
  53895. }
  53896. p.push(m)
  53897. }
  53898. var _ = [];
  53899. for (g = 0; g < i; g++)
  53900. for (y = 0; y < t; y++) {
  53901. var b = p[g][y + 1]
  53902. , w = p[g][y]
  53903. , T = p[g + 1][y]
  53904. , x = p[g + 1][y + 1];
  53905. (0 !== g || 0 < o) && _.push(b, w, x),
  53906. (g !== i - 1 || s < Math.PI) && _.push(w, T, x)
  53907. }
  53908. this.setIndex(new (65535 < c.count ? Ci.Uint32Attribute : Ci.Uint16Attribute)(_,1)),
  53909. this.addAttribute("position", c),
  53910. this.addAttribute("normal", h),
  53911. this.addAttribute("uv", u),
  53912. this.boundingSphere = new Ci.Sphere(new Ci.Vector3,e)
  53913. }
  53914. ,
  53915. Ci.SphereBufferGeometry.prototype = Object.create(Ci.BufferGeometry.prototype),
  53916. Ci.SphereBufferGeometry.prototype.constructor = Ci.SphereBufferGeometry,
  53917. Ci.TextGeometry = function(e, t) {
  53918. var i = (t = t || {}).font;
  53919. if (i instanceof Ci.Font == 0)
  53920. return console.error("THREE.TextGeometry: font parameter is not an instance of THREE.Font."),
  53921. new Ci.Geometry;
  53922. var n = i.generateShapes(e, t.size, t.curveSegments);
  53923. t.amount = void 0 !== t.height ? t.height : 50,
  53924. void 0 === t.bevelThickness && (t.bevelThickness = 10),
  53925. void 0 === t.bevelSize && (t.bevelSize = 8),
  53926. void 0 === t.bevelEnabled && (t.bevelEnabled = !1),
  53927. Ci.ExtrudeGeometry.call(this, n, t),
  53928. this.type = "TextGeometry"
  53929. }
  53930. ,
  53931. Ci.TextGeometry.prototype = Object.create(Ci.ExtrudeGeometry.prototype),
  53932. Ci.TextGeometry.prototype.constructor = Ci.TextGeometry,
  53933. Ci.TorusBufferGeometry = function(e, t, i, n, r) {
  53934. Ci.BufferGeometry.call(this),
  53935. this.type = "TorusBufferGeometry",
  53936. this.parameters = {
  53937. radius: e,
  53938. tube: t,
  53939. radialSegments: i,
  53940. tubularSegments: n,
  53941. arc: r
  53942. },
  53943. e = e || 100,
  53944. t = t || 40,
  53945. i = Math.floor(i) || 8,
  53946. n = Math.floor(n) || 6,
  53947. r = r || 2 * Math.PI;
  53948. 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;
  53949. for (o = 0; o <= i; o++)
  53950. for (a = 0; a <= n; a++) {
  53951. var A = a / n * r
  53952. , C = o / i * Math.PI * 2;
  53953. v.x = (e + t * Math.cos(C)) * Math.cos(A),
  53954. v.y = (e + t * Math.cos(C)) * Math.sin(A),
  53955. v.z = t * Math.sin(C),
  53956. h[p] = v.x,
  53957. h[p + 1] = v.y,
  53958. h[p + 2] = v.z,
  53959. m.x = e * Math.cos(A),
  53960. m.y = e * Math.sin(A),
  53961. y.subVectors(v, m).normalize(),
  53962. u[p] = y.x,
  53963. u[p + 1] = y.y,
  53964. u[p + 2] = y.z,
  53965. d[f] = a / n,
  53966. d[f + 1] = o / i,
  53967. p += 3,
  53968. f += 2
  53969. }
  53970. for (o = 1; o <= i; o++)
  53971. for (a = 1; a <= n; a++) {
  53972. var I = (n + 1) * o + a - 1
  53973. , E = (n + 1) * (o - 1) + a - 1
  53974. , _ = (n + 1) * (o - 1) + a
  53975. , b = (n + 1) * o + a;
  53976. c[g] = I,
  53977. c[g + 1] = E,
  53978. c[g + 2] = b,
  53979. c[g + 3] = E,
  53980. c[g + 4] = _,
  53981. c[g + 5] = b,
  53982. g += 6
  53983. }
  53984. this.setIndex(new Ci.BufferAttribute(c,1)),
  53985. this.addAttribute("position", new Ci.BufferAttribute(h,3)),
  53986. this.addAttribute("normal", new Ci.BufferAttribute(u,3)),
  53987. this.addAttribute("uv", new Ci.BufferAttribute(d,2))
  53988. }
  53989. ,
  53990. Ci.TorusBufferGeometry.prototype = Object.create(Ci.BufferGeometry.prototype),
  53991. Ci.TorusBufferGeometry.prototype.constructor = Ci.TorusBufferGeometry,
  53992. Ci.TorusGeometry = function(e, t, i, n, r) {
  53993. Ci.Geometry.call(this),
  53994. this.type = "TorusGeometry",
  53995. this.parameters = {
  53996. radius: e,
  53997. tube: t,
  53998. radialSegments: i,
  53999. tubularSegments: n,
  54000. arc: r
  54001. },
  54002. this.fromBufferGeometry(new Ci.TorusBufferGeometry(e,t,i,n,r))
  54003. }
  54004. ,
  54005. Ci.TorusGeometry.prototype = Object.create(Ci.Geometry.prototype),
  54006. Ci.TorusGeometry.prototype.constructor = Ci.TorusGeometry,
  54007. Ci.TorusKnotBufferGeometry = function(e, t, i, n, r, o) {
  54008. function a(e, t, i, n, r) {
  54009. var o = Math.cos(e)
  54010. , a = Math.sin(e)
  54011. , s = i / t * e
  54012. , l = Math.cos(s);
  54013. r.x = n * (2 + l) * .5 * o,
  54014. r.y = n * (2 + l) * a * .5,
  54015. r.z = n * Math.sin(s) * .5
  54016. }
  54017. Ci.BufferGeometry.call(this),
  54018. this.type = "TorusKnotBufferGeometry",
  54019. this.parameters = {
  54020. radius: e,
  54021. tube: t,
  54022. tubularSegments: i,
  54023. radialSegments: n,
  54024. p: r,
  54025. q: o
  54026. },
  54027. e = e || 100,
  54028. t = t || 40,
  54029. i = Math.floor(i) || 64,
  54030. r = r || 2,
  54031. o = o || 3;
  54032. 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;
  54033. for (s = 0; s <= i; ++s) {
  54034. var w = s / i * r * Math.PI * 2;
  54035. for (a(w, r, o, e, C),
  54036. a(.01 + w, r, o, e, I),
  54037. _.subVectors(I, C),
  54038. b.addVectors(I, C),
  54039. E.crossVectors(_, b),
  54040. b.crossVectors(E, _),
  54041. E.normalize(),
  54042. b.normalize(),
  54043. l = 0; l <= n; ++l) {
  54044. var T = l / n * Math.PI * 2
  54045. , x = -t * Math.cos(T)
  54046. , S = t * Math.sin(T);
  54047. v.x = C.x + (x * b.x + S * E.x),
  54048. v.y = C.y + (x * b.y + S * E.y),
  54049. v.z = C.z + (x * b.z + S * E.z),
  54050. d.setXYZ(g, v.x, v.y, v.z),
  54051. y.subVectors(v, C).normalize(),
  54052. p.setXYZ(g, y.x, y.y, y.z),
  54053. A.x = s / i,
  54054. A.y = l / n,
  54055. f.setXY(g, A.x, A.y),
  54056. g++
  54057. }
  54058. }
  54059. for (l = 1; l <= i; l++)
  54060. for (s = 1; s <= n; s++) {
  54061. var M = (n + 1) * (l - 1) + (s - 1)
  54062. , R = (n + 1) * l + (s - 1)
  54063. , P = (n + 1) * l + s
  54064. , O = (n + 1) * (l - 1) + s;
  54065. u.setX(m, M),
  54066. m++,
  54067. u.setX(m, R),
  54068. m++,
  54069. u.setX(m, O),
  54070. m++,
  54071. u.setX(m, R),
  54072. m++,
  54073. u.setX(m, P),
  54074. m++,
  54075. u.setX(m, O),
  54076. m++
  54077. }
  54078. this.setIndex(u),
  54079. this.addAttribute("position", d),
  54080. this.addAttribute("normal", p),
  54081. this.addAttribute("uv", f)
  54082. }
  54083. ,
  54084. Ci.TorusKnotBufferGeometry.prototype = Object.create(Ci.BufferGeometry.prototype),
  54085. Ci.TorusKnotBufferGeometry.prototype.constructor = Ci.TorusKnotBufferGeometry,
  54086. Ci.TorusKnotGeometry = function(e, t, i, n, r, o, a) {
  54087. Ci.Geometry.call(this),
  54088. this.type = "TorusKnotGeometry",
  54089. this.parameters = {
  54090. radius: e,
  54091. tube: t,
  54092. tubularSegments: i,
  54093. radialSegments: n,
  54094. p: r,
  54095. q: o
  54096. },
  54097. void 0 !== a && console.warn("THREE.TorusKnotGeometry: heightScale has been deprecated. Use .scale( x, y, z ) instead."),
  54098. this.fromBufferGeometry(new Ci.TorusKnotBufferGeometry(e,t,i,n,r,o)),
  54099. this.mergeVertices()
  54100. }
  54101. ,
  54102. Ci.TorusKnotGeometry.prototype = Object.create(Ci.Geometry.prototype),
  54103. Ci.TorusKnotGeometry.prototype.constructor = Ci.TorusKnotGeometry,
  54104. Ci.TubeGeometry = function(e, t, i, n, r, o) {
  54105. Ci.Geometry.call(this),
  54106. this.type = "TubeGeometry",
  54107. this.parameters = {
  54108. path: e,
  54109. segments: t,
  54110. radius: i,
  54111. radialSegments: n,
  54112. closed: r,
  54113. taper: o
  54114. },
  54115. t = t || 64,
  54116. i = i || 1,
  54117. n = n || 8,
  54118. r = r || !1,
  54119. o = o || Ci.TubeGeometry.NoTaper;
  54120. 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;
  54121. for (this.tangents = D,
  54122. this.normals = N,
  54123. this.binormals = F,
  54124. f = 0; f < P; f++)
  54125. for (M[f] = [],
  54126. l = f / (P - 1),
  54127. p = e.getPointAt(l),
  54128. D[f],
  54129. a = N[f],
  54130. s = F[f],
  54131. h = i * o(l),
  54132. g = 0; g < n; g++)
  54133. c = g / n * 2 * Math.PI,
  54134. u = -h * Math.cos(c),
  54135. d = h * Math.sin(c),
  54136. O.copy(p),
  54137. O.x += u * a.x + d * s.x,
  54138. O.y += u * a.y + d * s.y,
  54139. O.z += u * a.z + d * s.z,
  54140. M[f][g] = (T = O.x,
  54141. x = O.y,
  54142. S = O.z,
  54143. R.vertices.push(new Ci.Vector3(T,x,S)) - 1);
  54144. for (f = 0; f < t; f++)
  54145. for (g = 0; g < n; g++)
  54146. m = r ? (f + 1) % t : f + 1,
  54147. v = (g + 1) % n,
  54148. y = M[f][g],
  54149. A = M[m][g],
  54150. C = M[m][v],
  54151. I = M[f][v],
  54152. E = new Ci.Vector2(f / t,g / n),
  54153. _ = new Ci.Vector2((f + 1) / t,g / n),
  54154. b = new Ci.Vector2((f + 1) / t,(g + 1) / n),
  54155. w = new Ci.Vector2(f / t,(g + 1) / n),
  54156. this.faces.push(new Ci.Face3(y,A,I)),
  54157. this.faceVertexUvs[0].push([E, _, w]),
  54158. this.faces.push(new Ci.Face3(A,C,I)),
  54159. this.faceVertexUvs[0].push([_.clone(), b, w.clone()]);
  54160. this.computeFaceNormals(),
  54161. this.computeVertexNormals()
  54162. }
  54163. ,
  54164. Ci.TubeGeometry.prototype = Object.create(Ci.Geometry.prototype),
  54165. Ci.TubeGeometry.prototype.constructor = Ci.TubeGeometry,
  54166. Ci.TubeGeometry.NoTaper = function(e) {
  54167. return 1
  54168. }
  54169. ,
  54170. Ci.TubeGeometry.SinusoidalTaper = function(e) {
  54171. return Math.sin(Math.PI * e)
  54172. }
  54173. ,
  54174. Ci.TubeGeometry.FrenetFrames = function(e, t, i) {
  54175. 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;
  54176. for (this.tangents = u,
  54177. this.normals = d,
  54178. this.binormals = p,
  54179. l = 0; l < m; l++)
  54180. c = l / (m - 1),
  54181. u[l] = e.getTangentAt(c),
  54182. u[l].normalize();
  54183. for (d[0] = new Ci.Vector3,
  54184. p[0] = new Ci.Vector3,
  54185. r = Number.MAX_VALUE,
  54186. o = Math.abs(u[0].x),
  54187. a = Math.abs(u[0].y),
  54188. s = Math.abs(u[0].z),
  54189. o <= r && (r = o,
  54190. h.set(1, 0, 0)),
  54191. a <= r && (r = a,
  54192. h.set(0, 1, 0)),
  54193. s <= r && h.set(0, 0, 1),
  54194. f.crossVectors(u[0], h).normalize(),
  54195. d[0].crossVectors(u[0], f),
  54196. p[0].crossVectors(u[0], d[0]),
  54197. l = 1; l < m; l++)
  54198. d[l] = d[l - 1].clone(),
  54199. p[l] = p[l - 1].clone(),
  54200. f.crossVectors(u[l - 1], u[l]),
  54201. f.length() > Number.EPSILON && (f.normalize(),
  54202. n = Math.acos(Ci.Math.clamp(u[l - 1].dot(u[l]), -1, 1)),
  54203. d[l].applyMatrix4(g.makeRotationAxis(f, n))),
  54204. p[l].crossVectors(u[l], d[l]);
  54205. if (i)
  54206. for (n = Math.acos(Ci.Math.clamp(d[0].dot(d[m - 1]), -1, 1)),
  54207. n /= m - 1,
  54208. 0 < u[0].dot(f.crossVectors(d[0], d[m - 1])) && (n = -n),
  54209. l = 1; l < m; l++)
  54210. d[l].applyMatrix4(g.makeRotationAxis(u[l], n * l)),
  54211. p[l].crossVectors(u[l], d[l])
  54212. }
  54213. ,
  54214. Ci.PolyhedronGeometry = function(e, t, i, n) {
  54215. function f(e) {
  54216. var t = e.normalize().clone();
  54217. t.index = m.vertices.push(t) - 1;
  54218. var i = a(e) / 2 / Math.PI + .5
  54219. , n = function(e) {
  54220. return Math.atan2(-e.y, Math.sqrt(e.x * e.x + e.z * e.z))
  54221. }(e) / Math.PI + .5;
  54222. return t.uv = new Ci.Vector2(i,1 - n),
  54223. t
  54224. }
  54225. function g(e, t, i, n) {
  54226. var r = new Ci.Face3(e.index,t.index,i.index,[e.clone(), t.clone(), i.clone()],void 0,n);
  54227. m.faces.push(r),
  54228. y.copy(e).add(t).add(i).divideScalar(3);
  54229. var o = a(y);
  54230. m.faceVertexUvs[0].push([s(e.uv, e, o), s(t.uv, t, o), s(i.uv, i, o)])
  54231. }
  54232. function r(e, t) {
  54233. 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++) {
  54234. a[l] = [];
  54235. 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++)
  54236. a[l][d] = 0 === d && l === i ? c : f(c.clone().lerp(h, d / u))
  54237. }
  54238. for (l = 0; l < i; l++)
  54239. for (d = 0; d < 2 * (i - l) - 1; d++) {
  54240. var p = Math.floor(d / 2);
  54241. 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)
  54242. }
  54243. }
  54244. function a(e) {
  54245. return Math.atan2(e.z, -e.x)
  54246. }
  54247. function s(e, t, i) {
  54248. return i < 0 && 1 === e.x && (e = new Ci.Vector2(e.x - 1,e.y)),
  54249. 0 === t.x && 0 === t.z && (e = new Ci.Vector2(i / 2 / Math.PI + .5,e.y)),
  54250. e.clone()
  54251. }
  54252. Ci.Geometry.call(this),
  54253. this.type = "PolyhedronGeometry",
  54254. this.parameters = {
  54255. vertices: e,
  54256. indices: t,
  54257. radius: i,
  54258. detail: n
  54259. },
  54260. i = i || 1,
  54261. n = n || 0;
  54262. for (var m = this, o = 0, l = e.length; o < l; o += 3)
  54263. f(new Ci.Vector3(e[o],e[o + 1],e[o + 2]));
  54264. var c = this.vertices
  54265. , h = []
  54266. , u = (o = 0,
  54267. 0);
  54268. for (l = t.length; o < l; o += 3,
  54269. u++) {
  54270. var d = c[t[o]]
  54271. , p = c[t[o + 1]]
  54272. , v = c[t[o + 2]];
  54273. h[u] = new Ci.Face3(d.index,p.index,v.index,[d.clone(), p.clone(), v.clone()],void 0,u)
  54274. }
  54275. var y = new Ci.Vector3;
  54276. for (o = 0,
  54277. l = h.length; o < l; o++)
  54278. r(h[o], n);
  54279. for (o = 0,
  54280. l = this.faceVertexUvs[0].length; o < l; o++) {
  54281. var A = this.faceVertexUvs[0][o]
  54282. , C = A[0].x
  54283. , I = A[1].x
  54284. , E = A[2].x
  54285. , _ = Math.max(C, I, E)
  54286. , b = Math.min(C, I, E);
  54287. .9 < _ && b < .1 && (C < .2 && (A[0].x += 1),
  54288. I < .2 && (A[1].x += 1),
  54289. E < .2 && (A[2].x += 1))
  54290. }
  54291. for (o = 0,
  54292. l = this.vertices.length; o < l; o++)
  54293. this.vertices[o].multiplyScalar(i);
  54294. this.mergeVertices(),
  54295. this.computeFaceNormals(),
  54296. this.boundingSphere = new Ci.Sphere(new Ci.Vector3,i)
  54297. }
  54298. ,
  54299. Ci.PolyhedronGeometry.prototype = Object.create(Ci.Geometry.prototype),
  54300. Ci.PolyhedronGeometry.prototype.constructor = Ci.PolyhedronGeometry,
  54301. Ci.DodecahedronGeometry = function(e, t) {
  54302. var i = (1 + Math.sqrt(5)) / 2
  54303. , n = 1 / i
  54304. , 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];
  54305. 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),
  54306. this.type = "DodecahedronGeometry",
  54307. this.parameters = {
  54308. radius: e,
  54309. detail: t
  54310. }
  54311. }
  54312. ,
  54313. Ci.DodecahedronGeometry.prototype = Object.create(Ci.PolyhedronGeometry.prototype),
  54314. Ci.DodecahedronGeometry.prototype.constructor = Ci.DodecahedronGeometry,
  54315. Ci.IcosahedronGeometry = function(e, t) {
  54316. var i = (1 + Math.sqrt(5)) / 2
  54317. , 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];
  54318. 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),
  54319. this.type = "IcosahedronGeometry",
  54320. this.parameters = {
  54321. radius: e,
  54322. detail: t
  54323. }
  54324. }
  54325. ,
  54326. Ci.IcosahedronGeometry.prototype = Object.create(Ci.PolyhedronGeometry.prototype),
  54327. Ci.IcosahedronGeometry.prototype.constructor = Ci.IcosahedronGeometry,
  54328. Ci.OctahedronGeometry = function(e, t) {
  54329. 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),
  54330. this.type = "OctahedronGeometry",
  54331. this.parameters = {
  54332. radius: e,
  54333. detail: t
  54334. }
  54335. }
  54336. ,
  54337. Ci.OctahedronGeometry.prototype = Object.create(Ci.PolyhedronGeometry.prototype),
  54338. Ci.OctahedronGeometry.prototype.constructor = Ci.OctahedronGeometry,
  54339. Ci.TetrahedronGeometry = function(e, t) {
  54340. 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),
  54341. this.type = "TetrahedronGeometry",
  54342. this.parameters = {
  54343. radius: e,
  54344. detail: t
  54345. }
  54346. }
  54347. ,
  54348. Ci.TetrahedronGeometry.prototype = Object.create(Ci.PolyhedronGeometry.prototype),
  54349. Ci.TetrahedronGeometry.prototype.constructor = Ci.TetrahedronGeometry,
  54350. Ci.ParametricGeometry = function(e, t, i) {
  54351. Ci.Geometry.call(this),
  54352. this.type = "ParametricGeometry",
  54353. this.parameters = {
  54354. func: e,
  54355. slices: t,
  54356. stacks: i
  54357. };
  54358. 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;
  54359. for (n = 0; n <= i; n++)
  54360. for (a = n / i,
  54361. r = 0; r <= t; r++)
  54362. o = e(r / t, a),
  54363. g.push(o);
  54364. for (n = 0; n < i; n++)
  54365. for (r = 0; r < t; r++)
  54366. l = (s = n * y + r) + 1,
  54367. c = (n + 1) * y + r + 1,
  54368. h = (n + 1) * y + r,
  54369. u = new Ci.Vector2(r / t,n / i),
  54370. d = new Ci.Vector2((r + 1) / t,n / i),
  54371. p = new Ci.Vector2((r + 1) / t,(n + 1) / i),
  54372. f = new Ci.Vector2(r / t,(n + 1) / i),
  54373. m.push(new Ci.Face3(s,l,h)),
  54374. v.push([u, d, f]),
  54375. m.push(new Ci.Face3(l,c,h)),
  54376. v.push([d.clone(), p, f.clone()]);
  54377. this.computeFaceNormals(),
  54378. this.computeVertexNormals()
  54379. }
  54380. ,
  54381. Ci.ParametricGeometry.prototype = Object.create(Ci.Geometry.prototype),
  54382. Ci.ParametricGeometry.prototype.constructor = Ci.ParametricGeometry,
  54383. Ci.WireframeGeometry = function(e) {
  54384. function t(e, t) {
  54385. return e - t
  54386. }
  54387. Ci.BufferGeometry.call(this);
  54388. var i = [0, 0]
  54389. , n = {}
  54390. , r = ["a", "b", "c"];
  54391. if (e instanceof Ci.Geometry) {
  54392. for (var o = e.vertices, a = e.faces, s = 0, l = new Uint32Array(6 * a.length), c = 0, h = a.length; c < h; c++)
  54393. for (var u = a[c], d = 0; d < 3; d++) {
  54394. i[0] = u[r[d]],
  54395. i[1] = u[r[(d + 1) % 3]],
  54396. i.sort(t),
  54397. void 0 === n[E = i.toString()] && (l[2 * s] = i[0],
  54398. l[2 * s + 1] = i[1],
  54399. n[E] = !0,
  54400. s++)
  54401. }
  54402. var p = new Float32Array(2 * s * 3);
  54403. for (c = 0,
  54404. h = s; c < h; c++)
  54405. for (d = 0; d < 2; d++) {
  54406. var f = o[l[2 * c + d]];
  54407. p[(_ = 6 * c + 3 * d) + 0] = f.x,
  54408. p[_ + 1] = f.y,
  54409. p[_ + 2] = f.z
  54410. }
  54411. this.addAttribute("position", new Ci.BufferAttribute(p,3))
  54412. } else if (e instanceof Ci.BufferGeometry)
  54413. if (null !== e.index) {
  54414. var g = e.index.array
  54415. , m = (o = e.attributes.position,
  54416. e.groups);
  54417. s = 0;
  54418. 0 === m.length && e.addGroup(0, g.length);
  54419. l = new Uint32Array(2 * g.length);
  54420. for (var v = 0, y = m.length; v < y; ++v)
  54421. for (var A = m[v], C = A.start, I = (c = C,
  54422. C + A.count); c < I; c += 3)
  54423. for (d = 0; d < 3; d++) {
  54424. var E;
  54425. i[0] = g[c + d],
  54426. i[1] = g[c + (d + 1) % 3],
  54427. i.sort(t),
  54428. void 0 === n[E = i.toString()] && (l[2 * s] = i[0],
  54429. l[2 * s + 1] = i[1],
  54430. n[E] = !0,
  54431. s++)
  54432. }
  54433. for (p = new Float32Array(2 * s * 3),
  54434. c = 0,
  54435. h = s; c < h; c++)
  54436. for (d = 0; d < 2; d++) {
  54437. var _ = 6 * c + 3 * d
  54438. , b = l[2 * c + d];
  54439. p[_ + 0] = o.getX(b),
  54440. p[_ + 1] = o.getY(b),
  54441. p[_ + 2] = o.getZ(b)
  54442. }
  54443. this.addAttribute("position", new Ci.BufferAttribute(p,3))
  54444. } else {
  54445. var w = (s = (o = e.attributes.position.array).length / 3) / 3;
  54446. for (p = new Float32Array(2 * s * 3),
  54447. c = 0,
  54448. h = w; c < h; c++)
  54449. for (d = 0; d < 3; d++) {
  54450. var T = 9 * c + 3 * d;
  54451. p[(_ = 18 * c + 6 * d) + 0] = o[T],
  54452. p[_ + 1] = o[1 + T],
  54453. p[_ + 2] = o[2 + T];
  54454. b = 9 * c + (d + 1) % 3 * 3;
  54455. p[_ + 3] = o[b],
  54456. p[_ + 4] = o[b + 1],
  54457. p[_ + 5] = o[b + 2]
  54458. }
  54459. this.addAttribute("position", new Ci.BufferAttribute(p,3))
  54460. }
  54461. }
  54462. ,
  54463. Ci.WireframeGeometry.prototype = Object.create(Ci.BufferGeometry.prototype),
  54464. Ci.WireframeGeometry.prototype.constructor = Ci.WireframeGeometry,
  54465. Ci.AxisHelper = function(e) {
  54466. e = e || 1;
  54467. var t = new Float32Array([0, 0, 0, e, 0, 0, 0, 0, 0, 0, e, 0, 0, 0, 0, 0, 0, e])
  54468. , i = new Float32Array([1, 0, 0, 1, .6, 0, 0, 1, 0, .6, 1, 0, 0, 0, 1, 0, .6, 1])
  54469. , n = new Ci.BufferGeometry;
  54470. n.addAttribute("position", new Ci.BufferAttribute(t,3)),
  54471. n.addAttribute("color", new Ci.BufferAttribute(i,3));
  54472. var r = new Ci.LineBasicMaterial({
  54473. vertexColors: Ci.VertexColors
  54474. });
  54475. Ci.LineSegments.call(this, n, r)
  54476. }
  54477. ,
  54478. Ci.AxisHelper.prototype = Object.create(Ci.LineSegments.prototype),
  54479. Ci.AxisHelper.prototype.constructor = Ci.AxisHelper,
  54480. Ci.ArrowHelper = function() {
  54481. var a = new Ci.Geometry;
  54482. a.vertices.push(new Ci.Vector3(0,0,0), new Ci.Vector3(0,1,0));
  54483. var s = new Ci.CylinderGeometry(0,.5,1,5,1);
  54484. return s.translate(0, -.5, 0),
  54485. function(e, t, i, n, r, o) {
  54486. Ci.Object3D.call(this),
  54487. void 0 === n && (n = 16776960),
  54488. void 0 === i && (i = 1),
  54489. void 0 === r && (r = .2 * i),
  54490. void 0 === o && (o = .2 * r),
  54491. this.position.copy(t),
  54492. this.line = new Ci.Line(a,new Ci.LineBasicMaterial({
  54493. color: n
  54494. })),
  54495. this.line.matrixAutoUpdate = !1,
  54496. this.add(this.line),
  54497. this.cone = new Ci.Mesh(s,new Ci.MeshBasicMaterial({
  54498. color: n
  54499. })),
  54500. this.cone.matrixAutoUpdate = !1,
  54501. this.add(this.cone),
  54502. this.setDirection(e),
  54503. this.setLength(i, r, o)
  54504. }
  54505. }(),
  54506. Ci.ArrowHelper.prototype = Object.create(Ci.Object3D.prototype),
  54507. Ci.ArrowHelper.prototype.constructor = Ci.ArrowHelper,
  54508. Ci.ArrowHelper.prototype.setDirection = (Ai = new Ci.Vector3,
  54509. function(e) {
  54510. .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(),
  54511. yi = Math.acos(e.y),
  54512. this.quaternion.setFromAxisAngle(Ai, yi))
  54513. }
  54514. ),
  54515. Ci.ArrowHelper.prototype.setLength = function(e, t, i) {
  54516. void 0 === t && (t = .2 * e),
  54517. void 0 === i && (i = .2 * t),
  54518. this.line.scale.set(1, Math.max(0, e - t), 1),
  54519. this.line.updateMatrix(),
  54520. this.cone.scale.set(i, t, i),
  54521. this.cone.position.y = e,
  54522. this.cone.updateMatrix()
  54523. }
  54524. ,
  54525. Ci.ArrowHelper.prototype.setColor = function(e) {
  54526. this.line.material.color.set(e),
  54527. this.cone.material.color.set(e)
  54528. }
  54529. ,
  54530. Ci.BoxHelper = function(e) {
  54531. 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])
  54532. , i = new Float32Array(24)
  54533. , n = new Ci.BufferGeometry;
  54534. n.setIndex(new Ci.BufferAttribute(t,1)),
  54535. n.addAttribute("position", new Ci.BufferAttribute(i,3)),
  54536. Ci.LineSegments.call(this, n, new Ci.LineBasicMaterial({
  54537. color: 16776960
  54538. })),
  54539. void 0 !== e && this.update(e)
  54540. }
  54541. ,
  54542. Ci.BoxHelper.prototype = Object.create(Ci.LineSegments.prototype),
  54543. Ci.BoxHelper.prototype.constructor = Ci.BoxHelper,
  54544. Ci.BoxHelper.prototype.update = (vi = new Ci.Box3,
  54545. function(e) {
  54546. if (vi.setFromObject(e),
  54547. !vi.isEmpty()) {
  54548. var t = vi.min
  54549. , i = vi.max
  54550. , n = this.geometry.attributes.position
  54551. , r = n.array;
  54552. r[0] = i.x,
  54553. r[1] = i.y,
  54554. r[2] = i.z,
  54555. r[3] = t.x,
  54556. r[4] = i.y,
  54557. r[5] = i.z,
  54558. r[6] = t.x,
  54559. r[7] = t.y,
  54560. r[8] = i.z,
  54561. r[9] = i.x,
  54562. r[10] = t.y,
  54563. r[11] = i.z,
  54564. r[12] = i.x,
  54565. r[13] = i.y,
  54566. r[14] = t.z,
  54567. r[15] = t.x,
  54568. r[16] = i.y,
  54569. r[17] = t.z,
  54570. r[18] = t.x,
  54571. r[19] = t.y,
  54572. r[20] = t.z,
  54573. r[21] = i.x,
  54574. r[22] = t.y,
  54575. r[23] = t.z,
  54576. n.needsUpdate = !0,
  54577. this.geometry.computeBoundingSphere()
  54578. }
  54579. }
  54580. ),
  54581. Ci.BoundingBoxHelper = function(e, t) {
  54582. var i = void 0 !== t ? t : 8947848;
  54583. this.object = e,
  54584. this.box = new Ci.Box3,
  54585. Ci.Mesh.call(this, new Ci.BoxGeometry(1,1,1), new Ci.MeshBasicMaterial({
  54586. color: i,
  54587. wireframe: !0
  54588. }))
  54589. }
  54590. ,
  54591. Ci.BoundingBoxHelper.prototype = Object.create(Ci.Mesh.prototype),
  54592. Ci.BoundingBoxHelper.prototype.constructor = Ci.BoundingBoxHelper,
  54593. Ci.BoundingBoxHelper.prototype.update = function() {
  54594. this.box.setFromObject(this.object),
  54595. this.box.size(this.scale),
  54596. this.box.center(this.position)
  54597. }
  54598. ,
  54599. Ci.CameraHelper = function(e) {
  54600. function t(e, t, i) {
  54601. n(e, i),
  54602. n(t, i)
  54603. }
  54604. function n(e, t) {
  54605. i.vertices.push(new Ci.Vector3),
  54606. i.colors.push(new Ci.Color(t)),
  54607. void 0 === o[e] && (o[e] = []),
  54608. o[e].push(i.vertices.length - 1)
  54609. }
  54610. var i = new Ci.Geometry
  54611. , r = new Ci.LineBasicMaterial({
  54612. color: 16777215,
  54613. vertexColors: Ci.FaceColors
  54614. })
  54615. , o = {}
  54616. , a = 16755200
  54617. , s = 16711680
  54618. , l = 3355443;
  54619. t("n1", "n2", a),
  54620. t("n2", "n4", a),
  54621. t("n4", "n3", a),
  54622. t("n3", "n1", a),
  54623. t("f1", "f2", a),
  54624. t("f2", "f4", a),
  54625. t("f4", "f3", a),
  54626. t("f3", "f1", a),
  54627. t("n1", "f1", a),
  54628. t("n2", "f2", a),
  54629. t("n3", "f3", a),
  54630. t("n4", "f4", a),
  54631. t("p", "n1", s),
  54632. t("p", "n2", s),
  54633. t("p", "n3", s),
  54634. t("p", "n4", s),
  54635. t("u1", "u2", 43775),
  54636. t("u2", "u3", 43775),
  54637. t("u3", "u1", 43775),
  54638. t("c", "t", 16777215),
  54639. t("p", "c", l),
  54640. t("cn1", "cn2", l),
  54641. t("cn3", "cn4", l),
  54642. t("cf1", "cf2", l),
  54643. t("cf3", "cf4", l),
  54644. Ci.LineSegments.call(this, i, r),
  54645. this.camera = e,
  54646. this.camera.updateProjectionMatrix(),
  54647. this.matrix = e.matrixWorld,
  54648. this.matrixAutoUpdate = !1,
  54649. this.pointMap = o,
  54650. this.update()
  54651. }
  54652. ,
  54653. Ci.CameraHelper.prototype = Object.create(Ci.LineSegments.prototype),
  54654. Ci.CameraHelper.prototype.constructor = Ci.CameraHelper,
  54655. Ci.CameraHelper.prototype.update = (gi = new Ci.Vector3,
  54656. mi = new Ci.Camera,
  54657. function() {
  54658. pi = this.geometry,
  54659. fi = this.pointMap,
  54660. mi.projectionMatrix.copy(this.camera.projectionMatrix),
  54661. Ni("c", 0, 0, -1),
  54662. Ni("t", 0, 0, 1),
  54663. Ni("n1", -1, -1, -1),
  54664. Ni("n2", 1, -1, -1),
  54665. Ni("n3", -1, 1, -1),
  54666. Ni("n4", 1, 1, -1),
  54667. Ni("f1", -1, -1, 1),
  54668. Ni("f2", 1, -1, 1),
  54669. Ni("f3", -1, 1, 1),
  54670. Ni("f4", 1, 1, 1),
  54671. Ni("u1", .7, 1.1, -1),
  54672. Ni("u2", -.7, 1.1, -1),
  54673. Ni("u3", 0, 2, -1),
  54674. Ni("cf1", -1, 0, 1),
  54675. Ni("cf2", 1, 0, 1),
  54676. Ni("cf3", 0, -1, 1),
  54677. Ni("cf4", 0, 1, 1),
  54678. Ni("cn1", -1, 0, -1),
  54679. Ni("cn2", 1, 0, -1),
  54680. Ni("cn3", 0, -1, -1),
  54681. Ni("cn4", 0, 1, -1),
  54682. pi.verticesNeedUpdate = !0
  54683. }
  54684. ),
  54685. Ci.DirectionalLightHelper = function(e, t) {
  54686. Ci.Object3D.call(this),
  54687. this.light = e,
  54688. this.light.updateMatrixWorld(),
  54689. this.matrix = e.matrixWorld,
  54690. this.matrixAutoUpdate = !1,
  54691. t = t || 1;
  54692. var i = new Ci.Geometry;
  54693. 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));
  54694. var n = new Ci.LineBasicMaterial({
  54695. fog: !1
  54696. });
  54697. n.color.copy(this.light.color).multiplyScalar(this.light.intensity),
  54698. this.lightPlane = new Ci.Line(i,n),
  54699. this.add(this.lightPlane),
  54700. (i = new Ci.Geometry).vertices.push(new Ci.Vector3, new Ci.Vector3),
  54701. (n = new Ci.LineBasicMaterial({
  54702. fog: !1
  54703. })).color.copy(this.light.color).multiplyScalar(this.light.intensity),
  54704. this.targetLine = new Ci.Line(i,n),
  54705. this.add(this.targetLine),
  54706. this.update()
  54707. }
  54708. ,
  54709. Ci.DirectionalLightHelper.prototype = Object.create(Ci.Object3D.prototype),
  54710. Ci.DirectionalLightHelper.prototype.constructor = Ci.DirectionalLightHelper,
  54711. Ci.DirectionalLightHelper.prototype.dispose = function() {
  54712. this.lightPlane.geometry.dispose(),
  54713. this.lightPlane.material.dispose(),
  54714. this.targetLine.geometry.dispose(),
  54715. this.targetLine.material.dispose()
  54716. }
  54717. ,
  54718. Ci.DirectionalLightHelper.prototype.update = (hi = new Ci.Vector3,
  54719. ui = new Ci.Vector3,
  54720. di = new Ci.Vector3,
  54721. function() {
  54722. hi.setFromMatrixPosition(this.light.matrixWorld),
  54723. ui.setFromMatrixPosition(this.light.target.matrixWorld),
  54724. di.subVectors(ui, hi),
  54725. this.lightPlane.lookAt(di),
  54726. this.lightPlane.material.color.copy(this.light.color).multiplyScalar(this.light.intensity),
  54727. this.targetLine.geometry.vertices[1].copy(di),
  54728. this.targetLine.geometry.verticesNeedUpdate = !0,
  54729. this.targetLine.material.color.copy(this.lightPlane.material.color)
  54730. }
  54731. ),
  54732. Ci.EdgesHelper = function(e, t, i) {
  54733. var n = void 0 !== t ? t : 16777215;
  54734. Ci.LineSegments.call(this, new Ci.EdgesGeometry(e.geometry,i), new Ci.LineBasicMaterial({
  54735. color: n
  54736. })),
  54737. this.matrix = e.matrixWorld,
  54738. this.matrixAutoUpdate = !1
  54739. }
  54740. ,
  54741. Ci.EdgesHelper.prototype = Object.create(Ci.LineSegments.prototype),
  54742. Ci.EdgesHelper.prototype.constructor = Ci.EdgesHelper,
  54743. Ci.FaceNormalsHelper = function(e, t, i, n) {
  54744. this.object = e,
  54745. this.size = void 0 !== t ? t : 1;
  54746. var r = void 0 !== i ? i : 16776960
  54747. , o = void 0 !== n ? n : 1
  54748. , a = 0
  54749. , s = this.object.geometry;
  54750. s instanceof Ci.Geometry ? a = s.faces.length : console.warn("THREE.FaceNormalsHelper: only THREE.Geometry is supported. Use THREE.VertexNormalsHelper, instead.");
  54751. var l = new Ci.BufferGeometry
  54752. , c = new Ci.Float32Attribute(2 * a * 3,3);
  54753. l.addAttribute("position", c),
  54754. Ci.LineSegments.call(this, l, new Ci.LineBasicMaterial({
  54755. color: r,
  54756. linewidth: o
  54757. })),
  54758. this.matrixAutoUpdate = !1,
  54759. this.update()
  54760. }
  54761. ,
  54762. Ci.FaceNormalsHelper.prototype = Object.create(Ci.LineSegments.prototype),
  54763. Ci.FaceNormalsHelper.prototype.constructor = Ci.FaceNormalsHelper,
  54764. Ci.FaceNormalsHelper.prototype.update = (si = new Ci.Vector3,
  54765. li = new Ci.Vector3,
  54766. ci = new Ci.Matrix3,
  54767. function() {
  54768. this.object.updateMatrixWorld(!0),
  54769. ci.getNormalMatrix(this.object.matrixWorld);
  54770. 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++) {
  54771. var l = r[a]
  54772. , c = l.normal;
  54773. si.copy(n[l.a]).add(n[l.b]).add(n[l.c]).divideScalar(3).applyMatrix4(e),
  54774. li.copy(c).applyMatrix3(ci).normalize().multiplyScalar(this.size).add(si),
  54775. t.setXYZ(o, si.x, si.y, si.z),
  54776. o += 1,
  54777. t.setXYZ(o, li.x, li.y, li.z),
  54778. o += 1
  54779. }
  54780. return t.needsUpdate = !0,
  54781. this
  54782. }
  54783. ),
  54784. Ci.GridHelper = function(e, t) {
  54785. var i = new Ci.Geometry
  54786. , n = new Ci.LineBasicMaterial({
  54787. vertexColors: Ci.VertexColors
  54788. });
  54789. this.color1 = new Ci.Color(4473924),
  54790. this.color2 = new Ci.Color(8947848);
  54791. for (var r = -e; r <= e; r += t) {
  54792. 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));
  54793. var o = 0 === r ? this.color1 : this.color2;
  54794. i.colors.push(o, o, o, o)
  54795. }
  54796. Ci.LineSegments.call(this, i, n)
  54797. }
  54798. ,
  54799. Ci.GridHelper.prototype = Object.create(Ci.LineSegments.prototype),
  54800. Ci.GridHelper.prototype.constructor = Ci.GridHelper,
  54801. Ci.GridHelper.prototype.setColors = function(e, t) {
  54802. this.color1.set(e),
  54803. this.color2.set(t),
  54804. this.geometry.colorsNeedUpdate = !0
  54805. }
  54806. ,
  54807. Ci.HemisphereLightHelper = function(e, t) {
  54808. Ci.Object3D.call(this),
  54809. this.light = e,
  54810. this.light.updateMatrixWorld(),
  54811. this.matrix = e.matrixWorld,
  54812. this.matrixAutoUpdate = !1,
  54813. this.colors = [new Ci.Color, new Ci.Color];
  54814. var i = new Ci.SphereGeometry(t,4,2);
  54815. i.rotateX(-Math.PI / 2);
  54816. for (var n = 0; n < 8; n++)
  54817. i.faces[n].color = this.colors[n < 4 ? 0 : 1];
  54818. var r = new Ci.MeshBasicMaterial({
  54819. vertexColors: Ci.FaceColors,
  54820. wireframe: !0
  54821. });
  54822. this.lightSphere = new Ci.Mesh(i,r),
  54823. this.add(this.lightSphere),
  54824. this.update()
  54825. }
  54826. ,
  54827. Ci.HemisphereLightHelper.prototype = Object.create(Ci.Object3D.prototype),
  54828. Ci.HemisphereLightHelper.prototype.constructor = Ci.HemisphereLightHelper,
  54829. Ci.HemisphereLightHelper.prototype.dispose = function() {
  54830. this.lightSphere.geometry.dispose(),
  54831. this.lightSphere.material.dispose()
  54832. }
  54833. ,
  54834. Ci.HemisphereLightHelper.prototype.update = (ai = new Ci.Vector3,
  54835. function() {
  54836. this.colors[0].copy(this.light.color).multiplyScalar(this.light.intensity),
  54837. this.colors[1].copy(this.light.groundColor).multiplyScalar(this.light.intensity),
  54838. this.lightSphere.lookAt(ai.setFromMatrixPosition(this.light.matrixWorld).negate()),
  54839. this.lightSphere.geometry.colorsNeedUpdate = !0
  54840. }
  54841. ),
  54842. Ci.PointLightHelper = function(e, t) {
  54843. this.light = e,
  54844. this.light.updateMatrixWorld();
  54845. var i = new Ci.SphereGeometry(t,4,2)
  54846. , n = new Ci.MeshBasicMaterial({
  54847. wireframe: !0,
  54848. fog: !1
  54849. });
  54850. n.color.copy(this.light.color).multiplyScalar(this.light.intensity),
  54851. Ci.Mesh.call(this, i, n),
  54852. this.matrix = this.light.matrixWorld,
  54853. this.matrixAutoUpdate = !1
  54854. }
  54855. ,
  54856. Ci.PointLightHelper.prototype = Object.create(Ci.Mesh.prototype),
  54857. Ci.PointLightHelper.prototype.constructor = Ci.PointLightHelper,
  54858. Ci.PointLightHelper.prototype.dispose = function() {
  54859. this.geometry.dispose(),
  54860. this.material.dispose()
  54861. }
  54862. ,
  54863. Ci.PointLightHelper.prototype.update = function() {
  54864. this.material.color.copy(this.light.color).multiplyScalar(this.light.intensity)
  54865. }
  54866. ,
  54867. Ci.SkeletonHelper = function(e) {
  54868. this.bones = this.getBoneList(e);
  54869. for (var t = new Ci.Geometry, i = 0; i < this.bones.length; i++) {
  54870. this.bones[i].parent instanceof Ci.Bone && (t.vertices.push(new Ci.Vector3),
  54871. t.vertices.push(new Ci.Vector3),
  54872. t.colors.push(new Ci.Color(0,0,1)),
  54873. t.colors.push(new Ci.Color(0,1,0)))
  54874. }
  54875. t.dynamic = !0;
  54876. var n = new Ci.LineBasicMaterial({
  54877. vertexColors: Ci.VertexColors,
  54878. depthTest: !1,
  54879. depthWrite: !1,
  54880. transparent: !0
  54881. });
  54882. Ci.LineSegments.call(this, t, n),
  54883. this.root = e,
  54884. this.matrix = e.matrixWorld,
  54885. this.matrixAutoUpdate = !1,
  54886. this.update()
  54887. }
  54888. ,
  54889. Ci.SkeletonHelper.prototype = Object.create(Ci.LineSegments.prototype),
  54890. Ci.SkeletonHelper.prototype.constructor = Ci.SkeletonHelper,
  54891. Ci.SkeletonHelper.prototype.getBoneList = function(e) {
  54892. var t = [];
  54893. e instanceof Ci.Bone && t.push(e);
  54894. for (var i = 0; i < e.children.length; i++)
  54895. t.push.apply(t, this.getBoneList(e.children[i]));
  54896. return t
  54897. }
  54898. ,
  54899. Ci.SkeletonHelper.prototype.update = function() {
  54900. 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++) {
  54901. var o = this.bones[r];
  54902. o.parent instanceof Ci.Bone && (i.multiplyMatrices(t, o.matrixWorld),
  54903. e.vertices[n].setFromMatrixPosition(i),
  54904. i.multiplyMatrices(t, o.parent.matrixWorld),
  54905. e.vertices[n + 1].setFromMatrixPosition(i),
  54906. n += 2)
  54907. }
  54908. e.verticesNeedUpdate = !0,
  54909. e.computeBoundingSphere()
  54910. }
  54911. ,
  54912. Ci.SpotLightHelper = function(e) {
  54913. Ci.Object3D.call(this),
  54914. this.light = e,
  54915. this.light.updateMatrixWorld(),
  54916. this.matrix = e.matrixWorld,
  54917. this.matrixAutoUpdate = !1;
  54918. var t = new Ci.CylinderGeometry(0,1,1,8,1,!0);
  54919. t.translate(0, -.5, 0),
  54920. t.rotateX(-Math.PI / 2);
  54921. var i = new Ci.MeshBasicMaterial({
  54922. wireframe: !0,
  54923. fog: !1
  54924. });
  54925. this.cone = new Ci.Mesh(t,i),
  54926. this.add(this.cone),
  54927. this.update()
  54928. }
  54929. ,
  54930. Ci.SpotLightHelper.prototype = Object.create(Ci.Object3D.prototype),
  54931. Ci.SpotLightHelper.prototype.constructor = Ci.SpotLightHelper,
  54932. Ci.SpotLightHelper.prototype.dispose = function() {
  54933. this.cone.geometry.dispose(),
  54934. this.cone.material.dispose()
  54935. }
  54936. ,
  54937. Ci.SpotLightHelper.prototype.update = (ri = new Ci.Vector3,
  54938. oi = new Ci.Vector3,
  54939. function() {
  54940. var e = this.light.distance ? this.light.distance : 1e4
  54941. , t = e * Math.tan(this.light.angle);
  54942. this.cone.scale.set(t, t, e),
  54943. ri.setFromMatrixPosition(this.light.matrixWorld),
  54944. oi.setFromMatrixPosition(this.light.target.matrixWorld),
  54945. this.cone.lookAt(oi.sub(ri)),
  54946. this.cone.material.color.copy(this.light.color).multiplyScalar(this.light.intensity)
  54947. }
  54948. ),
  54949. Ci.VertexNormalsHelper = function(e, t, i, n) {
  54950. this.object = e,
  54951. this.size = void 0 !== t ? t : 1;
  54952. var r = void 0 !== i ? i : 16711680
  54953. , o = void 0 !== n ? n : 1
  54954. , a = 0
  54955. , s = this.object.geometry;
  54956. s instanceof Ci.Geometry ? a = 3 * s.faces.length : s instanceof Ci.BufferGeometry && (a = s.attributes.normal.count);
  54957. var l = new Ci.BufferGeometry
  54958. , c = new Ci.Float32Attribute(2 * a * 3,3);
  54959. l.addAttribute("position", c),
  54960. Ci.LineSegments.call(this, l, new Ci.LineBasicMaterial({
  54961. color: r,
  54962. linewidth: o
  54963. })),
  54964. this.matrixAutoUpdate = !1,
  54965. this.update()
  54966. }
  54967. ,
  54968. Ci.VertexNormalsHelper.prototype = Object.create(Ci.LineSegments.prototype),
  54969. Ci.VertexNormalsHelper.prototype.constructor = Ci.VertexNormalsHelper,
  54970. Ci.VertexNormalsHelper.prototype.update = (ti = new Ci.Vector3,
  54971. ii = new Ci.Vector3,
  54972. ni = new Ci.Matrix3,
  54973. function() {
  54974. var e = ["a", "b", "c"];
  54975. this.object.updateMatrixWorld(!0),
  54976. ni.getNormalMatrix(this.object.matrixWorld);
  54977. var t = this.object.matrixWorld
  54978. , i = this.geometry.attributes.position
  54979. , n = this.object.geometry;
  54980. if (n instanceof Ci.Geometry)
  54981. for (var r = n.vertices, o = n.faces, a = 0, s = 0, l = o.length; s < l; s++)
  54982. for (var c = o[s], h = 0, u = c.vertexNormals.length; h < u; h++) {
  54983. var d = r[c[e[h]]]
  54984. , p = c.vertexNormals[h];
  54985. ti.copy(d).applyMatrix4(t),
  54986. ii.copy(p).applyMatrix3(ni).normalize().multiplyScalar(this.size).add(ti),
  54987. i.setXYZ(a, ti.x, ti.y, ti.z),
  54988. a += 1,
  54989. i.setXYZ(a, ii.x, ii.y, ii.z),
  54990. a += 1
  54991. }
  54992. else if (n instanceof Ci.BufferGeometry) {
  54993. var f = n.attributes.position
  54994. , g = n.attributes.normal;
  54995. for (h = a = 0,
  54996. u = f.count; h < u; h++)
  54997. ti.set(f.getX(h), f.getY(h), f.getZ(h)).applyMatrix4(t),
  54998. ii.set(g.getX(h), g.getY(h), g.getZ(h)),
  54999. ii.applyMatrix3(ni).normalize().multiplyScalar(this.size).add(ti),
  55000. i.setXYZ(a, ti.x, ti.y, ti.z),
  55001. a += 1,
  55002. i.setXYZ(a, ii.x, ii.y, ii.z),
  55003. a += 1
  55004. }
  55005. return i.needsUpdate = !0,
  55006. this
  55007. }
  55008. ),
  55009. Ci.WireframeHelper = function(e, t) {
  55010. var i = void 0 !== t ? t : 16777215;
  55011. Ci.LineSegments.call(this, new Ci.WireframeGeometry(e.geometry), new Ci.LineBasicMaterial({
  55012. color: i
  55013. })),
  55014. this.matrix = e.matrixWorld,
  55015. this.matrixAutoUpdate = !1
  55016. }
  55017. ,
  55018. Ci.WireframeHelper.prototype = Object.create(Ci.LineSegments.prototype),
  55019. Ci.WireframeHelper.prototype.constructor = Ci.WireframeHelper,
  55020. Ci.ImmediateRenderObject = function(e) {
  55021. Ci.Object3D.call(this),
  55022. this.material = e,
  55023. this.render = function(e) {}
  55024. }
  55025. ,
  55026. Ci.ImmediateRenderObject.prototype = Object.create(Ci.Object3D.prototype),
  55027. Ci.ImmediateRenderObject.prototype.constructor = Ci.ImmediateRenderObject,
  55028. Ci.MorphBlendMesh = function(e, t) {
  55029. Ci.Mesh.call(this, e, t),
  55030. this.animationsMap = {},
  55031. this.animationsList = [];
  55032. var i = this.geometry.morphTargets.length
  55033. , n = i - 1
  55034. , r = i / 1;
  55035. this.createAnimation("__default", 0, n, r),
  55036. this.setAnimationWeight("__default", 1)
  55037. }
  55038. ,
  55039. Ci.MorphBlendMesh.prototype = Object.create(Ci.Mesh.prototype),
  55040. Ci.MorphBlendMesh.prototype.constructor = Ci.MorphBlendMesh,
  55041. Ci.MorphBlendMesh.prototype.createAnimation = function(e, t, i, n) {
  55042. var r = {
  55043. start: t,
  55044. end: i,
  55045. length: i - t + 1,
  55046. fps: n,
  55047. duration: (i - t) / n,
  55048. lastFrame: 0,
  55049. currentFrame: 0,
  55050. active: !1,
  55051. time: 0,
  55052. direction: 1,
  55053. weight: 1,
  55054. directionBackwards: !1,
  55055. mirroredLoop: !1
  55056. };
  55057. this.animationsMap[e] = r,
  55058. this.animationsList.push(r)
  55059. }
  55060. ,
  55061. Ci.MorphBlendMesh.prototype.autoCreateAnimations = function(e) {
  55062. for (var t, i = /([a-z]+)_?(\d+)/i, n = {}, r = this.geometry, o = 0, a = r.morphTargets.length; o < a; o++) {
  55063. var s = r.morphTargets[o].name.match(i);
  55064. if (s && 1 < s.length)
  55065. n[l = s[1]] || (n[l] = {
  55066. start: 1 / 0,
  55067. end: -1 / 0
  55068. }),
  55069. o < (c = n[l]).start && (c.start = o),
  55070. o > c.end && (c.end = o),
  55071. t = t || l
  55072. }
  55073. for (var l in n) {
  55074. var c = n[l];
  55075. this.createAnimation(l, c.start, c.end, e)
  55076. }
  55077. this.firstAnimation = t
  55078. }
  55079. ,
  55080. Ci.MorphBlendMesh.prototype.setAnimationDirectionForward = function(e) {
  55081. var t = this.animationsMap[e];
  55082. t && (t.direction = 1,
  55083. t.directionBackwards = !1)
  55084. }
  55085. ,
  55086. Ci.MorphBlendMesh.prototype.setAnimationDirectionBackward = function(e) {
  55087. var t = this.animationsMap[e];
  55088. t && (t.direction = -1,
  55089. t.directionBackwards = !0)
  55090. }
  55091. ,
  55092. Ci.MorphBlendMesh.prototype.setAnimationFPS = function(e, t) {
  55093. var i = this.animationsMap[e];
  55094. i && (i.fps = t,
  55095. i.duration = (i.end - i.start) / i.fps)
  55096. }
  55097. ,
  55098. Ci.MorphBlendMesh.prototype.setAnimationDuration = function(e, t) {
  55099. var i = this.animationsMap[e];
  55100. i && (i.duration = t,
  55101. i.fps = (i.end - i.start) / i.duration)
  55102. }
  55103. ,
  55104. Ci.MorphBlendMesh.prototype.setAnimationWeight = function(e, t) {
  55105. var i = this.animationsMap[e];
  55106. i && (i.weight = t)
  55107. }
  55108. ,
  55109. Ci.MorphBlendMesh.prototype.setAnimationTime = function(e, t) {
  55110. var i = this.animationsMap[e];
  55111. i && (i.time = t)
  55112. }
  55113. ,
  55114. Ci.MorphBlendMesh.prototype.getAnimationTime = function(e) {
  55115. var t = 0
  55116. , i = this.animationsMap[e];
  55117. return i && (t = i.time),
  55118. t
  55119. }
  55120. ,
  55121. Ci.MorphBlendMesh.prototype.getAnimationDuration = function(e) {
  55122. var t = -1
  55123. , i = this.animationsMap[e];
  55124. return i && (t = i.duration),
  55125. t
  55126. }
  55127. ,
  55128. Ci.MorphBlendMesh.prototype.playAnimation = function(e) {
  55129. var t = this.animationsMap[e];
  55130. t ? (t.time = 0,
  55131. t.active = !0) : console.warn("THREE.MorphBlendMesh: animation[" + e + "] undefined in .playAnimation()")
  55132. }
  55133. ,
  55134. Ci.MorphBlendMesh.prototype.stopAnimation = function(e) {
  55135. var t = this.animationsMap[e];
  55136. t && (t.active = !1)
  55137. }
  55138. ,
  55139. Ci.MorphBlendMesh.prototype.update = function(e) {
  55140. for (var t = 0, i = this.animationsList.length; t < i; t++) {
  55141. var n = this.animationsList[t];
  55142. if (n.active) {
  55143. var r = n.duration / n.length;
  55144. n.time += n.direction * e,
  55145. n.mirroredLoop ? (n.time > n.duration || n.time < 0) && (n.direction *= -1,
  55146. n.time > n.duration && (n.time = n.duration,
  55147. n.directionBackwards = !0),
  55148. n.time < 0 && (n.time = 0,
  55149. n.directionBackwards = !1)) : (n.time = n.time % n.duration,
  55150. n.time < 0 && (n.time += n.duration));
  55151. var o = n.start + Ci.Math.clamp(Math.floor(n.time / r), 0, n.length - 1)
  55152. , a = n.weight;
  55153. o !== n.currentFrame && (this.morphTargetInfluences[n.lastFrame] = 0,
  55154. this.morphTargetInfluences[n.currentFrame] = 1 * a,
  55155. this.morphTargetInfluences[o] = 0,
  55156. n.lastFrame = n.currentFrame,
  55157. n.currentFrame = o);
  55158. var s = n.time % r / r;
  55159. n.directionBackwards && (s = 1 - s),
  55160. n.currentFrame !== n.lastFrame ? (this.morphTargetInfluences[n.currentFrame] = s * a,
  55161. this.morphTargetInfluences[n.lastFrame] = (1 - s) * a) : this.morphTargetInfluences[n.currentFrame] = a
  55162. }
  55163. }
  55164. }
  55165. ,
  55166. void 0 !== i ? (void 0 !== t && t.exports && (i = t.exports = Ci),
  55167. i.THREE = Ci) : this.THREE = Ci
  55168. window.THREE = Ci
  55169. getObjLoader()
  55170. initByTHREE(THREE)
  55171. }
  55172. , {}]
  55173. }, {}, [116]);